proteus  1.8.1
C/C++/Fortran libraries
superluWrappers.c
Go to the documentation of this file.
1 /* Generated by Cython 0.29.30 */
2 
3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
5 #endif /* PY_SSIZE_T_CLEAN */
6 #include "Python.h"
7 #ifndef Py_PYTHON_H
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+.
11 #else
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
15 #include <stddef.h>
16 #ifndef offsetof
17  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
18 #endif
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
20  #ifndef __stdcall
21  #define __stdcall
22  #endif
23  #ifndef __cdecl
24  #define __cdecl
25  #endif
26  #ifndef __fastcall
27  #define __fastcall
28  #endif
29 #endif
30 #ifndef DL_IMPORT
31  #define DL_IMPORT(t) t
32 #endif
33 #ifndef DL_EXPORT
34  #define DL_EXPORT(t) t
35 #endif
36 #define __PYX_COMMA ,
37 #ifndef HAVE_LONG_LONG
38  #if PY_VERSION_HEX >= 0x02070000
39  #define HAVE_LONG_LONG
40  #endif
41 #endif
42 #ifndef PY_LONG_LONG
43  #define PY_LONG_LONG LONG_LONG
44 #endif
45 #ifndef Py_HUGE_VAL
46  #define Py_HUGE_VAL HUGE_VAL
47 #endif
48 #ifdef PYPY_VERSION
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
61  #endif
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)
90  #endif
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
97  #endif
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
106  #endif
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
113  #endif
114  #ifndef CYTHON_ASSUME_SAFE_MACROS
115  #define CYTHON_ASSUME_SAFE_MACROS 1
116  #endif
117  #ifndef CYTHON_UNPACK_METHODS
118  #define CYTHON_UNPACK_METHODS 1
119  #endif
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
134  #endif
135 #else
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
141  #endif
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
147  #endif
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
153  #endif
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
159  #endif
160  #ifndef CYTHON_USE_PYLIST_INTERNALS
161  #define CYTHON_USE_PYLIST_INTERNALS 1
162  #endif
163  #ifndef CYTHON_USE_UNICODE_INTERNALS
164  #define CYTHON_USE_UNICODE_INTERNALS 1
165  #endif
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
171  #endif
172  #ifndef CYTHON_AVOID_BORROWED_REFS
173  #define CYTHON_AVOID_BORROWED_REFS 0
174  #endif
175  #ifndef CYTHON_ASSUME_SAFE_MACROS
176  #define CYTHON_ASSUME_SAFE_MACROS 1
177  #endif
178  #ifndef CYTHON_UNPACK_METHODS
179  #define CYTHON_UNPACK_METHODS 1
180  #endif
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
186  #endif
187  #ifndef CYTHON_FAST_PYCALL
188  #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
189  #endif
190  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
192  #endif
193  #ifndef CYTHON_USE_TP_FINALIZE
194  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
195  #endif
196  #ifndef CYTHON_USE_DICT_VERSIONS
197  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
198  #endif
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)
204  #endif
205  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206  #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
207  #endif
208 #endif
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
211 #endif
212 #if CYTHON_USE_PYLONG_INTERNALS
213  #if PY_MAJOR_VERSION < 3
214  #include "longintrepr.h"
215  #endif
216  #undef SHIFT
217  #undef BASE
218  #undef MASK
219  #ifdef SIZEOF_VOID_P
220  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
221  #endif
222 #endif
223 #ifndef __has_attribute
224  #define __has_attribute(x) 0
225 #endif
226 #ifndef __has_cpp_attribute
227  #define __has_cpp_attribute(x) 0
228 #endif
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
236  #else
237  #define CYTHON_RESTRICT
238  #endif
239 #endif
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__))
244 # else
245 # define CYTHON_UNUSED
246 # endif
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
249 # else
250 # define CYTHON_UNUSED
251 # endif
252 #endif
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
256 # else
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
258 # endif
259 #endif
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
263 # else
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
265 # endif
266 #endif
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
268 #ifdef _MSC_VER
269  #ifndef _MSC_STDINT_H_
270  #if _MSC_VER < 1300
271  typedef unsigned char uint8_t;
272  typedef unsigned int uint32_t;
273  #else
274  typedef unsigned __int8 uint8_t;
275  typedef unsigned __int32 uint32_t;
276  #endif
277  #endif
278 #else
279  #include <stdint.h>
280 #endif
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]]
289  #endif
290  #endif
291  #ifndef CYTHON_FALLTHROUGH
292  #if __has_attribute(fallthrough)
293  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
294  #else
295  #define CYTHON_FALLTHROUGH
296  #endif
297  #endif
298  #if defined(__clang__ ) && defined(__apple_build_version__)
299  #if __apple_build_version__ < 7000000
300  #undef CYTHON_FALLTHROUGH
301  #define CYTHON_FALLTHROUGH
302  #endif
303  #endif
304 #endif
305 
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
315  #else
316  #define CYTHON_INLINE
317  #endif
318 #endif
319 
320 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
321  #define Py_OptimizeFlag 0
322 #endif
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
330 #else
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; // unfortunately __pyx_empty_tuple isn't available here
370  if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
371  Py_XDECREF((PyObject*)co);
372  co = (PyCodeObject*)call_result;
373  call_result = NULL;
374  if (0) {
375  cleanup_code_too:
376  Py_XDECREF((PyObject*)co);
377  co = NULL;
378  }
379  end:
380  Py_XDECREF(kwds);
381  Py_XDECREF(argcount);
382  Py_XDECREF(posonlyargcount);
383  Py_XDECREF(kwonlyargcount);
384  Py_XDECREF(nlocals);
385  Py_XDECREF(stacksize);
386  Py_XDECREF(replace);
387  Py_XDECREF(call_result);
388  Py_XDECREF(empty);
389  if (type) {
390  PyErr_Restore(type, value, traceback);
391  }
392  return co;
393  }
394 #else
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)
397 #endif
398  #define __Pyx_DefaultClassType PyType_Type
399 #endif
400 #ifndef Py_TPFLAGS_CHECKTYPES
401  #define Py_TPFLAGS_CHECKTYPES 0
402 #endif
403 #ifndef Py_TPFLAGS_HAVE_INDEX
404  #define Py_TPFLAGS_HAVE_INDEX 0
405 #endif
406 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
407  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
408 #endif
409 #ifndef Py_TPFLAGS_HAVE_FINALIZE
410  #define Py_TPFLAGS_HAVE_FINALIZE 0
411 #endif
412 #ifndef METH_STACKLESS
413  #define METH_STACKLESS 0
414 #endif
415 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
416  #ifndef METH_FASTCALL
417  #define METH_FASTCALL 0x80
418  #endif
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);
422 #else
423  #define __Pyx_PyCFunctionFast _PyCFunctionFast
424  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
425 #endif
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)))))
429 #else
430 #define __Pyx_PyFastCFunction_Check(func) 0
431 #endif
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)
436 #endif
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)
441 #endif
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)
445 #else
446  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
447  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
448 #endif
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()
455 #else
456  #define __Pyx_PyThreadState_Current _PyThreadState_Current
457 #endif
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();
464  return 0;
465 }
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;
469  return key;
470 }
471 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
472  PyObject_Free(key);
473 }
474 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
475  return *key != Py_tss_NEEDS_INIT;
476 }
477 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
478  PyThread_delete_key(*key);
479  *key = Py_tss_NEEDS_INIT;
480 }
481 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
482  return PyThread_set_key_value(*key, value);
483 }
484 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
485  return PyThread_get_key_value(*key);
486 }
487 #endif
488 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
489 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
490 #else
491 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
492 #endif
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)
496 #else
497  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
498  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
499 #endif
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)
502 #else
503 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
504 #endif
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)))
510  #else
511  #define __Pyx_PyUnicode_READY(op) (0)
512  #endif
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))
523  #else
524  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
525  #endif
526  #else
527  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
528  #endif
529 #else
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))
543 #endif
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)
547 #else
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))
551 #endif
552 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
553  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
554 #endif
555 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
556  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
557 #endif
558 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
559  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
560 #endif
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)
565 #else
566  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
567 #endif
568 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
569  #define PyObject_ASCII(o) PyObject_Repr(o)
570 #endif
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
579 #endif
580 #endif
581 #if PY_MAJOR_VERSION >= 3
582  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
583  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
584 #else
585  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
586  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
587 #endif
588 #ifndef PySet_CheckExact
589  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
590 #endif
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)
594 #else
595  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
596  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
597 #endif
598 #if CYTHON_ASSUME_SAFE_MACROS
599  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
600 #else
601  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
602 #endif
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
619 #endif
620 #if PY_MAJOR_VERSION >= 3
621  #define PyBoolObject PyLongObject
622 #endif
623 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
624  #ifndef PyUnicode_InternFromString
625  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
626  #endif
627 #endif
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
632 #else
633  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
634  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
635 #endif
636 #if PY_MAJOR_VERSION >= 3
637  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
638 #else
639  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
640 #endif
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)
645  #else
646  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
647  #endif
648 #else
649  #define __Pyx_PyType_AsAsync(obj) NULL
650 #endif
651 #ifndef __Pyx_PyAsyncMethodsStruct
652  typedef struct {
653  unaryfunc am_await;
654  unaryfunc am_aiter;
655  unaryfunc am_anext;
656  } __Pyx_PyAsyncMethodsStruct;
657 #endif
658 
659 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
660  #if !defined(_USE_MATH_DEFINES)
661  #define _USE_MATH_DEFINES
662  #endif
663 #endif
664 #include <math.h>
665 #ifdef NAN
666 #define __PYX_NAN() ((float) NAN)
667 #else
668 static CYTHON_INLINE float __PYX_NAN() {
669  float value;
670  memset(&value, 0xFF, sizeof(value));
671  return value;
672 }
673 #endif
674 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
675 #define __Pyx_truncl trunc
676 #else
677 #define __Pyx_truncl truncl
678 #endif
679 
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; }
684 
685 #ifndef __PYX_EXTERN_C
686  #ifdef __cplusplus
687  #define __PYX_EXTERN_C extern "C"
688  #else
689  #define __PYX_EXTERN_C extern
690  #endif
691 #endif
692 
693 #define __PYX_HAVE__superluWrappers
694 #define __PYX_HAVE_API__superluWrappers
695 /* Early includes */
696 #include <string.h>
697 #include <stdio.h>
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"
703 
704  /* NumPy API declarations from "numpy/__init__.pxd" */
705 
706 #include "proteus_superlu.h"
707 #include <stdlib.h>
708 #include "pythread.h"
709 #include "pystate.h"
710 #ifdef _OPENMP
711 #include <omp.h>
712 #endif /* _OPENMP */
713 
714 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
715 #define CYTHON_WITHOUT_ASSERTIONS
716 #endif
717 
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;
720 
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;
741 }
742 #if defined (__cplusplus) && __cplusplus >= 201103L
743  #include <cstdlib>
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)
755 #else
756  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
757 #endif
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
768 #else
769  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
770  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
771 #endif
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;
790  while (*u_end++) ;
791  return (size_t)(u_end - u - 1);
792 }
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))
809 #else
810 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
811 #endif
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))
815 #else
816 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
817 #endif
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) {
822  PyObject* sys;
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");
828  if (!sys) goto bad;
829  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
830  Py_DECREF(sys);
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;
836  } else {
837  char ascii_chars[128];
838  int c;
839  for (c = 0; c < 128; c++) {
840  ascii_chars[c] = c;
841  }
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) {
847  PyErr_Format(
848  PyExc_ValueError,
849  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
850  default_encoding_c);
851  goto bad;
852  }
853  Py_DECREF(ascii_chars_u);
854  Py_DECREF(ascii_chars_b);
855  }
856  Py_DECREF(default_encoding);
857  return 0;
858 bad:
859  Py_XDECREF(default_encoding);
860  Py_XDECREF(ascii_chars_u);
861  Py_XDECREF(ascii_chars_b);
862  return -1;
863 }
864 #endif
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)
867 #else
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) {
872  PyObject* sys;
873  PyObject* default_encoding = NULL;
874  char* default_encoding_c;
875  sys = PyImport_ImportModule("sys");
876  if (!sys) goto bad;
877  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
878  Py_DECREF(sys);
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);
886  return 0;
887 bad:
888  Py_XDECREF(default_encoding);
889  return -1;
890 }
891 #endif
892 #endif
893 
894 
895 /* Test for GCC > 2.95 */
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)
899 #else /* !__GNUC__ or GCC < 2.95 */
900  #define likely(x) (x)
901  #define unlikely(x) (x)
902 #endif /* __GNUC__ */
903 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
904 
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;
916 
917 /* Header.proto */
918 #if !defined(CYTHON_CCOMPLEX)
919  #if defined(__cplusplus)
920  #define CYTHON_CCOMPLEX 1
921  #elif defined(_Complex_I)
922  #define CYTHON_CCOMPLEX 1
923  #else
924  #define CYTHON_CCOMPLEX 0
925  #endif
926 #endif
927 #if CYTHON_CCOMPLEX
928  #ifdef __cplusplus
929  #include <complex>
930  #else
931  #include <complex.h>
932  #endif
933 #endif
934 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
935  #undef _Complex_I
936  #define _Complex_I 1.0fj
937 #endif
938 
939 
940 static const char *__pyx_f[] = {
941  "proteus/superluWrappers.pyx",
942  "stringsource",
943  "__init__.pxd",
944  "type.pxd",
945 };
946 /* MemviewSliceStruct.proto */
947 struct __pyx_memoryview_obj;
948 typedef struct {
949  struct __pyx_memoryview_obj *memview;
950  char *data;
951  Py_ssize_t shape[8];
952  Py_ssize_t strides[8];
953  Py_ssize_t suboffsets[8];
954 } __Pyx_memviewslice;
955 #define __Pyx_MemoryView_Len(m) (m.shape[0])
956 
957 /* Atomics.proto */
958 #include <pythread.h>
959 #ifndef CYTHON_ATOMICS
960  #define CYTHON_ATOMICS 1
961 #endif
962 #define __pyx_atomic_int_type int
963 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
964  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
965  !defined(__i386__)
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"
970  #endif
971 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
972  #include <Windows.h>
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")
979  #endif
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"
985  #endif
986 #else
987  #undef CYTHON_ATOMICS
988  #define CYTHON_ATOMICS 0
989  #ifdef __PYX_DEBUG_ATOMICS
990  #warning "Not using atomics"
991  #endif
992 #endif
993 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
994 #if CYTHON_ATOMICS
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)
999 #else
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)
1004 #endif
1005 
1006 /* ForceInitThreads.proto */
1007 #ifndef __PYX_FORCE_INIT_THREADS
1008  #define __PYX_FORCE_INIT_THREADS 0
1009 #endif
1010 
1011 /* NoFastGil.proto */
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()
1017 
1018 /* BufferFormatStructs.proto */
1019 #define IS_UNSIGNED(type) (((type) -1) > 0)
1020 struct __Pyx_StructField_;
1021 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1022 typedef struct {
1023  const char* name;
1024  struct __Pyx_StructField_* fields;
1025  size_t size;
1026  size_t arraysize[8];
1027  int ndim;
1028  char typegroup;
1029  char is_unsigned;
1030  int flags;
1031 } __Pyx_TypeInfo;
1032 typedef struct __Pyx_StructField_ {
1033  __Pyx_TypeInfo* type;
1034  const char* name;
1035  size_t offset;
1036 } __Pyx_StructField;
1037 typedef struct {
1038  __Pyx_StructField* field;
1039  size_t parent_offset;
1040 } __Pyx_BufFmt_StackElem;
1041 typedef struct {
1042  __Pyx_StructField root;
1043  __Pyx_BufFmt_StackElem* head;
1044  size_t fmt_offset;
1045  size_t new_count, enc_count;
1046  size_t struct_alignment;
1047  int is_complex;
1048  char enc_type;
1049  char new_packmode;
1050  char enc_packmode;
1051  char is_valid_array;
1052 } __Pyx_BufFmt_Context;
1053 
1054 
1055 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":690
1056  * # in Cython to enable them only on the right systems.
1057  *
1058  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1059  * ctypedef npy_int16 int16_t
1060  * ctypedef npy_int32 int32_t
1061  */
1062 typedef npy_int8 __pyx_t_5numpy_int8_t;
1063 
1064 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":691
1065  *
1066  * ctypedef npy_int8 int8_t
1067  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1068  * ctypedef npy_int32 int32_t
1069  * ctypedef npy_int64 int64_t
1070  */
1071 typedef npy_int16 __pyx_t_5numpy_int16_t;
1072 
1073 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":692
1074  * ctypedef npy_int8 int8_t
1075  * ctypedef npy_int16 int16_t
1076  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1077  * ctypedef npy_int64 int64_t
1078  * #ctypedef npy_int96 int96_t
1079  */
1080 typedef npy_int32 __pyx_t_5numpy_int32_t;
1081 
1082 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":693
1083  * ctypedef npy_int16 int16_t
1084  * ctypedef npy_int32 int32_t
1085  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1086  * #ctypedef npy_int96 int96_t
1087  * #ctypedef npy_int128 int128_t
1088  */
1089 typedef npy_int64 __pyx_t_5numpy_int64_t;
1090 
1091 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":697
1092  * #ctypedef npy_int128 int128_t
1093  *
1094  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1095  * ctypedef npy_uint16 uint16_t
1096  * ctypedef npy_uint32 uint32_t
1097  */
1098 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1099 
1100 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":698
1101  *
1102  * ctypedef npy_uint8 uint8_t
1103  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1104  * ctypedef npy_uint32 uint32_t
1105  * ctypedef npy_uint64 uint64_t
1106  */
1107 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1108 
1109 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":699
1110  * ctypedef npy_uint8 uint8_t
1111  * ctypedef npy_uint16 uint16_t
1112  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1113  * ctypedef npy_uint64 uint64_t
1114  * #ctypedef npy_uint96 uint96_t
1115  */
1116 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1117 
1118 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":700
1119  * ctypedef npy_uint16 uint16_t
1120  * ctypedef npy_uint32 uint32_t
1121  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1122  * #ctypedef npy_uint96 uint96_t
1123  * #ctypedef npy_uint128 uint128_t
1124  */
1125 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1126 
1127 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":704
1128  * #ctypedef npy_uint128 uint128_t
1129  *
1130  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1131  * ctypedef npy_float64 float64_t
1132  * #ctypedef npy_float80 float80_t
1133  */
1134 typedef npy_float32 __pyx_t_5numpy_float32_t;
1135 
1136 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":705
1137  *
1138  * ctypedef npy_float32 float32_t
1139  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1140  * #ctypedef npy_float80 float80_t
1141  * #ctypedef npy_float128 float128_t
1142  */
1143 typedef npy_float64 __pyx_t_5numpy_float64_t;
1144 
1145 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":714
1146  * # The int types are mapped a bit surprising --
1147  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1148  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1149  * ctypedef npy_longlong long_t
1150  * ctypedef npy_longlong longlong_t
1151  */
1152 typedef npy_long __pyx_t_5numpy_int_t;
1153 
1154 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":715
1155  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1156  * ctypedef npy_long int_t
1157  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1158  * ctypedef npy_longlong longlong_t
1159  *
1160  */
1161 typedef npy_longlong __pyx_t_5numpy_long_t;
1162 
1163 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":716
1164  * ctypedef npy_long int_t
1165  * ctypedef npy_longlong long_t
1166  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1167  *
1168  * ctypedef npy_ulong uint_t
1169  */
1170 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1171 
1172 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":718
1173  * ctypedef npy_longlong longlong_t
1174  *
1175  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1176  * ctypedef npy_ulonglong ulong_t
1177  * ctypedef npy_ulonglong ulonglong_t
1178  */
1179 typedef npy_ulong __pyx_t_5numpy_uint_t;
1180 
1181 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":719
1182  *
1183  * ctypedef npy_ulong uint_t
1184  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1185  * ctypedef npy_ulonglong ulonglong_t
1186  *
1187  */
1188 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1189 
1190 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":720
1191  * ctypedef npy_ulong uint_t
1192  * ctypedef npy_ulonglong ulong_t
1193  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1194  *
1195  * ctypedef npy_intp intp_t
1196  */
1197 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1198 
1199 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":722
1200  * ctypedef npy_ulonglong ulonglong_t
1201  *
1202  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1203  * ctypedef npy_uintp uintp_t
1204  *
1205  */
1206 typedef npy_intp __pyx_t_5numpy_intp_t;
1207 
1208 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":723
1209  *
1210  * ctypedef npy_intp intp_t
1211  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1212  *
1213  * ctypedef npy_double float_t
1214  */
1215 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1216 
1217 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":725
1218  * ctypedef npy_uintp uintp_t
1219  *
1220  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1221  * ctypedef npy_double double_t
1222  * ctypedef npy_longdouble longdouble_t
1223  */
1224 typedef npy_double __pyx_t_5numpy_float_t;
1225 
1226 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":726
1227  *
1228  * ctypedef npy_double float_t
1229  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1230  * ctypedef npy_longdouble longdouble_t
1231  *
1232  */
1233 typedef npy_double __pyx_t_5numpy_double_t;
1234 
1235 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":727
1236  * ctypedef npy_double float_t
1237  * ctypedef npy_double double_t
1238  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1239  *
1240  * ctypedef npy_cfloat cfloat_t
1241  */
1242 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1243 /* Declarations.proto */
1244 #if CYTHON_CCOMPLEX
1245  #ifdef __cplusplus
1246  typedef ::std::complex< float > __pyx_t_float_complex;
1247  #else
1248  typedef float _Complex __pyx_t_float_complex;
1249  #endif
1250 #else
1251  typedef struct { float real, imag; } __pyx_t_float_complex;
1252 #endif
1253 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1254 
1255 /* Declarations.proto */
1256 #if CYTHON_CCOMPLEX
1257  #ifdef __cplusplus
1258  typedef ::std::complex< double > __pyx_t_double_complex;
1259  #else
1260  typedef double _Complex __pyx_t_double_complex;
1261  #endif
1262 #else
1263  typedef struct { double real, imag; } __pyx_t_double_complex;
1264 #endif
1265 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1266 
1267 
1268 /*--- Type declarations ---*/
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;
1275 
1276 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":729
1277  * ctypedef npy_longdouble longdouble_t
1278  *
1279  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1280  * ctypedef npy_cdouble cdouble_t
1281  * ctypedef npy_clongdouble clongdouble_t
1282  */
1283 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1284 
1285 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":730
1286  *
1287  * ctypedef npy_cfloat cfloat_t
1288  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1289  * ctypedef npy_clongdouble clongdouble_t
1290  *
1291  */
1292 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1293 
1294 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":731
1295  * ctypedef npy_cfloat cfloat_t
1296  * ctypedef npy_cdouble cdouble_t
1297  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1298  *
1299  * ctypedef npy_cdouble complex_t
1300  */
1301 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1302 
1303 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":733
1304  * ctypedef npy_clongdouble clongdouble_t
1305  *
1306  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1307  *
1308  * cdef inline object PyArray_MultiIterNew1(a):
1309  */
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;
1315 
1316 /* "superluWrappers.pxd":61
1317  * void csp_preorder "sp_preorder"(_superlu_options_t *, _SuperMatrix *, int *, int *, _SuperMatrix *)
1318  *
1319  * cdef struct _NRformat: # <<<<<<<<<<<<<<
1320  * np.int32_t nnz
1321  * np.float64_t * nzval
1322  */
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;
1328 };
1329 
1330 /* "superluWrappers.pyx":128
1331  * yp[i] = tmp
1332  *
1333  * cdef struct _NCformat: # <<<<<<<<<<<<<<
1334  * np.int32_t nnz
1335  * np.float64_t * nzval
1336  */
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;
1342 };
1343 
1344 /* "superluWrappers.pyx":134
1345  * np.int32_t * colptr
1346  *
1347  * cdef struct _DNformat: # <<<<<<<<<<<<<<
1348  * np.int32_t lda
1349  * void *nzval
1350  */
1351 struct __pyx_t_15superluWrappers__DNformat {
1352  __pyx_t_5numpy_int32_t lda;
1353  void *nzval;
1354 };
1355 
1356 /* "superluWrappers.pyx":138
1357  * void *nzval
1358  *
1359  * cdef struct _NCPformat: # <<<<<<<<<<<<<<
1360  * np.int32_t nnz
1361  * void * nzval
1362  */
1363 struct __pyx_t_15superluWrappers__NCPformat {
1364  __pyx_t_5numpy_int32_t nnz;
1365  void *nzval;
1366  __pyx_t_5numpy_int32_t *rowind;
1367  __pyx_t_5numpy_int32_t *colbeg;
1368  __pyx_t_5numpy_int32_t *colend;
1369 };
1370 
1371 /* "superluWrappers.pxd":67
1372  * np.int32_t * rowptr
1373  *
1374  * cdef class cSparseMatrix(object): # <<<<<<<<<<<<<<
1375  * cdef np.int32_t dim[2]
1376  * cdef _NRformat A
1377  */
1378 struct __pyx_obj_15superluWrappers_cSparseMatrix {
1379  PyObject_HEAD
1380  __pyx_t_5numpy_int32_t dim[2];
1381  struct __pyx_t_15superluWrappers__NRformat A;
1382 };
1383 
1384 
1385 /* "superluWrappers.pyx":145
1386  * np.int32_t * colend
1387  *
1388  * cdef class SparseFactor(object): # <<<<<<<<<<<<<<
1389  *
1390  * cdef _superlu_options_t options
1391  */
1392 struct __pyx_obj_15superluWrappers_SparseFactor {
1393  PyObject_HEAD
1394  struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtab;
1395  superlu_options_t options;
1396  SuperMatrix A;
1397  SuperMatrix AC;
1398  SuperMatrix L;
1399  SuperMatrix U;
1400  SuperMatrix X;
1401  GlobalLU_t Glu;
1402  SuperLUStat_t stat;
1403  struct __pyx_t_15superluWrappers__NCformat storeA;
1404  struct __pyx_t_15superluWrappers__DNformat storeX;
1405  int *perm_c;
1406  int *perm_r;
1407  int *etree;
1408  unsigned int use_same_perm_c;
1409  unsigned int use_same_sparsity;
1410  int dim;
1411 };
1412 
1413 
1414 /* "View.MemoryView":105
1415  *
1416  * @cname("__pyx_array")
1417  * cdef class array: # <<<<<<<<<<<<<<
1418  *
1419  * cdef:
1420  */
1421 struct __pyx_array_obj {
1422  PyObject_HEAD
1423  struct __pyx_vtabstruct_array *__pyx_vtab;
1424  char *data;
1425  Py_ssize_t len;
1426  char *format;
1427  int ndim;
1428  Py_ssize_t *_shape;
1429  Py_ssize_t *_strides;
1430  Py_ssize_t itemsize;
1431  PyObject *mode;
1432  PyObject *_format;
1433  void (*callback_free_data)(void *);
1434  int free_data;
1435  int dtype_is_object;
1436 };
1437 
1438 
1439 /* "View.MemoryView":279
1440  *
1441  * @cname('__pyx_MemviewEnum')
1442  * cdef class Enum(object): # <<<<<<<<<<<<<<
1443  * cdef object name
1444  * def __init__(self, name):
1445  */
1446 struct __pyx_MemviewEnum_obj {
1447  PyObject_HEAD
1448  PyObject *name;
1449 };
1450 
1451 
1452 /* "View.MemoryView":330
1453  *
1454  * @cname('__pyx_memoryview')
1455  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1456  *
1457  * cdef object obj
1458  */
1459 struct __pyx_memoryview_obj {
1460  PyObject_HEAD
1461  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1462  PyObject *obj;
1463  PyObject *_size;
1464  PyObject *_array_interface;
1465  PyThread_type_lock lock;
1466  __pyx_atomic_int acquisition_count[2];
1467  __pyx_atomic_int *acquisition_count_aligned_p;
1468  Py_buffer view;
1469  int flags;
1470  int dtype_is_object;
1471  __Pyx_TypeInfo *typeinfo;
1472 };
1473 
1474 
1475 /* "View.MemoryView":965
1476  *
1477  * @cname('__pyx_memoryviewslice')
1478  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1479  * "Internal class for passing memoryview slices to Python"
1480  *
1481  */
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 *);
1488 };
1489 
1490 
1491 
1492 /* "superluWrappers.pyx":145
1493  * np.int32_t * colend
1494  *
1495  * cdef class SparseFactor(object): # <<<<<<<<<<<<<<
1496  *
1497  * cdef _superlu_options_t options
1498  */
1499 
1500 struct __pyx_vtabstruct_15superluWrappers_SparseFactor {
1501  PyObject *(*_set_mat_types)(struct __pyx_obj_15superluWrappers_SparseFactor *);
1502 };
1503 static struct __pyx_vtabstruct_15superluWrappers_SparseFactor *__pyx_vtabptr_15superluWrappers_SparseFactor;
1504 
1505 
1506 /* "View.MemoryView":105
1507  *
1508  * @cname("__pyx_array")
1509  * cdef class array: # <<<<<<<<<<<<<<
1510  *
1511  * cdef:
1512  */
1513 
1514 struct __pyx_vtabstruct_array {
1515  PyObject *(*get_memview)(struct __pyx_array_obj *);
1516 };
1517 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1518 
1519 
1520 /* "View.MemoryView":330
1521  *
1522  * @cname('__pyx_memoryview')
1523  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1524  *
1525  * cdef object obj
1526  */
1527 
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 *);
1536 };
1537 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1538 
1539 
1540 /* "View.MemoryView":965
1541  *
1542  * @cname('__pyx_memoryviewslice')
1543  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1544  * "Internal class for passing memoryview slices to Python"
1545  *
1546  */
1547 
1548 struct __pyx_vtabstruct__memoryviewslice {
1549  struct __pyx_vtabstruct_memoryview __pyx_base;
1550 };
1551 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1552 
1553 /* --- Runtime support code (head) --- */
1554 /* Refnanny.proto */
1555 #ifndef CYTHON_REFNANNY
1556  #define CYTHON_REFNANNY 0
1557 #endif
1558 #if CYTHON_REFNANNY
1559  typedef struct {
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;
1570 #ifdef WITH_THREAD
1571  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1572  if (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);\
1576  } else {\
1577  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1578  }
1579 #else
1580  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1581  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1582 #endif
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)
1593 #else
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)
1605 #endif
1606 #define __Pyx_XDECREF_SET(r, v) do {\
1607  PyObject *tmp = (PyObject *) r;\
1608  r = v; __Pyx_XDECREF(tmp);\
1609  } while (0)
1610 #define __Pyx_DECREF_SET(r, v) do {\
1611  PyObject *tmp = (PyObject *) r;\
1612  r = v; __Pyx_DECREF(tmp);\
1613  } while (0)
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)
1616 
1617 /* PyObjectGetAttrStr.proto */
1618 #if CYTHON_USE_TYPE_SLOTS
1619 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1620 #else
1621 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1622 #endif
1623 
1624 /* GetBuiltinName.proto */
1625 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1626 
1627 /* RaiseArgTupleInvalid.proto */
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);
1630 
1631 /* RaiseDoubleKeywords.proto */
1632 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1633 
1634 /* ParseKeywords.proto */
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);
1638 
1639 /* PyObjectSetAttrStr.proto */
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);
1643 #else
1644 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1645 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1646 #endif
1647 
1648 /* PyObjectCall.proto */
1649 #if CYTHON_COMPILING_IN_CPYTHON
1650 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1651 #else
1652 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1653 #endif
1654 
1655 /* ExtTypeTest.proto */
1656 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1657 
1658 /* MemviewSliceInit.proto */
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,
1670  int ndim,
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);
1683 
1684 /* PyObjectLookupSpecial.proto */
1685 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
1686 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
1687  PyObject *res;
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);
1692 #endif
1693  res = _PyType_Lookup(tp, attr_name);
1694  if (likely(res)) {
1695  descrgetfunc f = Py_TYPE(res)->tp_descr_get;
1696  if (!f) {
1697  Py_INCREF(res);
1698  } else {
1699  res = f(res, obj, (PyObject *)tp);
1700  }
1701  } else {
1702  PyErr_SetObject(PyExc_AttributeError, attr_name);
1703  }
1704  return res;
1705 }
1706 #else
1707 #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
1708 #endif
1709 
1710 /* PyFunctionFastCall.proto */
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);
1716 #else
1717 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1718 #endif
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)
1723 #endif
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
1730  #endif
1731  #include "internal/pycore_frame.h"
1732 #endif
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
1739 #endif
1740 
1741 /* PyObjectCallMethO.proto */
1742 #if CYTHON_COMPILING_IN_CPYTHON
1743 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1744 #endif
1745 
1746 /* PyObjectCallNoArg.proto */
1747 #if CYTHON_COMPILING_IN_CPYTHON
1748 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1749 #else
1750 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1751 #endif
1752 
1753 /* PyCFunctionFastCall.proto */
1754 #if CYTHON_FAST_PYCCALL
1755 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1756 #else
1757 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1758 #endif
1759 
1760 /* PyObjectCallOneArg.proto */
1761 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1762 
1763 /* GetItemInt.proto */
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);
1784 
1785 /* ObjectGetItem.proto */
1786 #if CYTHON_USE_TYPE_SLOTS
1787 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1788 #else
1789 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1790 #endif
1791 
1792 /* PyObjectCall2Args.proto */
1793 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1794 
1795 /* PyIntBinop.proto */
1796 #if !CYTHON_COMPILING_IN_PYPY
1797 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1798 #else
1799 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1800  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1801 #endif
1802 
1803 /* GetTopmostException.proto */
1804 #if CYTHON_USE_EXC_INFO_STACK
1805 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1806 #endif
1807 
1808 /* PyThreadStateGet.proto */
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
1813 #else
1814 #define __Pyx_PyThreadState_declare
1815 #define __Pyx_PyThreadState_assign
1816 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1817 #endif
1818 
1819 /* SaveResetException.proto */
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);
1825 #else
1826 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1827 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1828 #endif
1829 
1830 /* GetException.proto */
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);
1834 #else
1835 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1836 #endif
1837 
1838 /* PyErrFetchRestore.proto */
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))
1849 #else
1850 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1851 #endif
1852 #else
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)
1861 #endif
1862 
1863 /* SliceObject.proto */
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);
1868 
1869 /* RaiseException.proto */
1870 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1871 
1872 /* WriteUnraisableException.proto */
1873 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1874  int lineno, const char *filename,
1875  int full_traceback, int nogil);
1876 
1877 /* PyErrExceptionMatches.proto */
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);
1881 #else
1882 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1883 #endif
1884 
1885 /* ArgTypeTest.proto */
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);
1890 
1891 /* IncludeStringH.proto */
1892 #include <string.h>
1893 
1894 /* BytesEquals.proto */
1895 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1896 
1897 /* UnicodeEquals.proto */
1898 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1899 
1900 /* StrEquals.proto */
1901 #if PY_MAJOR_VERSION >= 3
1902 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1903 #else
1904 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1905 #endif
1906 
1907 /* DivInt[Py_ssize_t].proto */
1908 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1909 
1910 /* UnaryNegOverflows.proto */
1911 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1912  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1913 
1914 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1915 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1916 /* GetAttr.proto */
1917 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1918 
1919 /* decode_c_string_utf16.proto */
1920 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1921  int byteorder = 0;
1922  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1923 }
1924 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1925  int byteorder = -1;
1926  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1927 }
1928 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1929  int byteorder = 1;
1930  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1931 }
1932 
1933 /* decode_c_string.proto */
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));
1938 
1939 /* GetAttr3.proto */
1940 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1941 
1942 /* PyDictVersioning.proto */
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;\
1954  } else {\
1955  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1956  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1957  }\
1958 }
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);
1962 #else
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);
1966 #endif
1967 
1968 /* GetModuleGlobalName.proto */
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);\
1976 }
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);\
1981 }
1982 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1983 #else
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);
1987 #endif
1988 
1989 /* RaiseTooManyValuesToUnpack.proto */
1990 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1991 
1992 /* RaiseNeedMoreValuesToUnpack.proto */
1993 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1994 
1995 /* RaiseNoneIterError.proto */
1996 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1997 
1998 /* SwapException.proto */
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);
2002 #else
2003 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2004 #endif
2005 
2006 /* Import.proto */
2007 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2008 
2009 /* FastTypeChecks.proto */
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);
2015 #else
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))
2019 #endif
2020 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2021 
2022 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2023 /* ListCompAppend.proto */
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)) {
2029  Py_INCREF(x);
2030  PyList_SET_ITEM(list, len, x);
2031  __Pyx_SET_SIZE(list, len + 1);
2032  return 0;
2033  }
2034  return PyList_Append(list, x);
2035 }
2036 #else
2037 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2038 #endif
2039 
2040 /* ListExtend.proto */
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))
2045  return -1;
2046  Py_DECREF(none);
2047  return 0;
2048 #else
2049  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2050 #endif
2051 }
2052 
2053 /* ListAppend.proto */
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))) {
2059  Py_INCREF(x);
2060  PyList_SET_ITEM(list, len, x);
2061  __Pyx_SET_SIZE(list, len + 1);
2062  return 0;
2063  }
2064  return PyList_Append(list, x);
2065 }
2066 #else
2067 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2068 #endif
2069 
2070 /* None.proto */
2071 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2072 
2073 /* DivInt[long].proto */
2074 static CYTHON_INLINE long __Pyx_div_long(long, long);
2075 
2076 /* PySequenceContains.proto */
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));
2080 }
2081 
2082 /* ImportFrom.proto */
2083 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2084 
2085 /* HasAttr.proto */
2086 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2087 
2088 /* PyObject_GenericGetAttrNoDict.proto */
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);
2091 #else
2092 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2093 #endif
2094 
2095 /* PyObject_GenericGetAttr.proto */
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);
2098 #else
2099 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2100 #endif
2101 
2102 /* PyObjectGetAttrStrNoError.proto */
2103 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2104 
2105 /* SetupReduce.proto */
2106 static int __Pyx_setup_reduce(PyObject* type_obj);
2107 
2108 /* SetVTable.proto */
2109 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2110 
2111 /* TypeImport.proto */
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
2118 };
2119 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2120 #endif
2121 
2122 /* CalculateMetaclass.proto */
2123 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
2124 
2125 /* FetchCommonType.proto */
2126 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2127 
2128 /* CythonFunctionShared.proto */
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)
2141 typedef struct {
2142  PyCFunctionObject func;
2143 #if PY_VERSION_HEX < 0x030500A0
2144  PyObject *func_weakreflist;
2145 #endif
2146  PyObject *func_dict;
2147  PyObject *func_name;
2148  PyObject *func_qualname;
2149  PyObject *func_doc;
2150  PyObject *func_globals;
2151  PyObject *func_code;
2152  PyObject *func_closure;
2153  PyObject *func_classobj;
2154  void *defaults;
2155  int defaults_pyobjects;
2156  size_t defaults_size; // used by FusedFunction for copying defaults
2157  int flags;
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,
2167  PyObject *self,
2168  PyObject *module, PyObject *globals,
2169  PyObject* code);
2170 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2171  size_t size,
2172  int pyobjects);
2173 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2174  PyObject *tuple);
2175 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2176  PyObject *dict);
2177 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2178  PyObject *dict);
2179 static int __pyx_CyFunction_init(void);
2180 
2181 /* CythonFunction.proto */
2182 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2183  int flags, PyObject* qualname,
2184  PyObject *closure,
2185  PyObject *module, PyObject *globals,
2186  PyObject* code);
2187 
2188 /* SetNameInClass.proto */
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))
2195 #else
2196 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2197 #endif
2198 
2199 /* Py3ClassCreate.proto */
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);
2204 
2205 /* CLineInTraceback.proto */
2206 #ifdef CYTHON_CLINE_IN_TRACEBACK
2207 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2208 #else
2209 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2210 #endif
2211 
2212 /* CodeObjectCache.proto */
2213 typedef struct {
2214  PyCodeObject* code_object;
2215  int code_line;
2216 } __Pyx_CodeObjectCacheEntry;
2217 struct __Pyx_CodeObjectCache {
2218  int count;
2219  int max_count;
2220  __Pyx_CodeObjectCacheEntry* entries;
2221 };
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);
2226 
2227 /* AddTraceback.proto */
2228 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2229  int py_line, const char *filename);
2230 
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);
2234 #else
2235  #define __Pyx_GetBuffer PyObject_GetBuffer
2236  #define __Pyx_ReleaseBuffer PyBuffer_Release
2237 #endif
2238 
2239 
2240 /* BufferStructDeclare.proto */
2241 typedef struct {
2242  Py_ssize_t shape, strides, suboffsets;
2243 } __Pyx_Buf_DimInfo;
2244 typedef struct {
2245  size_t refcount;
2246  Py_buffer pybuffer;
2247 } __Pyx_Buffer;
2248 typedef struct {
2249  __Pyx_Buffer *rcbuffer;
2250  char *data;
2251  __Pyx_Buf_DimInfo diminfo[8];
2252 } __Pyx_LocalBuf_ND;
2253 
2254 /* MemviewSliceIsContig.proto */
2255 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2256 
2257 /* OverlappingSlices.proto */
2258 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2259  __Pyx_memviewslice *slice2,
2260  int ndim, size_t itemsize);
2261 
2262 /* Capsule.proto */
2263 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2264 
2265 /* GCCDiagnostics.proto */
2266 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2267 #define __Pyx_HAS_GCC_DIAGNOSTIC
2268 #endif
2269 
2270 /* IsLittleEndian.proto */
2271 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2272 
2273 /* BufferFormatCheck.proto */
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);
2278 
2279 /* TypeInfoCompare.proto */
2280 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2281 
2282 /* MemviewSliceValidateAndInit.proto */
2283 static int __Pyx_ValidateAndInit_memviewslice(
2284  int *axes_specs,
2285  int c_or_f_flag,
2286  int buf_flags,
2287  int ndim,
2288  __Pyx_TypeInfo *dtype,
2289  __Pyx_BufFmt_StackElem stack[],
2290  __Pyx_memviewslice *memviewslice,
2291  PyObject *original_obj);
2292 
2293 /* ObjectToMemviewSlice.proto */
2294 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *, int writable_flag);
2295 
2296 /* ObjectToMemviewSlice.proto */
2297 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *, int writable_flag);
2298 
2299 /* RealImag.proto */
2300 #if CYTHON_CCOMPLEX
2301  #ifdef __cplusplus
2302  #define __Pyx_CREAL(z) ((z).real())
2303  #define __Pyx_CIMAG(z) ((z).imag())
2304  #else
2305  #define __Pyx_CREAL(z) (__real__(z))
2306  #define __Pyx_CIMAG(z) (__imag__(z))
2307  #endif
2308 #else
2309  #define __Pyx_CREAL(z) ((z).real)
2310  #define __Pyx_CIMAG(z) ((z).imag)
2311 #endif
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))
2316 #else
2317  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2318  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2319 #endif
2320 
2321 /* Arithmetic.proto */
2322 #if CYTHON_CCOMPLEX
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))
2329  #ifdef __cplusplus
2330  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2331  #define __Pyx_c_conj_float(z) (::std::conj(z))
2332  #if 1
2333  #define __Pyx_c_abs_float(z) (::std::abs(z))
2334  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2335  #endif
2336  #else
2337  #define __Pyx_c_is_zero_float(z) ((z)==0)
2338  #define __Pyx_c_conj_float(z) (conjf(z))
2339  #if 1
2340  #define __Pyx_c_abs_float(z) (cabsf(z))
2341  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2342  #endif
2343  #endif
2344 #else
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);
2353  #if 1
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);
2356  #endif
2357 #endif
2358 
2359 /* Arithmetic.proto */
2360 #if CYTHON_CCOMPLEX
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))
2367  #ifdef __cplusplus
2368  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2369  #define __Pyx_c_conj_double(z) (::std::conj(z))
2370  #if 1
2371  #define __Pyx_c_abs_double(z) (::std::abs(z))
2372  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2373  #endif
2374  #else
2375  #define __Pyx_c_is_zero_double(z) ((z)==0)
2376  #define __Pyx_c_conj_double(z) (conj(z))
2377  #if 1
2378  #define __Pyx_c_abs_double(z) (cabs(z))
2379  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2380  #endif
2381  #endif
2382 #else
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);
2391  #if 1
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);
2394  #endif
2395 #endif
2396 
2397 /* MemviewSliceCopyTemplate.proto */
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);
2403 
2404 /* CIntFromPy.proto */
2405 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2406 
2407 /* CIntToPy.proto */
2408 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
2409 
2410 /* CIntFromPy.proto */
2411 static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
2412 
2413 /* CIntFromPy.proto */
2414 static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
2415 
2416 /* CIntToPy.proto */
2417 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2418 
2419 /* CIntFromPy.proto */
2420 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2421 
2422 /* CIntToPy.proto */
2423 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2424 
2425 /* CIntFromPy.proto */
2426 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2427 
2428 /* CheckBinaryVersion.proto */
2429 static int __Pyx_check_binary_version(void);
2430 
2431 /* InitStrings.proto */
2432 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2433 
2434 static PyObject *__pyx_f_15superluWrappers_12SparseFactor__set_mat_types(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto*/
2435 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2436 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2437 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2438 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
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); /* proto*/
2440 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2441 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2442 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2443 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2444 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2445 
2446 /* Module declarations from 'cpython.buffer' */
2447 
2448 /* Module declarations from 'libc.string' */
2449 
2450 /* Module declarations from 'libc.stdio' */
2451 
2452 /* Module declarations from '__builtin__' */
2453 
2454 /* Module declarations from 'cpython.type' */
2455 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2456 
2457 /* Module declarations from 'cpython' */
2458 
2459 /* Module declarations from 'cpython.object' */
2460 
2461 /* Module declarations from 'cpython.ref' */
2462 
2463 /* Module declarations from 'cpython.mem' */
2464 
2465 /* Module declarations from 'numpy' */
2466 
2467 /* Module declarations from 'numpy' */
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;
2483 
2484 /* Module declarations from 'cython.view' */
2485 
2486 /* Module declarations from 'cython' */
2487 
2488 /* Module declarations from 'libc.stdlib' */
2489 
2490 /* Module declarations from 'superluWrappers' */
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); /*proto*/
2505 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorPrepare(struct __pyx_obj_15superluWrappers_cSparseMatrix *, struct __pyx_obj_15superluWrappers_SparseFactor *); /*proto*/
2506 static void __pyx_f_15superluWrappers_superluWrappersSparseFactorSolve(struct __pyx_obj_15superluWrappers_SparseFactor *, __Pyx_memviewslice); /*proto*/
2507 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2508 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2509 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2510 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2511 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2512 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2513 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
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); /*proto*/
2515 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2516 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2517 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2518 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2519 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2520 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2521 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2522 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2523 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2524 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2525 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2526 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2527 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2528 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2529 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2530 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2531 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2532 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2533 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2534 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2535 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2536 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2537 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2538 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2539 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
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;
2545 
2546 /* Implementation of 'superluWrappers' */
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); /* proto */
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); /* proto */
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); /* proto */
2845 static PyObject *__pyx_pf_15superluWrappers_12SparseMatrix_6getCSRrepresentation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
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); /* proto */
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); /* proto */
2848 static PyObject *__pyx_pf_15superluWrappers_13cSparseMatrix_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_cSparseMatrix *__pyx_v_self); /* proto */
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); /* proto */
2850 static int __pyx_pf_15superluWrappers_12SparseFactor___init__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */
2851 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_3dim___get__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto */
2852 static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2853 static PyObject *__pyx_pf_15superluWrappers_12SparseFactor_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self); /* proto */
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); /* proto */
2855 static PyObject *__pyx_pf_15superluWrappers_sparseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparse_matrix, PyObject *__pyx_v_sparseFactor); /* proto */
2856 static PyObject *__pyx_pf_15superluWrappers_2sparseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sparseFactor, PyObject *__pyx_v_x); /* proto */
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); /* proto */
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); /* proto */
2859 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2860 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2861 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2862 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2863 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
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); /* proto */
2865 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
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); /* proto */
2867 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2868 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2869 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2870 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
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); /* proto */
2872 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2873 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
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); /* proto */
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); /* proto */
2876 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2877 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2878 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2879 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2880 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2881 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2882 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2883 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2884 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2885 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2886 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2887 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2888 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2889 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2890 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2891 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2892 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
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); /* proto */
2894 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2895 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2896 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
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); /* proto */
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); /* proto */
2899 static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2900 static PyObject *__pyx_tp_new_15superluWrappers_SparseFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2901 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2902 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2903 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2904 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
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;
2959 /* Late includes */
2960 
2961 /* "superluWrappers.pyx":15
2962  * class SparseMatrix(object):
2963  *
2964  * def __init__(self, # <<<<<<<<<<<<<<
2965  * nr,
2966  * nc,
2967  */
2968 
2969 /* Python wrapper */
2970 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
2986  {
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)) {
2990  Py_ssize_t kw_args;
2991  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2992  switch (pos_args) {
2993  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2994  CYTHON_FALLTHROUGH;
2995  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2996  CYTHON_FALLTHROUGH;
2997  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2998  CYTHON_FALLTHROUGH;
2999  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3000  CYTHON_FALLTHROUGH;
3001  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3002  CYTHON_FALLTHROUGH;
3003  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3004  CYTHON_FALLTHROUGH;
3005  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3006  CYTHON_FALLTHROUGH;
3007  case 0: break;
3008  default: goto __pyx_L5_argtuple_error;
3009  }
3010  kw_args = PyDict_Size(__pyx_kwds);
3011  switch (pos_args) {
3012  case 0:
3013  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3014  else goto __pyx_L5_argtuple_error;
3015  CYTHON_FALLTHROUGH;
3016  case 1:
3017  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nr)) != 0)) kw_args--;
3018  else {
3019  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 1); __PYX_ERR(0, 15, __pyx_L3_error)
3020  }
3021  CYTHON_FALLTHROUGH;
3022  case 2:
3023  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
3024  else {
3025  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 2); __PYX_ERR(0, 15, __pyx_L3_error)
3026  }
3027  CYTHON_FALLTHROUGH;
3028  case 3:
3029  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
3030  else {
3031  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 3); __PYX_ERR(0, 15, __pyx_L3_error)
3032  }
3033  CYTHON_FALLTHROUGH;
3034  case 4:
3035  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nzvals)) != 0)) kw_args--;
3036  else {
3037  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 4); __PYX_ERR(0, 15, __pyx_L3_error)
3038  }
3039  CYTHON_FALLTHROUGH;
3040  case 5:
3041  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
3042  else {
3043  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 5); __PYX_ERR(0, 15, __pyx_L3_error)
3044  }
3045  CYTHON_FALLTHROUGH;
3046  case 6:
3047  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
3048  else {
3049  __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 6); __PYX_ERR(0, 15, __pyx_L3_error)
3050  }
3051  }
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)
3054  }
3055  } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
3056  goto __pyx_L5_argtuple_error;
3057  } else {
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);
3065  }
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];
3073  }
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)
3077  __pyx_L3_error:;
3078  __Pyx_AddTraceback("superluWrappers.SparseMatrix.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3079  __Pyx_RefNannyFinishContext();
3080  return NULL;
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);
3083 
3084  /* function exit code */
3085  __Pyx_RefNannyFinishContext();
3086  return __pyx_r;
3087 }
3088 
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);
3100 
3101  /* "superluWrappers.pyx":22
3102  * colind,
3103  * rowptr):
3104  * self.nr = nr ; self.nc = nc # <<<<<<<<<<<<<<
3105  * self.nnz = nnz
3106  * self.shape = [self.nr, self.nc]
3107  */
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)
3110 
3111  /* "superluWrappers.pyx":23
3112  * rowptr):
3113  * self.nr = nr ; self.nc = nc
3114  * self.nnz = nnz # <<<<<<<<<<<<<<
3115  * self.shape = [self.nr, self.nc]
3116  * self.nzvals = nzvals
3117  */
3118  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nnz, __pyx_v_nnz) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
3119 
3120  /* "superluWrappers.pyx":24
3121  * self.nr = nr ; self.nc = nc
3122  * self.nnz = nnz
3123  * self.shape = [self.nr, self.nc] # <<<<<<<<<<<<<<
3124  * self.nzvals = nzvals
3125  * self.colind = colind
3126  */
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);
3137  __pyx_t_1 = 0;
3138  __pyx_t_2 = 0;
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;
3141 
3142  /* "superluWrappers.pyx":25
3143  * self.nnz = nnz
3144  * self.shape = [self.nr, self.nc]
3145  * self.nzvals = nzvals # <<<<<<<<<<<<<<
3146  * self.colind = colind
3147  * self.rowptr = rowptr
3148  */
3149  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nzvals, __pyx_v_nzvals) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
3150 
3151  /* "superluWrappers.pyx":26
3152  * self.shape = [self.nr, self.nc]
3153  * self.nzvals = nzvals
3154  * self.colind = colind # <<<<<<<<<<<<<<
3155  * self.rowptr = rowptr
3156  * self._cSparseMatrix = cSparseMatrix(nr,
3157  */
3158  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_colind, __pyx_v_colind) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
3159 
3160  /* "superluWrappers.pyx":27
3161  * self.nzvals = nzvals
3162  * self.colind = colind
3163  * self.rowptr = rowptr # <<<<<<<<<<<<<<
3164  * self._cSparseMatrix = cSparseMatrix(nr,
3165  * nc,
3166  */
3167  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rowptr, __pyx_v_rowptr) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
3168 
3169  /* "superluWrappers.pyx":31
3170  * nc,
3171  * nnz,
3172  * self.nzvals, # <<<<<<<<<<<<<<
3173  * self.colind,
3174  * self.rowptr)
3175  */
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);
3178 
3179  /* "superluWrappers.pyx":32
3180  * nnz,
3181  * self.nzvals,
3182  * self.colind, # <<<<<<<<<<<<<<
3183  * self.rowptr)
3184  *
3185  */
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);
3188 
3189  /* "superluWrappers.pyx":33
3190  * self.nzvals,
3191  * self.colind,
3192  * self.rowptr) # <<<<<<<<<<<<<<
3193  *
3194  * def matvec(self, x, y):
3195  */
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);
3198 
3199  /* "superluWrappers.pyx":28
3200  * self.colind = colind
3201  * self.rowptr = rowptr
3202  * self._cSparseMatrix = cSparseMatrix(nr, # <<<<<<<<<<<<<<
3203  * nc,
3204  * nnz,
3205  */
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);
3223  __pyx_t_3 = 0;
3224  __pyx_t_2 = 0;
3225  __pyx_t_1 = 0;
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;
3231 
3232  /* "superluWrappers.pyx":15
3233  * class SparseMatrix(object):
3234  *
3235  * def __init__(self, # <<<<<<<<<<<<<<
3236  * nr,
3237  * nc,
3238  */
3239 
3240  /* function exit code */
3241  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3242  goto __pyx_L0;
3243  __pyx_L1_error:;
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);
3249  __pyx_r = NULL;
3250  __pyx_L0:;
3251  __Pyx_XGIVEREF(__pyx_r);
3252  __Pyx_RefNannyFinishContext();
3253  return __pyx_r;
3254 }
3255 
3256 /* "superluWrappers.pyx":35
3257  * self.rowptr)
3258  *
3259  * def matvec(self, x, y): # <<<<<<<<<<<<<<
3260  * """
3261  * Compute the sparse matrix-vector product y = Ax
3262  */
3263 
3264 /* Python wrapper */
3265 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_3matvec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
3278  {
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)) {
3282  Py_ssize_t kw_args;
3283  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3284  switch (pos_args) {
3285  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3286  CYTHON_FALLTHROUGH;
3287  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3288  CYTHON_FALLTHROUGH;
3289  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3290  CYTHON_FALLTHROUGH;
3291  case 0: break;
3292  default: goto __pyx_L5_argtuple_error;
3293  }
3294  kw_args = PyDict_Size(__pyx_kwds);
3295  switch (pos_args) {
3296  case 0:
3297  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3298  else goto __pyx_L5_argtuple_error;
3299  CYTHON_FALLTHROUGH;
3300  case 1:
3301  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
3302  else {
3303  __Pyx_RaiseArgtupleInvalid("matvec", 1, 3, 3, 1); __PYX_ERR(0, 35, __pyx_L3_error)
3304  }
3305  CYTHON_FALLTHROUGH;
3306  case 2:
3307  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
3308  else {
3309  __Pyx_RaiseArgtupleInvalid("matvec", 1, 3, 3, 2); __PYX_ERR(0, 35, __pyx_L3_error)
3310  }
3311  }
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)
3314  }
3315  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3316  goto __pyx_L5_argtuple_error;
3317  } else {
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);
3321  }
3322  __pyx_v_self = values[0];
3323  __pyx_v_x = values[1];
3324  __pyx_v_y = values[2];
3325  }
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)
3329  __pyx_L3_error:;
3330  __Pyx_AddTraceback("superluWrappers.SparseMatrix.matvec", __pyx_clineno, __pyx_lineno, __pyx_filename);
3331  __Pyx_RefNannyFinishContext();
3332  return NULL;
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);
3335 
3336  /* function exit code */
3337  __Pyx_RefNannyFinishContext();
3338  return __pyx_r;
3339 }
3340 
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);
3351 
3352  /* "superluWrappers.pyx":44
3353  * y (output) : numpy array
3354  * """
3355  * SparseMatrix_matvec(self._cSparseMatrix, x, y) # <<<<<<<<<<<<<<
3356  *
3357  * def fwrite(self, filename, base):
3358  */
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;
3372 
3373  /* "superluWrappers.pyx":35
3374  * self.rowptr)
3375  *
3376  * def matvec(self, x, y): # <<<<<<<<<<<<<<
3377  * """
3378  * Compute the sparse matrix-vector product y = Ax
3379  */
3380 
3381  /* function exit code */
3382  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3383  goto __pyx_L0;
3384  __pyx_L1_error:;
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);
3389  __pyx_r = NULL;
3390  __pyx_L0:;
3391  __Pyx_XGIVEREF(__pyx_r);
3392  __Pyx_RefNannyFinishContext();
3393  return __pyx_r;
3394 }
3395 
3396 /* "superluWrappers.pyx":46
3397  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
3398  *
3399  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
3400  * """ Write the sparse matrix to a file
3401  *
3402  */
3403 
3404 /* Python wrapper */
3405 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_5fwrite(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
3418  {
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)) {
3422  Py_ssize_t kw_args;
3423  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3424  switch (pos_args) {
3425  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3426  CYTHON_FALLTHROUGH;
3427  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3428  CYTHON_FALLTHROUGH;
3429  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3430  CYTHON_FALLTHROUGH;
3431  case 0: break;
3432  default: goto __pyx_L5_argtuple_error;
3433  }
3434  kw_args = PyDict_Size(__pyx_kwds);
3435  switch (pos_args) {
3436  case 0:
3437  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3438  else goto __pyx_L5_argtuple_error;
3439  CYTHON_FALLTHROUGH;
3440  case 1:
3441  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
3442  else {
3443  __Pyx_RaiseArgtupleInvalid("fwrite", 1, 3, 3, 1); __PYX_ERR(0, 46, __pyx_L3_error)
3444  }
3445  CYTHON_FALLTHROUGH;
3446  case 2:
3447  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base)) != 0)) kw_args--;
3448  else {
3449  __Pyx_RaiseArgtupleInvalid("fwrite", 1, 3, 3, 2); __PYX_ERR(0, 46, __pyx_L3_error)
3450  }
3451  }
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)
3454  }
3455  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3456  goto __pyx_L5_argtuple_error;
3457  } else {
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);
3461  }
3462  __pyx_v_self = values[0];
3463  __pyx_v_filename = values[1];
3464  __pyx_v_base = values[2];
3465  }
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)
3469  __pyx_L3_error:;
3470  __Pyx_AddTraceback("superluWrappers.SparseMatrix.fwrite", __pyx_clineno, __pyx_lineno, __pyx_filename);
3471  __Pyx_RefNannyFinishContext();
3472  return NULL;
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);
3475 
3476  /* function exit code */
3477  __Pyx_RefNannyFinishContext();
3478  return __pyx_r;
3479 }
3480 
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;
3504  int __pyx_t_18;
3505  int __pyx_t_19;
3506  int __pyx_lineno = 0;
3507  const char *__pyx_filename = NULL;
3508  int __pyx_clineno = 0;
3509  __Pyx_RefNannySetupContext("fwrite", 0);
3510 
3511  /* "superluWrappers.pyx":56
3512  * ?!Possibly something to do with parallel?!
3513  * """
3514  * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
3515  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3516  * for i in range(self.nr):
3517  */
3518  /*with:*/ {
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);
3534  __pyx_t_5 = NULL;
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);
3542  }
3543  }
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;
3550  __pyx_t_1 = 0;
3551  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3552  /*try:*/ {
3553  {
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);
3560  /*try:*/ {
3561  __pyx_v_output_file = __pyx_t_4;
3562  __pyx_t_4 = 0;
3563 
3564  /* "superluWrappers.pyx":57
3565  * """
3566  * with open(filename, 'w') as output_file:
3567  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) ) # <<<<<<<<<<<<<<
3568  * for i in range(self.nr):
3569  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3570  */
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);
3593  __pyx_t_1 = 0;
3594  __pyx_t_5 = 0;
3595  __pyx_t_11 = 0;
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;
3599  __pyx_t_10 = NULL;
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);
3607  }
3608  }
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;
3616 
3617  /* "superluWrappers.pyx":58
3618  * with open(filename, 'w') as output_file:
3619  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3620  * for i in range(self.nr): # <<<<<<<<<<<<<<
3621  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3622  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3623  */
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;
3631  __pyx_t_13 = NULL;
3632  } else {
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)
3636  }
3637  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3638  for (;;) {
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)
3644  #else
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);
3647  #endif
3648  } else {
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)
3652  #else
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);
3655  #endif
3656  }
3657  } else {
3658  __pyx_t_2 = __pyx_t_13(__pyx_t_4);
3659  if (unlikely(!__pyx_t_2)) {
3660  PyObject* exc_type = PyErr_Occurred();
3661  if (exc_type) {
3662  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3663  else __PYX_ERR(0, 58, __pyx_L7_error)
3664  }
3665  break;
3666  }
3667  __Pyx_GOTREF(__pyx_t_2);
3668  }
3669  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
3670  __pyx_t_2 = 0;
3671 
3672  /* "superluWrappers.pyx":59
3673  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3674  * for i in range(self.nr):
3675  * for k in range(self.rowptr[i], self.rowptr[i+1]): # <<<<<<<<<<<<<<
3676  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3677  *
3678  */
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);
3698  __pyx_t_11 = 0;
3699  __pyx_t_5 = 0;
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;
3705  __pyx_t_15 = NULL;
3706  } else {
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)
3710  }
3711  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3712  for (;;) {
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)
3718  #else
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);
3721  #endif
3722  } else {
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)
3726  #else
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);
3729  #endif
3730  }
3731  } else {
3732  __pyx_t_5 = __pyx_t_15(__pyx_t_10);
3733  if (unlikely(!__pyx_t_5)) {
3734  PyObject* exc_type = PyErr_Occurred();
3735  if (exc_type) {
3736  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3737  else __PYX_ERR(0, 59, __pyx_L7_error)
3738  }
3739  break;
3740  }
3741  __Pyx_GOTREF(__pyx_t_5);
3742  }
3743  __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
3744  __pyx_t_5 = 0;
3745 
3746  /* "superluWrappers.pyx":60
3747  * for i in range(self.nr):
3748  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3749  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) ) # <<<<<<<<<<<<<<
3750  *
3751  * def getCSRrepresentation(self):
3752  */
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);
3778  __pyx_t_2 = 0;
3779  __pyx_t_1 = 0;
3780  __pyx_t_16 = 0;
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;
3784  __pyx_t_9 = NULL;
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);
3792  }
3793  }
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;
3801 
3802  /* "superluWrappers.pyx":59
3803  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3804  * for i in range(self.nr):
3805  * for k in range(self.rowptr[i], self.rowptr[i+1]): # <<<<<<<<<<<<<<
3806  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3807  *
3808  */
3809  }
3810  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3811 
3812  /* "superluWrappers.pyx":58
3813  * with open(filename, 'w') as output_file:
3814  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3815  * for i in range(self.nr): # <<<<<<<<<<<<<<
3816  * for k in range(self.rowptr[i], self.rowptr[i+1]):
3817  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3818  */
3819  }
3820  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3821 
3822  /* "superluWrappers.pyx":56
3823  * ?!Possibly something to do with parallel?!
3824  * """
3825  * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
3826  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
3827  * for i in range(self.nr):
3828  */
3829  }
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;
3834  __pyx_L7_error:;
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;
3843  /*except:*/ {
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);
3860  if (__pyx_t_19) {
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)
3867  }
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;
3872  }
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);
3884  __pyx_L12_try_end:;
3885  }
3886  }
3887  /*finally:*/ {
3888  /*normal exit:*/{
3889  if (__pyx_t_3) {
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;
3895  }
3896  goto __pyx_L6;
3897  }
3898  __pyx_L6:;
3899  }
3900  goto __pyx_L20;
3901  __pyx_L3_error:;
3902  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3903  goto __pyx_L1_error;
3904  __pyx_L20:;
3905  }
3906 
3907  /* "superluWrappers.pyx":46
3908  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
3909  *
3910  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
3911  * """ Write the sparse matrix to a file
3912  *
3913  */
3914 
3915  /* function exit code */
3916  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3917  goto __pyx_L0;
3918  __pyx_L1_error:;
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);
3928  __pyx_r = NULL;
3929  __pyx_L0:;
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();
3935  return __pyx_r;
3936 }
3937 
3938 /* "superluWrappers.pyx":62
3939  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
3940  *
3941  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
3942  * """ Get the CSR representation of the sparse matrix.
3943  *
3944  */
3945 
3946 /* Python wrapper */
3947 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_7getCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
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));
3955 
3956  /* function exit code */
3957  __Pyx_RefNannyFinishContext();
3958  return __pyx_r;
3959 }
3960 
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);
3972 
3973  /* "superluWrappers.pyx":70
3974  * (rowptr, colptr, vals)
3975  * """
3976  * return (self.rowptr, self.colind, self.nzvals) # <<<<<<<<<<<<<<
3977  *
3978  * def getSubMatCSRrepresentation(self,
3979  */
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);
3995  __pyx_t_1 = 0;
3996  __pyx_t_2 = 0;
3997  __pyx_t_3 = 0;
3998  __pyx_r = __pyx_t_4;
3999  __pyx_t_4 = 0;
4000  goto __pyx_L0;
4001 
4002  /* "superluWrappers.pyx":62
4003  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
4004  *
4005  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
4006  * """ Get the CSR representation of the sparse matrix.
4007  *
4008  */
4009 
4010  /* function exit code */
4011  __pyx_L1_error:;
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);
4017  __pyx_r = NULL;
4018  __pyx_L0:;
4019  __Pyx_XGIVEREF(__pyx_r);
4020  __Pyx_RefNannyFinishContext();
4021  return __pyx_r;
4022 }
4023 
4024 /* "superluWrappers.pyx":72
4025  * return (self.rowptr, self.colind, self.nzvals)
4026  *
4027  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
4028  * range_start,
4029  * range_end):
4030  */
4031 
4032 /* Python wrapper */
4033 static PyObject *__pyx_pw_15superluWrappers_12SparseMatrix_9getSubMatCSRrepresentation(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
4046  {
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)) {
4050  Py_ssize_t kw_args;
4051  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4052  switch (pos_args) {
4053  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4054  CYTHON_FALLTHROUGH;
4055  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4056  CYTHON_FALLTHROUGH;
4057  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4058  CYTHON_FALLTHROUGH;
4059  case 0: break;
4060  default: goto __pyx_L5_argtuple_error;
4061  }
4062  kw_args = PyDict_Size(__pyx_kwds);
4063  switch (pos_args) {
4064  case 0:
4065  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
4066  else goto __pyx_L5_argtuple_error;
4067  CYTHON_FALLTHROUGH;
4068  case 1:
4069  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_range_start)) != 0)) kw_args--;
4070  else {
4071  __Pyx_RaiseArgtupleInvalid("getSubMatCSRrepresentation", 1, 3, 3, 1); __PYX_ERR(0, 72, __pyx_L3_error)
4072  }
4073  CYTHON_FALLTHROUGH;
4074  case 2:
4075  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_range_end)) != 0)) kw_args--;
4076  else {
4077  __Pyx_RaiseArgtupleInvalid("getSubMatCSRrepresentation", 1, 3, 3, 2); __PYX_ERR(0, 72, __pyx_L3_error)
4078  }
4079  }
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)
4082  }
4083  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4084  goto __pyx_L5_argtuple_error;
4085  } else {
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);
4089  }
4090  __pyx_v_self = values[0];
4091  __pyx_v_range_start = values[1];
4092  __pyx_v_range_end = values[2];
4093  }
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)
4097  __pyx_L3_error:;
4098  __Pyx_AddTraceback("superluWrappers.SparseMatrix.getSubMatCSRrepresentation", __pyx_clineno, __pyx_lineno, __pyx_filename);
4099  __Pyx_RefNannyFinishContext();
4100  return NULL;
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);
4103 
4104  /* function exit code */
4105  __Pyx_RefNannyFinishContext();
4106  return __pyx_r;
4107 }
4108 
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;
4118  int __pyx_t_2;
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);
4126 
4127  /* "superluWrappers.pyx":87
4128  * (rowptr, colind, nzvals)
4129  * """
4130  * assert range_start >= 0 ; assert range_end <= self.nr # <<<<<<<<<<<<<<
4131  * assert range_end > range_start
4132  * _rows = range_end - range_start
4133  */
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)
4142  }
4143  }
4144  #endif
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)
4156  }
4157  }
4158  #endif
4159 
4160  /* "superluWrappers.pyx":88
4161  * """
4162  * assert range_start >= 0 ; assert range_end <= self.nr
4163  * assert range_end > range_start # <<<<<<<<<<<<<<
4164  * _rows = range_end - range_start
4165  * assert _rows <= self.nr
4166  */
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)
4175  }
4176  }
4177  #endif
4178 
4179  /* "superluWrappers.pyx":89
4180  * assert range_start >= 0 ; assert range_end <= self.nr
4181  * assert range_end > range_start
4182  * _rows = range_end - range_start # <<<<<<<<<<<<<<
4183  * assert _rows <= self.nr
4184  *
4185  */
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;
4189  __pyx_t_3 = 0;
4190 
4191  /* "superluWrappers.pyx":90
4192  * assert range_end > range_start
4193  * _rows = range_end - range_start
4194  * assert _rows <= self.nr # <<<<<<<<<<<<<<
4195  *
4196  * nnz = self.rowptr[range_end] - self.rowptr[range_start]
4197  */
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)
4209  }
4210  }
4211  #endif
4212 
4213  /* "superluWrappers.pyx":92
4214  * assert _rows <= self.nr
4215  *
4216  * nnz = self.rowptr[range_end] - self.rowptr[range_start] # <<<<<<<<<<<<<<
4217  *
4218  * rowptr = self.rowptr[range_start : range_start + _rows + 1]
4219  */
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;
4235  __pyx_t_1 = 0;
4236 
4237  /* "superluWrappers.pyx":94
4238  * nnz = self.rowptr[range_end] - self.rowptr[range_start]
4239  *
4240  * rowptr = self.rowptr[range_start : range_start + _rows + 1] # <<<<<<<<<<<<<<
4241  * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4242  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4243  */
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;
4256  __pyx_t_4 = 0;
4257 
4258  /* "superluWrappers.pyx":95
4259  *
4260  * rowptr = self.rowptr[range_start : range_start + _rows + 1]
4261  * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz] # <<<<<<<<<<<<<<
4262  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4263  *
4264  */
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;
4286  __pyx_t_5 = 0;
4287 
4288  /* "superluWrappers.pyx":96
4289  * rowptr = self.rowptr[range_start : range_start + _rows + 1]
4290  * colind = self.colind[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4291  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz] # <<<<<<<<<<<<<<
4292  *
4293  * return rowptr, colind, nzvals
4294  */
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;
4316  __pyx_t_4 = 0;
4317 
4318  /* "superluWrappers.pyx":98
4319  * nzvals = self.nzvals[self.rowptr[range_start] : self.rowptr[range_start] + nnz]
4320  *
4321  * return rowptr, colind, nzvals # <<<<<<<<<<<<<<
4322  *
4323  * cdef class cSparseMatrix(object):
4324  */
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;
4338  __pyx_t_4 = 0;
4339  goto __pyx_L0;
4340 
4341  /* "superluWrappers.pyx":72
4342  * return (self.rowptr, self.colind, self.nzvals)
4343  *
4344  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
4345  * range_start,
4346  * range_end):
4347  */
4348 
4349  /* function exit code */
4350  __pyx_L1_error:;
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);
4356  __pyx_r = NULL;
4357  __pyx_L0:;
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();
4365  return __pyx_r;
4366 }
4367 
4368 /* "superluWrappers.pyx":102
4369  * cdef class cSparseMatrix(object):
4370  *
4371  * def __cinit__(self, # <<<<<<<<<<<<<<
4372  * int nr,
4373  * int nc,
4374  */
4375 
4376 /* Python wrapper */
4377 static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4378 static int __pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4379  int __pyx_v_nr;
4380  int __pyx_v_nc;
4381  int __pyx_v_nnz;
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;
4388  int __pyx_r;
4389  __Pyx_RefNannyDeclarations
4390  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4391  {
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)) {
4395  Py_ssize_t kw_args;
4396  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4397  switch (pos_args) {
4398  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4399  CYTHON_FALLTHROUGH;
4400  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4401  CYTHON_FALLTHROUGH;
4402  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4403  CYTHON_FALLTHROUGH;
4404  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4405  CYTHON_FALLTHROUGH;
4406  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4407  CYTHON_FALLTHROUGH;
4408  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4409  CYTHON_FALLTHROUGH;
4410  case 0: break;
4411  default: goto __pyx_L5_argtuple_error;
4412  }
4413  kw_args = PyDict_Size(__pyx_kwds);
4414  switch (pos_args) {
4415  case 0:
4416  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nr)) != 0)) kw_args--;
4417  else goto __pyx_L5_argtuple_error;
4418  CYTHON_FALLTHROUGH;
4419  case 1:
4420  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
4421  else {
4422  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); __PYX_ERR(0, 102, __pyx_L3_error)
4423  }
4424  CYTHON_FALLTHROUGH;
4425  case 2:
4426  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nnz)) != 0)) kw_args--;
4427  else {
4428  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); __PYX_ERR(0, 102, __pyx_L3_error)
4429  }
4430  CYTHON_FALLTHROUGH;
4431  case 3:
4432  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nzval)) != 0)) kw_args--;
4433  else {
4434  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); __PYX_ERR(0, 102, __pyx_L3_error)
4435  }
4436  CYTHON_FALLTHROUGH;
4437  case 4:
4438  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
4439  else {
4440  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); __PYX_ERR(0, 102, __pyx_L3_error)
4441  }
4442  CYTHON_FALLTHROUGH;
4443  case 5:
4444  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
4445  else {
4446  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); __PYX_ERR(0, 102, __pyx_L3_error)
4447  }
4448  }
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)
4451  }
4452  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4453  goto __pyx_L5_argtuple_error;
4454  } else {
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);
4461  }
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)
4468  }
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)
4472  __pyx_L3_error:;
4473  __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4474  __Pyx_RefNannyFinishContext();
4475  return -1;
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);
4478 
4479  /* function exit code */
4480  __Pyx_RefNannyFinishContext();
4481  return __pyx_r;
4482 }
4483 
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) {
4485  int __pyx_r;
4486  __Pyx_RefNannyDeclarations
4487  Py_ssize_t __pyx_t_1;
4488  __Pyx_RefNannySetupContext("__cinit__", 0);
4489 
4490  /* "superluWrappers.pyx":109
4491  * np.int32_t [:] colind,
4492  * np.int32_t [:] rowptr):
4493  * self.dim[0] = nr ; self.dim[1] = nc # <<<<<<<<<<<<<<
4494  * self.A.nnz = nnz
4495  * #ARB - should memory for these ptrs need be allocated?
4496  */
4497  (__pyx_v_self->dim[0]) = __pyx_v_nr;
4498  (__pyx_v_self->dim[1]) = __pyx_v_nc;
4499 
4500  /* "superluWrappers.pyx":110
4501  * np.int32_t [:] rowptr):
4502  * self.dim[0] = nr ; self.dim[1] = nc
4503  * self.A.nnz = nnz # <<<<<<<<<<<<<<
4504  * #ARB - should memory for these ptrs need be allocated?
4505  * self.A.nzval = &nzval[0]
4506  */
4507  __pyx_v_self->A.nnz = __pyx_v_nnz;
4508 
4509  /* "superluWrappers.pyx":112
4510  * self.A.nnz = nnz
4511  * #ARB - should memory for these ptrs need be allocated?
4512  * self.A.nzval = &nzval[0] # <<<<<<<<<<<<<<
4513  * self.A.colind = &colind[0]
4514  * self.A.rowptr = &rowptr[0]
4515  */
4516  __pyx_t_1 = 0;
4517  __pyx_v_self->A.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_nzval.data + __pyx_t_1 * __pyx_v_nzval.strides[0]) ))));
4518 
4519  /* "superluWrappers.pyx":113
4520  * #ARB - should memory for these ptrs need be allocated?
4521  * self.A.nzval = &nzval[0]
4522  * self.A.colind = &colind[0] # <<<<<<<<<<<<<<
4523  * self.A.rowptr = &rowptr[0]
4524  *
4525  */
4526  __pyx_t_1 = 0;
4527  __pyx_v_self->A.colind = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_colind.data + __pyx_t_1 * __pyx_v_colind.strides[0]) ))));
4528 
4529  /* "superluWrappers.pyx":114
4530  * self.A.nzval = &nzval[0]
4531  * self.A.colind = &colind[0]
4532  * self.A.rowptr = &rowptr[0] # <<<<<<<<<<<<<<
4533  *
4534  * cdef void SparseMatrix_matvec(cSparseMatrix sm,
4535  */
4536  __pyx_t_1 = 0;
4537  __pyx_v_self->A.rowptr = (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_rowptr.data + __pyx_t_1 * __pyx_v_rowptr.strides[0]) ))));
4538 
4539  /* "superluWrappers.pyx":102
4540  * cdef class cSparseMatrix(object):
4541  *
4542  * def __cinit__(self, # <<<<<<<<<<<<<<
4543  * int nr,
4544  * int nc,
4545  */
4546 
4547  /* function exit code */
4548  __pyx_r = 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();
4553  return __pyx_r;
4554 }
4555 
4556 /* "(tree fragment)":1
4557  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4558  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4559  * def __setstate_cython__(self, __pyx_state):
4560  */
4561 
4562 /* Python wrapper */
4563 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
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));
4569 
4570  /* function exit code */
4571  __Pyx_RefNannyFinishContext();
4572  return __pyx_r;
4573 }
4574 
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);
4583 
4584  /* "(tree fragment)":2
4585  * def __reduce_cython__(self):
4586  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4587  * def __setstate_cython__(self, __pyx_state):
4588  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4589  */
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)
4595 
4596  /* "(tree fragment)":1
4597  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4598  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4599  * def __setstate_cython__(self, __pyx_state):
4600  */
4601 
4602  /* function exit code */
4603  __pyx_L1_error:;
4604  __Pyx_XDECREF(__pyx_t_1);
4605  __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4606  __pyx_r = NULL;
4607  __Pyx_XGIVEREF(__pyx_r);
4608  __Pyx_RefNannyFinishContext();
4609  return __pyx_r;
4610 }
4611 
4612 /* "(tree fragment)":3
4613  * def __reduce_cython__(self):
4614  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4615  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4616  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4617  */
4618 
4619 /* Python wrapper */
4620 static PyObject *__pyx_pw_15superluWrappers_13cSparseMatrix_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
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));
4626 
4627  /* function exit code */
4628  __Pyx_RefNannyFinishContext();
4629  return __pyx_r;
4630 }
4631 
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);
4640 
4641  /* "(tree fragment)":4
4642  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4643  * def __setstate_cython__(self, __pyx_state):
4644  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4645  */
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)
4651 
4652  /* "(tree fragment)":3
4653  * def __reduce_cython__(self):
4654  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4655  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4656  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4657  */
4658 
4659  /* function exit code */
4660  __pyx_L1_error:;
4661  __Pyx_XDECREF(__pyx_t_1);
4662  __Pyx_AddTraceback("superluWrappers.cSparseMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4663  __pyx_r = NULL;
4664  __Pyx_XGIVEREF(__pyx_r);
4665  __Pyx_RefNannyFinishContext();
4666  return __pyx_r;
4667 }
4668 
4669 /* "superluWrappers.pyx":116
4670  * self.A.rowptr = &rowptr[0]
4671  *
4672  * cdef void SparseMatrix_matvec(cSparseMatrix sm, # <<<<<<<<<<<<<<
4673  * np.float64_t [:] xp,
4674  * np.float64_t [:] yp):
4675  */
4676 
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;
4679  int __pyx_v_i;
4680  int __pyx_v_k;
4681  __Pyx_RefNannyDeclarations
4682  __pyx_t_5numpy_int32_t __pyx_t_1;
4683  __pyx_t_5numpy_int32_t __pyx_t_2;
4684  int __pyx_t_3;
4685  __pyx_t_5numpy_int32_t __pyx_t_4;
4686  __pyx_t_5numpy_int32_t __pyx_t_5;
4687  int __pyx_t_6;
4688  Py_ssize_t __pyx_t_7;
4689  __Pyx_RefNannySetupContext("SparseMatrix_matvec", 0);
4690 
4691  /* "superluWrappers.pyx":119
4692  * np.float64_t [:] xp,
4693  * np.float64_t [:] yp):
4694  * cdef np.float64_t tmp = 0. # <<<<<<<<<<<<<<
4695  * cdef int i, k
4696  *
4697  */
4698  __pyx_v_tmp = 0.;
4699 
4700  /* "superluWrappers.pyx":122
4701  * cdef int i, k
4702  *
4703  * for i in range(sm.dim[0]): # <<<<<<<<<<<<<<
4704  * tmp = 0.
4705  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4706  */
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;
4711 
4712  /* "superluWrappers.pyx":123
4713  *
4714  * for i in range(sm.dim[0]):
4715  * tmp = 0. # <<<<<<<<<<<<<<
4716  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4717  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
4718  */
4719  __pyx_v_tmp = 0.;
4720 
4721  /* "superluWrappers.pyx":124
4722  * for i in range(sm.dim[0]):
4723  * tmp = 0.
4724  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]): # <<<<<<<<<<<<<<
4725  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
4726  * yp[i] = tmp
4727  */
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;
4732 
4733  /* "superluWrappers.pyx":125
4734  * tmp = 0.
4735  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4736  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]] # <<<<<<<<<<<<<<
4737  * yp[i] = tmp
4738  *
4739  */
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 *) ( /* dim=0 */ (__pyx_v_xp.data + __pyx_t_7 * __pyx_v_xp.strides[0]) )))));
4742  }
4743 
4744  /* "superluWrappers.pyx":126
4745  * for k in range(sm.A.rowptr[i], sm.A.rowptr[i+1]):
4746  * tmp += sm.A.nzval[k] * xp[sm.A.colind[k]]
4747  * yp[i] = tmp # <<<<<<<<<<<<<<
4748  *
4749  * cdef struct _NCformat:
4750  */
4751  __pyx_t_7 = __pyx_v_i;
4752  *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_yp.data + __pyx_t_7 * __pyx_v_yp.strides[0]) )) = __pyx_v_tmp;
4753  }
4754 
4755  /* "superluWrappers.pyx":116
4756  * self.A.rowptr = &rowptr[0]
4757  *
4758  * cdef void SparseMatrix_matvec(cSparseMatrix sm, # <<<<<<<<<<<<<<
4759  * np.float64_t [:] xp,
4760  * np.float64_t [:] yp):
4761  */
4762 
4763  /* function exit code */
4764  __Pyx_RefNannyFinishContext();
4765 }
4766 
4767 /* "superluWrappers.pyx":170
4768  * cdef public int dim
4769  *
4770  * def __init__(self, dim): # <<<<<<<<<<<<<<
4771  * """
4772  * Arguments
4773  */
4774 
4775 /* Python wrapper */
4776 static int __pyx_pw_15superluWrappers_12SparseFactor_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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__;
4780 #endif
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;
4786  int __pyx_r;
4787  __Pyx_RefNannyDeclarations
4788  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4789  {
4790  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dim,0};
4791  PyObject* values[1] = {0};
4792  if (unlikely(__pyx_kwds)) {
4793  Py_ssize_t kw_args;
4794  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4795  switch (pos_args) {
4796  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4797  CYTHON_FALLTHROUGH;
4798  case 0: break;
4799  default: goto __pyx_L5_argtuple_error;
4800  }
4801  kw_args = PyDict_Size(__pyx_kwds);
4802  switch (pos_args) {
4803  case 0:
4804  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dim)) != 0)) kw_args--;
4805  else goto __pyx_L5_argtuple_error;
4806  }
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)
4809  }
4810  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
4811  goto __pyx_L5_argtuple_error;
4812  } else {
4813  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4814  }
4815  __pyx_v_dim = values[0];
4816  }
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)
4820  __pyx_L3_error:;
4821  __Pyx_AddTraceback("superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4822  __Pyx_RefNannyFinishContext();
4823  return -1;
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);
4826 
4827  /* function exit code */
4828  __Pyx_RefNannyFinishContext();
4829  return __pyx_r;
4830 }
4831 
4832 static int __pyx_pf_15superluWrappers_12SparseFactor___init__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_dim) {
4833  int __pyx_r;
4834  __Pyx_RefNannyDeclarations
4835  PyObject *__pyx_t_1 = NULL;
4836  int __pyx_t_2;
4837  __pyx_t_5numpy_int32_t __pyx_t_3;
4838  PyObject *__pyx_t_4 = NULL;
4839  size_t __pyx_t_5;
4840  int __pyx_lineno = 0;
4841  const char *__pyx_filename = NULL;
4842  int __pyx_clineno = 0;
4843  __Pyx_RefNannySetupContext("__init__", 0);
4844 
4845  /* "superluWrappers.pyx":177
4846  * Dimension of the sparse factor.
4847  * """
4848  * cStatInit(&self.stat) # <<<<<<<<<<<<<<
4849  * cset_default_options(&self.options)
4850  * self._set_mat_types()
4851  */
4852  StatInit((&__pyx_v_self->stat));
4853 
4854  /* "superluWrappers.pyx":178
4855  * """
4856  * cStatInit(&self.stat)
4857  * cset_default_options(&self.options) # <<<<<<<<<<<<<<
4858  * self._set_mat_types()
4859  * self.dim = dim
4860  */
4861  set_default_options((&__pyx_v_self->options));
4862 
4863  /* "superluWrappers.pyx":179
4864  * cStatInit(&self.stat)
4865  * cset_default_options(&self.options)
4866  * self._set_mat_types() # <<<<<<<<<<<<<<
4867  * self.dim = dim
4868  * self.A.nrow = dim ; self.A.ncol = dim
4869  */
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;
4873 
4874  /* "superluWrappers.pyx":180
4875  * cset_default_options(&self.options)
4876  * self._set_mat_types()
4877  * self.dim = dim # <<<<<<<<<<<<<<
4878  * self.A.nrow = dim ; self.A.ncol = dim
4879  * self.AC.nrow = dim ; self.AC.ncol = dim
4880  */
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;
4883 
4884  /* "superluWrappers.pyx":181
4885  * self._set_mat_types()
4886  * self.dim = dim
4887  * self.A.nrow = dim ; self.A.ncol = dim # <<<<<<<<<<<<<<
4888  * self.AC.nrow = dim ; self.AC.ncol = dim
4889  * self.L.nrow = dim ; self.L.ncol = dim
4890  */
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;
4895 
4896  /* "superluWrappers.pyx":182
4897  * self.dim = dim
4898  * self.A.nrow = dim ; self.A.ncol = dim
4899  * self.AC.nrow = dim ; self.AC.ncol = dim # <<<<<<<<<<<<<<
4900  * self.L.nrow = dim ; self.L.ncol = dim
4901  * self.U.nrow = dim ; self.U.ncol = dim
4902  */
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;
4907 
4908  /* "superluWrappers.pyx":183
4909  * self.A.nrow = dim ; self.A.ncol = dim
4910  * self.AC.nrow = dim ; self.AC.ncol = dim
4911  * self.L.nrow = dim ; self.L.ncol = dim # <<<<<<<<<<<<<<
4912  * self.U.nrow = dim ; self.U.ncol = dim
4913  * self.X.nrow = dim ; self.X.ncol = 1
4914  */
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;
4919 
4920  /* "superluWrappers.pyx":184
4921  * self.AC.nrow = dim ; self.AC.ncol = dim
4922  * self.L.nrow = dim ; self.L.ncol = dim
4923  * self.U.nrow = dim ; self.U.ncol = dim # <<<<<<<<<<<<<<
4924  * self.X.nrow = dim ; self.X.ncol = 1
4925  * self.storeX.lda = dim
4926  */
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;
4931 
4932  /* "superluWrappers.pyx":185
4933  * self.L.nrow = dim ; self.L.ncol = dim
4934  * self.U.nrow = dim ; self.U.ncol = dim
4935  * self.X.nrow = dim ; self.X.ncol = 1 # <<<<<<<<<<<<<<
4936  * self.storeX.lda = dim
4937  * self.use_same_perm_c = 0
4938  */
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;
4942 
4943  /* "superluWrappers.pyx":186
4944  * self.U.nrow = dim ; self.U.ncol = dim
4945  * self.X.nrow = dim ; self.X.ncol = 1
4946  * self.storeX.lda = dim # <<<<<<<<<<<<<<
4947  * self.use_same_perm_c = 0
4948  * self.use_same_sparsity = 0
4949  */
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;
4952 
4953  /* "superluWrappers.pyx":187
4954  * self.X.nrow = dim ; self.X.ncol = 1
4955  * self.storeX.lda = dim
4956  * self.use_same_perm_c = 0 # <<<<<<<<<<<<<<
4957  * self.use_same_sparsity = 0
4958  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4959  */
4960  __pyx_v_self->use_same_perm_c = 0;
4961 
4962  /* "superluWrappers.pyx":188
4963  * self.storeX.lda = dim
4964  * self.use_same_perm_c = 0
4965  * self.use_same_sparsity = 0 # <<<<<<<<<<<<<<
4966  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4967  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
4968  */
4969  __pyx_v_self->use_same_sparsity = 0;
4970 
4971  /* "superluWrappers.pyx":189
4972  * self.use_same_perm_c = 0
4973  * self.use_same_sparsity = 0
4974  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
4975  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
4976  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
4977  */
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));
4986 
4987  /* "superluWrappers.pyx":190
4988  * self.use_same_sparsity = 0
4989  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
4990  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
4991  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
4992  *
4993  */
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));
5002 
5003  /* "superluWrappers.pyx":191
5004  * self.perm_c = <int *>malloc(dim*sizeof(np.int32_t))
5005  * self.perm_r = <int *>malloc(dim*sizeof(np.int32_t))
5006  * self.etree = <int *>malloc(dim*sizeof(np.int32_t)) # <<<<<<<<<<<<<<
5007  *
5008  * cdef _set_mat_types(self):
5009  */
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));
5018 
5019  /* "superluWrappers.pyx":170
5020  * cdef public int dim
5021  *
5022  * def __init__(self, dim): # <<<<<<<<<<<<<<
5023  * """
5024  * Arguments
5025  */
5026 
5027  /* function exit code */
5028  __pyx_r = 0;
5029  goto __pyx_L0;
5030  __pyx_L1_error:;
5031  __Pyx_XDECREF(__pyx_t_1);
5032  __Pyx_XDECREF(__pyx_t_4);
5033  __Pyx_AddTraceback("superluWrappers.SparseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5034  __pyx_r = -1;
5035  __pyx_L0:;
5036  __Pyx_RefNannyFinishContext();
5037  return __pyx_r;
5038 }
5039 
5040 /* "superluWrappers.pyx":193
5041  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
5042  *
5043  * cdef _set_mat_types(self): # <<<<<<<<<<<<<<
5044  * self.A.Stype = _SLU_NC
5045  * self.A.Dtype = _SLU_D
5046  */
5047 
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);
5052 
5053  /* "superluWrappers.pyx":194
5054  *
5055  * cdef _set_mat_types(self):
5056  * self.A.Stype = _SLU_NC # <<<<<<<<<<<<<<
5057  * self.A.Dtype = _SLU_D
5058  * self.A.Mtype = _SLU_GE
5059  */
5060  __pyx_v_self->A.Stype = SLU_NC;
5061 
5062  /* "superluWrappers.pyx":195
5063  * cdef _set_mat_types(self):
5064  * self.A.Stype = _SLU_NC
5065  * self.A.Dtype = _SLU_D # <<<<<<<<<<<<<<
5066  * self.A.Mtype = _SLU_GE
5067  * self.A.Store = &self.storeA
5068  */
5069  __pyx_v_self->A.Dtype = SLU_D;
5070 
5071  /* "superluWrappers.pyx":196
5072  * self.A.Stype = _SLU_NC
5073  * self.A.Dtype = _SLU_D
5074  * self.A.Mtype = _SLU_GE # <<<<<<<<<<<<<<
5075  * self.A.Store = &self.storeA
5076  *
5077  */
5078  __pyx_v_self->A.Mtype = SLU_GE;
5079 
5080  /* "superluWrappers.pyx":197
5081  * self.A.Dtype = _SLU_D
5082  * self.A.Mtype = _SLU_GE
5083  * self.A.Store = &self.storeA # <<<<<<<<<<<<<<
5084  *
5085  * self.AC.Stype = _SLU_NCP
5086  */
5087  __pyx_v_self->A.Store = (&__pyx_v_self->storeA);
5088 
5089  /* "superluWrappers.pyx":199
5090  * self.A.Store = &self.storeA
5091  *
5092  * self.AC.Stype = _SLU_NCP # <<<<<<<<<<<<<<
5093  * self.AC.Dtype = _SLU_D
5094  * self.AC.Mtype = _SLU_GE
5095  */
5096  __pyx_v_self->AC.Stype = SLU_NCP;
5097 
5098  /* "superluWrappers.pyx":200
5099  *
5100  * self.AC.Stype = _SLU_NCP
5101  * self.AC.Dtype = _SLU_D # <<<<<<<<<<<<<<
5102  * self.AC.Mtype = _SLU_GE
5103  * self.AC.Store = NULL
5104  */
5105  __pyx_v_self->AC.Dtype = SLU_D;
5106 
5107  /* "superluWrappers.pyx":201
5108  * self.AC.Stype = _SLU_NCP
5109  * self.AC.Dtype = _SLU_D
5110  * self.AC.Mtype = _SLU_GE # <<<<<<<<<<<<<<
5111  * self.AC.Store = NULL
5112  *
5113  */
5114  __pyx_v_self->AC.Mtype = SLU_GE;
5115 
5116  /* "superluWrappers.pyx":202
5117  * self.AC.Dtype = _SLU_D
5118  * self.AC.Mtype = _SLU_GE
5119  * self.AC.Store = NULL # <<<<<<<<<<<<<<
5120  *
5121  * self.L.Stype = _SLU_NC
5122  */
5123  __pyx_v_self->AC.Store = NULL;
5124 
5125  /* "superluWrappers.pyx":204
5126  * self.AC.Store = NULL
5127  *
5128  * self.L.Stype = _SLU_NC # <<<<<<<<<<<<<<
5129  * self.L.Dtype = _SLU_D
5130  * self.L.Mtype = _SLU_TRLU
5131  */
5132  __pyx_v_self->L.Stype = SLU_NC;
5133 
5134  /* "superluWrappers.pyx":205
5135  *
5136  * self.L.Stype = _SLU_NC
5137  * self.L.Dtype = _SLU_D # <<<<<<<<<<<<<<
5138  * self.L.Mtype = _SLU_TRLU
5139  * self.L.Store = NULL
5140  */
5141  __pyx_v_self->L.Dtype = SLU_D;
5142 
5143  /* "superluWrappers.pyx":206
5144  * self.L.Stype = _SLU_NC
5145  * self.L.Dtype = _SLU_D
5146  * self.L.Mtype = _SLU_TRLU # <<<<<<<<<<<<<<
5147  * self.L.Store = NULL
5148  *
5149  */
5150  __pyx_v_self->L.Mtype = SLU_TRLU;
5151 
5152  /* "superluWrappers.pyx":207
5153  * self.L.Dtype = _SLU_D
5154  * self.L.Mtype = _SLU_TRLU
5155  * self.L.Store = NULL # <<<<<<<<<<<<<<
5156  *
5157  * self.U.Stype = _SLU_NC
5158  */
5159  __pyx_v_self->L.Store = NULL;
5160 
5161  /* "superluWrappers.pyx":209
5162  * self.L.Store = NULL
5163  *
5164  * self.U.Stype = _SLU_NC # <<<<<<<<<<<<<<
5165  * self.U.Dtype = _SLU_D
5166  * self.U.Mtype = _SLU_TRU
5167  */
5168  __pyx_v_self->U.Stype = SLU_NC;
5169 
5170  /* "superluWrappers.pyx":210
5171  *
5172  * self.U.Stype = _SLU_NC
5173  * self.U.Dtype = _SLU_D # <<<<<<<<<<<<<<
5174  * self.U.Mtype = _SLU_TRU
5175  * self.U.Store = NULL
5176  */
5177  __pyx_v_self->U.Dtype = SLU_D;
5178 
5179  /* "superluWrappers.pyx":211
5180  * self.U.Stype = _SLU_NC
5181  * self.U.Dtype = _SLU_D
5182  * self.U.Mtype = _SLU_TRU # <<<<<<<<<<<<<<
5183  * self.U.Store = NULL
5184  *
5185  */
5186  __pyx_v_self->U.Mtype = SLU_TRU;
5187 
5188  /* "superluWrappers.pyx":212
5189  * self.U.Dtype = _SLU_D
5190  * self.U.Mtype = _SLU_TRU
5191  * self.U.Store = NULL # <<<<<<<<<<<<<<
5192  *
5193  * self.X.Stype = _SLU_DN
5194  */
5195  __pyx_v_self->U.Store = NULL;
5196 
5197  /* "superluWrappers.pyx":214
5198  * self.U.Store = NULL
5199  *
5200  * self.X.Stype = _SLU_DN # <<<<<<<<<<<<<<
5201  * self.X.Dtype = _SLU_D
5202  * self.X.Mtype = _SLU_GE
5203  */
5204  __pyx_v_self->X.Stype = SLU_DN;
5205 
5206  /* "superluWrappers.pyx":215
5207  *
5208  * self.X.Stype = _SLU_DN
5209  * self.X.Dtype = _SLU_D # <<<<<<<<<<<<<<
5210  * self.X.Mtype = _SLU_GE
5211  * self.X.Store = &self.storeX
5212  */
5213  __pyx_v_self->X.Dtype = SLU_D;
5214 
5215  /* "superluWrappers.pyx":216
5216  * self.X.Stype = _SLU_DN
5217  * self.X.Dtype = _SLU_D
5218  * self.X.Mtype = _SLU_GE # <<<<<<<<<<<<<<
5219  * self.X.Store = &self.storeX
5220  *
5221  */
5222  __pyx_v_self->X.Mtype = SLU_GE;
5223 
5224  /* "superluWrappers.pyx":217
5225  * self.X.Dtype = _SLU_D
5226  * self.X.Mtype = _SLU_GE
5227  * self.X.Store = &self.storeX # <<<<<<<<<<<<<<
5228  *
5229  * def sparseFactorPrepare(sparse_matrix,
5230  */
5231  __pyx_v_self->X.Store = (&__pyx_v_self->storeX);
5232 
5233  /* "superluWrappers.pyx":193
5234  * self.etree = <int *>malloc(dim*sizeof(np.int32_t))
5235  *
5236  * cdef _set_mat_types(self): # <<<<<<<<<<<<<<
5237  * self.A.Stype = _SLU_NC
5238  * self.A.Dtype = _SLU_D
5239  */
5240 
5241  /* function exit code */
5242  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5243  __Pyx_XGIVEREF(__pyx_r);
5244  __Pyx_RefNannyFinishContext();
5245  return __pyx_r;
5246 }
5247 
5248 /* "superluWrappers.pyx":168
5249  * cdef unsigned int use_same_sparsity
5250  *
5251  * cdef public int dim # <<<<<<<<<<<<<<
5252  *
5253  * def __init__(self, dim):
5254  */
5255 
5256 /* Python wrapper */
5257 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(PyObject *__pyx_v_self); /*proto*/
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));
5263 
5264  /* function exit code */
5265  __Pyx_RefNannyFinishContext();
5266  return __pyx_r;
5267 }
5268 
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;
5281  __pyx_t_1 = 0;
5282  goto __pyx_L0;
5283 
5284  /* function exit code */
5285  __pyx_L1_error:;
5286  __Pyx_XDECREF(__pyx_t_1);
5287  __Pyx_AddTraceback("superluWrappers.SparseFactor.dim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5288  __pyx_r = NULL;
5289  __pyx_L0:;
5290  __Pyx_XGIVEREF(__pyx_r);
5291  __Pyx_RefNannyFinishContext();
5292  return __pyx_r;
5293 }
5294 
5295 /* Python wrapper */
5296 static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
5297 static int __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
5298  int __pyx_r;
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));
5302 
5303  /* function exit code */
5304  __Pyx_RefNannyFinishContext();
5305  return __pyx_r;
5306 }
5307 
5308 static int __pyx_pf_15superluWrappers_12SparseFactor_3dim_2__set__(struct __pyx_obj_15superluWrappers_SparseFactor *__pyx_v_self, PyObject *__pyx_v_value) {
5309  int __pyx_r;
5310  __Pyx_RefNannyDeclarations
5311  int __pyx_t_1;
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;
5318 
5319  /* function exit code */
5320  __pyx_r = 0;
5321  goto __pyx_L0;
5322  __pyx_L1_error:;
5323  __Pyx_AddTraceback("superluWrappers.SparseFactor.dim.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5324  __pyx_r = -1;
5325  __pyx_L0:;
5326  __Pyx_RefNannyFinishContext();
5327  return __pyx_r;
5328 }
5329 
5330 /* "(tree fragment)":1
5331  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5332  * raise TypeError("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")
5333  * def __setstate_cython__(self, __pyx_state):
5334  */
5335 
5336 /* Python wrapper */
5337 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
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));
5343 
5344  /* function exit code */
5345  __Pyx_RefNannyFinishContext();
5346  return __pyx_r;
5347 }
5348 
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);
5357 
5358  /* "(tree fragment)":2
5359  * def __reduce_cython__(self):
5360  * raise TypeError("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") # <<<<<<<<<<<<<<
5361  * def __setstate_cython__(self, __pyx_state):
5362  * raise TypeError("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")
5363  */
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)
5369 
5370  /* "(tree fragment)":1
5371  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5372  * raise TypeError("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")
5373  * def __setstate_cython__(self, __pyx_state):
5374  */
5375 
5376  /* function exit code */
5377  __pyx_L1_error:;
5378  __Pyx_XDECREF(__pyx_t_1);
5379  __Pyx_AddTraceback("superluWrappers.SparseFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5380  __pyx_r = NULL;
5381  __Pyx_XGIVEREF(__pyx_r);
5382  __Pyx_RefNannyFinishContext();
5383  return __pyx_r;
5384 }
5385 
5386 /* "(tree fragment)":3
5387  * def __reduce_cython__(self):
5388  * raise TypeError("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")
5389  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5390  * raise TypeError("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")
5391  */
5392 
5393 /* Python wrapper */
5394 static PyObject *__pyx_pw_15superluWrappers_12SparseFactor_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
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));
5400 
5401  /* function exit code */
5402  __Pyx_RefNannyFinishContext();
5403  return __pyx_r;
5404 }
5405 
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);
5414 
5415  /* "(tree fragment)":4
5416  * raise TypeError("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")
5417  * def __setstate_cython__(self, __pyx_state):
5418  * raise TypeError("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") # <<<<<<<<<<<<<<
5419  */
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)
5425 
5426  /* "(tree fragment)":3
5427  * def __reduce_cython__(self):
5428  * raise TypeError("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")
5429  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5430  * raise TypeError("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")
5431  */
5432 
5433  /* function exit code */
5434  __pyx_L1_error:;
5435  __Pyx_XDECREF(__pyx_t_1);
5436  __Pyx_AddTraceback("superluWrappers.SparseFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5437  __pyx_r = NULL;
5438  __Pyx_XGIVEREF(__pyx_r);
5439  __Pyx_RefNannyFinishContext();
5440  return __pyx_r;
5441 }
5442 
5443 /* "superluWrappers.pyx":219
5444  * self.X.Store = &self.storeX
5445  *
5446  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
5447  * sparseFactor):
5448  * """ Python wrapper for superlu Sparse Factor Prepare function.
5449  */
5450 
5451 /* Python wrapper */
5452 static PyObject *__pyx_pw_15superluWrappers_1sparseFactorPrepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
5464  {
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)) {
5468  Py_ssize_t kw_args;
5469  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5470  switch (pos_args) {
5471  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5472  CYTHON_FALLTHROUGH;
5473  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5474  CYTHON_FALLTHROUGH;
5475  case 0: break;
5476  default: goto __pyx_L5_argtuple_error;
5477  }
5478  kw_args = PyDict_Size(__pyx_kwds);
5479  switch (pos_args) {
5480  case 0:
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;
5483  CYTHON_FALLTHROUGH;
5484  case 1:
5485  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparseFactor)) != 0)) kw_args--;
5486  else {
5487  __Pyx_RaiseArgtupleInvalid("sparseFactorPrepare", 1, 2, 2, 1); __PYX_ERR(0, 219, __pyx_L3_error)
5488  }
5489  }
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)
5492  }
5493  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5494  goto __pyx_L5_argtuple_error;
5495  } else {
5496  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5497  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5498  }
5499  __pyx_v_sparse_matrix = values[0];
5500  __pyx_v_sparseFactor = values[1];
5501  }
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)
5505  __pyx_L3_error:;
5506  __Pyx_AddTraceback("superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5507  __Pyx_RefNannyFinishContext();
5508  return NULL;
5509  __pyx_L4_argument_unpacking_done:;
5510  __pyx_r = __pyx_pf_15superluWrappers_sparseFactorPrepare(__pyx_self, __pyx_v_sparse_matrix, __pyx_v_sparseFactor);
5511 
5512  /* function exit code */
5513  __Pyx_RefNannyFinishContext();
5514  return __pyx_r;
5515 }
5516 
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);
5525 
5526  /* "superluWrappers.pyx":229
5527  *
5528  * """
5529  * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix, # <<<<<<<<<<<<<<
5530  * sparseFactor)
5531  *
5532  */
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)
5536 
5537  /* "superluWrappers.pyx":230
5538  * """
5539  * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix,
5540  * sparseFactor) # <<<<<<<<<<<<<<
5541  *
5542  * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm,
5543  */
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)
5545 
5546  /* "superluWrappers.pyx":229
5547  *
5548  * """
5549  * superluWrappersSparseFactorPrepare(sparse_matrix._cSparseMatrix, # <<<<<<<<<<<<<<
5550  * sparseFactor)
5551  *
5552  */
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;
5555 
5556  /* "superluWrappers.pyx":219
5557  * self.X.Store = &self.storeX
5558  *
5559  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
5560  * sparseFactor):
5561  * """ Python wrapper for superlu Sparse Factor Prepare function.
5562  */
5563 
5564  /* function exit code */
5565  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5566  goto __pyx_L0;
5567  __pyx_L1_error:;
5568  __Pyx_XDECREF(__pyx_t_1);
5569  __Pyx_AddTraceback("superluWrappers.sparseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5570  __pyx_r = NULL;
5571  __pyx_L0:;
5572  __Pyx_XGIVEREF(__pyx_r);
5573  __Pyx_RefNannyFinishContext();
5574  return __pyx_r;
5575 }
5576 
5577 /* "superluWrappers.pyx":232
5578  * sparseFactor)
5579  *
5580  * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm, # <<<<<<<<<<<<<<
5581  * SparseFactor sparseFactor):
5582  *
5583  */
5584 
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;
5587  int __pyx_v_n;
5588  int __pyx_v_relax;
5589  int __pyx_v_panel_size;
5590  int __pyx_v_lwork;
5591  int __pyx_v_info;
5592  void *__pyx_v_work;
5593  PyObject *__pyx_v_i = NULL;
5594  __Pyx_RefNannyDeclarations
5595  __pyx_t_5numpy_int32_t __pyx_t_1;
5596  int __pyx_t_2;
5597  int __pyx_t_3;
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);
5608 
5609  /* "superluWrappers.pyx":235
5610  * SparseFactor sparseFactor):
5611  *
5612  * cdef int permc_spec = 3 # <<<<<<<<<<<<<<
5613  * cdef int n
5614  * cdef int relax=1
5615  */
5616  __pyx_v_permc_spec = 3;
5617 
5618  /* "superluWrappers.pyx":237
5619  * cdef int permc_spec = 3
5620  * cdef int n
5621  * cdef int relax=1 # <<<<<<<<<<<<<<
5622  * cdef int panel_size = 10
5623  * cdef int lwork = 0
5624  */
5625  __pyx_v_relax = 1;
5626 
5627  /* "superluWrappers.pyx":238
5628  * cdef int n
5629  * cdef int relax=1
5630  * cdef int panel_size = 10 # <<<<<<<<<<<<<<
5631  * cdef int lwork = 0
5632  * cdef int info = 0
5633  */
5634  __pyx_v_panel_size = 10;
5635 
5636  /* "superluWrappers.pyx":239
5637  * cdef int relax=1
5638  * cdef int panel_size = 10
5639  * cdef int lwork = 0 # <<<<<<<<<<<<<<
5640  * cdef int info = 0
5641  * cdef void *work = NULL
5642  */
5643  __pyx_v_lwork = 0;
5644 
5645  /* "superluWrappers.pyx":240
5646  * cdef int panel_size = 10
5647  * cdef int lwork = 0
5648  * cdef int info = 0 # <<<<<<<<<<<<<<
5649  * cdef void *work = NULL
5650  *
5651  */
5652  __pyx_v_info = 0;
5653 
5654  /* "superluWrappers.pyx":241
5655  * cdef int lwork = 0
5656  * cdef int info = 0
5657  * cdef void *work = NULL # <<<<<<<<<<<<<<
5658  *
5659  * sparseFactor.storeA.nnz = sm.A.nnz
5660  */
5661  __pyx_v_work = NULL;
5662 
5663  /* "superluWrappers.pyx":243
5664  * cdef void *work = NULL
5665  *
5666  * sparseFactor.storeA.nnz = sm.A.nnz # <<<<<<<<<<<<<<
5667  * sparseFactor.storeA.nzval = &sm.A.nzval[0]
5668  * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
5669  */
5670  __pyx_t_1 = __pyx_v_sm->A.nnz;
5671  __pyx_v_sparseFactor->storeA.nnz = __pyx_t_1;
5672 
5673  /* "superluWrappers.pyx":244
5674  *
5675  * sparseFactor.storeA.nnz = sm.A.nnz
5676  * sparseFactor.storeA.nzval = &sm.A.nzval[0] # <<<<<<<<<<<<<<
5677  * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
5678  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5679  */
5680  __pyx_v_sparseFactor->storeA.nzval = (&(__pyx_v_sm->A.nzval[0]));
5681 
5682  /* "superluWrappers.pyx":245
5683  * sparseFactor.storeA.nnz = sm.A.nnz
5684  * sparseFactor.storeA.nzval = &sm.A.nzval[0]
5685  * sparseFactor.storeA.colptr = &sm.A.rowptr[0] # <<<<<<<<<<<<<<
5686  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5687  *
5688  */
5689  __pyx_v_sparseFactor->storeA.colptr = (&(__pyx_v_sm->A.rowptr[0]));
5690 
5691  /* "superluWrappers.pyx":246
5692  * sparseFactor.storeA.nzval = &sm.A.nzval[0]
5693  * sparseFactor.storeA.colptr = &sm.A.rowptr[0]
5694  * sparseFactor.storeA.rowind = &sm.A.colind[0] # <<<<<<<<<<<<<<
5695  *
5696  * if sparseFactor.use_same_perm_c == 0:
5697  */
5698  __pyx_v_sparseFactor->storeA.rowind = (&(__pyx_v_sm->A.colind[0]));
5699 
5700  /* "superluWrappers.pyx":248
5701  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5702  *
5703  * if sparseFactor.use_same_perm_c == 0: # <<<<<<<<<<<<<<
5704  * cget_perm_c(permc_spec,
5705  * &sparseFactor.A,
5706  */
5707  __pyx_t_2 = ((__pyx_v_sparseFactor->use_same_perm_c == 0) != 0);
5708  if (__pyx_t_2) {
5709 
5710  /* "superluWrappers.pyx":249
5711  *
5712  * if sparseFactor.use_same_perm_c == 0:
5713  * cget_perm_c(permc_spec, # <<<<<<<<<<<<<<
5714  * &sparseFactor.A,
5715  * sparseFactor.perm_c)
5716  */
5717  get_perm_c(__pyx_v_permc_spec, (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c);
5718 
5719  /* "superluWrappers.pyx":252
5720  * &sparseFactor.A,
5721  * sparseFactor.perm_c)
5722  * sparseFactor.use_same_perm_c = 1 # <<<<<<<<<<<<<<
5723  *
5724  * if sparseFactor.use_same_sparsity == 0:
5725  */
5726  __pyx_v_sparseFactor->use_same_perm_c = 1;
5727 
5728  /* "superluWrappers.pyx":248
5729  * sparseFactor.storeA.rowind = &sm.A.colind[0]
5730  *
5731  * if sparseFactor.use_same_perm_c == 0: # <<<<<<<<<<<<<<
5732  * cget_perm_c(permc_spec,
5733  * &sparseFactor.A,
5734  */
5735  }
5736 
5737  /* "superluWrappers.pyx":254
5738  * sparseFactor.use_same_perm_c = 1
5739  *
5740  * if sparseFactor.use_same_sparsity == 0: # <<<<<<<<<<<<<<
5741  * if sparseFactor.AC.Store != NULL:
5742  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5743  */
5744  __pyx_t_2 = ((__pyx_v_sparseFactor->use_same_sparsity == 0) != 0);
5745  if (__pyx_t_2) {
5746 
5747  /* "superluWrappers.pyx":255
5748  *
5749  * if sparseFactor.use_same_sparsity == 0:
5750  * if sparseFactor.AC.Store != NULL: # <<<<<<<<<<<<<<
5751  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5752  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5753  */
5754  __pyx_t_2 = ((__pyx_v_sparseFactor->AC.Store != NULL) != 0);
5755  if (__pyx_t_2) {
5756 
5757  /* "superluWrappers.pyx":256
5758  * if sparseFactor.use_same_sparsity == 0:
5759  * if sparseFactor.AC.Store != NULL:
5760  * cDestroy_CompCol_Permuted(&sparseFactor.AC) # <<<<<<<<<<<<<<
5761  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5762  * cDestroy_CompCol_Matrix(&sparseFactor.U)
5763  */
5764  Destroy_CompCol_Permuted((&__pyx_v_sparseFactor->AC));
5765 
5766  /* "superluWrappers.pyx":257
5767  * if sparseFactor.AC.Store != NULL:
5768  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5769  * cDestroy_SuperNode_Matrix(&sparseFactor.L) # <<<<<<<<<<<<<<
5770  * cDestroy_CompCol_Matrix(&sparseFactor.U)
5771  * csp_preorder(&sparseFactor.options,
5772  */
5773  Destroy_SuperNode_Matrix((&__pyx_v_sparseFactor->L));
5774 
5775  /* "superluWrappers.pyx":258
5776  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5777  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5778  * cDestroy_CompCol_Matrix(&sparseFactor.U) # <<<<<<<<<<<<<<
5779  * csp_preorder(&sparseFactor.options,
5780  * &sparseFactor.A,
5781  */
5782  Destroy_CompCol_Matrix((&__pyx_v_sparseFactor->U));
5783 
5784  /* "superluWrappers.pyx":255
5785  *
5786  * if sparseFactor.use_same_sparsity == 0:
5787  * if sparseFactor.AC.Store != NULL: # <<<<<<<<<<<<<<
5788  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5789  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5790  */
5791  }
5792 
5793  /* "superluWrappers.pyx":259
5794  * cDestroy_SuperNode_Matrix(&sparseFactor.L)
5795  * cDestroy_CompCol_Matrix(&sparseFactor.U)
5796  * csp_preorder(&sparseFactor.options, # <<<<<<<<<<<<<<
5797  * &sparseFactor.A,
5798  * sparseFactor.perm_c,
5799  */
5800  sp_preorder((&__pyx_v_sparseFactor->options), (&__pyx_v_sparseFactor->A), __pyx_v_sparseFactor->perm_c, __pyx_v_sparseFactor->etree, (&__pyx_v_sparseFactor->AC));
5801 
5802  /* "superluWrappers.pyx":264
5803  * sparseFactor.etree,
5804  * &sparseFactor.AC)
5805  * sparseFactor.use_same_sparsity = 1 # <<<<<<<<<<<<<<
5806  * else:
5807  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5808  */
5809  __pyx_v_sparseFactor->use_same_sparsity = 1;
5810 
5811  /* "superluWrappers.pyx":254
5812  * sparseFactor.use_same_perm_c = 1
5813  *
5814  * if sparseFactor.use_same_sparsity == 0: # <<<<<<<<<<<<<<
5815  * if sparseFactor.AC.Store != NULL:
5816  * cDestroy_CompCol_Permuted(&sparseFactor.AC)
5817  */
5818  goto __pyx_L4;
5819  }
5820 
5821  /* "superluWrappers.pyx":266
5822  * sparseFactor.use_same_sparsity = 1
5823  * else:
5824  * sparseFactor.options.Fact = _SamePattern_SameRowPerm # <<<<<<<<<<<<<<
5825  * n = sparseFactor.A.ncol
5826  * for i in range(n):
5827  */
5828  /*else*/ {
5829  __pyx_v_sparseFactor->options.Fact = SamePattern_SameRowPerm;
5830 
5831  /* "superluWrappers.pyx":267
5832  * else:
5833  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5834  * n = sparseFactor.A.ncol # <<<<<<<<<<<<<<
5835  * for i in range(n):
5836  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5837  */
5838  __pyx_t_3 = __pyx_v_sparseFactor->A.ncol;
5839  __pyx_v_n = __pyx_t_3;
5840 
5841  /* "superluWrappers.pyx":268
5842  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5843  * n = sparseFactor.A.ncol
5844  * for i in range(n): # <<<<<<<<<<<<<<
5845  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5846  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5847  */
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;
5855  __pyx_t_7 = NULL;
5856  } else {
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)
5860  }
5861  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5862  for (;;) {
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)
5868  #else
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);
5871  #endif
5872  } else {
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)
5876  #else
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);
5879  #endif
5880  }
5881  } else {
5882  __pyx_t_5 = __pyx_t_7(__pyx_t_4);
5883  if (unlikely(!__pyx_t_5)) {
5884  PyObject* exc_type = PyErr_Occurred();
5885  if (exc_type) {
5886  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5887  else __PYX_ERR(0, 268, __pyx_L1_error)
5888  }
5889  break;
5890  }
5891  __Pyx_GOTREF(__pyx_t_5);
5892  }
5893  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
5894  __pyx_t_5 = 0;
5895 
5896  /* "superluWrappers.pyx":269
5897  * n = sparseFactor.A.ncol
5898  * for i in range(n):
5899  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i] # <<<<<<<<<<<<<<
5900  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5901  * cdgstrf(&sparseFactor.options,
5902  */
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]);
5906 
5907  /* "superluWrappers.pyx":270
5908  * for i in range(n):
5909  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5910  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1] # <<<<<<<<<<<<<<
5911  * cdgstrf(&sparseFactor.options,
5912  * &sparseFactor.AC,
5913  */
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]);
5920 
5921  /* "superluWrappers.pyx":268
5922  * sparseFactor.options.Fact = _SamePattern_SameRowPerm
5923  * n = sparseFactor.A.ncol
5924  * for i in range(n): # <<<<<<<<<<<<<<
5925  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5926  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5927  */
5928  }
5929  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5930  }
5931  __pyx_L4:;
5932 
5933  /* "superluWrappers.pyx":271
5934  * (<_NCPformat *>sparseFactor.AC.Store).colbeg[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i]
5935  * (<_NCPformat *>sparseFactor.AC.Store).colend[sparseFactor.perm_c[i]] = (<_NCformat *> sparseFactor.A.Store).colptr[i+1]
5936  * cdgstrf(&sparseFactor.options, # <<<<<<<<<<<<<<
5937  * &sparseFactor.AC,
5938  * relax,
5939  */
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));
5941 
5942  /* "superluWrappers.pyx":232
5943  * sparseFactor)
5944  *
5945  * cdef void superluWrappersSparseFactorPrepare(cSparseMatrix sm, # <<<<<<<<<<<<<<
5946  * SparseFactor sparseFactor):
5947  *
5948  */
5949 
5950  /* function exit code */
5951  goto __pyx_L0;
5952  __pyx_L1_error:;
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);
5956  __pyx_L0:;
5957  __Pyx_XDECREF(__pyx_v_i);
5958  __Pyx_RefNannyFinishContext();
5959 }
5960 
5961 /* "superluWrappers.pyx":286
5962  * &info)
5963  *
5964  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
5965  * x):
5966  * """ Sparse factor solve wrappers
5967  */
5968 
5969 /* Python wrapper */
5970 static PyObject *__pyx_pw_15superluWrappers_3sparseFactorSolve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
5982  {
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)) {
5986  Py_ssize_t kw_args;
5987  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5988  switch (pos_args) {
5989  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5990  CYTHON_FALLTHROUGH;
5991  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5992  CYTHON_FALLTHROUGH;
5993  case 0: break;
5994  default: goto __pyx_L5_argtuple_error;
5995  }
5996  kw_args = PyDict_Size(__pyx_kwds);
5997  switch (pos_args) {
5998  case 0:
5999  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sparseFactor)) != 0)) kw_args--;
6000  else goto __pyx_L5_argtuple_error;
6001  CYTHON_FALLTHROUGH;
6002  case 1:
6003  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6004  else {
6005  __Pyx_RaiseArgtupleInvalid("sparseFactorSolve", 1, 2, 2, 1); __PYX_ERR(0, 286, __pyx_L3_error)
6006  }
6007  }
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)
6010  }
6011  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6012  goto __pyx_L5_argtuple_error;
6013  } else {
6014  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6015  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6016  }
6017  __pyx_v_sparseFactor = values[0];
6018  __pyx_v_x = values[1];
6019  }
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)
6023  __pyx_L3_error:;
6024  __Pyx_AddTraceback("superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6025  __Pyx_RefNannyFinishContext();
6026  return NULL;
6027  __pyx_L4_argument_unpacking_done:;
6028  __pyx_r = __pyx_pf_15superluWrappers_2sparseFactorSolve(__pyx_self, __pyx_v_sparseFactor, __pyx_v_x);
6029 
6030  /* function exit code */
6031  __Pyx_RefNannyFinishContext();
6032  return __pyx_r;
6033 }
6034 
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);
6043 
6044  /* "superluWrappers.pyx":296
6045  * x serves as the right hand side and then becomes the solution
6046  * """
6047  * superluWrappersSparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
6048  * x)
6049  *
6050  */
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)
6052 
6053  /* "superluWrappers.pyx":297
6054  * """
6055  * superluWrappersSparseFactorSolve(sparseFactor,
6056  * x) # <<<<<<<<<<<<<<
6057  *
6058  *
6059  */
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)
6061 
6062  /* "superluWrappers.pyx":296
6063  * x serves as the right hand side and then becomes the solution
6064  * """
6065  * superluWrappersSparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
6066  * x)
6067  *
6068  */
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;
6073 
6074  /* "superluWrappers.pyx":286
6075  * &info)
6076  *
6077  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
6078  * x):
6079  * """ Sparse factor solve wrappers
6080  */
6081 
6082  /* function exit code */
6083  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6084  goto __pyx_L0;
6085  __pyx_L1_error:;
6086  __PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
6087  __Pyx_AddTraceback("superluWrappers.sparseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6088  __pyx_r = NULL;
6089  __pyx_L0:;
6090  __Pyx_XGIVEREF(__pyx_r);
6091  __Pyx_RefNannyFinishContext();
6092  return __pyx_r;
6093 }
6094 
6095 /* "superluWrappers.pyx":300
6096  *
6097  *
6098  * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor, # <<<<<<<<<<<<<<
6099  * np.float64_t [:] x):
6100  * cdef _trans_t trans = _TRANS
6101  */
6102 
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;
6105  int __pyx_v_info;
6106  __Pyx_RefNannyDeclarations
6107  Py_ssize_t __pyx_t_1;
6108  __Pyx_RefNannySetupContext("superluWrappersSparseFactorSolve", 0);
6109 
6110  /* "superluWrappers.pyx":302
6111  * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor,
6112  * np.float64_t [:] x):
6113  * cdef _trans_t trans = _TRANS # <<<<<<<<<<<<<<
6114  * cdef int info = 0
6115  *
6116  */
6117  __pyx_v_trans = TRANS;
6118 
6119  /* "superluWrappers.pyx":303
6120  * np.float64_t [:] x):
6121  * cdef _trans_t trans = _TRANS
6122  * cdef int info = 0 # <<<<<<<<<<<<<<
6123  *
6124  * sparseFactor.storeX.nzval = &x[0]
6125  */
6126  __pyx_v_info = 0;
6127 
6128  /* "superluWrappers.pyx":305
6129  * cdef int info = 0
6130  *
6131  * sparseFactor.storeX.nzval = &x[0] # <<<<<<<<<<<<<<
6132  *
6133  * cdgstrs(trans,
6134  */
6135  __pyx_t_1 = 0;
6136  __pyx_v_sparseFactor->storeX.nzval = (&(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_x.data + __pyx_t_1 * __pyx_v_x.strides[0]) ))));
6137 
6138  /* "superluWrappers.pyx":307
6139  * sparseFactor.storeX.nzval = &x[0]
6140  *
6141  * cdgstrs(trans, # <<<<<<<<<<<<<<
6142  * &sparseFactor.L,
6143  * &sparseFactor.U,
6144  */
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));
6146 
6147  /* "superluWrappers.pyx":300
6148  *
6149  *
6150  * cdef void superluWrappersSparseFactorSolve(SparseFactor sparseFactor, # <<<<<<<<<<<<<<
6151  * np.float64_t [:] x):
6152  * cdef _trans_t trans = _TRANS
6153  */
6154 
6155  /* function exit code */
6156  __Pyx_RefNannyFinishContext();
6157 }
6158 
6159 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
6160  * ctypedef npy_cdouble complex_t
6161  *
6162  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6163  * return PyArray_MultiIterNew(1, <void*>a)
6164  *
6165  */
6166 
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);
6175 
6176  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":736
6177  *
6178  * cdef inline object PyArray_MultiIterNew1(a):
6179  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
6180  *
6181  * cdef inline object PyArray_MultiIterNew2(a, b):
6182  */
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;
6187  __pyx_t_1 = 0;
6188  goto __pyx_L0;
6189 
6190  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
6191  * ctypedef npy_cdouble complex_t
6192  *
6193  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6194  * return PyArray_MultiIterNew(1, <void*>a)
6195  *
6196  */
6197 
6198  /* function exit code */
6199  __pyx_L1_error:;
6200  __Pyx_XDECREF(__pyx_t_1);
6201  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6202  __pyx_r = 0;
6203  __pyx_L0:;
6204  __Pyx_XGIVEREF(__pyx_r);
6205  __Pyx_RefNannyFinishContext();
6206  return __pyx_r;
6207 }
6208 
6209 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
6210  * return PyArray_MultiIterNew(1, <void*>a)
6211  *
6212  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6213  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6214  *
6215  */
6216 
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);
6225 
6226  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":739
6227  *
6228  * cdef inline object PyArray_MultiIterNew2(a, b):
6229  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
6230  *
6231  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6232  */
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;
6237  __pyx_t_1 = 0;
6238  goto __pyx_L0;
6239 
6240  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
6241  * return PyArray_MultiIterNew(1, <void*>a)
6242  *
6243  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6244  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6245  *
6246  */
6247 
6248  /* function exit code */
6249  __pyx_L1_error:;
6250  __Pyx_XDECREF(__pyx_t_1);
6251  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6252  __pyx_r = 0;
6253  __pyx_L0:;
6254  __Pyx_XGIVEREF(__pyx_r);
6255  __Pyx_RefNannyFinishContext();
6256  return __pyx_r;
6257 }
6258 
6259 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
6260  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6261  *
6262  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6263  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6264  *
6265  */
6266 
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);
6275 
6276  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":742
6277  *
6278  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6279  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
6280  *
6281  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6282  */
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;
6287  __pyx_t_1 = 0;
6288  goto __pyx_L0;
6289 
6290  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
6291  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6292  *
6293  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6294  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6295  *
6296  */
6297 
6298  /* function exit code */
6299  __pyx_L1_error:;
6300  __Pyx_XDECREF(__pyx_t_1);
6301  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6302  __pyx_r = 0;
6303  __pyx_L0:;
6304  __Pyx_XGIVEREF(__pyx_r);
6305  __Pyx_RefNannyFinishContext();
6306  return __pyx_r;
6307 }
6308 
6309 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
6310  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6311  *
6312  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6313  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6314  *
6315  */
6316 
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);
6325 
6326  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":745
6327  *
6328  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6329  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
6330  *
6331  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6332  */
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;
6337  __pyx_t_1 = 0;
6338  goto __pyx_L0;
6339 
6340  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
6341  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6342  *
6343  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6344  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6345  *
6346  */
6347 
6348  /* function exit code */
6349  __pyx_L1_error:;
6350  __Pyx_XDECREF(__pyx_t_1);
6351  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6352  __pyx_r = 0;
6353  __pyx_L0:;
6354  __Pyx_XGIVEREF(__pyx_r);
6355  __Pyx_RefNannyFinishContext();
6356  return __pyx_r;
6357 }
6358 
6359 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
6360  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6361  *
6362  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6363  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6364  *
6365  */
6366 
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);
6375 
6376  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":748
6377  *
6378  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6379  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
6380  *
6381  * cdef inline tuple PyDataType_SHAPE(dtype d):
6382  */
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;
6387  __pyx_t_1 = 0;
6388  goto __pyx_L0;
6389 
6390  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
6391  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6392  *
6393  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6394  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6395  *
6396  */
6397 
6398  /* function exit code */
6399  __pyx_L1_error:;
6400  __Pyx_XDECREF(__pyx_t_1);
6401  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6402  __pyx_r = 0;
6403  __pyx_L0:;
6404  __Pyx_XGIVEREF(__pyx_r);
6405  __Pyx_RefNannyFinishContext();
6406  return __pyx_r;
6407 }
6408 
6409 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
6410  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6411  *
6412  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6413  * if PyDataType_HASSUBARRAY(d):
6414  * return <tuple>d.subarray.shape
6415  */
6416 
6417 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6418  PyObject *__pyx_r = NULL;
6419  __Pyx_RefNannyDeclarations
6420  int __pyx_t_1;
6421  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
6422 
6423  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
6424  *
6425  * cdef inline tuple PyDataType_SHAPE(dtype d):
6426  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6427  * return <tuple>d.subarray.shape
6428  * else:
6429  */
6430  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6431  if (__pyx_t_1) {
6432 
6433  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":752
6434  * cdef inline tuple PyDataType_SHAPE(dtype d):
6435  * if PyDataType_HASSUBARRAY(d):
6436  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
6437  * else:
6438  * return ()
6439  */
6440  __Pyx_XDECREF(__pyx_r);
6441  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6442  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6443  goto __pyx_L0;
6444 
6445  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
6446  *
6447  * cdef inline tuple PyDataType_SHAPE(dtype d):
6448  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6449  * return <tuple>d.subarray.shape
6450  * else:
6451  */
6452  }
6453 
6454  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":754
6455  * return <tuple>d.subarray.shape
6456  * else:
6457  * return () # <<<<<<<<<<<<<<
6458  *
6459  *
6460  */
6461  /*else*/ {
6462  __Pyx_XDECREF(__pyx_r);
6463  __Pyx_INCREF(__pyx_empty_tuple);
6464  __pyx_r = __pyx_empty_tuple;
6465  goto __pyx_L0;
6466  }
6467 
6468  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
6469  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6470  *
6471  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6472  * if PyDataType_HASSUBARRAY(d):
6473  * return <tuple>d.subarray.shape
6474  */
6475 
6476  /* function exit code */
6477  __pyx_L0:;
6478  __Pyx_XGIVEREF(__pyx_r);
6479  __Pyx_RefNannyFinishContext();
6480  return __pyx_r;
6481 }
6482 
6483 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
6484  * int _import_umath() except -1
6485  *
6486  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
6487  * Py_INCREF(base) # important to do this before stealing the reference below!
6488  * PyArray_SetBaseObject(arr, base)
6489  */
6490 
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);
6494 
6495  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":930
6496  *
6497  * cdef inline void set_array_base(ndarray arr, object base):
6498  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
6499  * PyArray_SetBaseObject(arr, base)
6500  *
6501  */
6502  Py_INCREF(__pyx_v_base);
6503 
6504  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":931
6505  * cdef inline void set_array_base(ndarray arr, object base):
6506  * Py_INCREF(base) # important to do this before stealing the reference below!
6507  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
6508  *
6509  * cdef inline object get_array_base(ndarray arr):
6510  */
6511  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
6512 
6513  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
6514  * int _import_umath() except -1
6515  *
6516  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
6517  * Py_INCREF(base) # important to do this before stealing the reference below!
6518  * PyArray_SetBaseObject(arr, base)
6519  */
6520 
6521  /* function exit code */
6522  __Pyx_RefNannyFinishContext();
6523 }
6524 
6525 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
6526  * PyArray_SetBaseObject(arr, base)
6527  *
6528  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
6529  * base = PyArray_BASE(arr)
6530  * if base is NULL:
6531  */
6532 
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
6537  int __pyx_t_1;
6538  __Pyx_RefNannySetupContext("get_array_base", 0);
6539 
6540  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":934
6541  *
6542  * cdef inline object get_array_base(ndarray arr):
6543  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
6544  * if base is NULL:
6545  * return None
6546  */
6547  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
6548 
6549  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
6550  * cdef inline object get_array_base(ndarray arr):
6551  * base = PyArray_BASE(arr)
6552  * if base is NULL: # <<<<<<<<<<<<<<
6553  * return None
6554  * return <object>base
6555  */
6556  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
6557  if (__pyx_t_1) {
6558 
6559  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":936
6560  * base = PyArray_BASE(arr)
6561  * if base is NULL:
6562  * return None # <<<<<<<<<<<<<<
6563  * return <object>base
6564  *
6565  */
6566  __Pyx_XDECREF(__pyx_r);
6567  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6568  goto __pyx_L0;
6569 
6570  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
6571  * cdef inline object get_array_base(ndarray arr):
6572  * base = PyArray_BASE(arr)
6573  * if base is NULL: # <<<<<<<<<<<<<<
6574  * return None
6575  * return <object>base
6576  */
6577  }
6578 
6579  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":937
6580  * if base is NULL:
6581  * return None
6582  * return <object>base # <<<<<<<<<<<<<<
6583  *
6584  * # Versions of the import_* functions which are more suitable for
6585  */
6586  __Pyx_XDECREF(__pyx_r);
6587  __Pyx_INCREF(((PyObject *)__pyx_v_base));
6588  __pyx_r = ((PyObject *)__pyx_v_base);
6589  goto __pyx_L0;
6590 
6591  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
6592  * PyArray_SetBaseObject(arr, base)
6593  *
6594  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
6595  * base = PyArray_BASE(arr)
6596  * if base is NULL:
6597  */
6598 
6599  /* function exit code */
6600  __pyx_L0:;
6601  __Pyx_XGIVEREF(__pyx_r);
6602  __Pyx_RefNannyFinishContext();
6603  return __pyx_r;
6604 }
6605 
6606 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
6607  * # Versions of the import_* functions which are more suitable for
6608  * # Cython code.
6609  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
6610  * try:
6611  * __pyx_import_array()
6612  */
6613 
6614 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
6615  int __pyx_r;
6616  __Pyx_RefNannyDeclarations
6617  PyObject *__pyx_t_1 = NULL;
6618  PyObject *__pyx_t_2 = NULL;
6619  PyObject *__pyx_t_3 = NULL;
6620  int __pyx_t_4;
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);
6629 
6630  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
6631  * # Cython code.
6632  * cdef inline int import_array() except -1:
6633  * try: # <<<<<<<<<<<<<<
6634  * __pyx_import_array()
6635  * except Exception:
6636  */
6637  {
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);
6644  /*try:*/ {
6645 
6646  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":943
6647  * cdef inline int import_array() except -1:
6648  * try:
6649  * __pyx_import_array() # <<<<<<<<<<<<<<
6650  * except Exception:
6651  * raise ImportError("numpy.core.multiarray failed to import")
6652  */
6653  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
6654 
6655  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
6656  * # Cython code.
6657  * cdef inline int import_array() except -1:
6658  * try: # <<<<<<<<<<<<<<
6659  * __pyx_import_array()
6660  * except Exception:
6661  */
6662  }
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;
6667  __pyx_L3_error:;
6668 
6669  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":944
6670  * try:
6671  * __pyx_import_array()
6672  * except Exception: # <<<<<<<<<<<<<<
6673  * raise ImportError("numpy.core.multiarray failed to import")
6674  *
6675  */
6676  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6677  if (__pyx_t_4) {
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);
6683 
6684  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
6685  * __pyx_import_array()
6686  * except Exception:
6687  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
6688  *
6689  * cdef inline int import_umath() except -1:
6690  */
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)
6696  }
6697  goto __pyx_L5_except_error;
6698  __pyx_L5_except_error:;
6699 
6700  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
6701  * # Cython code.
6702  * cdef inline int import_array() except -1:
6703  * try: # <<<<<<<<<<<<<<
6704  * __pyx_import_array()
6705  * except Exception:
6706  */
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;
6712  __pyx_L8_try_end:;
6713  }
6714 
6715  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
6716  * # Versions of the import_* functions which are more suitable for
6717  * # Cython code.
6718  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
6719  * try:
6720  * __pyx_import_array()
6721  */
6722 
6723  /* function exit code */
6724  __pyx_r = 0;
6725  goto __pyx_L0;
6726  __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);
6732  __pyx_r = -1;
6733  __pyx_L0:;
6734  __Pyx_RefNannyFinishContext();
6735  return __pyx_r;
6736 }
6737 
6738 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
6739  * raise ImportError("numpy.core.multiarray failed to import")
6740  *
6741  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
6742  * try:
6743  * _import_umath()
6744  */
6745 
6746 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
6747  int __pyx_r;
6748  __Pyx_RefNannyDeclarations
6749  PyObject *__pyx_t_1 = NULL;
6750  PyObject *__pyx_t_2 = NULL;
6751  PyObject *__pyx_t_3 = NULL;
6752  int __pyx_t_4;
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);
6761 
6762  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
6763  *
6764  * cdef inline int import_umath() except -1:
6765  * try: # <<<<<<<<<<<<<<
6766  * _import_umath()
6767  * except Exception:
6768  */
6769  {
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);
6776  /*try:*/ {
6777 
6778  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":949
6779  * cdef inline int import_umath() except -1:
6780  * try:
6781  * _import_umath() # <<<<<<<<<<<<<<
6782  * except Exception:
6783  * raise ImportError("numpy.core.umath failed to import")
6784  */
6785  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
6786 
6787  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
6788  *
6789  * cdef inline int import_umath() except -1:
6790  * try: # <<<<<<<<<<<<<<
6791  * _import_umath()
6792  * except Exception:
6793  */
6794  }
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;
6799  __pyx_L3_error:;
6800 
6801  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":950
6802  * try:
6803  * _import_umath()
6804  * except Exception: # <<<<<<<<<<<<<<
6805  * raise ImportError("numpy.core.umath failed to import")
6806  *
6807  */
6808  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6809  if (__pyx_t_4) {
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);
6815 
6816  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
6817  * _import_umath()
6818  * except Exception:
6819  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
6820  *
6821  * cdef inline int import_ufunc() except -1:
6822  */
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)
6828  }
6829  goto __pyx_L5_except_error;
6830  __pyx_L5_except_error:;
6831 
6832  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
6833  *
6834  * cdef inline int import_umath() except -1:
6835  * try: # <<<<<<<<<<<<<<
6836  * _import_umath()
6837  * except Exception:
6838  */
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;
6844  __pyx_L8_try_end:;
6845  }
6846 
6847  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
6848  * raise ImportError("numpy.core.multiarray failed to import")
6849  *
6850  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
6851  * try:
6852  * _import_umath()
6853  */
6854 
6855  /* function exit code */
6856  __pyx_r = 0;
6857  goto __pyx_L0;
6858  __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);
6864  __pyx_r = -1;
6865  __pyx_L0:;
6866  __Pyx_RefNannyFinishContext();
6867  return __pyx_r;
6868 }
6869 
6870 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
6871  * raise ImportError("numpy.core.umath failed to import")
6872  *
6873  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6874  * try:
6875  * _import_umath()
6876  */
6877 
6878 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
6879  int __pyx_r;
6880  __Pyx_RefNannyDeclarations
6881  PyObject *__pyx_t_1 = NULL;
6882  PyObject *__pyx_t_2 = NULL;
6883  PyObject *__pyx_t_3 = NULL;
6884  int __pyx_t_4;
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);
6893 
6894  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
6895  *
6896  * cdef inline int import_ufunc() except -1:
6897  * try: # <<<<<<<<<<<<<<
6898  * _import_umath()
6899  * except Exception:
6900  */
6901  {
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);
6908  /*try:*/ {
6909 
6910  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":955
6911  * cdef inline int import_ufunc() except -1:
6912  * try:
6913  * _import_umath() # <<<<<<<<<<<<<<
6914  * except Exception:
6915  * raise ImportError("numpy.core.umath failed to import")
6916  */
6917  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
6918 
6919  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
6920  *
6921  * cdef inline int import_ufunc() except -1:
6922  * try: # <<<<<<<<<<<<<<
6923  * _import_umath()
6924  * except Exception:
6925  */
6926  }
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;
6931  __pyx_L3_error:;
6932 
6933  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":956
6934  * try:
6935  * _import_umath()
6936  * except Exception: # <<<<<<<<<<<<<<
6937  * raise ImportError("numpy.core.umath failed to import")
6938  *
6939  */
6940  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6941  if (__pyx_t_4) {
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);
6947 
6948  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":957
6949  * _import_umath()
6950  * except Exception:
6951  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
6952  *
6953  * cdef extern from *:
6954  */
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)
6960  }
6961  goto __pyx_L5_except_error;
6962  __pyx_L5_except_error:;
6963 
6964  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
6965  *
6966  * cdef inline int import_ufunc() except -1:
6967  * try: # <<<<<<<<<<<<<<
6968  * _import_umath()
6969  * except Exception:
6970  */
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;
6976  __pyx_L8_try_end:;
6977  }
6978 
6979  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
6980  * raise ImportError("numpy.core.umath failed to import")
6981  *
6982  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6983  * try:
6984  * _import_umath()
6985  */
6986 
6987  /* function exit code */
6988  __pyx_r = 0;
6989  goto __pyx_L0;
6990  __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);
6996  __pyx_r = -1;
6997  __pyx_L0:;
6998  __Pyx_RefNannyFinishContext();
6999  return __pyx_r;
7000 }
7001 
7002 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
7003  *
7004  *
7005  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
7006  * """
7007  * Cython equivalent of `isinstance(obj, np.timedelta64)`
7008  */
7009 
7010 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
7011  int __pyx_r;
7012  __Pyx_RefNannyDeclarations
7013  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
7014 
7015  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":979
7016  * bool
7017  * """
7018  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
7019  *
7020  *
7021  */
7022  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
7023  goto __pyx_L0;
7024 
7025  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
7026  *
7027  *
7028  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
7029  * """
7030  * Cython equivalent of `isinstance(obj, np.timedelta64)`
7031  */
7032 
7033  /* function exit code */
7034  __pyx_L0:;
7035  __Pyx_RefNannyFinishContext();
7036  return __pyx_r;
7037 }
7038 
7039 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
7040  *
7041  *
7042  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
7043  * """
7044  * Cython equivalent of `isinstance(obj, np.datetime64)`
7045  */
7046 
7047 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
7048  int __pyx_r;
7049  __Pyx_RefNannyDeclarations
7050  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
7051 
7052  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":994
7053  * bool
7054  * """
7055  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
7056  *
7057  *
7058  */
7059  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
7060  goto __pyx_L0;
7061 
7062  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
7063  *
7064  *
7065  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
7066  * """
7067  * Cython equivalent of `isinstance(obj, np.datetime64)`
7068  */
7069 
7070  /* function exit code */
7071  __pyx_L0:;
7072  __Pyx_RefNannyFinishContext();
7073  return __pyx_r;
7074 }
7075 
7076 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
7077  *
7078  *
7079  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
7080  * """
7081  * returns the int64 value underlying scalar numpy datetime64 object
7082  */
7083 
7084 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
7085  npy_datetime __pyx_r;
7086 
7087  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1004
7088  * also needed. That can be found using `get_datetime64_unit`.
7089  * """
7090  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
7091  *
7092  *
7093  */
7094  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
7095  goto __pyx_L0;
7096 
7097  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
7098  *
7099  *
7100  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
7101  * """
7102  * returns the int64 value underlying scalar numpy datetime64 object
7103  */
7104 
7105  /* function exit code */
7106  __pyx_L0:;
7107  return __pyx_r;
7108 }
7109 
7110 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
7111  *
7112  *
7113  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
7114  * """
7115  * returns the int64 value underlying scalar numpy timedelta64 object
7116  */
7117 
7118 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
7119  npy_timedelta __pyx_r;
7120 
7121  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1011
7122  * returns the int64 value underlying scalar numpy timedelta64 object
7123  * """
7124  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
7125  *
7126  *
7127  */
7128  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
7129  goto __pyx_L0;
7130 
7131  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
7132  *
7133  *
7134  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
7135  * """
7136  * returns the int64 value underlying scalar numpy timedelta64 object
7137  */
7138 
7139  /* function exit code */
7140  __pyx_L0:;
7141  return __pyx_r;
7142 }
7143 
7144 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
7145  *
7146  *
7147  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
7148  * """
7149  * returns the unit part of the dtype for a numpy datetime64 object.
7150  */
7151 
7152 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
7153  NPY_DATETIMEUNIT __pyx_r;
7154 
7155  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1018
7156  * returns the unit part of the dtype for a numpy datetime64 object.
7157  * """
7158  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
7159  */
7160  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
7161  goto __pyx_L0;
7162 
7163  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
7164  *
7165  *
7166  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
7167  * """
7168  * returns the unit part of the dtype for a numpy datetime64 object.
7169  */
7170 
7171  /* function exit code */
7172  __pyx_L0:;
7173  return __pyx_r;
7174 }
7175 
7176 /* "View.MemoryView":122
7177  * cdef bint dtype_is_object
7178  *
7179  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7180  * mode="c", bint allocate_buffer=True):
7181  *
7182  */
7183 
7184 /* Python wrapper */
7185 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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;
7195  int __pyx_r;
7196  __Pyx_RefNannyDeclarations
7197  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7198  {
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)) {
7203  Py_ssize_t kw_args;
7204  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7205  switch (pos_args) {
7206  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7207  CYTHON_FALLTHROUGH;
7208  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7209  CYTHON_FALLTHROUGH;
7210  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7211  CYTHON_FALLTHROUGH;
7212  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7213  CYTHON_FALLTHROUGH;
7214  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7215  CYTHON_FALLTHROUGH;
7216  case 0: break;
7217  default: goto __pyx_L5_argtuple_error;
7218  }
7219  kw_args = PyDict_Size(__pyx_kwds);
7220  switch (pos_args) {
7221  case 0:
7222  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
7223  else goto __pyx_L5_argtuple_error;
7224  CYTHON_FALLTHROUGH;
7225  case 1:
7226  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
7227  else {
7228  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
7229  }
7230  CYTHON_FALLTHROUGH;
7231  case 2:
7232  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
7233  else {
7234  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
7235  }
7236  CYTHON_FALLTHROUGH;
7237  case 3:
7238  if (kw_args > 0) {
7239  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
7240  if (value) { values[3] = value; kw_args--; }
7241  }
7242  CYTHON_FALLTHROUGH;
7243  case 4:
7244  if (kw_args > 0) {
7245  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
7246  if (value) { values[4] = value; kw_args--; }
7247  }
7248  }
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)
7251  }
7252  } else {
7253  switch (PyTuple_GET_SIZE(__pyx_args)) {
7254  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7255  CYTHON_FALLTHROUGH;
7256  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7257  CYTHON_FALLTHROUGH;
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);
7261  break;
7262  default: goto __pyx_L5_argtuple_error;
7263  }
7264  }
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];
7269  if (values[4]) {
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)
7271  } else {
7272 
7273  /* "View.MemoryView":123
7274  *
7275  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
7276  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
7277  *
7278  * cdef int idx
7279  */
7280  __pyx_v_allocate_buffer = ((int)1);
7281  }
7282  }
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)
7286  __pyx_L3_error:;
7287  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7288  __Pyx_RefNannyFinishContext();
7289  return -1;
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)
7294  }
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);
7296 
7297  /* "View.MemoryView":122
7298  * cdef bint dtype_is_object
7299  *
7300  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7301  * mode="c", bint allocate_buffer=True):
7302  *
7303  */
7304 
7305  /* function exit code */
7306  goto __pyx_L0;
7307  __pyx_L1_error:;
7308  __pyx_r = -1;
7309  __pyx_L0:;
7310  __Pyx_RefNannyFinishContext();
7311  return __pyx_r;
7312 }
7313 
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) {
7315  int __pyx_v_idx;
7316  Py_ssize_t __pyx_v_i;
7317  Py_ssize_t __pyx_v_dim;
7318  PyObject **__pyx_v_p;
7319  char __pyx_v_order;
7320  int __pyx_r;
7321  __Pyx_RefNannyDeclarations
7322  Py_ssize_t __pyx_t_1;
7323  int __pyx_t_2;
7324  PyObject *__pyx_t_3 = NULL;
7325  int __pyx_t_4;
7326  PyObject *__pyx_t_5 = NULL;
7327  PyObject *__pyx_t_6 = NULL;
7328  char *__pyx_t_7;
7329  int __pyx_t_8;
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);
7338 
7339  /* "View.MemoryView":129
7340  * cdef PyObject **p
7341  *
7342  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
7343  * self.itemsize = itemsize
7344  *
7345  */
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)
7349  }
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);
7352 
7353  /* "View.MemoryView":130
7354  *
7355  * self.ndim = <int> len(shape)
7356  * self.itemsize = itemsize # <<<<<<<<<<<<<<
7357  *
7358  * if not self.ndim:
7359  */
7360  __pyx_v_self->itemsize = __pyx_v_itemsize;
7361 
7362  /* "View.MemoryView":132
7363  * self.itemsize = itemsize
7364  *
7365  * if not self.ndim: # <<<<<<<<<<<<<<
7366  * raise ValueError("Empty shape tuple for cython.array")
7367  *
7368  */
7369  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
7370  if (unlikely(__pyx_t_2)) {
7371 
7372  /* "View.MemoryView":133
7373  *
7374  * if not self.ndim:
7375  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
7376  *
7377  * if itemsize <= 0:
7378  */
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)
7384 
7385  /* "View.MemoryView":132
7386  * self.itemsize = itemsize
7387  *
7388  * if not self.ndim: # <<<<<<<<<<<<<<
7389  * raise ValueError("Empty shape tuple for cython.array")
7390  *
7391  */
7392  }
7393 
7394  /* "View.MemoryView":135
7395  * raise ValueError("Empty shape tuple for cython.array")
7396  *
7397  * if itemsize <= 0: # <<<<<<<<<<<<<<
7398  * raise ValueError("itemsize <= 0 for cython.array")
7399  *
7400  */
7401  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
7402  if (unlikely(__pyx_t_2)) {
7403 
7404  /* "View.MemoryView":136
7405  *
7406  * if itemsize <= 0:
7407  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
7408  *
7409  * if not isinstance(format, bytes):
7410  */
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)
7416 
7417  /* "View.MemoryView":135
7418  * raise ValueError("Empty shape tuple for cython.array")
7419  *
7420  * if itemsize <= 0: # <<<<<<<<<<<<<<
7421  * raise ValueError("itemsize <= 0 for cython.array")
7422  *
7423  */
7424  }
7425 
7426  /* "View.MemoryView":138
7427  * raise ValueError("itemsize <= 0 for cython.array")
7428  *
7429  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
7430  * format = format.encode('ASCII')
7431  * self._format = format # keep a reference to the byte string
7432  */
7433  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
7434  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
7435  if (__pyx_t_4) {
7436 
7437  /* "View.MemoryView":139
7438  *
7439  * if not isinstance(format, bytes):
7440  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
7441  * self._format = format # keep a reference to the byte string
7442  * self.format = self._format
7443  */
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);
7446  __pyx_t_6 = NULL;
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);
7454  }
7455  }
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);
7462  __pyx_t_3 = 0;
7463 
7464  /* "View.MemoryView":138
7465  * raise ValueError("itemsize <= 0 for cython.array")
7466  *
7467  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
7468  * format = format.encode('ASCII')
7469  * self._format = format # keep a reference to the byte string
7470  */
7471  }
7472 
7473  /* "View.MemoryView":140
7474  * if not isinstance(format, bytes):
7475  * format = format.encode('ASCII')
7476  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
7477  * self.format = self._format
7478  *
7479  */
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);
7487  __pyx_t_3 = 0;
7488 
7489  /* "View.MemoryView":141
7490  * format = format.encode('ASCII')
7491  * self._format = format # keep a reference to the byte string
7492  * self.format = self._format # <<<<<<<<<<<<<<
7493  *
7494  *
7495  */
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)
7499  }
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;
7502 
7503  /* "View.MemoryView":144
7504  *
7505  *
7506  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
7507  * self._strides = self._shape + self.ndim
7508  *
7509  */
7510  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
7511 
7512  /* "View.MemoryView":145
7513  *
7514  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
7515  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
7516  *
7517  * if not self._shape:
7518  */
7519  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
7520 
7521  /* "View.MemoryView":147
7522  * self._strides = self._shape + self.ndim
7523  *
7524  * if not self._shape: # <<<<<<<<<<<<<<
7525  * raise MemoryError("unable to allocate shape and strides.")
7526  *
7527  */
7528  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
7529  if (unlikely(__pyx_t_4)) {
7530 
7531  /* "View.MemoryView":148
7532  *
7533  * if not self._shape:
7534  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
7535  *
7536  *
7537  */
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)
7543 
7544  /* "View.MemoryView":147
7545  * self._strides = self._shape + self.ndim
7546  *
7547  * if not self._shape: # <<<<<<<<<<<<<<
7548  * raise MemoryError("unable to allocate shape and strides.")
7549  *
7550  */
7551  }
7552 
7553  /* "View.MemoryView":151
7554  *
7555  *
7556  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
7557  * if dim <= 0:
7558  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7559  */
7560  __pyx_t_8 = 0;
7561  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
7562  for (;;) {
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)
7566  #else
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);
7569  #endif
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);
7575 
7576  /* "View.MemoryView":152
7577  *
7578  * for idx, dim in enumerate(shape):
7579  * if dim <= 0: # <<<<<<<<<<<<<<
7580  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7581  * self._shape[idx] = dim
7582  */
7583  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
7584  if (unlikely(__pyx_t_4)) {
7585 
7586  /* "View.MemoryView":153
7587  * for idx, dim in enumerate(shape):
7588  * if dim <= 0:
7589  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
7590  * self._shape[idx] = dim
7591  *
7592  */
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);
7603  __pyx_t_5 = 0;
7604  __pyx_t_6 = 0;
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)
7614 
7615  /* "View.MemoryView":152
7616  *
7617  * for idx, dim in enumerate(shape):
7618  * if dim <= 0: # <<<<<<<<<<<<<<
7619  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7620  * self._shape[idx] = dim
7621  */
7622  }
7623 
7624  /* "View.MemoryView":154
7625  * if dim <= 0:
7626  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7627  * self._shape[idx] = dim # <<<<<<<<<<<<<<
7628  *
7629  * cdef char order
7630  */
7631  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
7632 
7633  /* "View.MemoryView":151
7634  *
7635  *
7636  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
7637  * if dim <= 0:
7638  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7639  */
7640  }
7641  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7642 
7643  /* "View.MemoryView":157
7644  *
7645  * cdef char order
7646  * if mode == 'fortran': # <<<<<<<<<<<<<<
7647  * order = b'F'
7648  * self.mode = u'fortran'
7649  */
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)
7651  if (__pyx_t_4) {
7652 
7653  /* "View.MemoryView":158
7654  * cdef char order
7655  * if mode == 'fortran':
7656  * order = b'F' # <<<<<<<<<<<<<<
7657  * self.mode = u'fortran'
7658  * elif mode == 'c':
7659  */
7660  __pyx_v_order = 'F';
7661 
7662  /* "View.MemoryView":159
7663  * if mode == 'fortran':
7664  * order = b'F'
7665  * self.mode = u'fortran' # <<<<<<<<<<<<<<
7666  * elif mode == 'c':
7667  * order = b'C'
7668  */
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;
7674 
7675  /* "View.MemoryView":157
7676  *
7677  * cdef char order
7678  * if mode == 'fortran': # <<<<<<<<<<<<<<
7679  * order = b'F'
7680  * self.mode = u'fortran'
7681  */
7682  goto __pyx_L10;
7683  }
7684 
7685  /* "View.MemoryView":160
7686  * order = b'F'
7687  * self.mode = u'fortran'
7688  * elif mode == 'c': # <<<<<<<<<<<<<<
7689  * order = b'C'
7690  * self.mode = u'c'
7691  */
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)) {
7694 
7695  /* "View.MemoryView":161
7696  * self.mode = u'fortran'
7697  * elif mode == 'c':
7698  * order = b'C' # <<<<<<<<<<<<<<
7699  * self.mode = u'c'
7700  * else:
7701  */
7702  __pyx_v_order = 'C';
7703 
7704  /* "View.MemoryView":162
7705  * elif mode == 'c':
7706  * order = b'C'
7707  * self.mode = u'c' # <<<<<<<<<<<<<<
7708  * else:
7709  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
7710  */
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;
7716 
7717  /* "View.MemoryView":160
7718  * order = b'F'
7719  * self.mode = u'fortran'
7720  * elif mode == 'c': # <<<<<<<<<<<<<<
7721  * order = b'C'
7722  * self.mode = u'c'
7723  */
7724  goto __pyx_L10;
7725  }
7726 
7727  /* "View.MemoryView":164
7728  * self.mode = u'c'
7729  * else:
7730  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
7731  *
7732  * self.len = fill_contig_strides_array(self._shape, self._strides,
7733  */
7734  /*else*/ {
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)
7743  }
7744  __pyx_L10:;
7745 
7746  /* "View.MemoryView":166
7747  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
7748  *
7749  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
7750  * itemsize, self.ndim, order)
7751  *
7752  */
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);
7754 
7755  /* "View.MemoryView":169
7756  * itemsize, self.ndim, order)
7757  *
7758  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
7759  * self.dtype_is_object = format == b'O'
7760  * if allocate_buffer:
7761  */
7762  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
7763 
7764  /* "View.MemoryView":170
7765  *
7766  * self.free_data = allocate_buffer
7767  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
7768  * if allocate_buffer:
7769  *
7770  */
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;
7775 
7776  /* "View.MemoryView":171
7777  * self.free_data = allocate_buffer
7778  * self.dtype_is_object = format == b'O'
7779  * if allocate_buffer: # <<<<<<<<<<<<<<
7780  *
7781  *
7782  */
7783  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
7784  if (__pyx_t_4) {
7785 
7786  /* "View.MemoryView":174
7787  *
7788  *
7789  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
7790  * if not self.data:
7791  * raise MemoryError("unable to allocate array data.")
7792  */
7793  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
7794 
7795  /* "View.MemoryView":175
7796  *
7797  * self.data = <char *>malloc(self.len)
7798  * if not self.data: # <<<<<<<<<<<<<<
7799  * raise MemoryError("unable to allocate array data.")
7800  *
7801  */
7802  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
7803  if (unlikely(__pyx_t_4)) {
7804 
7805  /* "View.MemoryView":176
7806  * self.data = <char *>malloc(self.len)
7807  * if not self.data:
7808  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
7809  *
7810  * if self.dtype_is_object:
7811  */
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)
7817 
7818  /* "View.MemoryView":175
7819  *
7820  * self.data = <char *>malloc(self.len)
7821  * if not self.data: # <<<<<<<<<<<<<<
7822  * raise MemoryError("unable to allocate array data.")
7823  *
7824  */
7825  }
7826 
7827  /* "View.MemoryView":178
7828  * raise MemoryError("unable to allocate array data.")
7829  *
7830  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7831  * p = <PyObject **> self.data
7832  * for i in range(self.len / itemsize):
7833  */
7834  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
7835  if (__pyx_t_4) {
7836 
7837  /* "View.MemoryView":179
7838  *
7839  * if self.dtype_is_object:
7840  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
7841  * for i in range(self.len / itemsize):
7842  * p[i] = Py_None
7843  */
7844  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
7845 
7846  /* "View.MemoryView":180
7847  * if self.dtype_is_object:
7848  * p = <PyObject **> self.data
7849  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
7850  * p[i] = Py_None
7851  * Py_INCREF(Py_None)
7852  */
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)
7856  }
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)
7860  }
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;
7865 
7866  /* "View.MemoryView":181
7867  * p = <PyObject **> self.data
7868  * for i in range(self.len / itemsize):
7869  * p[i] = Py_None # <<<<<<<<<<<<<<
7870  * Py_INCREF(Py_None)
7871  *
7872  */
7873  (__pyx_v_p[__pyx_v_i]) = Py_None;
7874 
7875  /* "View.MemoryView":182
7876  * for i in range(self.len / itemsize):
7877  * p[i] = Py_None
7878  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7879  *
7880  * @cname('getbuffer')
7881  */
7882  Py_INCREF(Py_None);
7883  }
7884 
7885  /* "View.MemoryView":178
7886  * raise MemoryError("unable to allocate array data.")
7887  *
7888  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7889  * p = <PyObject **> self.data
7890  * for i in range(self.len / itemsize):
7891  */
7892  }
7893 
7894  /* "View.MemoryView":171
7895  * self.free_data = allocate_buffer
7896  * self.dtype_is_object = format == b'O'
7897  * if allocate_buffer: # <<<<<<<<<<<<<<
7898  *
7899  *
7900  */
7901  }
7902 
7903  /* "View.MemoryView":122
7904  * cdef bint dtype_is_object
7905  *
7906  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7907  * mode="c", bint allocate_buffer=True):
7908  *
7909  */
7910 
7911  /* function exit code */
7912  __pyx_r = 0;
7913  goto __pyx_L0;
7914  __pyx_L1_error:;
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);
7920  __pyx_r = -1;
7921  __pyx_L0:;
7922  __Pyx_XDECREF(__pyx_v_format);
7923  __Pyx_RefNannyFinishContext();
7924  return __pyx_r;
7925 }
7926 
7927 /* "View.MemoryView":185
7928  *
7929  * @cname('getbuffer')
7930  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
7931  * cdef int bufmode = -1
7932  * if self.mode == u"c":
7933  */
7934 
7935 /* Python wrapper */
7936 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
7937 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
7938  int __pyx_r;
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));
7942 
7943  /* function exit code */
7944  __Pyx_RefNannyFinishContext();
7945  return __pyx_r;
7946 }
7947 
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;
7950  int __pyx_r;
7951  __Pyx_RefNannyDeclarations
7952  int __pyx_t_1;
7953  int __pyx_t_2;
7954  PyObject *__pyx_t_3 = NULL;
7955  char *__pyx_t_4;
7956  Py_ssize_t __pyx_t_5;
7957  int __pyx_t_6;
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");
7964  return -1;
7965  }
7966  __Pyx_RefNannySetupContext("__getbuffer__", 0);
7967  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
7968  __Pyx_GIVEREF(__pyx_v_info->obj);
7969 
7970  /* "View.MemoryView":186
7971  * @cname('getbuffer')
7972  * def __getbuffer__(self, Py_buffer *info, int flags):
7973  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
7974  * if self.mode == u"c":
7975  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7976  */
7977  __pyx_v_bufmode = -1;
7978 
7979  /* "View.MemoryView":187
7980  * def __getbuffer__(self, Py_buffer *info, int flags):
7981  * cdef int bufmode = -1
7982  * if self.mode == u"c": # <<<<<<<<<<<<<<
7983  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7984  * elif self.mode == u"fortran":
7985  */
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);
7988  if (__pyx_t_2) {
7989 
7990  /* "View.MemoryView":188
7991  * cdef int bufmode = -1
7992  * if self.mode == u"c":
7993  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
7994  * elif self.mode == u"fortran":
7995  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7996  */
7997  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7998 
7999  /* "View.MemoryView":187
8000  * def __getbuffer__(self, Py_buffer *info, int flags):
8001  * cdef int bufmode = -1
8002  * if self.mode == u"c": # <<<<<<<<<<<<<<
8003  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8004  * elif self.mode == u"fortran":
8005  */
8006  goto __pyx_L3;
8007  }
8008 
8009  /* "View.MemoryView":189
8010  * if self.mode == u"c":
8011  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8012  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
8013  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8014  * if not (flags & bufmode):
8015  */
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);
8018  if (__pyx_t_1) {
8019 
8020  /* "View.MemoryView":190
8021  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8022  * elif self.mode == u"fortran":
8023  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
8024  * if not (flags & bufmode):
8025  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8026  */
8027  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8028 
8029  /* "View.MemoryView":189
8030  * if self.mode == u"c":
8031  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8032  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
8033  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8034  * if not (flags & bufmode):
8035  */
8036  }
8037  __pyx_L3:;
8038 
8039  /* "View.MemoryView":191
8040  * elif self.mode == u"fortran":
8041  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8042  * if not (flags & bufmode): # <<<<<<<<<<<<<<
8043  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8044  * info.buf = self.data
8045  */
8046  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8047  if (unlikely(__pyx_t_1)) {
8048 
8049  /* "View.MemoryView":192
8050  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8051  * if not (flags & bufmode):
8052  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
8053  * info.buf = self.data
8054  * info.len = self.len
8055  */
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)
8061 
8062  /* "View.MemoryView":191
8063  * elif self.mode == u"fortran":
8064  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8065  * if not (flags & bufmode): # <<<<<<<<<<<<<<
8066  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8067  * info.buf = self.data
8068  */
8069  }
8070 
8071  /* "View.MemoryView":193
8072  * if not (flags & bufmode):
8073  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8074  * info.buf = self.data # <<<<<<<<<<<<<<
8075  * info.len = self.len
8076  * info.ndim = self.ndim
8077  */
8078  __pyx_t_4 = __pyx_v_self->data;
8079  __pyx_v_info->buf = __pyx_t_4;
8080 
8081  /* "View.MemoryView":194
8082  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8083  * info.buf = self.data
8084  * info.len = self.len # <<<<<<<<<<<<<<
8085  * info.ndim = self.ndim
8086  * info.shape = self._shape
8087  */
8088  __pyx_t_5 = __pyx_v_self->len;
8089  __pyx_v_info->len = __pyx_t_5;
8090 
8091  /* "View.MemoryView":195
8092  * info.buf = self.data
8093  * info.len = self.len
8094  * info.ndim = self.ndim # <<<<<<<<<<<<<<
8095  * info.shape = self._shape
8096  * info.strides = self._strides
8097  */
8098  __pyx_t_6 = __pyx_v_self->ndim;
8099  __pyx_v_info->ndim = __pyx_t_6;
8100 
8101  /* "View.MemoryView":196
8102  * info.len = self.len
8103  * info.ndim = self.ndim
8104  * info.shape = self._shape # <<<<<<<<<<<<<<
8105  * info.strides = self._strides
8106  * info.suboffsets = NULL
8107  */
8108  __pyx_t_7 = __pyx_v_self->_shape;
8109  __pyx_v_info->shape = __pyx_t_7;
8110 
8111  /* "View.MemoryView":197
8112  * info.ndim = self.ndim
8113  * info.shape = self._shape
8114  * info.strides = self._strides # <<<<<<<<<<<<<<
8115  * info.suboffsets = NULL
8116  * info.itemsize = self.itemsize
8117  */
8118  __pyx_t_7 = __pyx_v_self->_strides;
8119  __pyx_v_info->strides = __pyx_t_7;
8120 
8121  /* "View.MemoryView":198
8122  * info.shape = self._shape
8123  * info.strides = self._strides
8124  * info.suboffsets = NULL # <<<<<<<<<<<<<<
8125  * info.itemsize = self.itemsize
8126  * info.readonly = 0
8127  */
8128  __pyx_v_info->suboffsets = NULL;
8129 
8130  /* "View.MemoryView":199
8131  * info.strides = self._strides
8132  * info.suboffsets = NULL
8133  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
8134  * info.readonly = 0
8135  *
8136  */
8137  __pyx_t_5 = __pyx_v_self->itemsize;
8138  __pyx_v_info->itemsize = __pyx_t_5;
8139 
8140  /* "View.MemoryView":200
8141  * info.suboffsets = NULL
8142  * info.itemsize = self.itemsize
8143  * info.readonly = 0 # <<<<<<<<<<<<<<
8144  *
8145  * if flags & PyBUF_FORMAT:
8146  */
8147  __pyx_v_info->readonly = 0;
8148 
8149  /* "View.MemoryView":202
8150  * info.readonly = 0
8151  *
8152  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8153  * info.format = self.format
8154  * else:
8155  */
8156  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8157  if (__pyx_t_1) {
8158 
8159  /* "View.MemoryView":203
8160  *
8161  * if flags & PyBUF_FORMAT:
8162  * info.format = self.format # <<<<<<<<<<<<<<
8163  * else:
8164  * info.format = NULL
8165  */
8166  __pyx_t_4 = __pyx_v_self->format;
8167  __pyx_v_info->format = __pyx_t_4;
8168 
8169  /* "View.MemoryView":202
8170  * info.readonly = 0
8171  *
8172  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8173  * info.format = self.format
8174  * else:
8175  */
8176  goto __pyx_L5;
8177  }
8178 
8179  /* "View.MemoryView":205
8180  * info.format = self.format
8181  * else:
8182  * info.format = NULL # <<<<<<<<<<<<<<
8183  *
8184  * info.obj = self
8185  */
8186  /*else*/ {
8187  __pyx_v_info->format = NULL;
8188  }
8189  __pyx_L5:;
8190 
8191  /* "View.MemoryView":207
8192  * info.format = NULL
8193  *
8194  * info.obj = self # <<<<<<<<<<<<<<
8195  *
8196  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8197  */
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);
8203 
8204  /* "View.MemoryView":185
8205  *
8206  * @cname('getbuffer')
8207  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8208  * cdef int bufmode = -1
8209  * if self.mode == u"c":
8210  */
8211 
8212  /* function exit code */
8213  __pyx_r = 0;
8214  goto __pyx_L0;
8215  __pyx_L1_error:;
8216  __Pyx_XDECREF(__pyx_t_3);
8217  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8218  __pyx_r = -1;
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;
8222  }
8223  goto __pyx_L2;
8224  __pyx_L0:;
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;
8228  }
8229  __pyx_L2:;
8230  __Pyx_RefNannyFinishContext();
8231  return __pyx_r;
8232 }
8233 
8234 /* "View.MemoryView":211
8235  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8236  *
8237  * def __dealloc__(array self): # <<<<<<<<<<<<<<
8238  * if self.callback_free_data != NULL:
8239  * self.callback_free_data(self.data)
8240  */
8241 
8242 /* Python wrapper */
8243 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
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));
8248 
8249  /* function exit code */
8250  __Pyx_RefNannyFinishContext();
8251 }
8252 
8253 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
8254  __Pyx_RefNannyDeclarations
8255  int __pyx_t_1;
8256  __Pyx_RefNannySetupContext("__dealloc__", 0);
8257 
8258  /* "View.MemoryView":212
8259  *
8260  * def __dealloc__(array self):
8261  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
8262  * self.callback_free_data(self.data)
8263  * elif self.free_data:
8264  */
8265  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
8266  if (__pyx_t_1) {
8267 
8268  /* "View.MemoryView":213
8269  * def __dealloc__(array self):
8270  * if self.callback_free_data != NULL:
8271  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
8272  * elif self.free_data:
8273  * if self.dtype_is_object:
8274  */
8275  __pyx_v_self->callback_free_data(__pyx_v_self->data);
8276 
8277  /* "View.MemoryView":212
8278  *
8279  * def __dealloc__(array self):
8280  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
8281  * self.callback_free_data(self.data)
8282  * elif self.free_data:
8283  */
8284  goto __pyx_L3;
8285  }
8286 
8287  /* "View.MemoryView":214
8288  * if self.callback_free_data != NULL:
8289  * self.callback_free_data(self.data)
8290  * elif self.free_data: # <<<<<<<<<<<<<<
8291  * if self.dtype_is_object:
8292  * refcount_objects_in_slice(self.data, self._shape,
8293  */
8294  __pyx_t_1 = (__pyx_v_self->free_data != 0);
8295  if (__pyx_t_1) {
8296 
8297  /* "View.MemoryView":215
8298  * self.callback_free_data(self.data)
8299  * elif self.free_data:
8300  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8301  * refcount_objects_in_slice(self.data, self._shape,
8302  * self._strides, self.ndim, False)
8303  */
8304  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
8305  if (__pyx_t_1) {
8306 
8307  /* "View.MemoryView":216
8308  * elif self.free_data:
8309  * if self.dtype_is_object:
8310  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
8311  * self._strides, self.ndim, False)
8312  * free(self.data)
8313  */
8314  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
8315 
8316  /* "View.MemoryView":215
8317  * self.callback_free_data(self.data)
8318  * elif self.free_data:
8319  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8320  * refcount_objects_in_slice(self.data, self._shape,
8321  * self._strides, self.ndim, False)
8322  */
8323  }
8324 
8325  /* "View.MemoryView":218
8326  * refcount_objects_in_slice(self.data, self._shape,
8327  * self._strides, self.ndim, False)
8328  * free(self.data) # <<<<<<<<<<<<<<
8329  * PyObject_Free(self._shape)
8330  *
8331  */
8332  free(__pyx_v_self->data);
8333 
8334  /* "View.MemoryView":214
8335  * if self.callback_free_data != NULL:
8336  * self.callback_free_data(self.data)
8337  * elif self.free_data: # <<<<<<<<<<<<<<
8338  * if self.dtype_is_object:
8339  * refcount_objects_in_slice(self.data, self._shape,
8340  */
8341  }
8342  __pyx_L3:;
8343 
8344  /* "View.MemoryView":219
8345  * self._strides, self.ndim, False)
8346  * free(self.data)
8347  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
8348  *
8349  * @property
8350  */
8351  PyObject_Free(__pyx_v_self->_shape);
8352 
8353  /* "View.MemoryView":211
8354  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8355  *
8356  * def __dealloc__(array self): # <<<<<<<<<<<<<<
8357  * if self.callback_free_data != NULL:
8358  * self.callback_free_data(self.data)
8359  */
8360 
8361  /* function exit code */
8362  __Pyx_RefNannyFinishContext();
8363 }
8364 
8365 /* "View.MemoryView":222
8366  *
8367  * @property
8368  * def memview(self): # <<<<<<<<<<<<<<
8369  * return self.get_memview()
8370  *
8371  */
8372 
8373 /* Python wrapper */
8374 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
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));
8380 
8381  /* function exit code */
8382  __Pyx_RefNannyFinishContext();
8383  return __pyx_r;
8384 }
8385 
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);
8394 
8395  /* "View.MemoryView":223
8396  * @property
8397  * def memview(self):
8398  * return self.get_memview() # <<<<<<<<<<<<<<
8399  *
8400  * @cname('get_memview')
8401  */
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;
8406  __pyx_t_1 = 0;
8407  goto __pyx_L0;
8408 
8409  /* "View.MemoryView":222
8410  *
8411  * @property
8412  * def memview(self): # <<<<<<<<<<<<<<
8413  * return self.get_memview()
8414  *
8415  */
8416 
8417  /* function exit code */
8418  __pyx_L1_error:;
8419  __Pyx_XDECREF(__pyx_t_1);
8420  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8421  __pyx_r = NULL;
8422  __pyx_L0:;
8423  __Pyx_XGIVEREF(__pyx_r);
8424  __Pyx_RefNannyFinishContext();
8425  return __pyx_r;
8426 }
8427 
8428 /* "View.MemoryView":226
8429  *
8430  * @cname('get_memview')
8431  * cdef get_memview(self): # <<<<<<<<<<<<<<
8432  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8433  * return memoryview(self, flags, self.dtype_is_object)
8434  */
8435 
8436 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
8437  int __pyx_v_flags;
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);
8447 
8448  /* "View.MemoryView":227
8449  * @cname('get_memview')
8450  * cdef get_memview(self):
8451  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
8452  * return memoryview(self, flags, self.dtype_is_object)
8453  *
8454  */
8455  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
8456 
8457  /* "View.MemoryView":228
8458  * cdef get_memview(self):
8459  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8460  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
8461  *
8462  * def __len__(self):
8463  */
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);
8478  __pyx_t_1 = 0;
8479  __pyx_t_2 = 0;
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;
8484  __pyx_t_2 = 0;
8485  goto __pyx_L0;
8486 
8487  /* "View.MemoryView":226
8488  *
8489  * @cname('get_memview')
8490  * cdef get_memview(self): # <<<<<<<<<<<<<<
8491  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8492  * return memoryview(self, flags, self.dtype_is_object)
8493  */
8494 
8495  /* function exit code */
8496  __pyx_L1_error:;
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);
8501  __pyx_r = 0;
8502  __pyx_L0:;
8503  __Pyx_XGIVEREF(__pyx_r);
8504  __Pyx_RefNannyFinishContext();
8505  return __pyx_r;
8506 }
8507 
8508 /* "View.MemoryView":230
8509  * return memoryview(self, flags, self.dtype_is_object)
8510  *
8511  * def __len__(self): # <<<<<<<<<<<<<<
8512  * return self._shape[0]
8513  *
8514  */
8515 
8516 /* Python wrapper */
8517 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
8518 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
8519  Py_ssize_t __pyx_r;
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));
8523 
8524  /* function exit code */
8525  __Pyx_RefNannyFinishContext();
8526  return __pyx_r;
8527 }
8528 
8529 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
8530  Py_ssize_t __pyx_r;
8531  __Pyx_RefNannyDeclarations
8532  __Pyx_RefNannySetupContext("__len__", 0);
8533 
8534  /* "View.MemoryView":231
8535  *
8536  * def __len__(self):
8537  * return self._shape[0] # <<<<<<<<<<<<<<
8538  *
8539  * def __getattr__(self, attr):
8540  */
8541  __pyx_r = (__pyx_v_self->_shape[0]);
8542  goto __pyx_L0;
8543 
8544  /* "View.MemoryView":230
8545  * return memoryview(self, flags, self.dtype_is_object)
8546  *
8547  * def __len__(self): # <<<<<<<<<<<<<<
8548  * return self._shape[0]
8549  *
8550  */
8551 
8552  /* function exit code */
8553  __pyx_L0:;
8554  __Pyx_RefNannyFinishContext();
8555  return __pyx_r;
8556 }
8557 
8558 /* "View.MemoryView":233
8559  * return self._shape[0]
8560  *
8561  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
8562  * return getattr(self.memview, attr)
8563  *
8564  */
8565 
8566 /* Python wrapper */
8567 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
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));
8573 
8574  /* function exit code */
8575  __Pyx_RefNannyFinishContext();
8576  return __pyx_r;
8577 }
8578 
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);
8588 
8589  /* "View.MemoryView":234
8590  *
8591  * def __getattr__(self, attr):
8592  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
8593  *
8594  * def __getitem__(self, item):
8595  */
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;
8603  __pyx_t_2 = 0;
8604  goto __pyx_L0;
8605 
8606  /* "View.MemoryView":233
8607  * return self._shape[0]
8608  *
8609  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
8610  * return getattr(self.memview, attr)
8611  *
8612  */
8613 
8614  /* function exit code */
8615  __pyx_L1_error:;
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);
8619  __pyx_r = NULL;
8620  __pyx_L0:;
8621  __Pyx_XGIVEREF(__pyx_r);
8622  __Pyx_RefNannyFinishContext();
8623  return __pyx_r;
8624 }
8625 
8626 /* "View.MemoryView":236
8627  * return getattr(self.memview, attr)
8628  *
8629  * def __getitem__(self, item): # <<<<<<<<<<<<<<
8630  * return self.memview[item]
8631  *
8632  */
8633 
8634 /* Python wrapper */
8635 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
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));
8641 
8642  /* function exit code */
8643  __Pyx_RefNannyFinishContext();
8644  return __pyx_r;
8645 }
8646 
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);
8656 
8657  /* "View.MemoryView":237
8658  *
8659  * def __getitem__(self, item):
8660  * return self.memview[item] # <<<<<<<<<<<<<<
8661  *
8662  * def __setitem__(self, item, value):
8663  */
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;
8671  __pyx_t_2 = 0;
8672  goto __pyx_L0;
8673 
8674  /* "View.MemoryView":236
8675  * return getattr(self.memview, attr)
8676  *
8677  * def __getitem__(self, item): # <<<<<<<<<<<<<<
8678  * return self.memview[item]
8679  *
8680  */
8681 
8682  /* function exit code */
8683  __pyx_L1_error:;
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);
8687  __pyx_r = NULL;
8688  __pyx_L0:;
8689  __Pyx_XGIVEREF(__pyx_r);
8690  __Pyx_RefNannyFinishContext();
8691  return __pyx_r;
8692 }
8693 
8694 /* "View.MemoryView":239
8695  * return self.memview[item]
8696  *
8697  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
8698  * self.memview[item] = value
8699  *
8700  */
8701 
8702 /* Python wrapper */
8703 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
8704 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8705  int __pyx_r;
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));
8709 
8710  /* function exit code */
8711  __Pyx_RefNannyFinishContext();
8712  return __pyx_r;
8713 }
8714 
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) {
8716  int __pyx_r;
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);
8723 
8724  /* "View.MemoryView":240
8725  *
8726  * def __setitem__(self, item, value):
8727  * self.memview[item] = value # <<<<<<<<<<<<<<
8728  *
8729  *
8730  */
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;
8735 
8736  /* "View.MemoryView":239
8737  * return self.memview[item]
8738  *
8739  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
8740  * self.memview[item] = value
8741  *
8742  */
8743 
8744  /* function exit code */
8745  __pyx_r = 0;
8746  goto __pyx_L0;
8747  __pyx_L1_error:;
8748  __Pyx_XDECREF(__pyx_t_1);
8749  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8750  __pyx_r = -1;
8751  __pyx_L0:;
8752  __Pyx_RefNannyFinishContext();
8753  return __pyx_r;
8754 }
8755 
8756 /* "(tree fragment)":1
8757  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8758  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8759  * def __setstate_cython__(self, __pyx_state):
8760  */
8761 
8762 /* Python wrapper */
8763 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
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));
8769 
8770  /* function exit code */
8771  __Pyx_RefNannyFinishContext();
8772  return __pyx_r;
8773 }
8774 
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);
8783 
8784  /* "(tree fragment)":2
8785  * def __reduce_cython__(self):
8786  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8787  * def __setstate_cython__(self, __pyx_state):
8788  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8789  */
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)
8795 
8796  /* "(tree fragment)":1
8797  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8798  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8799  * def __setstate_cython__(self, __pyx_state):
8800  */
8801 
8802  /* function exit code */
8803  __pyx_L1_error:;
8804  __Pyx_XDECREF(__pyx_t_1);
8805  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8806  __pyx_r = NULL;
8807  __Pyx_XGIVEREF(__pyx_r);
8808  __Pyx_RefNannyFinishContext();
8809  return __pyx_r;
8810 }
8811 
8812 /* "(tree fragment)":3
8813  * def __reduce_cython__(self):
8814  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8815  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8816  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8817  */
8818 
8819 /* Python wrapper */
8820 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
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));
8826 
8827  /* function exit code */
8828  __Pyx_RefNannyFinishContext();
8829  return __pyx_r;
8830 }
8831 
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);
8840 
8841  /* "(tree fragment)":4
8842  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8843  * def __setstate_cython__(self, __pyx_state):
8844  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8845  */
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)
8851 
8852  /* "(tree fragment)":3
8853  * def __reduce_cython__(self):
8854  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8855  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8856  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8857  */
8858 
8859  /* function exit code */
8860  __pyx_L1_error:;
8861  __Pyx_XDECREF(__pyx_t_1);
8862  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8863  __pyx_r = NULL;
8864  __Pyx_XGIVEREF(__pyx_r);
8865  __Pyx_RefNannyFinishContext();
8866  return __pyx_r;
8867 }
8868 
8869 /* "View.MemoryView":244
8870  *
8871  * @cname("__pyx_array_new")
8872  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
8873  * char *mode, char *buf):
8874  * cdef array result
8875  */
8876 
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
8881  int __pyx_t_1;
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);
8890 
8891  /* "View.MemoryView":248
8892  * cdef array result
8893  *
8894  * if buf == NULL: # <<<<<<<<<<<<<<
8895  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8896  * else:
8897  */
8898  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
8899  if (__pyx_t_1) {
8900 
8901  /* "View.MemoryView":249
8902  *
8903  * if buf == NULL:
8904  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
8905  * else:
8906  * result = array(shape, itemsize, format, mode.decode('ASCII'),
8907  */
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);
8925  __pyx_t_2 = 0;
8926  __pyx_t_3 = 0;
8927  __pyx_t_4 = 0;
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);
8932  __pyx_t_4 = 0;
8933 
8934  /* "View.MemoryView":248
8935  * cdef array result
8936  *
8937  * if buf == NULL: # <<<<<<<<<<<<<<
8938  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8939  * else:
8940  */
8941  goto __pyx_L3;
8942  }
8943 
8944  /* "View.MemoryView":251
8945  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8946  * else:
8947  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
8948  * allocate_buffer=False)
8949  * result.data = buf
8950  */
8951  /*else*/ {
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);
8969  __pyx_t_4 = 0;
8970  __pyx_t_5 = 0;
8971  __pyx_t_3 = 0;
8972 
8973  /* "View.MemoryView":252
8974  * else:
8975  * result = array(shape, itemsize, format, mode.decode('ASCII'),
8976  * allocate_buffer=False) # <<<<<<<<<<<<<<
8977  * result.data = buf
8978  *
8979  */
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)
8983 
8984  /* "View.MemoryView":251
8985  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8986  * else:
8987  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
8988  * allocate_buffer=False)
8989  * result.data = buf
8990  */
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);
8996  __pyx_t_5 = 0;
8997 
8998  /* "View.MemoryView":253
8999  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9000  * allocate_buffer=False)
9001  * result.data = buf # <<<<<<<<<<<<<<
9002  *
9003  * return result
9004  */
9005  __pyx_v_result->data = __pyx_v_buf;
9006  }
9007  __pyx_L3:;
9008 
9009  /* "View.MemoryView":255
9010  * result.data = buf
9011  *
9012  * return result # <<<<<<<<<<<<<<
9013  *
9014  *
9015  */
9016  __Pyx_XDECREF(((PyObject *)__pyx_r));
9017  __Pyx_INCREF(((PyObject *)__pyx_v_result));
9018  __pyx_r = __pyx_v_result;
9019  goto __pyx_L0;
9020 
9021  /* "View.MemoryView":244
9022  *
9023  * @cname("__pyx_array_new")
9024  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9025  * char *mode, char *buf):
9026  * cdef array result
9027  */
9028 
9029  /* function exit code */
9030  __pyx_L1_error:;
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);
9036  __pyx_r = 0;
9037  __pyx_L0:;
9038  __Pyx_XDECREF((PyObject *)__pyx_v_result);
9039  __Pyx_XGIVEREF((PyObject *)__pyx_r);
9040  __Pyx_RefNannyFinishContext();
9041  return __pyx_r;
9042 }
9043 
9044 /* "View.MemoryView":281
9045  * cdef class Enum(object):
9046  * cdef object name
9047  * def __init__(self, name): # <<<<<<<<<<<<<<
9048  * self.name = name
9049  * def __repr__(self):
9050  */
9051 
9052 /* Python wrapper */
9053 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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;
9059  int __pyx_r;
9060  __Pyx_RefNannyDeclarations
9061  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
9062  {
9063  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9064  PyObject* values[1] = {0};
9065  if (unlikely(__pyx_kwds)) {
9066  Py_ssize_t kw_args;
9067  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9068  switch (pos_args) {
9069  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9070  CYTHON_FALLTHROUGH;
9071  case 0: break;
9072  default: goto __pyx_L5_argtuple_error;
9073  }
9074  kw_args = PyDict_Size(__pyx_kwds);
9075  switch (pos_args) {
9076  case 0:
9077  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
9078  else goto __pyx_L5_argtuple_error;
9079  }
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)
9082  }
9083  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9084  goto __pyx_L5_argtuple_error;
9085  } else {
9086  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9087  }
9088  __pyx_v_name = values[0];
9089  }
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)
9093  __pyx_L3_error:;
9094  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9095  __Pyx_RefNannyFinishContext();
9096  return -1;
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);
9099 
9100  /* function exit code */
9101  __Pyx_RefNannyFinishContext();
9102  return __pyx_r;
9103 }
9104 
9105 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
9106  int __pyx_r;
9107  __Pyx_RefNannyDeclarations
9108  __Pyx_RefNannySetupContext("__init__", 0);
9109 
9110  /* "View.MemoryView":282
9111  * cdef object name
9112  * def __init__(self, name):
9113  * self.name = name # <<<<<<<<<<<<<<
9114  * def __repr__(self):
9115  * return self.name
9116  */
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;
9122 
9123  /* "View.MemoryView":281
9124  * cdef class Enum(object):
9125  * cdef object name
9126  * def __init__(self, name): # <<<<<<<<<<<<<<
9127  * self.name = name
9128  * def __repr__(self):
9129  */
9130 
9131  /* function exit code */
9132  __pyx_r = 0;
9133  __Pyx_RefNannyFinishContext();
9134  return __pyx_r;
9135 }
9136 
9137 /* "View.MemoryView":283
9138  * def __init__(self, name):
9139  * self.name = name
9140  * def __repr__(self): # <<<<<<<<<<<<<<
9141  * return self.name
9142  *
9143  */
9144 
9145 /* Python wrapper */
9146 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
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));
9152 
9153  /* function exit code */
9154  __Pyx_RefNannyFinishContext();
9155  return __pyx_r;
9156 }
9157 
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);
9162 
9163  /* "View.MemoryView":284
9164  * self.name = name
9165  * def __repr__(self):
9166  * return self.name # <<<<<<<<<<<<<<
9167  *
9168  * cdef generic = Enum("<strided and direct or indirect>")
9169  */
9170  __Pyx_XDECREF(__pyx_r);
9171  __Pyx_INCREF(__pyx_v_self->name);
9172  __pyx_r = __pyx_v_self->name;
9173  goto __pyx_L0;
9174 
9175  /* "View.MemoryView":283
9176  * def __init__(self, name):
9177  * self.name = name
9178  * def __repr__(self): # <<<<<<<<<<<<<<
9179  * return self.name
9180  *
9181  */
9182 
9183  /* function exit code */
9184  __pyx_L0:;
9185  __Pyx_XGIVEREF(__pyx_r);
9186  __Pyx_RefNannyFinishContext();
9187  return __pyx_r;
9188 }
9189 
9190 /* "(tree fragment)":1
9191  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9192  * cdef tuple state
9193  * cdef object _dict
9194  */
9195 
9196 /* Python wrapper */
9197 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
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));
9203 
9204  /* function exit code */
9205  __Pyx_RefNannyFinishContext();
9206  return __pyx_r;
9207 }
9208 
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;
9216  int __pyx_t_2;
9217  int __pyx_t_3;
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);
9224 
9225  /* "(tree fragment)":5
9226  * cdef object _dict
9227  * cdef bint use_setstate
9228  * state = (self.name,) # <<<<<<<<<<<<<<
9229  * _dict = getattr(self, '__dict__', None)
9230  * if _dict is not None:
9231  */
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);
9238  __pyx_t_1 = 0;
9239 
9240  /* "(tree fragment)":6
9241  * cdef bint use_setstate
9242  * state = (self.name,)
9243  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
9244  * if _dict is not None:
9245  * state += (_dict,)
9246  */
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;
9250  __pyx_t_1 = 0;
9251 
9252  /* "(tree fragment)":7
9253  * state = (self.name,)
9254  * _dict = getattr(self, '__dict__', None)
9255  * if _dict is not None: # <<<<<<<<<<<<<<
9256  * state += (_dict,)
9257  * use_setstate = True
9258  */
9259  __pyx_t_2 = (__pyx_v__dict != Py_None);
9260  __pyx_t_3 = (__pyx_t_2 != 0);
9261  if (__pyx_t_3) {
9262 
9263  /* "(tree fragment)":8
9264  * _dict = getattr(self, '__dict__', None)
9265  * if _dict is not None:
9266  * state += (_dict,) # <<<<<<<<<<<<<<
9267  * use_setstate = True
9268  * else:
9269  */
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));
9279  __pyx_t_4 = 0;
9280 
9281  /* "(tree fragment)":9
9282  * if _dict is not None:
9283  * state += (_dict,)
9284  * use_setstate = True # <<<<<<<<<<<<<<
9285  * else:
9286  * use_setstate = self.name is not None
9287  */
9288  __pyx_v_use_setstate = 1;
9289 
9290  /* "(tree fragment)":7
9291  * state = (self.name,)
9292  * _dict = getattr(self, '__dict__', None)
9293  * if _dict is not None: # <<<<<<<<<<<<<<
9294  * state += (_dict,)
9295  * use_setstate = True
9296  */
9297  goto __pyx_L3;
9298  }
9299 
9300  /* "(tree fragment)":11
9301  * use_setstate = True
9302  * else:
9303  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
9304  * if use_setstate:
9305  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9306  */
9307  /*else*/ {
9308  __pyx_t_3 = (__pyx_v_self->name != Py_None);
9309  __pyx_v_use_setstate = __pyx_t_3;
9310  }
9311  __pyx_L3:;
9312 
9313  /* "(tree fragment)":12
9314  * else:
9315  * use_setstate = self.name is not None
9316  * if use_setstate: # <<<<<<<<<<<<<<
9317  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9318  * else:
9319  */
9320  __pyx_t_3 = (__pyx_v_use_setstate != 0);
9321  if (__pyx_t_3) {
9322 
9323  /* "(tree fragment)":13
9324  * use_setstate = self.name is not None
9325  * if use_setstate:
9326  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
9327  * else:
9328  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9329  */
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);
9353  __pyx_t_4 = 0;
9354  __pyx_t_1 = 0;
9355  __pyx_r = __pyx_t_5;
9356  __pyx_t_5 = 0;
9357  goto __pyx_L0;
9358 
9359  /* "(tree fragment)":12
9360  * else:
9361  * use_setstate = self.name is not None
9362  * if use_setstate: # <<<<<<<<<<<<<<
9363  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9364  * else:
9365  */
9366  }
9367 
9368  /* "(tree fragment)":15
9369  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9370  * else:
9371  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
9372  * def __setstate_cython__(self, __pyx_state):
9373  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9374  */
9375  /*else*/ {
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);
9396  __pyx_t_5 = 0;
9397  __pyx_t_1 = 0;
9398  __pyx_r = __pyx_t_4;
9399  __pyx_t_4 = 0;
9400  goto __pyx_L0;
9401  }
9402 
9403  /* "(tree fragment)":1
9404  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9405  * cdef tuple state
9406  * cdef object _dict
9407  */
9408 
9409  /* function exit code */
9410  __pyx_L1_error:;
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);
9415  __pyx_r = NULL;
9416  __pyx_L0:;
9417  __Pyx_XDECREF(__pyx_v_state);
9418  __Pyx_XDECREF(__pyx_v__dict);
9419  __Pyx_XGIVEREF(__pyx_r);
9420  __Pyx_RefNannyFinishContext();
9421  return __pyx_r;
9422 }
9423 
9424 /* "(tree fragment)":16
9425  * else:
9426  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9427  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9428  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9429  */
9430 
9431 /* Python wrapper */
9432 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
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));
9438 
9439  /* function exit code */
9440  __Pyx_RefNannyFinishContext();
9441  return __pyx_r;
9442 }
9443 
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);
9452 
9453  /* "(tree fragment)":17
9454  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9455  * def __setstate_cython__(self, __pyx_state):
9456  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
9457  */
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;
9462 
9463  /* "(tree fragment)":16
9464  * else:
9465  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9466  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9467  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9468  */
9469 
9470  /* function exit code */
9471  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9472  goto __pyx_L0;
9473  __pyx_L1_error:;
9474  __Pyx_XDECREF(__pyx_t_1);
9475  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9476  __pyx_r = NULL;
9477  __pyx_L0:;
9478  __Pyx_XGIVEREF(__pyx_r);
9479  __Pyx_RefNannyFinishContext();
9480  return __pyx_r;
9481 }
9482 
9483 /* "View.MemoryView":298
9484  *
9485  * @cname('__pyx_align_pointer')
9486  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
9487  * "Align pointer memory on a given boundary"
9488  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
9489  */
9490 
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;
9494  void *__pyx_r;
9495  int __pyx_t_1;
9496 
9497  /* "View.MemoryView":300
9498  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
9499  * "Align pointer memory on a given boundary"
9500  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
9501  * cdef size_t offset
9502  *
9503  */
9504  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
9505 
9506  /* "View.MemoryView":304
9507  *
9508  * with cython.cdivision(True):
9509  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
9510  *
9511  * if offset > 0:
9512  */
9513  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
9514 
9515  /* "View.MemoryView":306
9516  * offset = aligned_p % alignment
9517  *
9518  * if offset > 0: # <<<<<<<<<<<<<<
9519  * aligned_p += alignment - offset
9520  *
9521  */
9522  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
9523  if (__pyx_t_1) {
9524 
9525  /* "View.MemoryView":307
9526  *
9527  * if offset > 0:
9528  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
9529  *
9530  * return <void *> aligned_p
9531  */
9532  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
9533 
9534  /* "View.MemoryView":306
9535  * offset = aligned_p % alignment
9536  *
9537  * if offset > 0: # <<<<<<<<<<<<<<
9538  * aligned_p += alignment - offset
9539  *
9540  */
9541  }
9542 
9543  /* "View.MemoryView":309
9544  * aligned_p += alignment - offset
9545  *
9546  * return <void *> aligned_p # <<<<<<<<<<<<<<
9547  *
9548  *
9549  */
9550  __pyx_r = ((void *)__pyx_v_aligned_p);
9551  goto __pyx_L0;
9552 
9553  /* "View.MemoryView":298
9554  *
9555  * @cname('__pyx_align_pointer')
9556  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
9557  * "Align pointer memory on a given boundary"
9558  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
9559  */
9560 
9561  /* function exit code */
9562  __pyx_L0:;
9563  return __pyx_r;
9564 }
9565 
9566 /* "View.MemoryView":345
9567  * cdef __Pyx_TypeInfo *typeinfo
9568  *
9569  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
9570  * self.obj = obj
9571  * self.flags = flags
9572  */
9573 
9574 /* Python wrapper */
9575 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9576 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9577  PyObject *__pyx_v_obj = 0;
9578  int __pyx_v_flags;
9579  int __pyx_v_dtype_is_object;
9580  int __pyx_lineno = 0;
9581  const char *__pyx_filename = NULL;
9582  int __pyx_clineno = 0;
9583  int __pyx_r;
9584  __Pyx_RefNannyDeclarations
9585  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
9586  {
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)) {
9590  Py_ssize_t kw_args;
9591  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9592  switch (pos_args) {
9593  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9594  CYTHON_FALLTHROUGH;
9595  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9596  CYTHON_FALLTHROUGH;
9597  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9598  CYTHON_FALLTHROUGH;
9599  case 0: break;
9600  default: goto __pyx_L5_argtuple_error;
9601  }
9602  kw_args = PyDict_Size(__pyx_kwds);
9603  switch (pos_args) {
9604  case 0:
9605  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
9606  else goto __pyx_L5_argtuple_error;
9607  CYTHON_FALLTHROUGH;
9608  case 1:
9609  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
9610  else {
9611  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
9612  }
9613  CYTHON_FALLTHROUGH;
9614  case 2:
9615  if (kw_args > 0) {
9616  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
9617  if (value) { values[2] = value; kw_args--; }
9618  }
9619  }
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)
9622  }
9623  } else {
9624  switch (PyTuple_GET_SIZE(__pyx_args)) {
9625  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9626  CYTHON_FALLTHROUGH;
9627  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9628  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9629  break;
9630  default: goto __pyx_L5_argtuple_error;
9631  }
9632  }
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)
9635  if (values[2]) {
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)
9637  } else {
9638  __pyx_v_dtype_is_object = ((int)0);
9639  }
9640  }
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)
9644  __pyx_L3_error:;
9645  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9646  __Pyx_RefNannyFinishContext();
9647  return -1;
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);
9650 
9651  /* function exit code */
9652  __Pyx_RefNannyFinishContext();
9653  return __pyx_r;
9654 }
9655 
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) {
9657  int __pyx_r;
9658  __Pyx_RefNannyDeclarations
9659  int __pyx_t_1;
9660  int __pyx_t_2;
9661  int __pyx_t_3;
9662  int __pyx_t_4;
9663  int __pyx_lineno = 0;
9664  const char *__pyx_filename = NULL;
9665  int __pyx_clineno = 0;
9666  __Pyx_RefNannySetupContext("__cinit__", 0);
9667 
9668  /* "View.MemoryView":346
9669  *
9670  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
9671  * self.obj = obj # <<<<<<<<<<<<<<
9672  * self.flags = flags
9673  * if type(self) is memoryview or obj is not None:
9674  */
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;
9680 
9681  /* "View.MemoryView":347
9682  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
9683  * self.obj = obj
9684  * self.flags = flags # <<<<<<<<<<<<<<
9685  * if type(self) is memoryview or obj is not None:
9686  * __Pyx_GetBuffer(obj, &self.view, flags)
9687  */
9688  __pyx_v_self->flags = __pyx_v_flags;
9689 
9690  /* "View.MemoryView":348
9691  * self.obj = obj
9692  * self.flags = flags
9693  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
9694  * __Pyx_GetBuffer(obj, &self.view, flags)
9695  * if <PyObject *> self.view.obj == NULL:
9696  */
9697  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
9698  __pyx_t_3 = (__pyx_t_2 != 0);
9699  if (!__pyx_t_3) {
9700  } else {
9701  __pyx_t_1 = __pyx_t_3;
9702  goto __pyx_L4_bool_binop_done;
9703  }
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:;
9708  if (__pyx_t_1) {
9709 
9710  /* "View.MemoryView":349
9711  * self.flags = flags
9712  * if type(self) is memoryview or obj is not None:
9713  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
9714  * if <PyObject *> self.view.obj == NULL:
9715  * (<__pyx_buffer *> &self.view).obj = Py_None
9716  */
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)
9718 
9719  /* "View.MemoryView":350
9720  * if type(self) is memoryview or obj is not None:
9721  * __Pyx_GetBuffer(obj, &self.view, flags)
9722  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
9723  * (<__pyx_buffer *> &self.view).obj = Py_None
9724  * Py_INCREF(Py_None)
9725  */
9726  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
9727  if (__pyx_t_1) {
9728 
9729  /* "View.MemoryView":351
9730  * __Pyx_GetBuffer(obj, &self.view, flags)
9731  * if <PyObject *> self.view.obj == NULL:
9732  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
9733  * Py_INCREF(Py_None)
9734  *
9735  */
9736  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
9737 
9738  /* "View.MemoryView":352
9739  * if <PyObject *> self.view.obj == NULL:
9740  * (<__pyx_buffer *> &self.view).obj = Py_None
9741  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
9742  *
9743  * global __pyx_memoryview_thread_locks_used
9744  */
9745  Py_INCREF(Py_None);
9746 
9747  /* "View.MemoryView":350
9748  * if type(self) is memoryview or obj is not None:
9749  * __Pyx_GetBuffer(obj, &self.view, flags)
9750  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
9751  * (<__pyx_buffer *> &self.view).obj = Py_None
9752  * Py_INCREF(Py_None)
9753  */
9754  }
9755 
9756  /* "View.MemoryView":348
9757  * self.obj = obj
9758  * self.flags = flags
9759  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
9760  * __Pyx_GetBuffer(obj, &self.view, flags)
9761  * if <PyObject *> self.view.obj == NULL:
9762  */
9763  }
9764 
9765  /* "View.MemoryView":355
9766  *
9767  * global __pyx_memoryview_thread_locks_used
9768  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
9769  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9770  * __pyx_memoryview_thread_locks_used += 1
9771  */
9772  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
9773  if (__pyx_t_1) {
9774 
9775  /* "View.MemoryView":356
9776  * global __pyx_memoryview_thread_locks_used
9777  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
9778  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
9779  * __pyx_memoryview_thread_locks_used += 1
9780  * if self.lock is NULL:
9781  */
9782  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9783 
9784  /* "View.MemoryView":357
9785  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
9786  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9787  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
9788  * if self.lock is NULL:
9789  * self.lock = PyThread_allocate_lock()
9790  */
9791  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
9792 
9793  /* "View.MemoryView":355
9794  *
9795  * global __pyx_memoryview_thread_locks_used
9796  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
9797  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9798  * __pyx_memoryview_thread_locks_used += 1
9799  */
9800  }
9801 
9802  /* "View.MemoryView":358
9803  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9804  * __pyx_memoryview_thread_locks_used += 1
9805  * if self.lock is NULL: # <<<<<<<<<<<<<<
9806  * self.lock = PyThread_allocate_lock()
9807  * if self.lock is NULL:
9808  */
9809  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9810  if (__pyx_t_1) {
9811 
9812  /* "View.MemoryView":359
9813  * __pyx_memoryview_thread_locks_used += 1
9814  * if self.lock is NULL:
9815  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
9816  * if self.lock is NULL:
9817  * raise MemoryError
9818  */
9819  __pyx_v_self->lock = PyThread_allocate_lock();
9820 
9821  /* "View.MemoryView":360
9822  * if self.lock is NULL:
9823  * self.lock = PyThread_allocate_lock()
9824  * if self.lock is NULL: # <<<<<<<<<<<<<<
9825  * raise MemoryError
9826  *
9827  */
9828  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9829  if (unlikely(__pyx_t_1)) {
9830 
9831  /* "View.MemoryView":361
9832  * self.lock = PyThread_allocate_lock()
9833  * if self.lock is NULL:
9834  * raise MemoryError # <<<<<<<<<<<<<<
9835  *
9836  * if flags & PyBUF_FORMAT:
9837  */
9838  PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
9839 
9840  /* "View.MemoryView":360
9841  * if self.lock is NULL:
9842  * self.lock = PyThread_allocate_lock()
9843  * if self.lock is NULL: # <<<<<<<<<<<<<<
9844  * raise MemoryError
9845  *
9846  */
9847  }
9848 
9849  /* "View.MemoryView":358
9850  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9851  * __pyx_memoryview_thread_locks_used += 1
9852  * if self.lock is NULL: # <<<<<<<<<<<<<<
9853  * self.lock = PyThread_allocate_lock()
9854  * if self.lock is NULL:
9855  */
9856  }
9857 
9858  /* "View.MemoryView":363
9859  * raise MemoryError
9860  *
9861  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9862  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9863  * else:
9864  */
9865  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9866  if (__pyx_t_1) {
9867 
9868  /* "View.MemoryView":364
9869  *
9870  * if flags & PyBUF_FORMAT:
9871  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
9872  * else:
9873  * self.dtype_is_object = dtype_is_object
9874  */
9875  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
9876  if (__pyx_t_2) {
9877  } else {
9878  __pyx_t_1 = __pyx_t_2;
9879  goto __pyx_L11_bool_binop_done;
9880  }
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;
9885 
9886  /* "View.MemoryView":363
9887  * raise MemoryError
9888  *
9889  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9890  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9891  * else:
9892  */
9893  goto __pyx_L10;
9894  }
9895 
9896  /* "View.MemoryView":366
9897  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9898  * else:
9899  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
9900  *
9901  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
9902  */
9903  /*else*/ {
9904  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
9905  }
9906  __pyx_L10:;
9907 
9908  /* "View.MemoryView":368
9909  * self.dtype_is_object = dtype_is_object
9910  *
9911  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
9912  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
9913  * self.typeinfo = NULL
9914  */
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))));
9916 
9917  /* "View.MemoryView":370
9918  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
9919  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
9920  * self.typeinfo = NULL # <<<<<<<<<<<<<<
9921  *
9922  * def __dealloc__(memoryview self):
9923  */
9924  __pyx_v_self->typeinfo = NULL;
9925 
9926  /* "View.MemoryView":345
9927  * cdef __Pyx_TypeInfo *typeinfo
9928  *
9929  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
9930  * self.obj = obj
9931  * self.flags = flags
9932  */
9933 
9934  /* function exit code */
9935  __pyx_r = 0;
9936  goto __pyx_L0;
9937  __pyx_L1_error:;
9938  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9939  __pyx_r = -1;
9940  __pyx_L0:;
9941  __Pyx_RefNannyFinishContext();
9942  return __pyx_r;
9943 }
9944 
9945 /* "View.MemoryView":372
9946  * self.typeinfo = NULL
9947  *
9948  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
9949  * if self.obj is not None:
9950  * __Pyx_ReleaseBuffer(&self.view)
9951  */
9952 
9953 /* Python wrapper */
9954 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
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));
9959 
9960  /* function exit code */
9961  __Pyx_RefNannyFinishContext();
9962 }
9963 
9964 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
9965  int __pyx_v_i;
9966  __Pyx_RefNannyDeclarations
9967  int __pyx_t_1;
9968  int __pyx_t_2;
9969  int __pyx_t_3;
9970  int __pyx_t_4;
9971  int __pyx_t_5;
9972  PyThread_type_lock __pyx_t_6;
9973  PyThread_type_lock __pyx_t_7;
9974  __Pyx_RefNannySetupContext("__dealloc__", 0);
9975 
9976  /* "View.MemoryView":373
9977  *
9978  * def __dealloc__(memoryview self):
9979  * if self.obj is not None: # <<<<<<<<<<<<<<
9980  * __Pyx_ReleaseBuffer(&self.view)
9981  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9982  */
9983  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
9984  __pyx_t_2 = (__pyx_t_1 != 0);
9985  if (__pyx_t_2) {
9986 
9987  /* "View.MemoryView":374
9988  * def __dealloc__(memoryview self):
9989  * if self.obj is not None:
9990  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
9991  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9992  *
9993  */
9994  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
9995 
9996  /* "View.MemoryView":373
9997  *
9998  * def __dealloc__(memoryview self):
9999  * if self.obj is not None: # <<<<<<<<<<<<<<
10000  * __Pyx_ReleaseBuffer(&self.view)
10001  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10002  */
10003  goto __pyx_L3;
10004  }
10005 
10006  /* "View.MemoryView":375
10007  * if self.obj is not None:
10008  * __Pyx_ReleaseBuffer(&self.view)
10009  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
10010  *
10011  * (<__pyx_buffer *> &self.view).obj = NULL
10012  */
10013  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
10014  if (__pyx_t_2) {
10015 
10016  /* "View.MemoryView":377
10017  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10018  *
10019  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
10020  * Py_DECREF(Py_None)
10021  *
10022  */
10023  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
10024 
10025  /* "View.MemoryView":378
10026  *
10027  * (<__pyx_buffer *> &self.view).obj = NULL
10028  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
10029  *
10030  * cdef int i
10031  */
10032  Py_DECREF(Py_None);
10033 
10034  /* "View.MemoryView":375
10035  * if self.obj is not None:
10036  * __Pyx_ReleaseBuffer(&self.view)
10037  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
10038  *
10039  * (<__pyx_buffer *> &self.view).obj = NULL
10040  */
10041  }
10042  __pyx_L3:;
10043 
10044  /* "View.MemoryView":382
10045  * cdef int i
10046  * global __pyx_memoryview_thread_locks_used
10047  * if self.lock != NULL: # <<<<<<<<<<<<<<
10048  * for i in range(__pyx_memoryview_thread_locks_used):
10049  * if __pyx_memoryview_thread_locks[i] is self.lock:
10050  */
10051  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10052  if (__pyx_t_2) {
10053 
10054  /* "View.MemoryView":383
10055  * global __pyx_memoryview_thread_locks_used
10056  * if self.lock != NULL:
10057  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
10058  * if __pyx_memoryview_thread_locks[i] is self.lock:
10059  * __pyx_memoryview_thread_locks_used -= 1
10060  */
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;
10065 
10066  /* "View.MemoryView":384
10067  * if self.lock != NULL:
10068  * for i in range(__pyx_memoryview_thread_locks_used):
10069  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10070  * __pyx_memoryview_thread_locks_used -= 1
10071  * if i != __pyx_memoryview_thread_locks_used:
10072  */
10073  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10074  if (__pyx_t_2) {
10075 
10076  /* "View.MemoryView":385
10077  * for i in range(__pyx_memoryview_thread_locks_used):
10078  * if __pyx_memoryview_thread_locks[i] is self.lock:
10079  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
10080  * if i != __pyx_memoryview_thread_locks_used:
10081  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10082  */
10083  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10084 
10085  /* "View.MemoryView":386
10086  * if __pyx_memoryview_thread_locks[i] is self.lock:
10087  * __pyx_memoryview_thread_locks_used -= 1
10088  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10089  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10090  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10091  */
10092  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10093  if (__pyx_t_2) {
10094 
10095  /* "View.MemoryView":388
10096  * if i != __pyx_memoryview_thread_locks_used:
10097  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10098  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
10099  * break
10100  * else:
10101  */
10102  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10103  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10104 
10105  /* "View.MemoryView":387
10106  * __pyx_memoryview_thread_locks_used -= 1
10107  * if i != __pyx_memoryview_thread_locks_used:
10108  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
10109  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10110  * break
10111  */
10112  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10113  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10114 
10115  /* "View.MemoryView":386
10116  * if __pyx_memoryview_thread_locks[i] is self.lock:
10117  * __pyx_memoryview_thread_locks_used -= 1
10118  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10119  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10120  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10121  */
10122  }
10123 
10124  /* "View.MemoryView":389
10125  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10126  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10127  * break # <<<<<<<<<<<<<<
10128  * else:
10129  * PyThread_free_lock(self.lock)
10130  */
10131  goto __pyx_L6_break;
10132 
10133  /* "View.MemoryView":384
10134  * if self.lock != NULL:
10135  * for i in range(__pyx_memoryview_thread_locks_used):
10136  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10137  * __pyx_memoryview_thread_locks_used -= 1
10138  * if i != __pyx_memoryview_thread_locks_used:
10139  */
10140  }
10141  }
10142  /*else*/ {
10143 
10144  /* "View.MemoryView":391
10145  * break
10146  * else:
10147  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
10148  *
10149  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10150  */
10151  PyThread_free_lock(__pyx_v_self->lock);
10152  }
10153  __pyx_L6_break:;
10154 
10155  /* "View.MemoryView":382
10156  * cdef int i
10157  * global __pyx_memoryview_thread_locks_used
10158  * if self.lock != NULL: # <<<<<<<<<<<<<<
10159  * for i in range(__pyx_memoryview_thread_locks_used):
10160  * if __pyx_memoryview_thread_locks[i] is self.lock:
10161  */
10162  }
10163 
10164  /* "View.MemoryView":372
10165  * self.typeinfo = NULL
10166  *
10167  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10168  * if self.obj is not None:
10169  * __Pyx_ReleaseBuffer(&self.view)
10170  */
10171 
10172  /* function exit code */
10173  __Pyx_RefNannyFinishContext();
10174 }
10175 
10176 /* "View.MemoryView":393
10177  * PyThread_free_lock(self.lock)
10178  *
10179  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10180  * cdef Py_ssize_t dim
10181  * cdef char *itemp = <char *> self.view.buf
10182  */
10183 
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;
10188  char *__pyx_r;
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;
10196  char *__pyx_t_7;
10197  int __pyx_lineno = 0;
10198  const char *__pyx_filename = NULL;
10199  int __pyx_clineno = 0;
10200  __Pyx_RefNannySetupContext("get_item_pointer", 0);
10201 
10202  /* "View.MemoryView":395
10203  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10204  * cdef Py_ssize_t dim
10205  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
10206  *
10207  * for dim, idx in enumerate(index):
10208  */
10209  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
10210 
10211  /* "View.MemoryView":397
10212  * cdef char *itemp = <char *> self.view.buf
10213  *
10214  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10215  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10216  *
10217  */
10218  __pyx_t_1 = 0;
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;
10221  __pyx_t_4 = NULL;
10222  } else {
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)
10226  }
10227  for (;;) {
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)
10233  #else
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);
10236  #endif
10237  } else {
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)
10241  #else
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);
10244  #endif
10245  }
10246  } else {
10247  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10248  if (unlikely(!__pyx_t_5)) {
10249  PyObject* exc_type = PyErr_Occurred();
10250  if (exc_type) {
10251  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10252  else __PYX_ERR(1, 397, __pyx_L1_error)
10253  }
10254  break;
10255  }
10256  __Pyx_GOTREF(__pyx_t_5);
10257  }
10258  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10259  __pyx_t_5 = 0;
10260  __pyx_v_dim = __pyx_t_1;
10261  __pyx_t_1 = (__pyx_t_1 + 1);
10262 
10263  /* "View.MemoryView":398
10264  *
10265  * for dim, idx in enumerate(index):
10266  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
10267  *
10268  * return itemp
10269  */
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;
10273 
10274  /* "View.MemoryView":397
10275  * cdef char *itemp = <char *> self.view.buf
10276  *
10277  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10278  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10279  *
10280  */
10281  }
10282  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10283 
10284  /* "View.MemoryView":400
10285  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10286  *
10287  * return itemp # <<<<<<<<<<<<<<
10288  *
10289  *
10290  */
10291  __pyx_r = __pyx_v_itemp;
10292  goto __pyx_L0;
10293 
10294  /* "View.MemoryView":393
10295  * PyThread_free_lock(self.lock)
10296  *
10297  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10298  * cdef Py_ssize_t dim
10299  * cdef char *itemp = <char *> self.view.buf
10300  */
10301 
10302  /* function exit code */
10303  __pyx_L1_error:;
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);
10307  __pyx_r = NULL;
10308  __pyx_L0:;
10309  __Pyx_XDECREF(__pyx_v_idx);
10310  __Pyx_RefNannyFinishContext();
10311  return __pyx_r;
10312 }
10313 
10314 /* "View.MemoryView":403
10315  *
10316  *
10317  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
10318  * if index is Ellipsis:
10319  * return self
10320  */
10321 
10322 /* Python wrapper */
10323 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
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));
10329 
10330  /* function exit code */
10331  __Pyx_RefNannyFinishContext();
10332  return __pyx_r;
10333 }
10334 
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
10341  int __pyx_t_1;
10342  int __pyx_t_2;
10343  PyObject *__pyx_t_3 = NULL;
10344  PyObject *__pyx_t_4 = NULL;
10345  PyObject *__pyx_t_5 = NULL;
10346  char *__pyx_t_6;
10347  int __pyx_lineno = 0;
10348  const char *__pyx_filename = NULL;
10349  int __pyx_clineno = 0;
10350  __Pyx_RefNannySetupContext("__getitem__", 0);
10351 
10352  /* "View.MemoryView":404
10353  *
10354  * def __getitem__(memoryview self, object index):
10355  * if index is Ellipsis: # <<<<<<<<<<<<<<
10356  * return self
10357  *
10358  */
10359  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
10360  __pyx_t_2 = (__pyx_t_1 != 0);
10361  if (__pyx_t_2) {
10362 
10363  /* "View.MemoryView":405
10364  * def __getitem__(memoryview self, object index):
10365  * if index is Ellipsis:
10366  * return self # <<<<<<<<<<<<<<
10367  *
10368  * have_slices, indices = _unellipsify(index, self.view.ndim)
10369  */
10370  __Pyx_XDECREF(__pyx_r);
10371  __Pyx_INCREF(((PyObject *)__pyx_v_self));
10372  __pyx_r = ((PyObject *)__pyx_v_self);
10373  goto __pyx_L0;
10374 
10375  /* "View.MemoryView":404
10376  *
10377  * def __getitem__(memoryview self, object index):
10378  * if index is Ellipsis: # <<<<<<<<<<<<<<
10379  * return self
10380  *
10381  */
10382  }
10383 
10384  /* "View.MemoryView":407
10385  * return self
10386  *
10387  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
10388  *
10389  * cdef char *itemp
10390  */
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)
10400  }
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);
10406  #else
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);
10411  #endif
10412  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10413  } else {
10414  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
10415  }
10416  __pyx_v_have_slices = __pyx_t_4;
10417  __pyx_t_4 = 0;
10418  __pyx_v_indices = __pyx_t_5;
10419  __pyx_t_5 = 0;
10420 
10421  /* "View.MemoryView":410
10422  *
10423  * cdef char *itemp
10424  * if have_slices: # <<<<<<<<<<<<<<
10425  * return memview_slice(self, indices)
10426  * else:
10427  */
10428  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
10429  if (__pyx_t_2) {
10430 
10431  /* "View.MemoryView":411
10432  * cdef char *itemp
10433  * if have_slices:
10434  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
10435  * else:
10436  * itemp = self.get_item_pointer(indices)
10437  */
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;
10442  __pyx_t_3 = 0;
10443  goto __pyx_L0;
10444 
10445  /* "View.MemoryView":410
10446  *
10447  * cdef char *itemp
10448  * if have_slices: # <<<<<<<<<<<<<<
10449  * return memview_slice(self, indices)
10450  * else:
10451  */
10452  }
10453 
10454  /* "View.MemoryView":413
10455  * return memview_slice(self, indices)
10456  * else:
10457  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
10458  * return self.convert_item_to_object(itemp)
10459  *
10460  */
10461  /*else*/ {
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;
10464 
10465  /* "View.MemoryView":414
10466  * else:
10467  * itemp = self.get_item_pointer(indices)
10468  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
10469  *
10470  * def __setitem__(memoryview self, object index, object value):
10471  */
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;
10476  __pyx_t_3 = 0;
10477  goto __pyx_L0;
10478  }
10479 
10480  /* "View.MemoryView":403
10481  *
10482  *
10483  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
10484  * if index is Ellipsis:
10485  * return self
10486  */
10487 
10488  /* function exit code */
10489  __pyx_L1_error:;
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);
10494  __pyx_r = NULL;
10495  __pyx_L0:;
10496  __Pyx_XDECREF(__pyx_v_have_slices);
10497  __Pyx_XDECREF(__pyx_v_indices);
10498  __Pyx_XGIVEREF(__pyx_r);
10499  __Pyx_RefNannyFinishContext();
10500  return __pyx_r;
10501 }
10502 
10503 /* "View.MemoryView":416
10504  * return self.convert_item_to_object(itemp)
10505  *
10506  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
10507  * if self.view.readonly:
10508  * raise TypeError("Cannot assign to read-only memoryview")
10509  */
10510 
10511 /* Python wrapper */
10512 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
10513 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10514  int __pyx_r;
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));
10518 
10519  /* function exit code */
10520  __Pyx_RefNannyFinishContext();
10521  return __pyx_r;
10522 }
10523 
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;
10527  int __pyx_r;
10528  __Pyx_RefNannyDeclarations
10529  int __pyx_t_1;
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);
10538 
10539  /* "View.MemoryView":417
10540  *
10541  * def __setitem__(memoryview self, object index, object value):
10542  * if self.view.readonly: # <<<<<<<<<<<<<<
10543  * raise TypeError("Cannot assign to read-only memoryview")
10544  *
10545  */
10546  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
10547  if (unlikely(__pyx_t_1)) {
10548 
10549  /* "View.MemoryView":418
10550  * def __setitem__(memoryview self, object index, object value):
10551  * if self.view.readonly:
10552  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
10553  *
10554  * have_slices, index = _unellipsify(index, self.view.ndim)
10555  */
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)
10561 
10562  /* "View.MemoryView":417
10563  *
10564  * def __setitem__(memoryview self, object index, object value):
10565  * if self.view.readonly: # <<<<<<<<<<<<<<
10566  * raise TypeError("Cannot assign to read-only memoryview")
10567  *
10568  */
10569  }
10570 
10571  /* "View.MemoryView":420
10572  * raise TypeError("Cannot assign to read-only memoryview")
10573  *
10574  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
10575  *
10576  * if have_slices:
10577  */
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)
10587  }
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);
10593  #else
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);
10598  #endif
10599  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10600  } else {
10601  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
10602  }
10603  __pyx_v_have_slices = __pyx_t_3;
10604  __pyx_t_3 = 0;
10605  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
10606  __pyx_t_4 = 0;
10607 
10608  /* "View.MemoryView":422
10609  * have_slices, index = _unellipsify(index, self.view.ndim)
10610  *
10611  * if have_slices: # <<<<<<<<<<<<<<
10612  * obj = self.is_slice(value)
10613  * if obj:
10614  */
10615  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
10616  if (__pyx_t_1) {
10617 
10618  /* "View.MemoryView":423
10619  *
10620  * if have_slices:
10621  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
10622  * if obj:
10623  * self.setitem_slice_assignment(self[index], obj)
10624  */
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;
10628  __pyx_t_2 = 0;
10629 
10630  /* "View.MemoryView":424
10631  * if have_slices:
10632  * obj = self.is_slice(value)
10633  * if obj: # <<<<<<<<<<<<<<
10634  * self.setitem_slice_assignment(self[index], obj)
10635  * else:
10636  */
10637  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
10638  if (__pyx_t_1) {
10639 
10640  /* "View.MemoryView":425
10641  * obj = self.is_slice(value)
10642  * if obj:
10643  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
10644  * else:
10645  * self.setitem_slice_assign_scalar(self[index], value)
10646  */
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;
10653 
10654  /* "View.MemoryView":424
10655  * if have_slices:
10656  * obj = self.is_slice(value)
10657  * if obj: # <<<<<<<<<<<<<<
10658  * self.setitem_slice_assignment(self[index], obj)
10659  * else:
10660  */
10661  goto __pyx_L5;
10662  }
10663 
10664  /* "View.MemoryView":427
10665  * self.setitem_slice_assignment(self[index], obj)
10666  * else:
10667  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
10668  * else:
10669  * self.setitem_indexed(index, value)
10670  */
10671  /*else*/ {
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;
10679  }
10680  __pyx_L5:;
10681 
10682  /* "View.MemoryView":422
10683  * have_slices, index = _unellipsify(index, self.view.ndim)
10684  *
10685  * if have_slices: # <<<<<<<<<<<<<<
10686  * obj = self.is_slice(value)
10687  * if obj:
10688  */
10689  goto __pyx_L4;
10690  }
10691 
10692  /* "View.MemoryView":429
10693  * self.setitem_slice_assign_scalar(self[index], value)
10694  * else:
10695  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
10696  *
10697  * cdef is_slice(self, obj):
10698  */
10699  /*else*/ {
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;
10703  }
10704  __pyx_L4:;
10705 
10706  /* "View.MemoryView":416
10707  * return self.convert_item_to_object(itemp)
10708  *
10709  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
10710  * if self.view.readonly:
10711  * raise TypeError("Cannot assign to read-only memoryview")
10712  */
10713 
10714  /* function exit code */
10715  __pyx_r = 0;
10716  goto __pyx_L0;
10717  __pyx_L1_error:;
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);
10722  __pyx_r = -1;
10723  __pyx_L0:;
10724  __Pyx_XDECREF(__pyx_v_have_slices);
10725  __Pyx_XDECREF(__pyx_v_obj);
10726  __Pyx_XDECREF(__pyx_v_index);
10727  __Pyx_RefNannyFinishContext();
10728  return __pyx_r;
10729 }
10730 
10731 /* "View.MemoryView":431
10732  * self.setitem_indexed(index, value)
10733  *
10734  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
10735  * if not isinstance(obj, memoryview):
10736  * try:
10737  */
10738 
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
10742  int __pyx_t_1;
10743  int __pyx_t_2;
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;
10750  int __pyx_t_9;
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);
10756 
10757  /* "View.MemoryView":432
10758  *
10759  * cdef is_slice(self, obj):
10760  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
10761  * try:
10762  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10763  */
10764  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
10765  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
10766  if (__pyx_t_2) {
10767 
10768  /* "View.MemoryView":433
10769  * cdef is_slice(self, obj):
10770  * if not isinstance(obj, memoryview):
10771  * try: # <<<<<<<<<<<<<<
10772  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10773  * self.dtype_is_object)
10774  */
10775  {
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);
10782  /*try:*/ {
10783 
10784  /* "View.MemoryView":434
10785  * if not isinstance(obj, memoryview):
10786  * try:
10787  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
10788  * self.dtype_is_object)
10789  * except TypeError:
10790  */
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);
10793 
10794  /* "View.MemoryView":435
10795  * try:
10796  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10797  * self.dtype_is_object) # <<<<<<<<<<<<<<
10798  * except TypeError:
10799  * return None
10800  */
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);
10803 
10804  /* "View.MemoryView":434
10805  * if not isinstance(obj, memoryview):
10806  * try:
10807  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
10808  * self.dtype_is_object)
10809  * except TypeError:
10810  */
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);
10820  __pyx_t_6 = 0;
10821  __pyx_t_7 = 0;
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);
10826  __pyx_t_7 = 0;
10827 
10828  /* "View.MemoryView":433
10829  * cdef is_slice(self, obj):
10830  * if not isinstance(obj, memoryview):
10831  * try: # <<<<<<<<<<<<<<
10832  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10833  * self.dtype_is_object)
10834  */
10835  }
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;
10840  __pyx_L4_error:;
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;
10844 
10845  /* "View.MemoryView":436
10846  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10847  * self.dtype_is_object)
10848  * except TypeError: # <<<<<<<<<<<<<<
10849  * return None
10850  *
10851  */
10852  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
10853  if (__pyx_t_9) {
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);
10859 
10860  /* "View.MemoryView":437
10861  * self.dtype_is_object)
10862  * except TypeError:
10863  * return None # <<<<<<<<<<<<<<
10864  *
10865  * return obj
10866  */
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;
10873  }
10874  goto __pyx_L6_except_error;
10875  __pyx_L6_except_error:;
10876 
10877  /* "View.MemoryView":433
10878  * cdef is_slice(self, obj):
10879  * if not isinstance(obj, memoryview):
10880  * try: # <<<<<<<<<<<<<<
10881  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10882  * self.dtype_is_object)
10883  */
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);
10894  goto __pyx_L0;
10895  __pyx_L9_try_end:;
10896  }
10897 
10898  /* "View.MemoryView":432
10899  *
10900  * cdef is_slice(self, obj):
10901  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
10902  * try:
10903  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10904  */
10905  }
10906 
10907  /* "View.MemoryView":439
10908  * return None
10909  *
10910  * return obj # <<<<<<<<<<<<<<
10911  *
10912  * cdef setitem_slice_assignment(self, dst, src):
10913  */
10914  __Pyx_XDECREF(__pyx_r);
10915  __Pyx_INCREF(__pyx_v_obj);
10916  __pyx_r = __pyx_v_obj;
10917  goto __pyx_L0;
10918 
10919  /* "View.MemoryView":431
10920  * self.setitem_indexed(index, value)
10921  *
10922  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
10923  * if not isinstance(obj, memoryview):
10924  * try:
10925  */
10926 
10927  /* function exit code */
10928  __pyx_L1_error:;
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);
10933  __pyx_r = 0;
10934  __pyx_L0:;
10935  __Pyx_XDECREF(__pyx_v_obj);
10936  __Pyx_XGIVEREF(__pyx_r);
10937  __Pyx_RefNannyFinishContext();
10938  return __pyx_r;
10939 }
10940 
10941 /* "View.MemoryView":441
10942  * return obj
10943  *
10944  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
10945  * cdef __Pyx_memviewslice dst_slice
10946  * cdef __Pyx_memviewslice src_slice
10947  */
10948 
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;
10957  int __pyx_t_4;
10958  int __pyx_t_5;
10959  int __pyx_t_6;
10960  int __pyx_lineno = 0;
10961  const char *__pyx_filename = NULL;
10962  int __pyx_clineno = 0;
10963  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
10964 
10965  /* "View.MemoryView":445
10966  * cdef __Pyx_memviewslice src_slice
10967  *
10968  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
10969  * get_slice_from_memview(dst, &dst_slice)[0],
10970  * src.ndim, dst.ndim, self.dtype_is_object)
10971  */
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)
10974 
10975  /* "View.MemoryView":446
10976  *
10977  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
10978  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
10979  * src.ndim, dst.ndim, self.dtype_is_object)
10980  *
10981  */
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)
10984 
10985  /* "View.MemoryView":447
10986  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
10987  * get_slice_from_memview(dst, &dst_slice)[0],
10988  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
10989  *
10990  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
10991  */
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;
11000 
11001  /* "View.MemoryView":445
11002  * cdef __Pyx_memviewslice src_slice
11003  *
11004  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11005  * get_slice_from_memview(dst, &dst_slice)[0],
11006  * src.ndim, dst.ndim, self.dtype_is_object)
11007  */
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)
11009 
11010  /* "View.MemoryView":441
11011  * return obj
11012  *
11013  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11014  * cdef __Pyx_memviewslice dst_slice
11015  * cdef __Pyx_memviewslice src_slice
11016  */
11017 
11018  /* function exit code */
11019  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11020  goto __pyx_L0;
11021  __pyx_L1_error:;
11022  __Pyx_XDECREF(__pyx_t_3);
11023  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11024  __pyx_r = 0;
11025  __pyx_L0:;
11026  __Pyx_XGIVEREF(__pyx_r);
11027  __Pyx_RefNannyFinishContext();
11028  return __pyx_r;
11029 }
11030 
11031 /* "View.MemoryView":449
11032  * src.ndim, dst.ndim, self.dtype_is_object)
11033  *
11034  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11035  * cdef int array[128]
11036  * cdef void *tmp = NULL
11037  */
11038 
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];
11041  void *__pyx_v_tmp;
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;
11048  int __pyx_t_2;
11049  PyObject *__pyx_t_3 = NULL;
11050  int __pyx_t_4;
11051  int __pyx_t_5;
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);
11063 
11064  /* "View.MemoryView":451
11065  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11066  * cdef int array[128]
11067  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
11068  * cdef void *item
11069  *
11070  */
11071  __pyx_v_tmp = NULL;
11072 
11073  /* "View.MemoryView":456
11074  * cdef __Pyx_memviewslice *dst_slice
11075  * cdef __Pyx_memviewslice tmp_slice
11076  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
11077  *
11078  * if <size_t>self.view.itemsize > sizeof(array):
11079  */
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;
11082 
11083  /* "View.MemoryView":458
11084  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11085  *
11086  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11087  * tmp = PyMem_Malloc(self.view.itemsize)
11088  * if tmp == NULL:
11089  */
11090  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
11091  if (__pyx_t_2) {
11092 
11093  /* "View.MemoryView":459
11094  *
11095  * if <size_t>self.view.itemsize > sizeof(array):
11096  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
11097  * if tmp == NULL:
11098  * raise MemoryError
11099  */
11100  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11101 
11102  /* "View.MemoryView":460
11103  * if <size_t>self.view.itemsize > sizeof(array):
11104  * tmp = PyMem_Malloc(self.view.itemsize)
11105  * if tmp == NULL: # <<<<<<<<<<<<<<
11106  * raise MemoryError
11107  * item = tmp
11108  */
11109  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
11110  if (unlikely(__pyx_t_2)) {
11111 
11112  /* "View.MemoryView":461
11113  * tmp = PyMem_Malloc(self.view.itemsize)
11114  * if tmp == NULL:
11115  * raise MemoryError # <<<<<<<<<<<<<<
11116  * item = tmp
11117  * else:
11118  */
11119  PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
11120 
11121  /* "View.MemoryView":460
11122  * if <size_t>self.view.itemsize > sizeof(array):
11123  * tmp = PyMem_Malloc(self.view.itemsize)
11124  * if tmp == NULL: # <<<<<<<<<<<<<<
11125  * raise MemoryError
11126  * item = tmp
11127  */
11128  }
11129 
11130  /* "View.MemoryView":462
11131  * if tmp == NULL:
11132  * raise MemoryError
11133  * item = tmp # <<<<<<<<<<<<<<
11134  * else:
11135  * item = <void *> array
11136  */
11137  __pyx_v_item = __pyx_v_tmp;
11138 
11139  /* "View.MemoryView":458
11140  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11141  *
11142  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11143  * tmp = PyMem_Malloc(self.view.itemsize)
11144  * if tmp == NULL:
11145  */
11146  goto __pyx_L3;
11147  }
11148 
11149  /* "View.MemoryView":464
11150  * item = tmp
11151  * else:
11152  * item = <void *> array # <<<<<<<<<<<<<<
11153  *
11154  * try:
11155  */
11156  /*else*/ {
11157  __pyx_v_item = ((void *)__pyx_v_array);
11158  }
11159  __pyx_L3:;
11160 
11161  /* "View.MemoryView":466
11162  * item = <void *> array
11163  *
11164  * try: # <<<<<<<<<<<<<<
11165  * if self.dtype_is_object:
11166  * (<PyObject **> item)[0] = <PyObject *> value
11167  */
11168  /*try:*/ {
11169 
11170  /* "View.MemoryView":467
11171  *
11172  * try:
11173  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11174  * (<PyObject **> item)[0] = <PyObject *> value
11175  * else:
11176  */
11177  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
11178  if (__pyx_t_2) {
11179 
11180  /* "View.MemoryView":468
11181  * try:
11182  * if self.dtype_is_object:
11183  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
11184  * else:
11185  * self.assign_item_from_object(<char *> item, value)
11186  */
11187  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11188 
11189  /* "View.MemoryView":467
11190  *
11191  * try:
11192  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11193  * (<PyObject **> item)[0] = <PyObject *> value
11194  * else:
11195  */
11196  goto __pyx_L8;
11197  }
11198 
11199  /* "View.MemoryView":470
11200  * (<PyObject **> item)[0] = <PyObject *> value
11201  * else:
11202  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
11203  *
11204  *
11205  */
11206  /*else*/ {
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;
11210  }
11211  __pyx_L8:;
11212 
11213  /* "View.MemoryView":474
11214  *
11215  *
11216  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11217  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11218  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11219  */
11220  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11221  if (__pyx_t_2) {
11222 
11223  /* "View.MemoryView":475
11224  *
11225  * if self.view.suboffsets != NULL:
11226  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
11227  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11228  * item, self.dtype_is_object)
11229  */
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;
11233 
11234  /* "View.MemoryView":474
11235  *
11236  *
11237  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11238  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11239  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11240  */
11241  }
11242 
11243  /* "View.MemoryView":476
11244  * if self.view.suboffsets != NULL:
11245  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11246  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
11247  * item, self.dtype_is_object)
11248  * finally:
11249  */
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);
11251  }
11252 
11253  /* "View.MemoryView":479
11254  * item, self.dtype_is_object)
11255  * finally:
11256  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
11257  *
11258  * cdef setitem_indexed(self, index, value):
11259  */
11260  /*finally:*/ {
11261  /*normal exit:*/{
11262  PyMem_Free(__pyx_v_tmp);
11263  goto __pyx_L7;
11264  }
11265  __pyx_L6_error:;
11266  /*exception exit:*/{
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;
11280  {
11281  PyMem_Free(__pyx_v_tmp);
11282  }
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);
11288  }
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;
11296  }
11297  __pyx_L7:;
11298  }
11299 
11300  /* "View.MemoryView":449
11301  * src.ndim, dst.ndim, self.dtype_is_object)
11302  *
11303  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11304  * cdef int array[128]
11305  * cdef void *tmp = NULL
11306  */
11307 
11308  /* function exit code */
11309  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11310  goto __pyx_L0;
11311  __pyx_L1_error:;
11312  __Pyx_XDECREF(__pyx_t_3);
11313  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11314  __pyx_r = 0;
11315  __pyx_L0:;
11316  __Pyx_XGIVEREF(__pyx_r);
11317  __Pyx_RefNannyFinishContext();
11318  return __pyx_r;
11319 }
11320 
11321 /* "View.MemoryView":481
11322  * PyMem_Free(tmp)
11323  *
11324  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
11325  * cdef char *itemp = self.get_item_pointer(index)
11326  * self.assign_item_from_object(itemp, value)
11327  */
11328 
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
11333  char *__pyx_t_1;
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);
11339 
11340  /* "View.MemoryView":482
11341  *
11342  * cdef setitem_indexed(self, index, value):
11343  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
11344  * self.assign_item_from_object(itemp, value)
11345  *
11346  */
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;
11349 
11350  /* "View.MemoryView":483
11351  * cdef setitem_indexed(self, index, value):
11352  * cdef char *itemp = self.get_item_pointer(index)
11353  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
11354  *
11355  * cdef convert_item_to_object(self, char *itemp):
11356  */
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;
11360 
11361  /* "View.MemoryView":481
11362  * PyMem_Free(tmp)
11363  *
11364  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
11365  * cdef char *itemp = self.get_item_pointer(index)
11366  * self.assign_item_from_object(itemp, value)
11367  */
11368 
11369  /* function exit code */
11370  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11371  goto __pyx_L0;
11372  __pyx_L1_error:;
11373  __Pyx_XDECREF(__pyx_t_2);
11374  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
11375  __pyx_r = 0;
11376  __pyx_L0:;
11377  __Pyx_XGIVEREF(__pyx_r);
11378  __Pyx_RefNannyFinishContext();
11379  return __pyx_r;
11380 }
11381 
11382 /* "View.MemoryView":485
11383  * self.assign_item_from_object(itemp, value)
11384  *
11385  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
11386  * """Only used if instantiated manually by the user, or if Cython doesn't
11387  * know how to convert the type"""
11388  */
11389 
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;
11403  int __pyx_t_8;
11404  PyObject *__pyx_t_9 = NULL;
11405  size_t __pyx_t_10;
11406  int __pyx_t_11;
11407  int __pyx_lineno = 0;
11408  const char *__pyx_filename = NULL;
11409  int __pyx_clineno = 0;
11410  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
11411 
11412  /* "View.MemoryView":488
11413  * """Only used if instantiated manually by the user, or if Cython doesn't
11414  * know how to convert the type"""
11415  * import struct # <<<<<<<<<<<<<<
11416  * cdef bytes bytesitem
11417  *
11418  */
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;
11422  __pyx_t_1 = 0;
11423 
11424  /* "View.MemoryView":491
11425  * cdef bytes bytesitem
11426  *
11427  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
11428  * try:
11429  * result = struct.unpack(self.view.format, bytesitem)
11430  */
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);
11434  __pyx_t_1 = 0;
11435 
11436  /* "View.MemoryView":492
11437  *
11438  * bytesitem = itemp[:self.view.itemsize]
11439  * try: # <<<<<<<<<<<<<<
11440  * result = struct.unpack(self.view.format, bytesitem)
11441  * except struct.error:
11442  */
11443  {
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);
11450  /*try:*/ {
11451 
11452  /* "View.MemoryView":493
11453  * bytesitem = itemp[:self.view.itemsize]
11454  * try:
11455  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
11456  * except struct.error:
11457  * raise ValueError("Unable to convert item to object")
11458  */
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);
11463  __pyx_t_7 = NULL;
11464  __pyx_t_8 = 0;
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);
11472  __pyx_t_8 = 1;
11473  }
11474  }
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;
11482  } else
11483  #endif
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;
11491  } else
11492  #endif
11493  {
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);
11496  if (__pyx_t_7) {
11497  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
11498  }
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);
11504  __pyx_t_6 = 0;
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;
11508  }
11509  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11510  __pyx_v_result = __pyx_t_1;
11511  __pyx_t_1 = 0;
11512 
11513  /* "View.MemoryView":492
11514  *
11515  * bytesitem = itemp[:self.view.itemsize]
11516  * try: # <<<<<<<<<<<<<<
11517  * result = struct.unpack(self.view.format, bytesitem)
11518  * except struct.error:
11519  */
11520  }
11521 
11522  /* "View.MemoryView":497
11523  * raise ValueError("Unable to convert item to object")
11524  * else:
11525  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
11526  * return result[0]
11527  * return result
11528  */
11529  /*else:*/ {
11530  __pyx_t_10 = strlen(__pyx_v_self->view.format);
11531  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
11532  if (__pyx_t_11) {
11533 
11534  /* "View.MemoryView":498
11535  * else:
11536  * if len(self.view.format) == 1:
11537  * return result[0] # <<<<<<<<<<<<<<
11538  * return result
11539  *
11540  */
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;
11545  __pyx_t_1 = 0;
11546  goto __pyx_L6_except_return;
11547 
11548  /* "View.MemoryView":497
11549  * raise ValueError("Unable to convert item to object")
11550  * else:
11551  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
11552  * return result[0]
11553  * return result
11554  */
11555  }
11556 
11557  /* "View.MemoryView":499
11558  * if len(self.view.format) == 1:
11559  * return result[0]
11560  * return result # <<<<<<<<<<<<<<
11561  *
11562  * cdef assign_item_from_object(self, char *itemp, object value):
11563  */
11564  __Pyx_XDECREF(__pyx_r);
11565  __Pyx_INCREF(__pyx_v_result);
11566  __pyx_r = __pyx_v_result;
11567  goto __pyx_L6_except_return;
11568  }
11569  __pyx_L3_error:;
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;
11575 
11576  /* "View.MemoryView":494
11577  * try:
11578  * result = struct.unpack(self.view.format, bytesitem)
11579  * except struct.error: # <<<<<<<<<<<<<<
11580  * raise ValueError("Unable to convert item to object")
11581  * else:
11582  */
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;
11590  if (__pyx_t_8) {
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);
11596 
11597  /* "View.MemoryView":495
11598  * result = struct.unpack(self.view.format, bytesitem)
11599  * except struct.error:
11600  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
11601  * else:
11602  * if len(self.view.format) == 1:
11603  */
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)
11609  }
11610  goto __pyx_L5_except_error;
11611  __pyx_L5_except_error:;
11612 
11613  /* "View.MemoryView":492
11614  *
11615  * bytesitem = itemp[:self.view.itemsize]
11616  * try: # <<<<<<<<<<<<<<
11617  * result = struct.unpack(self.view.format, bytesitem)
11618  * except struct.error:
11619  */
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);
11630  goto __pyx_L0;
11631  }
11632 
11633  /* "View.MemoryView":485
11634  * self.assign_item_from_object(itemp, value)
11635  *
11636  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
11637  * """Only used if instantiated manually by the user, or if Cython doesn't
11638  * know how to convert the type"""
11639  */
11640 
11641  /* function exit code */
11642  __pyx_L1_error:;
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);
11649  __pyx_r = 0;
11650  __pyx_L0:;
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();
11656  return __pyx_r;
11657 }
11658 
11659 /* "View.MemoryView":501
11660  * return result
11661  *
11662  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
11663  * """Only used if instantiated manually by the user, or if Cython doesn't
11664  * know how to convert the type"""
11665  */
11666 
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;
11669  char __pyx_v_c;
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;
11675  int __pyx_t_2;
11676  int __pyx_t_3;
11677  PyObject *__pyx_t_4 = NULL;
11678  PyObject *__pyx_t_5 = NULL;
11679  PyObject *__pyx_t_6 = NULL;
11680  int __pyx_t_7;
11681  PyObject *__pyx_t_8 = NULL;
11682  Py_ssize_t __pyx_t_9;
11683  PyObject *__pyx_t_10 = NULL;
11684  char *__pyx_t_11;
11685  char *__pyx_t_12;
11686  char *__pyx_t_13;
11687  char *__pyx_t_14;
11688  int __pyx_lineno = 0;
11689  const char *__pyx_filename = NULL;
11690  int __pyx_clineno = 0;
11691  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
11692 
11693  /* "View.MemoryView":504
11694  * """Only used if instantiated manually by the user, or if Cython doesn't
11695  * know how to convert the type"""
11696  * import struct # <<<<<<<<<<<<<<
11697  * cdef char c
11698  * cdef bytes bytesvalue
11699  */
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;
11703  __pyx_t_1 = 0;
11704 
11705  /* "View.MemoryView":509
11706  * cdef Py_ssize_t i
11707  *
11708  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
11709  * bytesvalue = struct.pack(self.view.format, *value)
11710  * else:
11711  */
11712  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
11713  __pyx_t_3 = (__pyx_t_2 != 0);
11714  if (__pyx_t_3) {
11715 
11716  /* "View.MemoryView":510
11717  *
11718  * if isinstance(value, tuple):
11719  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
11720  * else:
11721  * bytesvalue = struct.pack(self.view.format, value)
11722  */
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);
11731  __pyx_t_4 = 0;
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);
11744  __pyx_t_4 = 0;
11745 
11746  /* "View.MemoryView":509
11747  * cdef Py_ssize_t i
11748  *
11749  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
11750  * bytesvalue = struct.pack(self.view.format, *value)
11751  * else:
11752  */
11753  goto __pyx_L3;
11754  }
11755 
11756  /* "View.MemoryView":512
11757  * bytesvalue = struct.pack(self.view.format, *value)
11758  * else:
11759  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
11760  *
11761  * for i, c in enumerate(bytesvalue):
11762  */
11763  /*else*/ {
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);
11768  __pyx_t_5 = NULL;
11769  __pyx_t_7 = 0;
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);
11777  __pyx_t_7 = 1;
11778  }
11779  }
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;
11787  } else
11788  #endif
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;
11796  } else
11797  #endif
11798  {
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);
11801  if (__pyx_t_5) {
11802  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
11803  }
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);
11809  __pyx_t_1 = 0;
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;
11813  }
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);
11817  __pyx_t_4 = 0;
11818  }
11819  __pyx_L3:;
11820 
11821  /* "View.MemoryView":514
11822  * bytesvalue = struct.pack(self.view.format, value)
11823  *
11824  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
11825  * itemp[i] = c
11826  *
11827  */
11828  __pyx_t_9 = 0;
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)
11832  }
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]);
11840 
11841  /* "View.MemoryView":515
11842  *
11843  * for i, c in enumerate(bytesvalue):
11844  * itemp[i] = c # <<<<<<<<<<<<<<
11845  *
11846  * @cname('getbuffer')
11847  */
11848  __pyx_v_i = __pyx_t_9;
11849 
11850  /* "View.MemoryView":514
11851  * bytesvalue = struct.pack(self.view.format, value)
11852  *
11853  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
11854  * itemp[i] = c
11855  *
11856  */
11857  __pyx_t_9 = (__pyx_t_9 + 1);
11858 
11859  /* "View.MemoryView":515
11860  *
11861  * for i, c in enumerate(bytesvalue):
11862  * itemp[i] = c # <<<<<<<<<<<<<<
11863  *
11864  * @cname('getbuffer')
11865  */
11866  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
11867  }
11868  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11869 
11870  /* "View.MemoryView":501
11871  * return result
11872  *
11873  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
11874  * """Only used if instantiated manually by the user, or if Cython doesn't
11875  * know how to convert the type"""
11876  */
11877 
11878  /* function exit code */
11879  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11880  goto __pyx_L0;
11881  __pyx_L1_error:;
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);
11889  __pyx_r = 0;
11890  __pyx_L0:;
11891  __Pyx_XDECREF(__pyx_v_struct);
11892  __Pyx_XDECREF(__pyx_v_bytesvalue);
11893  __Pyx_XGIVEREF(__pyx_r);
11894  __Pyx_RefNannyFinishContext();
11895  return __pyx_r;
11896 }
11897 
11898 /* "View.MemoryView":518
11899  *
11900  * @cname('getbuffer')
11901  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
11902  * if flags & PyBUF_WRITABLE and self.view.readonly:
11903  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11904  */
11905 
11906 /* Python wrapper */
11907 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
11908 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
11909  int __pyx_r;
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));
11913 
11914  /* function exit code */
11915  __Pyx_RefNannyFinishContext();
11916  return __pyx_r;
11917 }
11918 
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) {
11920  int __pyx_r;
11921  __Pyx_RefNannyDeclarations
11922  int __pyx_t_1;
11923  int __pyx_t_2;
11924  PyObject *__pyx_t_3 = NULL;
11925  Py_ssize_t *__pyx_t_4;
11926  char *__pyx_t_5;
11927  void *__pyx_t_6;
11928  int __pyx_t_7;
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");
11935  return -1;
11936  }
11937  __Pyx_RefNannySetupContext("__getbuffer__", 0);
11938  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
11939  __Pyx_GIVEREF(__pyx_v_info->obj);
11940 
11941  /* "View.MemoryView":519
11942  * @cname('getbuffer')
11943  * def __getbuffer__(self, Py_buffer *info, int flags):
11944  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
11945  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11946  *
11947  */
11948  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
11949  if (__pyx_t_2) {
11950  } else {
11951  __pyx_t_1 = __pyx_t_2;
11952  goto __pyx_L4_bool_binop_done;
11953  }
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)) {
11958 
11959  /* "View.MemoryView":520
11960  * def __getbuffer__(self, Py_buffer *info, int flags):
11961  * if flags & PyBUF_WRITABLE and self.view.readonly:
11962  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
11963  *
11964  * if flags & PyBUF_ND:
11965  */
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)
11971 
11972  /* "View.MemoryView":519
11973  * @cname('getbuffer')
11974  * def __getbuffer__(self, Py_buffer *info, int flags):
11975  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
11976  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11977  *
11978  */
11979  }
11980 
11981  /* "View.MemoryView":522
11982  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11983  *
11984  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
11985  * info.shape = self.view.shape
11986  * else:
11987  */
11988  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
11989  if (__pyx_t_1) {
11990 
11991  /* "View.MemoryView":523
11992  *
11993  * if flags & PyBUF_ND:
11994  * info.shape = self.view.shape # <<<<<<<<<<<<<<
11995  * else:
11996  * info.shape = NULL
11997  */
11998  __pyx_t_4 = __pyx_v_self->view.shape;
11999  __pyx_v_info->shape = __pyx_t_4;
12000 
12001  /* "View.MemoryView":522
12002  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12003  *
12004  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
12005  * info.shape = self.view.shape
12006  * else:
12007  */
12008  goto __pyx_L6;
12009  }
12010 
12011  /* "View.MemoryView":525
12012  * info.shape = self.view.shape
12013  * else:
12014  * info.shape = NULL # <<<<<<<<<<<<<<
12015  *
12016  * if flags & PyBUF_STRIDES:
12017  */
12018  /*else*/ {
12019  __pyx_v_info->shape = NULL;
12020  }
12021  __pyx_L6:;
12022 
12023  /* "View.MemoryView":527
12024  * info.shape = NULL
12025  *
12026  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12027  * info.strides = self.view.strides
12028  * else:
12029  */
12030  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12031  if (__pyx_t_1) {
12032 
12033  /* "View.MemoryView":528
12034  *
12035  * if flags & PyBUF_STRIDES:
12036  * info.strides = self.view.strides # <<<<<<<<<<<<<<
12037  * else:
12038  * info.strides = NULL
12039  */
12040  __pyx_t_4 = __pyx_v_self->view.strides;
12041  __pyx_v_info->strides = __pyx_t_4;
12042 
12043  /* "View.MemoryView":527
12044  * info.shape = NULL
12045  *
12046  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12047  * info.strides = self.view.strides
12048  * else:
12049  */
12050  goto __pyx_L7;
12051  }
12052 
12053  /* "View.MemoryView":530
12054  * info.strides = self.view.strides
12055  * else:
12056  * info.strides = NULL # <<<<<<<<<<<<<<
12057  *
12058  * if flags & PyBUF_INDIRECT:
12059  */
12060  /*else*/ {
12061  __pyx_v_info->strides = NULL;
12062  }
12063  __pyx_L7:;
12064 
12065  /* "View.MemoryView":532
12066  * info.strides = NULL
12067  *
12068  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12069  * info.suboffsets = self.view.suboffsets
12070  * else:
12071  */
12072  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12073  if (__pyx_t_1) {
12074 
12075  /* "View.MemoryView":533
12076  *
12077  * if flags & PyBUF_INDIRECT:
12078  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
12079  * else:
12080  * info.suboffsets = NULL
12081  */
12082  __pyx_t_4 = __pyx_v_self->view.suboffsets;
12083  __pyx_v_info->suboffsets = __pyx_t_4;
12084 
12085  /* "View.MemoryView":532
12086  * info.strides = NULL
12087  *
12088  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12089  * info.suboffsets = self.view.suboffsets
12090  * else:
12091  */
12092  goto __pyx_L8;
12093  }
12094 
12095  /* "View.MemoryView":535
12096  * info.suboffsets = self.view.suboffsets
12097  * else:
12098  * info.suboffsets = NULL # <<<<<<<<<<<<<<
12099  *
12100  * if flags & PyBUF_FORMAT:
12101  */
12102  /*else*/ {
12103  __pyx_v_info->suboffsets = NULL;
12104  }
12105  __pyx_L8:;
12106 
12107  /* "View.MemoryView":537
12108  * info.suboffsets = NULL
12109  *
12110  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12111  * info.format = self.view.format
12112  * else:
12113  */
12114  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12115  if (__pyx_t_1) {
12116 
12117  /* "View.MemoryView":538
12118  *
12119  * if flags & PyBUF_FORMAT:
12120  * info.format = self.view.format # <<<<<<<<<<<<<<
12121  * else:
12122  * info.format = NULL
12123  */
12124  __pyx_t_5 = __pyx_v_self->view.format;
12125  __pyx_v_info->format = __pyx_t_5;
12126 
12127  /* "View.MemoryView":537
12128  * info.suboffsets = NULL
12129  *
12130  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12131  * info.format = self.view.format
12132  * else:
12133  */
12134  goto __pyx_L9;
12135  }
12136 
12137  /* "View.MemoryView":540
12138  * info.format = self.view.format
12139  * else:
12140  * info.format = NULL # <<<<<<<<<<<<<<
12141  *
12142  * info.buf = self.view.buf
12143  */
12144  /*else*/ {
12145  __pyx_v_info->format = NULL;
12146  }
12147  __pyx_L9:;
12148 
12149  /* "View.MemoryView":542
12150  * info.format = NULL
12151  *
12152  * info.buf = self.view.buf # <<<<<<<<<<<<<<
12153  * info.ndim = self.view.ndim
12154  * info.itemsize = self.view.itemsize
12155  */
12156  __pyx_t_6 = __pyx_v_self->view.buf;
12157  __pyx_v_info->buf = __pyx_t_6;
12158 
12159  /* "View.MemoryView":543
12160  *
12161  * info.buf = self.view.buf
12162  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
12163  * info.itemsize = self.view.itemsize
12164  * info.len = self.view.len
12165  */
12166  __pyx_t_7 = __pyx_v_self->view.ndim;
12167  __pyx_v_info->ndim = __pyx_t_7;
12168 
12169  /* "View.MemoryView":544
12170  * info.buf = self.view.buf
12171  * info.ndim = self.view.ndim
12172  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
12173  * info.len = self.view.len
12174  * info.readonly = self.view.readonly
12175  */
12176  __pyx_t_8 = __pyx_v_self->view.itemsize;
12177  __pyx_v_info->itemsize = __pyx_t_8;
12178 
12179  /* "View.MemoryView":545
12180  * info.ndim = self.view.ndim
12181  * info.itemsize = self.view.itemsize
12182  * info.len = self.view.len # <<<<<<<<<<<<<<
12183  * info.readonly = self.view.readonly
12184  * info.obj = self
12185  */
12186  __pyx_t_8 = __pyx_v_self->view.len;
12187  __pyx_v_info->len = __pyx_t_8;
12188 
12189  /* "View.MemoryView":546
12190  * info.itemsize = self.view.itemsize
12191  * info.len = self.view.len
12192  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
12193  * info.obj = self
12194  *
12195  */
12196  __pyx_t_1 = __pyx_v_self->view.readonly;
12197  __pyx_v_info->readonly = __pyx_t_1;
12198 
12199  /* "View.MemoryView":547
12200  * info.len = self.view.len
12201  * info.readonly = self.view.readonly
12202  * info.obj = self # <<<<<<<<<<<<<<
12203  *
12204  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
12205  */
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);
12211 
12212  /* "View.MemoryView":518
12213  *
12214  * @cname('getbuffer')
12215  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12216  * if flags & PyBUF_WRITABLE and self.view.readonly:
12217  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12218  */
12219 
12220  /* function exit code */
12221  __pyx_r = 0;
12222  goto __pyx_L0;
12223  __pyx_L1_error:;
12224  __Pyx_XDECREF(__pyx_t_3);
12225  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12226  __pyx_r = -1;
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;
12230  }
12231  goto __pyx_L2;
12232  __pyx_L0:;
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;
12236  }
12237  __pyx_L2:;
12238  __Pyx_RefNannyFinishContext();
12239  return __pyx_r;
12240 }
12241 
12242 /* "View.MemoryView":553
12243  *
12244  * @property
12245  * def T(self): # <<<<<<<<<<<<<<
12246  * cdef _memoryviewslice result = memoryview_copy(self)
12247  * transpose_memslice(&result.from_slice)
12248  */
12249 
12250 /* Python wrapper */
12251 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
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));
12257 
12258  /* function exit code */
12259  __Pyx_RefNannyFinishContext();
12260  return __pyx_r;
12261 }
12262 
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;
12268  int __pyx_t_2;
12269  int __pyx_lineno = 0;
12270  const char *__pyx_filename = NULL;
12271  int __pyx_clineno = 0;
12272  __Pyx_RefNannySetupContext("__get__", 0);
12273 
12274  /* "View.MemoryView":554
12275  * @property
12276  * def T(self):
12277  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
12278  * transpose_memslice(&result.from_slice)
12279  * return result
12280  */
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);
12285  __pyx_t_1 = 0;
12286 
12287  /* "View.MemoryView":555
12288  * def T(self):
12289  * cdef _memoryviewslice result = memoryview_copy(self)
12290  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
12291  * return result
12292  *
12293  */
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)
12295 
12296  /* "View.MemoryView":556
12297  * cdef _memoryviewslice result = memoryview_copy(self)
12298  * transpose_memslice(&result.from_slice)
12299  * return result # <<<<<<<<<<<<<<
12300  *
12301  * @property
12302  */
12303  __Pyx_XDECREF(__pyx_r);
12304  __Pyx_INCREF(((PyObject *)__pyx_v_result));
12305  __pyx_r = ((PyObject *)__pyx_v_result);
12306  goto __pyx_L0;
12307 
12308  /* "View.MemoryView":553
12309  *
12310  * @property
12311  * def T(self): # <<<<<<<<<<<<<<
12312  * cdef _memoryviewslice result = memoryview_copy(self)
12313  * transpose_memslice(&result.from_slice)
12314  */
12315 
12316  /* function exit code */
12317  __pyx_L1_error:;
12318  __Pyx_XDECREF(__pyx_t_1);
12319  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12320  __pyx_r = NULL;
12321  __pyx_L0:;
12322  __Pyx_XDECREF((PyObject *)__pyx_v_result);
12323  __Pyx_XGIVEREF(__pyx_r);
12324  __Pyx_RefNannyFinishContext();
12325  return __pyx_r;
12326 }
12327 
12328 /* "View.MemoryView":559
12329  *
12330  * @property
12331  * def base(self): # <<<<<<<<<<<<<<
12332  * return self.obj
12333  *
12334  */
12335 
12336 /* Python wrapper */
12337 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
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));
12343 
12344  /* function exit code */
12345  __Pyx_RefNannyFinishContext();
12346  return __pyx_r;
12347 }
12348 
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);
12353 
12354  /* "View.MemoryView":560
12355  * @property
12356  * def base(self):
12357  * return self.obj # <<<<<<<<<<<<<<
12358  *
12359  * @property
12360  */
12361  __Pyx_XDECREF(__pyx_r);
12362  __Pyx_INCREF(__pyx_v_self->obj);
12363  __pyx_r = __pyx_v_self->obj;
12364  goto __pyx_L0;
12365 
12366  /* "View.MemoryView":559
12367  *
12368  * @property
12369  * def base(self): # <<<<<<<<<<<<<<
12370  * return self.obj
12371  *
12372  */
12373 
12374  /* function exit code */
12375  __pyx_L0:;
12376  __Pyx_XGIVEREF(__pyx_r);
12377  __Pyx_RefNannyFinishContext();
12378  return __pyx_r;
12379 }
12380 
12381 /* "View.MemoryView":563
12382  *
12383  * @property
12384  * def shape(self): # <<<<<<<<<<<<<<
12385  * return tuple([length for length in self.view.shape[:self.view.ndim]])
12386  *
12387  */
12388 
12389 /* Python wrapper */
12390 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
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));
12396 
12397  /* function exit code */
12398  __Pyx_RefNannyFinishContext();
12399  return __pyx_r;
12400 }
12401 
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);
12415 
12416  /* "View.MemoryView":564
12417  * @property
12418  * def shape(self):
12419  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
12420  *
12421  * @property
12422  */
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;
12434  }
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;
12439  __pyx_t_5 = 0;
12440  goto __pyx_L0;
12441 
12442  /* "View.MemoryView":563
12443  *
12444  * @property
12445  * def shape(self): # <<<<<<<<<<<<<<
12446  * return tuple([length for length in self.view.shape[:self.view.ndim]])
12447  *
12448  */
12449 
12450  /* function exit code */
12451  __pyx_L1_error:;
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);
12455  __pyx_r = NULL;
12456  __pyx_L0:;
12457  __Pyx_XGIVEREF(__pyx_r);
12458  __Pyx_RefNannyFinishContext();
12459  return __pyx_r;
12460 }
12461 
12462 /* "View.MemoryView":567
12463  *
12464  * @property
12465  * def strides(self): # <<<<<<<<<<<<<<
12466  * if self.view.strides == NULL:
12467  *
12468  */
12469 
12470 /* Python wrapper */
12471 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
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));
12477 
12478  /* function exit code */
12479  __Pyx_RefNannyFinishContext();
12480  return __pyx_r;
12481 }
12482 
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
12487  int __pyx_t_1;
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);
12497 
12498  /* "View.MemoryView":568
12499  * @property
12500  * def strides(self):
12501  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
12502  *
12503  * raise ValueError("Buffer view does not expose strides")
12504  */
12505  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
12506  if (unlikely(__pyx_t_1)) {
12507 
12508  /* "View.MemoryView":570
12509  * if self.view.strides == NULL:
12510  *
12511  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
12512  *
12513  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
12514  */
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)
12520 
12521  /* "View.MemoryView":568
12522  * @property
12523  * def strides(self):
12524  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
12525  *
12526  * raise ValueError("Buffer view does not expose strides")
12527  */
12528  }
12529 
12530  /* "View.MemoryView":572
12531  * raise ValueError("Buffer view does not expose strides")
12532  *
12533  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
12534  *
12535  * @property
12536  */
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;
12548  }
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;
12553  __pyx_t_6 = 0;
12554  goto __pyx_L0;
12555 
12556  /* "View.MemoryView":567
12557  *
12558  * @property
12559  * def strides(self): # <<<<<<<<<<<<<<
12560  * if self.view.strides == NULL:
12561  *
12562  */
12563 
12564  /* function exit code */
12565  __pyx_L1_error:;
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);
12569  __pyx_r = NULL;
12570  __pyx_L0:;
12571  __Pyx_XGIVEREF(__pyx_r);
12572  __Pyx_RefNannyFinishContext();
12573  return __pyx_r;
12574 }
12575 
12576 /* "View.MemoryView":575
12577  *
12578  * @property
12579  * def suboffsets(self): # <<<<<<<<<<<<<<
12580  * if self.view.suboffsets == NULL:
12581  * return (-1,) * self.view.ndim
12582  */
12583 
12584 /* Python wrapper */
12585 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
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));
12591 
12592  /* function exit code */
12593  __Pyx_RefNannyFinishContext();
12594  return __pyx_r;
12595 }
12596 
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
12601  int __pyx_t_1;
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);
12611 
12612  /* "View.MemoryView":576
12613  * @property
12614  * def suboffsets(self):
12615  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
12616  * return (-1,) * self.view.ndim
12617  *
12618  */
12619  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
12620  if (__pyx_t_1) {
12621 
12622  /* "View.MemoryView":577
12623  * def suboffsets(self):
12624  * if self.view.suboffsets == NULL:
12625  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
12626  *
12627  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
12628  */
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;
12636  __pyx_t_3 = 0;
12637  goto __pyx_L0;
12638 
12639  /* "View.MemoryView":576
12640  * @property
12641  * def suboffsets(self):
12642  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
12643  * return (-1,) * self.view.ndim
12644  *
12645  */
12646  }
12647 
12648  /* "View.MemoryView":579
12649  * return (-1,) * self.view.ndim
12650  *
12651  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
12652  *
12653  * @property
12654  */
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;
12666  }
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;
12671  __pyx_t_2 = 0;
12672  goto __pyx_L0;
12673 
12674  /* "View.MemoryView":575
12675  *
12676  * @property
12677  * def suboffsets(self): # <<<<<<<<<<<<<<
12678  * if self.view.suboffsets == NULL:
12679  * return (-1,) * self.view.ndim
12680  */
12681 
12682  /* function exit code */
12683  __pyx_L1_error:;
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);
12687  __pyx_r = NULL;
12688  __pyx_L0:;
12689  __Pyx_XGIVEREF(__pyx_r);
12690  __Pyx_RefNannyFinishContext();
12691  return __pyx_r;
12692 }
12693 
12694 /* "View.MemoryView":582
12695  *
12696  * @property
12697  * def ndim(self): # <<<<<<<<<<<<<<
12698  * return self.view.ndim
12699  *
12700  */
12701 
12702 /* Python wrapper */
12703 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
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));
12709 
12710  /* function exit code */
12711  __Pyx_RefNannyFinishContext();
12712  return __pyx_r;
12713 }
12714 
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);
12723 
12724  /* "View.MemoryView":583
12725  * @property
12726  * def ndim(self):
12727  * return self.view.ndim # <<<<<<<<<<<<<<
12728  *
12729  * @property
12730  */
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;
12735  __pyx_t_1 = 0;
12736  goto __pyx_L0;
12737 
12738  /* "View.MemoryView":582
12739  *
12740  * @property
12741  * def ndim(self): # <<<<<<<<<<<<<<
12742  * return self.view.ndim
12743  *
12744  */
12745 
12746  /* function exit code */
12747  __pyx_L1_error:;
12748  __Pyx_XDECREF(__pyx_t_1);
12749  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12750  __pyx_r = NULL;
12751  __pyx_L0:;
12752  __Pyx_XGIVEREF(__pyx_r);
12753  __Pyx_RefNannyFinishContext();
12754  return __pyx_r;
12755 }
12756 
12757 /* "View.MemoryView":586
12758  *
12759  * @property
12760  * def itemsize(self): # <<<<<<<<<<<<<<
12761  * return self.view.itemsize
12762  *
12763  */
12764 
12765 /* Python wrapper */
12766 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
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));
12772 
12773  /* function exit code */
12774  __Pyx_RefNannyFinishContext();
12775  return __pyx_r;
12776 }
12777 
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);
12786 
12787  /* "View.MemoryView":587
12788  * @property
12789  * def itemsize(self):
12790  * return self.view.itemsize # <<<<<<<<<<<<<<
12791  *
12792  * @property
12793  */
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;
12798  __pyx_t_1 = 0;
12799  goto __pyx_L0;
12800 
12801  /* "View.MemoryView":586
12802  *
12803  * @property
12804  * def itemsize(self): # <<<<<<<<<<<<<<
12805  * return self.view.itemsize
12806  *
12807  */
12808 
12809  /* function exit code */
12810  __pyx_L1_error:;
12811  __Pyx_XDECREF(__pyx_t_1);
12812  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12813  __pyx_r = NULL;
12814  __pyx_L0:;
12815  __Pyx_XGIVEREF(__pyx_r);
12816  __Pyx_RefNannyFinishContext();
12817  return __pyx_r;
12818 }
12819 
12820 /* "View.MemoryView":590
12821  *
12822  * @property
12823  * def nbytes(self): # <<<<<<<<<<<<<<
12824  * return self.size * self.view.itemsize
12825  *
12826  */
12827 
12828 /* Python wrapper */
12829 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
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));
12835 
12836  /* function exit code */
12837  __Pyx_RefNannyFinishContext();
12838  return __pyx_r;
12839 }
12840 
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);
12851 
12852  /* "View.MemoryView":591
12853  * @property
12854  * def nbytes(self):
12855  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
12856  *
12857  * @property
12858  */
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;
12869  __pyx_t_3 = 0;
12870  goto __pyx_L0;
12871 
12872  /* "View.MemoryView":590
12873  *
12874  * @property
12875  * def nbytes(self): # <<<<<<<<<<<<<<
12876  * return self.size * self.view.itemsize
12877  *
12878  */
12879 
12880  /* function exit code */
12881  __pyx_L1_error:;
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);
12886  __pyx_r = NULL;
12887  __pyx_L0:;
12888  __Pyx_XGIVEREF(__pyx_r);
12889  __Pyx_RefNannyFinishContext();
12890  return __pyx_r;
12891 }
12892 
12893 /* "View.MemoryView":594
12894  *
12895  * @property
12896  * def size(self): # <<<<<<<<<<<<<<
12897  * if self._size is None:
12898  * result = 1
12899  */
12900 
12901 /* Python wrapper */
12902 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
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));
12908 
12909  /* function exit code */
12910  __Pyx_RefNannyFinishContext();
12911  return __pyx_r;
12912 }
12913 
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
12919  int __pyx_t_1;
12920  int __pyx_t_2;
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);
12929 
12930  /* "View.MemoryView":595
12931  * @property
12932  * def size(self):
12933  * if self._size is None: # <<<<<<<<<<<<<<
12934  * result = 1
12935  *
12936  */
12937  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
12938  __pyx_t_2 = (__pyx_t_1 != 0);
12939  if (__pyx_t_2) {
12940 
12941  /* "View.MemoryView":596
12942  * def size(self):
12943  * if self._size is None:
12944  * result = 1 # <<<<<<<<<<<<<<
12945  *
12946  * for length in self.view.shape[:self.view.ndim]:
12947  */
12948  __Pyx_INCREF(__pyx_int_1);
12949  __pyx_v_result = __pyx_int_1;
12950 
12951  /* "View.MemoryView":598
12952  * result = 1
12953  *
12954  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
12955  * result *= length
12956  *
12957  */
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);
12964  __pyx_t_6 = 0;
12965 
12966  /* "View.MemoryView":599
12967  *
12968  * for length in self.view.shape[:self.view.ndim]:
12969  * result *= length # <<<<<<<<<<<<<<
12970  *
12971  * self._size = result
12972  */
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);
12976  __pyx_t_6 = 0;
12977  }
12978 
12979  /* "View.MemoryView":601
12980  * result *= length
12981  *
12982  * self._size = result # <<<<<<<<<<<<<<
12983  *
12984  * return self._size
12985  */
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;
12991 
12992  /* "View.MemoryView":595
12993  * @property
12994  * def size(self):
12995  * if self._size is None: # <<<<<<<<<<<<<<
12996  * result = 1
12997  *
12998  */
12999  }
13000 
13001  /* "View.MemoryView":603
13002  * self._size = result
13003  *
13004  * return self._size # <<<<<<<<<<<<<<
13005  *
13006  * def __len__(self):
13007  */
13008  __Pyx_XDECREF(__pyx_r);
13009  __Pyx_INCREF(__pyx_v_self->_size);
13010  __pyx_r = __pyx_v_self->_size;
13011  goto __pyx_L0;
13012 
13013  /* "View.MemoryView":594
13014  *
13015  * @property
13016  * def size(self): # <<<<<<<<<<<<<<
13017  * if self._size is None:
13018  * result = 1
13019  */
13020 
13021  /* function exit code */
13022  __pyx_L1_error:;
13023  __Pyx_XDECREF(__pyx_t_6);
13024  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13025  __pyx_r = NULL;
13026  __pyx_L0:;
13027  __Pyx_XDECREF(__pyx_v_result);
13028  __Pyx_XDECREF(__pyx_v_length);
13029  __Pyx_XGIVEREF(__pyx_r);
13030  __Pyx_RefNannyFinishContext();
13031  return __pyx_r;
13032 }
13033 
13034 /* "View.MemoryView":605
13035  * return self._size
13036  *
13037  * def __len__(self): # <<<<<<<<<<<<<<
13038  * if self.view.ndim >= 1:
13039  * return self.view.shape[0]
13040  */
13041 
13042 /* Python wrapper */
13043 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
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));
13049 
13050  /* function exit code */
13051  __Pyx_RefNannyFinishContext();
13052  return __pyx_r;
13053 }
13054 
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
13058  int __pyx_t_1;
13059  __Pyx_RefNannySetupContext("__len__", 0);
13060 
13061  /* "View.MemoryView":606
13062  *
13063  * def __len__(self):
13064  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13065  * return self.view.shape[0]
13066  *
13067  */
13068  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13069  if (__pyx_t_1) {
13070 
13071  /* "View.MemoryView":607
13072  * def __len__(self):
13073  * if self.view.ndim >= 1:
13074  * return self.view.shape[0] # <<<<<<<<<<<<<<
13075  *
13076  * return 0
13077  */
13078  __pyx_r = (__pyx_v_self->view.shape[0]);
13079  goto __pyx_L0;
13080 
13081  /* "View.MemoryView":606
13082  *
13083  * def __len__(self):
13084  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13085  * return self.view.shape[0]
13086  *
13087  */
13088  }
13089 
13090  /* "View.MemoryView":609
13091  * return self.view.shape[0]
13092  *
13093  * return 0 # <<<<<<<<<<<<<<
13094  *
13095  * def __repr__(self):
13096  */
13097  __pyx_r = 0;
13098  goto __pyx_L0;
13099 
13100  /* "View.MemoryView":605
13101  * return self._size
13102  *
13103  * def __len__(self): # <<<<<<<<<<<<<<
13104  * if self.view.ndim >= 1:
13105  * return self.view.shape[0]
13106  */
13107 
13108  /* function exit code */
13109  __pyx_L0:;
13110  __Pyx_RefNannyFinishContext();
13111  return __pyx_r;
13112 }
13113 
13114 /* "View.MemoryView":611
13115  * return 0
13116  *
13117  * def __repr__(self): # <<<<<<<<<<<<<<
13118  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13119  * id(self))
13120  */
13121 
13122 /* Python wrapper */
13123 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
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));
13129 
13130  /* function exit code */
13131  __Pyx_RefNannyFinishContext();
13132  return __pyx_r;
13133 }
13134 
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);
13145 
13146  /* "View.MemoryView":612
13147  *
13148  * def __repr__(self):
13149  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13150  * id(self))
13151  *
13152  */
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;
13162 
13163  /* "View.MemoryView":613
13164  * def __repr__(self):
13165  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13166  * id(self)) # <<<<<<<<<<<<<<
13167  *
13168  * def __str__(self):
13169  */
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);
13172 
13173  /* "View.MemoryView":612
13174  *
13175  * def __repr__(self):
13176  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13177  * id(self))
13178  *
13179  */
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);
13186  __pyx_t_1 = 0;
13187  __pyx_t_2 = 0;
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;
13192  __pyx_t_2 = 0;
13193  goto __pyx_L0;
13194 
13195  /* "View.MemoryView":611
13196  * return 0
13197  *
13198  * def __repr__(self): # <<<<<<<<<<<<<<
13199  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13200  * id(self))
13201  */
13202 
13203  /* function exit code */
13204  __pyx_L1_error:;
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);
13209  __pyx_r = NULL;
13210  __pyx_L0:;
13211  __Pyx_XGIVEREF(__pyx_r);
13212  __Pyx_RefNannyFinishContext();
13213  return __pyx_r;
13214 }
13215 
13216 /* "View.MemoryView":615
13217  * id(self))
13218  *
13219  * def __str__(self): # <<<<<<<<<<<<<<
13220  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13221  *
13222  */
13223 
13224 /* Python wrapper */
13225 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
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));
13231 
13232  /* function exit code */
13233  __Pyx_RefNannyFinishContext();
13234  return __pyx_r;
13235 }
13236 
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);
13246 
13247  /* "View.MemoryView":616
13248  *
13249  * def __str__(self):
13250  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
13251  *
13252  *
13253  */
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);
13267  __pyx_t_1 = 0;
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;
13272  __pyx_t_1 = 0;
13273  goto __pyx_L0;
13274 
13275  /* "View.MemoryView":615
13276  * id(self))
13277  *
13278  * def __str__(self): # <<<<<<<<<<<<<<
13279  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13280  *
13281  */
13282 
13283  /* function exit code */
13284  __pyx_L1_error:;
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);
13288  __pyx_r = NULL;
13289  __pyx_L0:;
13290  __Pyx_XGIVEREF(__pyx_r);
13291  __Pyx_RefNannyFinishContext();
13292  return __pyx_r;
13293 }
13294 
13295 /* "View.MemoryView":619
13296  *
13297  *
13298  * def is_c_contig(self): # <<<<<<<<<<<<<<
13299  * cdef __Pyx_memviewslice *mslice
13300  * cdef __Pyx_memviewslice tmp
13301  */
13302 
13303 /* Python wrapper */
13304 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
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));
13310 
13311  /* function exit code */
13312  __Pyx_RefNannyFinishContext();
13313  return __pyx_r;
13314 }
13315 
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);
13327 
13328  /* "View.MemoryView":622
13329  * cdef __Pyx_memviewslice *mslice
13330  * cdef __Pyx_memviewslice tmp
13331  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
13332  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13333  *
13334  */
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;
13337 
13338  /* "View.MemoryView":623
13339  * cdef __Pyx_memviewslice tmp
13340  * mslice = get_slice_from_memview(self, &tmp)
13341  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
13342  *
13343  * def is_f_contig(self):
13344  */
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;
13349  __pyx_t_2 = 0;
13350  goto __pyx_L0;
13351 
13352  /* "View.MemoryView":619
13353  *
13354  *
13355  * def is_c_contig(self): # <<<<<<<<<<<<<<
13356  * cdef __Pyx_memviewslice *mslice
13357  * cdef __Pyx_memviewslice tmp
13358  */
13359 
13360  /* function exit code */
13361  __pyx_L1_error:;
13362  __Pyx_XDECREF(__pyx_t_2);
13363  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13364  __pyx_r = NULL;
13365  __pyx_L0:;
13366  __Pyx_XGIVEREF(__pyx_r);
13367  __Pyx_RefNannyFinishContext();
13368  return __pyx_r;
13369 }
13370 
13371 /* "View.MemoryView":625
13372  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13373  *
13374  * def is_f_contig(self): # <<<<<<<<<<<<<<
13375  * cdef __Pyx_memviewslice *mslice
13376  * cdef __Pyx_memviewslice tmp
13377  */
13378 
13379 /* Python wrapper */
13380 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
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));
13386 
13387  /* function exit code */
13388  __Pyx_RefNannyFinishContext();
13389  return __pyx_r;
13390 }
13391 
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);
13403 
13404  /* "View.MemoryView":628
13405  * cdef __Pyx_memviewslice *mslice
13406  * cdef __Pyx_memviewslice tmp
13407  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
13408  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13409  *
13410  */
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;
13413 
13414  /* "View.MemoryView":629
13415  * cdef __Pyx_memviewslice tmp
13416  * mslice = get_slice_from_memview(self, &tmp)
13417  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
13418  *
13419  * def copy(self):
13420  */
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;
13425  __pyx_t_2 = 0;
13426  goto __pyx_L0;
13427 
13428  /* "View.MemoryView":625
13429  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13430  *
13431  * def is_f_contig(self): # <<<<<<<<<<<<<<
13432  * cdef __Pyx_memviewslice *mslice
13433  * cdef __Pyx_memviewslice tmp
13434  */
13435 
13436  /* function exit code */
13437  __pyx_L1_error:;
13438  __Pyx_XDECREF(__pyx_t_2);
13439  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13440  __pyx_r = NULL;
13441  __pyx_L0:;
13442  __Pyx_XGIVEREF(__pyx_r);
13443  __Pyx_RefNannyFinishContext();
13444  return __pyx_r;
13445 }
13446 
13447 /* "View.MemoryView":631
13448  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13449  *
13450  * def copy(self): # <<<<<<<<<<<<<<
13451  * cdef __Pyx_memviewslice mslice
13452  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13453  */
13454 
13455 /* Python wrapper */
13456 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
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));
13462 
13463  /* function exit code */
13464  __Pyx_RefNannyFinishContext();
13465  return __pyx_r;
13466 }
13467 
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;
13470  int __pyx_v_flags;
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);
13479 
13480  /* "View.MemoryView":633
13481  * def copy(self):
13482  * cdef __Pyx_memviewslice mslice
13483  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
13484  *
13485  * slice_copy(self, &mslice)
13486  */
13487  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
13488 
13489  /* "View.MemoryView":635
13490  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13491  *
13492  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
13493  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
13494  * self.view.itemsize,
13495  */
13496  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
13497 
13498  /* "View.MemoryView":636
13499  *
13500  * slice_copy(self, &mslice)
13501  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
13502  * self.view.itemsize,
13503  * flags|PyBUF_C_CONTIGUOUS,
13504  */
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;
13507 
13508  /* "View.MemoryView":641
13509  * self.dtype_is_object)
13510  *
13511  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
13512  *
13513  * def copy_fortran(self):
13514  */
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;
13519  __pyx_t_2 = 0;
13520  goto __pyx_L0;
13521 
13522  /* "View.MemoryView":631
13523  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13524  *
13525  * def copy(self): # <<<<<<<<<<<<<<
13526  * cdef __Pyx_memviewslice mslice
13527  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13528  */
13529 
13530  /* function exit code */
13531  __pyx_L1_error:;
13532  __Pyx_XDECREF(__pyx_t_2);
13533  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
13534  __pyx_r = NULL;
13535  __pyx_L0:;
13536  __Pyx_XGIVEREF(__pyx_r);
13537  __Pyx_RefNannyFinishContext();
13538  return __pyx_r;
13539 }
13540 
13541 /* "View.MemoryView":643
13542  * return memoryview_copy_from_slice(self, &mslice)
13543  *
13544  * def copy_fortran(self): # <<<<<<<<<<<<<<
13545  * cdef __Pyx_memviewslice src, dst
13546  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13547  */
13548 
13549 /* Python wrapper */
13550 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
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));
13556 
13557  /* function exit code */
13558  __Pyx_RefNannyFinishContext();
13559  return __pyx_r;
13560 }
13561 
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;
13565  int __pyx_v_flags;
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);
13574 
13575  /* "View.MemoryView":645
13576  * def copy_fortran(self):
13577  * cdef __Pyx_memviewslice src, dst
13578  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
13579  *
13580  * slice_copy(self, &src)
13581  */
13582  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
13583 
13584  /* "View.MemoryView":647
13585  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13586  *
13587  * slice_copy(self, &src) # <<<<<<<<<<<<<<
13588  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
13589  * self.view.itemsize,
13590  */
13591  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
13592 
13593  /* "View.MemoryView":648
13594  *
13595  * slice_copy(self, &src)
13596  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
13597  * self.view.itemsize,
13598  * flags|PyBUF_F_CONTIGUOUS,
13599  */
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;
13602 
13603  /* "View.MemoryView":653
13604  * self.dtype_is_object)
13605  *
13606  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
13607  *
13608  *
13609  */
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;
13614  __pyx_t_2 = 0;
13615  goto __pyx_L0;
13616 
13617  /* "View.MemoryView":643
13618  * return memoryview_copy_from_slice(self, &mslice)
13619  *
13620  * def copy_fortran(self): # <<<<<<<<<<<<<<
13621  * cdef __Pyx_memviewslice src, dst
13622  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13623  */
13624 
13625  /* function exit code */
13626  __pyx_L1_error:;
13627  __Pyx_XDECREF(__pyx_t_2);
13628  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
13629  __pyx_r = NULL;
13630  __pyx_L0:;
13631  __Pyx_XGIVEREF(__pyx_r);
13632  __Pyx_RefNannyFinishContext();
13633  return __pyx_r;
13634 }
13635 
13636 /* "(tree fragment)":1
13637  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13638  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13639  * def __setstate_cython__(self, __pyx_state):
13640  */
13641 
13642 /* Python wrapper */
13643 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
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));
13649 
13650  /* function exit code */
13651  __Pyx_RefNannyFinishContext();
13652  return __pyx_r;
13653 }
13654 
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);
13663 
13664  /* "(tree fragment)":2
13665  * def __reduce_cython__(self):
13666  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
13667  * def __setstate_cython__(self, __pyx_state):
13668  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13669  */
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)
13675 
13676  /* "(tree fragment)":1
13677  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13678  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13679  * def __setstate_cython__(self, __pyx_state):
13680  */
13681 
13682  /* function exit code */
13683  __pyx_L1_error:;
13684  __Pyx_XDECREF(__pyx_t_1);
13685  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13686  __pyx_r = NULL;
13687  __Pyx_XGIVEREF(__pyx_r);
13688  __Pyx_RefNannyFinishContext();
13689  return __pyx_r;
13690 }
13691 
13692 /* "(tree fragment)":3
13693  * def __reduce_cython__(self):
13694  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13695  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13696  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13697  */
13698 
13699 /* Python wrapper */
13700 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
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));
13706 
13707  /* function exit code */
13708  __Pyx_RefNannyFinishContext();
13709  return __pyx_r;
13710 }
13711 
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);
13720 
13721  /* "(tree fragment)":4
13722  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13723  * def __setstate_cython__(self, __pyx_state):
13724  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
13725  */
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)
13731 
13732  /* "(tree fragment)":3
13733  * def __reduce_cython__(self):
13734  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13735  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13736  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13737  */
13738 
13739  /* function exit code */
13740  __pyx_L1_error:;
13741  __Pyx_XDECREF(__pyx_t_1);
13742  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13743  __pyx_r = NULL;
13744  __Pyx_XGIVEREF(__pyx_r);
13745  __Pyx_RefNannyFinishContext();
13746  return __pyx_r;
13747 }
13748 
13749 /* "View.MemoryView":657
13750  *
13751  * @cname('__pyx_memoryview_new')
13752  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
13753  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13754  * result.typeinfo = typeinfo
13755  */
13756 
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);
13768 
13769  /* "View.MemoryView":658
13770  * @cname('__pyx_memoryview_new')
13771  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
13772  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
13773  * result.typeinfo = typeinfo
13774  * return result
13775  */
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);
13789  __pyx_t_1 = 0;
13790  __pyx_t_2 = 0;
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);
13795  __pyx_t_2 = 0;
13796 
13797  /* "View.MemoryView":659
13798  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
13799  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13800  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
13801  * return result
13802  *
13803  */
13804  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
13805 
13806  /* "View.MemoryView":660
13807  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13808  * result.typeinfo = typeinfo
13809  * return result # <<<<<<<<<<<<<<
13810  *
13811  * @cname('__pyx_memoryview_check')
13812  */
13813  __Pyx_XDECREF(__pyx_r);
13814  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13815  __pyx_r = ((PyObject *)__pyx_v_result);
13816  goto __pyx_L0;
13817 
13818  /* "View.MemoryView":657
13819  *
13820  * @cname('__pyx_memoryview_new')
13821  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
13822  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13823  * result.typeinfo = typeinfo
13824  */
13825 
13826  /* function exit code */
13827  __pyx_L1_error:;
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);
13832  __pyx_r = 0;
13833  __pyx_L0:;
13834  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13835  __Pyx_XGIVEREF(__pyx_r);
13836  __Pyx_RefNannyFinishContext();
13837  return __pyx_r;
13838 }
13839 
13840 /* "View.MemoryView":663
13841  *
13842  * @cname('__pyx_memoryview_check')
13843  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
13844  * return isinstance(o, memoryview)
13845  *
13846  */
13847 
13848 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
13849  int __pyx_r;
13850  __Pyx_RefNannyDeclarations
13851  int __pyx_t_1;
13852  __Pyx_RefNannySetupContext("memoryview_check", 0);
13853 
13854  /* "View.MemoryView":664
13855  * @cname('__pyx_memoryview_check')
13856  * cdef inline bint memoryview_check(object o):
13857  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
13858  *
13859  * cdef tuple _unellipsify(object index, int ndim):
13860  */
13861  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
13862  __pyx_r = __pyx_t_1;
13863  goto __pyx_L0;
13864 
13865  /* "View.MemoryView":663
13866  *
13867  * @cname('__pyx_memoryview_check')
13868  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
13869  * return isinstance(o, memoryview)
13870  *
13871  */
13872 
13873  /* function exit code */
13874  __pyx_L0:;
13875  __Pyx_RefNannyFinishContext();
13876  return __pyx_r;
13877 }
13878 
13879 /* "View.MemoryView":666
13880  * return isinstance(o, memoryview)
13881  *
13882  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13883  * """
13884  * Replace all ellipses with full slices and fill incomplete indices with
13885  */
13886 
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
13897  int __pyx_t_1;
13898  int __pyx_t_2;
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;
13905  int __pyx_t_9;
13906  int __pyx_t_10;
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);
13912 
13913  /* "View.MemoryView":671
13914  * full slices.
13915  * """
13916  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
13917  * tup = (index,)
13918  * else:
13919  */
13920  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
13921  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
13922  if (__pyx_t_2) {
13923 
13924  /* "View.MemoryView":672
13925  * """
13926  * if not isinstance(index, tuple):
13927  * tup = (index,) # <<<<<<<<<<<<<<
13928  * else:
13929  * tup = index
13930  */
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;
13937  __pyx_t_3 = 0;
13938 
13939  /* "View.MemoryView":671
13940  * full slices.
13941  * """
13942  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
13943  * tup = (index,)
13944  * else:
13945  */
13946  goto __pyx_L3;
13947  }
13948 
13949  /* "View.MemoryView":674
13950  * tup = (index,)
13951  * else:
13952  * tup = index # <<<<<<<<<<<<<<
13953  *
13954  * result = []
13955  */
13956  /*else*/ {
13957  __Pyx_INCREF(__pyx_v_index);
13958  __pyx_v_tup = __pyx_v_index;
13959  }
13960  __pyx_L3:;
13961 
13962  /* "View.MemoryView":676
13963  * tup = index
13964  *
13965  * result = [] # <<<<<<<<<<<<<<
13966  * have_slices = False
13967  * seen_ellipsis = False
13968  */
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);
13972  __pyx_t_3 = 0;
13973 
13974  /* "View.MemoryView":677
13975  *
13976  * result = []
13977  * have_slices = False # <<<<<<<<<<<<<<
13978  * seen_ellipsis = False
13979  * for idx, item in enumerate(tup):
13980  */
13981  __pyx_v_have_slices = 0;
13982 
13983  /* "View.MemoryView":678
13984  * result = []
13985  * have_slices = False
13986  * seen_ellipsis = False # <<<<<<<<<<<<<<
13987  * for idx, item in enumerate(tup):
13988  * if item is Ellipsis:
13989  */
13990  __pyx_v_seen_ellipsis = 0;
13991 
13992  /* "View.MemoryView":679
13993  * have_slices = False
13994  * seen_ellipsis = False
13995  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
13996  * if item is Ellipsis:
13997  * if not seen_ellipsis:
13998  */
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;
14003  __pyx_t_6 = NULL;
14004  } else {
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)
14008  }
14009  for (;;) {
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)
14015  #else
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);
14018  #endif
14019  } else {
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)
14023  #else
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);
14026  #endif
14027  }
14028  } else {
14029  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14030  if (unlikely(!__pyx_t_7)) {
14031  PyObject* exc_type = PyErr_Occurred();
14032  if (exc_type) {
14033  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14034  else __PYX_ERR(1, 679, __pyx_L1_error)
14035  }
14036  break;
14037  }
14038  __Pyx_GOTREF(__pyx_t_7);
14039  }
14040  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14041  __pyx_t_7 = 0;
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;
14048  __pyx_t_7 = 0;
14049 
14050  /* "View.MemoryView":680
14051  * seen_ellipsis = False
14052  * for idx, item in enumerate(tup):
14053  * if item is Ellipsis: # <<<<<<<<<<<<<<
14054  * if not seen_ellipsis:
14055  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14056  */
14057  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14058  __pyx_t_1 = (__pyx_t_2 != 0);
14059  if (__pyx_t_1) {
14060 
14061  /* "View.MemoryView":681
14062  * for idx, item in enumerate(tup):
14063  * if item is Ellipsis:
14064  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14065  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14066  * seen_ellipsis = True
14067  */
14068  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14069  if (__pyx_t_1) {
14070 
14071  /* "View.MemoryView":682
14072  * if item is Ellipsis:
14073  * if not seen_ellipsis:
14074  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
14075  * seen_ellipsis = True
14076  * else:
14077  */
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);
14086  }
14087  }
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;
14090 
14091  /* "View.MemoryView":683
14092  * if not seen_ellipsis:
14093  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14094  * seen_ellipsis = True # <<<<<<<<<<<<<<
14095  * else:
14096  * result.append(slice(None))
14097  */
14098  __pyx_v_seen_ellipsis = 1;
14099 
14100  /* "View.MemoryView":681
14101  * for idx, item in enumerate(tup):
14102  * if item is Ellipsis:
14103  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14104  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14105  * seen_ellipsis = True
14106  */
14107  goto __pyx_L7;
14108  }
14109 
14110  /* "View.MemoryView":685
14111  * seen_ellipsis = True
14112  * else:
14113  * result.append(slice(None)) # <<<<<<<<<<<<<<
14114  * have_slices = True
14115  * else:
14116  */
14117  /*else*/ {
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)
14119  }
14120  __pyx_L7:;
14121 
14122  /* "View.MemoryView":686
14123  * else:
14124  * result.append(slice(None))
14125  * have_slices = True # <<<<<<<<<<<<<<
14126  * else:
14127  * if not isinstance(item, slice) and not PyIndex_Check(item):
14128  */
14129  __pyx_v_have_slices = 1;
14130 
14131  /* "View.MemoryView":680
14132  * seen_ellipsis = False
14133  * for idx, item in enumerate(tup):
14134  * if item is Ellipsis: # <<<<<<<<<<<<<<
14135  * if not seen_ellipsis:
14136  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14137  */
14138  goto __pyx_L6;
14139  }
14140 
14141  /* "View.MemoryView":688
14142  * have_slices = True
14143  * else:
14144  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14145  * raise TypeError("Cannot index with type '%s'" % type(item))
14146  *
14147  */
14148  /*else*/ {
14149  __pyx_t_2 = PySlice_Check(__pyx_v_item);
14150  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14151  if (__pyx_t_10) {
14152  } else {
14153  __pyx_t_1 = __pyx_t_10;
14154  goto __pyx_L9_bool_binop_done;
14155  }
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)) {
14160 
14161  /* "View.MemoryView":689
14162  * else:
14163  * if not isinstance(item, slice) and not PyIndex_Check(item):
14164  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
14165  *
14166  * have_slices = have_slices or isinstance(item, slice)
14167  */
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)
14176 
14177  /* "View.MemoryView":688
14178  * have_slices = True
14179  * else:
14180  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14181  * raise TypeError("Cannot index with type '%s'" % type(item))
14182  *
14183  */
14184  }
14185 
14186  /* "View.MemoryView":691
14187  * raise TypeError("Cannot index with type '%s'" % type(item))
14188  *
14189  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
14190  * result.append(item)
14191  *
14192  */
14193  __pyx_t_10 = (__pyx_v_have_slices != 0);
14194  if (!__pyx_t_10) {
14195  } else {
14196  __pyx_t_1 = __pyx_t_10;
14197  goto __pyx_L11_bool_binop_done;
14198  }
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;
14204 
14205  /* "View.MemoryView":692
14206  *
14207  * have_slices = have_slices or isinstance(item, slice)
14208  * result.append(item) # <<<<<<<<<<<<<<
14209  *
14210  * nslices = ndim - len(result)
14211  */
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)
14213  }
14214  __pyx_L6:;
14215 
14216  /* "View.MemoryView":679
14217  * have_slices = False
14218  * seen_ellipsis = False
14219  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14220  * if item is Ellipsis:
14221  * if not seen_ellipsis:
14222  */
14223  }
14224  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14225  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14226 
14227  /* "View.MemoryView":694
14228  * result.append(item)
14229  *
14230  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
14231  * if nslices:
14232  * result.extend([slice(None)] * nslices)
14233  */
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);
14236 
14237  /* "View.MemoryView":695
14238  *
14239  * nslices = ndim - len(result)
14240  * if nslices: # <<<<<<<<<<<<<<
14241  * result.extend([slice(None)] * nslices)
14242  *
14243  */
14244  __pyx_t_1 = (__pyx_v_nslices != 0);
14245  if (__pyx_t_1) {
14246 
14247  /* "View.MemoryView":696
14248  * nslices = ndim - len(result)
14249  * if nslices:
14250  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
14251  *
14252  * return have_slices or nslices, tuple(result)
14253  */
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);
14261  }
14262  }
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;
14265 
14266  /* "View.MemoryView":695
14267  *
14268  * nslices = ndim - len(result)
14269  * if nslices: # <<<<<<<<<<<<<<
14270  * result.extend([slice(None)] * nslices)
14271  *
14272  */
14273  }
14274 
14275  /* "View.MemoryView":698
14276  * result.extend([slice(None)] * nslices)
14277  *
14278  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
14279  *
14280  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14281  */
14282  __Pyx_XDECREF(__pyx_r);
14283  if (!__pyx_v_have_slices) {
14284  } else {
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;
14288  __pyx_t_4 = 0;
14289  goto __pyx_L14_bool_binop_done;
14290  }
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;
14294  __pyx_t_4 = 0;
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);
14304  __pyx_t_3 = 0;
14305  __pyx_t_4 = 0;
14306  __pyx_r = ((PyObject*)__pyx_t_11);
14307  __pyx_t_11 = 0;
14308  goto __pyx_L0;
14309 
14310  /* "View.MemoryView":666
14311  * return isinstance(o, memoryview)
14312  *
14313  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14314  * """
14315  * Replace all ellipses with full slices and fill incomplete indices with
14316  */
14317 
14318  /* function exit code */
14319  __pyx_L1_error:;
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);
14325  __pyx_r = 0;
14326  __pyx_L0:;
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();
14333  return __pyx_r;
14334 }
14335 
14336 /* "View.MemoryView":700
14337  * return have_slices or nslices, tuple(result)
14338  *
14339  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
14340  * for suboffset in suboffsets[:ndim]:
14341  * if suboffset >= 0:
14342  */
14343 
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;
14351  int __pyx_t_4;
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);
14357 
14358  /* "View.MemoryView":701
14359  *
14360  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14361  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
14362  * if suboffset >= 0:
14363  * raise ValueError("Indirect dimensions not supported")
14364  */
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]);
14369 
14370  /* "View.MemoryView":702
14371  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14372  * for suboffset in suboffsets[:ndim]:
14373  * if suboffset >= 0: # <<<<<<<<<<<<<<
14374  * raise ValueError("Indirect dimensions not supported")
14375  *
14376  */
14377  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
14378  if (unlikely(__pyx_t_4)) {
14379 
14380  /* "View.MemoryView":703
14381  * for suboffset in suboffsets[:ndim]:
14382  * if suboffset >= 0:
14383  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
14384  *
14385  *
14386  */
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)
14392 
14393  /* "View.MemoryView":702
14394  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14395  * for suboffset in suboffsets[:ndim]:
14396  * if suboffset >= 0: # <<<<<<<<<<<<<<
14397  * raise ValueError("Indirect dimensions not supported")
14398  *
14399  */
14400  }
14401  }
14402 
14403  /* "View.MemoryView":700
14404  * return have_slices or nslices, tuple(result)
14405  *
14406  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
14407  * for suboffset in suboffsets[:ndim]:
14408  * if suboffset >= 0:
14409  */
14410 
14411  /* function exit code */
14412  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14413  goto __pyx_L0;
14414  __pyx_L1_error:;
14415  __Pyx_XDECREF(__pyx_t_5);
14416  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
14417  __pyx_r = 0;
14418  __pyx_L0:;
14419  __Pyx_XGIVEREF(__pyx_r);
14420  __Pyx_RefNannyFinishContext();
14421  return __pyx_r;
14422 }
14423 
14424 /* "View.MemoryView":710
14425  *
14426  * @cname('__pyx_memview_slice')
14427  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
14428  * cdef int new_ndim = 0, suboffset_dim = -1, dim
14429  * cdef bint negative_step
14430  */
14431 
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;
14435  int __pyx_v_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
14451  int __pyx_t_1;
14452  int __pyx_t_2;
14453  PyObject *__pyx_t_3 = NULL;
14454  struct __pyx_memoryview_obj *__pyx_t_4;
14455  char *__pyx_t_5;
14456  int __pyx_t_6;
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;
14461  int __pyx_t_11;
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);
14467 
14468  /* "View.MemoryView":711
14469  * @cname('__pyx_memview_slice')
14470  * cdef memoryview memview_slice(memoryview memview, object indices):
14471  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
14472  * cdef bint negative_step
14473  * cdef __Pyx_memviewslice src, dst
14474  */
14475  __pyx_v_new_ndim = 0;
14476  __pyx_v_suboffset_dim = -1;
14477 
14478  /* "View.MemoryView":718
14479  *
14480  *
14481  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
14482  *
14483  * cdef _memoryviewslice memviewsliceobj
14484  */
14485  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
14486 
14487  /* "View.MemoryView":722
14488  * cdef _memoryviewslice memviewsliceobj
14489  *
14490  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
14491  *
14492  * if isinstance(memview, _memoryviewslice):
14493  */
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)
14499  }
14500  }
14501  #endif
14502 
14503  /* "View.MemoryView":724
14504  * assert memview.view.ndim > 0
14505  *
14506  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14507  * memviewsliceobj = memview
14508  * p_src = &memviewsliceobj.from_slice
14509  */
14510  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14511  __pyx_t_2 = (__pyx_t_1 != 0);
14512  if (__pyx_t_2) {
14513 
14514  /* "View.MemoryView":725
14515  *
14516  * if isinstance(memview, _memoryviewslice):
14517  * memviewsliceobj = memview # <<<<<<<<<<<<<<
14518  * p_src = &memviewsliceobj.from_slice
14519  * else:
14520  */
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);
14525  __pyx_t_3 = 0;
14526 
14527  /* "View.MemoryView":726
14528  * if isinstance(memview, _memoryviewslice):
14529  * memviewsliceobj = memview
14530  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
14531  * else:
14532  * slice_copy(memview, &src)
14533  */
14534  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
14535 
14536  /* "View.MemoryView":724
14537  * assert memview.view.ndim > 0
14538  *
14539  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14540  * memviewsliceobj = memview
14541  * p_src = &memviewsliceobj.from_slice
14542  */
14543  goto __pyx_L3;
14544  }
14545 
14546  /* "View.MemoryView":728
14547  * p_src = &memviewsliceobj.from_slice
14548  * else:
14549  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
14550  * p_src = &src
14551  *
14552  */
14553  /*else*/ {
14554  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
14555 
14556  /* "View.MemoryView":729
14557  * else:
14558  * slice_copy(memview, &src)
14559  * p_src = &src # <<<<<<<<<<<<<<
14560  *
14561  *
14562  */
14563  __pyx_v_p_src = (&__pyx_v_src);
14564  }
14565  __pyx_L3:;
14566 
14567  /* "View.MemoryView":735
14568  *
14569  *
14570  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
14571  * dst.data = p_src.data
14572  *
14573  */
14574  __pyx_t_4 = __pyx_v_p_src->memview;
14575  __pyx_v_dst.memview = __pyx_t_4;
14576 
14577  /* "View.MemoryView":736
14578  *
14579  * dst.memview = p_src.memview
14580  * dst.data = p_src.data # <<<<<<<<<<<<<<
14581  *
14582  *
14583  */
14584  __pyx_t_5 = __pyx_v_p_src->data;
14585  __pyx_v_dst.data = __pyx_t_5;
14586 
14587  /* "View.MemoryView":741
14588  *
14589  *
14590  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
14591  * cdef int *p_suboffset_dim = &suboffset_dim
14592  * cdef Py_ssize_t start, stop, step
14593  */
14594  __pyx_v_p_dst = (&__pyx_v_dst);
14595 
14596  /* "View.MemoryView":742
14597  *
14598  * cdef __Pyx_memviewslice *p_dst = &dst
14599  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
14600  * cdef Py_ssize_t start, stop, step
14601  * cdef bint have_start, have_stop, have_step
14602  */
14603  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
14604 
14605  /* "View.MemoryView":746
14606  * cdef bint have_start, have_stop, have_step
14607  *
14608  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14609  * if PyIndex_Check(index):
14610  * slice_memviewslice(
14611  */
14612  __pyx_t_6 = 0;
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;
14615  __pyx_t_8 = NULL;
14616  } else {
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)
14620  }
14621  for (;;) {
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)
14627  #else
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);
14630  #endif
14631  } else {
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)
14635  #else
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);
14638  #endif
14639  }
14640  } else {
14641  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
14642  if (unlikely(!__pyx_t_9)) {
14643  PyObject* exc_type = PyErr_Occurred();
14644  if (exc_type) {
14645  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14646  else __PYX_ERR(1, 746, __pyx_L1_error)
14647  }
14648  break;
14649  }
14650  __Pyx_GOTREF(__pyx_t_9);
14651  }
14652  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
14653  __pyx_t_9 = 0;
14654  __pyx_v_dim = __pyx_t_6;
14655  __pyx_t_6 = (__pyx_t_6 + 1);
14656 
14657  /* "View.MemoryView":747
14658  *
14659  * for dim, index in enumerate(indices):
14660  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
14661  * slice_memviewslice(
14662  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14663  */
14664  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
14665  if (__pyx_t_2) {
14666 
14667  /* "View.MemoryView":751
14668  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14669  * dim, new_ndim, p_suboffset_dim,
14670  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
14671  * 0, 0, 0, # have_{start,stop,step}
14672  * False)
14673  */
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)
14675 
14676  /* "View.MemoryView":748
14677  * for dim, index in enumerate(indices):
14678  * if PyIndex_Check(index):
14679  * slice_memviewslice( # <<<<<<<<<<<<<<
14680  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14681  * dim, new_ndim, p_suboffset_dim,
14682  */
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)
14684 
14685  /* "View.MemoryView":747
14686  *
14687  * for dim, index in enumerate(indices):
14688  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
14689  * slice_memviewslice(
14690  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14691  */
14692  goto __pyx_L6;
14693  }
14694 
14695  /* "View.MemoryView":754
14696  * 0, 0, 0, # have_{start,stop,step}
14697  * False)
14698  * elif index is None: # <<<<<<<<<<<<<<
14699  * p_dst.shape[new_ndim] = 1
14700  * p_dst.strides[new_ndim] = 0
14701  */
14702  __pyx_t_2 = (__pyx_v_index == Py_None);
14703  __pyx_t_1 = (__pyx_t_2 != 0);
14704  if (__pyx_t_1) {
14705 
14706  /* "View.MemoryView":755
14707  * False)
14708  * elif index is None:
14709  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
14710  * p_dst.strides[new_ndim] = 0
14711  * p_dst.suboffsets[new_ndim] = -1
14712  */
14713  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
14714 
14715  /* "View.MemoryView":756
14716  * elif index is None:
14717  * p_dst.shape[new_ndim] = 1
14718  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
14719  * p_dst.suboffsets[new_ndim] = -1
14720  * new_ndim += 1
14721  */
14722  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
14723 
14724  /* "View.MemoryView":757
14725  * p_dst.shape[new_ndim] = 1
14726  * p_dst.strides[new_ndim] = 0
14727  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
14728  * new_ndim += 1
14729  * else:
14730  */
14731  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
14732 
14733  /* "View.MemoryView":758
14734  * p_dst.strides[new_ndim] = 0
14735  * p_dst.suboffsets[new_ndim] = -1
14736  * new_ndim += 1 # <<<<<<<<<<<<<<
14737  * else:
14738  * start = index.start or 0
14739  */
14740  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14741 
14742  /* "View.MemoryView":754
14743  * 0, 0, 0, # have_{start,stop,step}
14744  * False)
14745  * elif index is None: # <<<<<<<<<<<<<<
14746  * p_dst.shape[new_ndim] = 1
14747  * p_dst.strides[new_ndim] = 0
14748  */
14749  goto __pyx_L6;
14750  }
14751 
14752  /* "View.MemoryView":760
14753  * new_ndim += 1
14754  * else:
14755  * start = index.start or 0 # <<<<<<<<<<<<<<
14756  * stop = index.stop or 0
14757  * step = index.step or 0
14758  */
14759  /*else*/ {
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)
14763  if (!__pyx_t_1) {
14764  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14765  } else {
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;
14770  }
14771  __pyx_t_10 = 0;
14772  __pyx_L7_bool_binop_done:;
14773  __pyx_v_start = __pyx_t_10;
14774 
14775  /* "View.MemoryView":761
14776  * else:
14777  * start = index.start or 0
14778  * stop = index.stop or 0 # <<<<<<<<<<<<<<
14779  * step = index.step or 0
14780  *
14781  */
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)
14785  if (!__pyx_t_1) {
14786  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14787  } else {
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;
14792  }
14793  __pyx_t_10 = 0;
14794  __pyx_L9_bool_binop_done:;
14795  __pyx_v_stop = __pyx_t_10;
14796 
14797  /* "View.MemoryView":762
14798  * start = index.start or 0
14799  * stop = index.stop or 0
14800  * step = index.step or 0 # <<<<<<<<<<<<<<
14801  *
14802  * have_start = index.start is not None
14803  */
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)
14807  if (!__pyx_t_1) {
14808  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14809  } else {
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;
14814  }
14815  __pyx_t_10 = 0;
14816  __pyx_L11_bool_binop_done:;
14817  __pyx_v_step = __pyx_t_10;
14818 
14819  /* "View.MemoryView":764
14820  * step = index.step or 0
14821  *
14822  * have_start = index.start is not None # <<<<<<<<<<<<<<
14823  * have_stop = index.stop is not None
14824  * have_step = index.step is not None
14825  */
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;
14831 
14832  /* "View.MemoryView":765
14833  *
14834  * have_start = index.start is not None
14835  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
14836  * have_step = index.step is not None
14837  *
14838  */
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;
14844 
14845  /* "View.MemoryView":766
14846  * have_start = index.start is not None
14847  * have_stop = index.stop is not None
14848  * have_step = index.step is not None # <<<<<<<<<<<<<<
14849  *
14850  * slice_memviewslice(
14851  */
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;
14857 
14858  /* "View.MemoryView":768
14859  * have_step = index.step is not None
14860  *
14861  * slice_memviewslice( # <<<<<<<<<<<<<<
14862  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14863  * dim, new_ndim, p_suboffset_dim,
14864  */
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)
14866 
14867  /* "View.MemoryView":774
14868  * have_start, have_stop, have_step,
14869  * True)
14870  * new_ndim += 1 # <<<<<<<<<<<<<<
14871  *
14872  * if isinstance(memview, _memoryviewslice):
14873  */
14874  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14875  }
14876  __pyx_L6:;
14877 
14878  /* "View.MemoryView":746
14879  * cdef bint have_start, have_stop, have_step
14880  *
14881  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14882  * if PyIndex_Check(index):
14883  * slice_memviewslice(
14884  */
14885  }
14886  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14887 
14888  /* "View.MemoryView":776
14889  * new_ndim += 1
14890  *
14891  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14892  * return memoryview_fromslice(dst, new_ndim,
14893  * memviewsliceobj.to_object_func,
14894  */
14895  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14896  __pyx_t_2 = (__pyx_t_1 != 0);
14897  if (__pyx_t_2) {
14898 
14899  /* "View.MemoryView":777
14900  *
14901  * if isinstance(memview, _memoryviewslice):
14902  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
14903  * memviewsliceobj.to_object_func,
14904  * memviewsliceobj.to_dtype_func,
14905  */
14906  __Pyx_XDECREF(((PyObject *)__pyx_r));
14907 
14908  /* "View.MemoryView":778
14909  * if isinstance(memview, _memoryviewslice):
14910  * return memoryview_fromslice(dst, new_ndim,
14911  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
14912  * memviewsliceobj.to_dtype_func,
14913  * memview.dtype_is_object)
14914  */
14915  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
14916 
14917  /* "View.MemoryView":779
14918  * return memoryview_fromslice(dst, new_ndim,
14919  * memviewsliceobj.to_object_func,
14920  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
14921  * memview.dtype_is_object)
14922  * else:
14923  */
14924  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
14925 
14926  /* "View.MemoryView":777
14927  *
14928  * if isinstance(memview, _memoryviewslice):
14929  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
14930  * memviewsliceobj.to_object_func,
14931  * memviewsliceobj.to_dtype_func,
14932  */
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);
14937  __pyx_t_3 = 0;
14938  goto __pyx_L0;
14939 
14940  /* "View.MemoryView":776
14941  * new_ndim += 1
14942  *
14943  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14944  * return memoryview_fromslice(dst, new_ndim,
14945  * memviewsliceobj.to_object_func,
14946  */
14947  }
14948 
14949  /* "View.MemoryView":782
14950  * memview.dtype_is_object)
14951  * else:
14952  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14953  * memview.dtype_is_object)
14954  *
14955  */
14956  /*else*/ {
14957  __Pyx_XDECREF(((PyObject *)__pyx_r));
14958 
14959  /* "View.MemoryView":783
14960  * else:
14961  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
14962  * memview.dtype_is_object) # <<<<<<<<<<<<<<
14963  *
14964  *
14965  */
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);
14968 
14969  /* "View.MemoryView":782
14970  * memview.dtype_is_object)
14971  * else:
14972  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14973  * memview.dtype_is_object)
14974  *
14975  */
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);
14978  __pyx_t_3 = 0;
14979  goto __pyx_L0;
14980  }
14981 
14982  /* "View.MemoryView":710
14983  *
14984  * @cname('__pyx_memview_slice')
14985  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
14986  * cdef int new_ndim = 0, suboffset_dim = -1, dim
14987  * cdef bint negative_step
14988  */
14989 
14990  /* function exit code */
14991  __pyx_L1_error:;
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);
14995  __pyx_r = 0;
14996  __pyx_L0:;
14997  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
14998  __Pyx_XDECREF(__pyx_v_index);
14999  __Pyx_XGIVEREF((PyObject *)__pyx_r);
15000  __Pyx_RefNannyFinishContext();
15001  return __pyx_r;
15002 }
15003 
15004 /* "View.MemoryView":807
15005  *
15006  * @cname('__pyx_memoryview_slice_memviewslice')
15007  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15008  * __Pyx_memviewslice *dst,
15009  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15010  */
15011 
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;
15015  int __pyx_r;
15016  int __pyx_t_1;
15017  int __pyx_t_2;
15018  int __pyx_t_3;
15019  int __pyx_lineno = 0;
15020  const char *__pyx_filename = NULL;
15021  int __pyx_clineno = 0;
15022 
15023  /* "View.MemoryView":827
15024  * cdef bint negative_step
15025  *
15026  * if not is_slice: # <<<<<<<<<<<<<<
15027  *
15028  * if start < 0:
15029  */
15030  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15031  if (__pyx_t_1) {
15032 
15033  /* "View.MemoryView":829
15034  * if not is_slice:
15035  *
15036  * if start < 0: # <<<<<<<<<<<<<<
15037  * start += shape
15038  * if not 0 <= start < shape:
15039  */
15040  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15041  if (__pyx_t_1) {
15042 
15043  /* "View.MemoryView":830
15044  *
15045  * if start < 0:
15046  * start += shape # <<<<<<<<<<<<<<
15047  * if not 0 <= start < shape:
15048  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15049  */
15050  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15051 
15052  /* "View.MemoryView":829
15053  * if not is_slice:
15054  *
15055  * if start < 0: # <<<<<<<<<<<<<<
15056  * start += shape
15057  * if not 0 <= start < shape:
15058  */
15059  }
15060 
15061  /* "View.MemoryView":831
15062  * if start < 0:
15063  * start += shape
15064  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15065  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15066  * else:
15067  */
15068  __pyx_t_1 = (0 <= __pyx_v_start);
15069  if (__pyx_t_1) {
15070  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15071  }
15072  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15073  if (__pyx_t_2) {
15074 
15075  /* "View.MemoryView":832
15076  * start += shape
15077  * if not 0 <= start < shape:
15078  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
15079  * else:
15080  *
15081  */
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)
15083 
15084  /* "View.MemoryView":831
15085  * if start < 0:
15086  * start += shape
15087  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15088  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15089  * else:
15090  */
15091  }
15092 
15093  /* "View.MemoryView":827
15094  * cdef bint negative_step
15095  *
15096  * if not is_slice: # <<<<<<<<<<<<<<
15097  *
15098  * if start < 0:
15099  */
15100  goto __pyx_L3;
15101  }
15102 
15103  /* "View.MemoryView":835
15104  * else:
15105  *
15106  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
15107  *
15108  * if have_step and step == 0:
15109  */
15110  /*else*/ {
15111  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15112  if (__pyx_t_1) {
15113  } else {
15114  __pyx_t_2 = __pyx_t_1;
15115  goto __pyx_L6_bool_binop_done;
15116  }
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;
15121 
15122  /* "View.MemoryView":837
15123  * negative_step = have_step != 0 and step < 0
15124  *
15125  * if have_step and step == 0: # <<<<<<<<<<<<<<
15126  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15127  *
15128  */
15129  __pyx_t_1 = (__pyx_v_have_step != 0);
15130  if (__pyx_t_1) {
15131  } else {
15132  __pyx_t_2 = __pyx_t_1;
15133  goto __pyx_L9_bool_binop_done;
15134  }
15135  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15136  __pyx_t_2 = __pyx_t_1;
15137  __pyx_L9_bool_binop_done:;
15138  if (__pyx_t_2) {
15139 
15140  /* "View.MemoryView":838
15141  *
15142  * if have_step and step == 0:
15143  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
15144  *
15145  *
15146  */
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)
15148 
15149  /* "View.MemoryView":837
15150  * negative_step = have_step != 0 and step < 0
15151  *
15152  * if have_step and step == 0: # <<<<<<<<<<<<<<
15153  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15154  *
15155  */
15156  }
15157 
15158  /* "View.MemoryView":841
15159  *
15160  *
15161  * if have_start: # <<<<<<<<<<<<<<
15162  * if start < 0:
15163  * start += shape
15164  */
15165  __pyx_t_2 = (__pyx_v_have_start != 0);
15166  if (__pyx_t_2) {
15167 
15168  /* "View.MemoryView":842
15169  *
15170  * if have_start:
15171  * if start < 0: # <<<<<<<<<<<<<<
15172  * start += shape
15173  * if start < 0:
15174  */
15175  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15176  if (__pyx_t_2) {
15177 
15178  /* "View.MemoryView":843
15179  * if have_start:
15180  * if start < 0:
15181  * start += shape # <<<<<<<<<<<<<<
15182  * if start < 0:
15183  * start = 0
15184  */
15185  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15186 
15187  /* "View.MemoryView":844
15188  * if start < 0:
15189  * start += shape
15190  * if start < 0: # <<<<<<<<<<<<<<
15191  * start = 0
15192  * elif start >= shape:
15193  */
15194  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15195  if (__pyx_t_2) {
15196 
15197  /* "View.MemoryView":845
15198  * start += shape
15199  * if start < 0:
15200  * start = 0 # <<<<<<<<<<<<<<
15201  * elif start >= shape:
15202  * if negative_step:
15203  */
15204  __pyx_v_start = 0;
15205 
15206  /* "View.MemoryView":844
15207  * if start < 0:
15208  * start += shape
15209  * if start < 0: # <<<<<<<<<<<<<<
15210  * start = 0
15211  * elif start >= shape:
15212  */
15213  }
15214 
15215  /* "View.MemoryView":842
15216  *
15217  * if have_start:
15218  * if start < 0: # <<<<<<<<<<<<<<
15219  * start += shape
15220  * if start < 0:
15221  */
15222  goto __pyx_L12;
15223  }
15224 
15225  /* "View.MemoryView":846
15226  * if start < 0:
15227  * start = 0
15228  * elif start >= shape: # <<<<<<<<<<<<<<
15229  * if negative_step:
15230  * start = shape - 1
15231  */
15232  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
15233  if (__pyx_t_2) {
15234 
15235  /* "View.MemoryView":847
15236  * start = 0
15237  * elif start >= shape:
15238  * if negative_step: # <<<<<<<<<<<<<<
15239  * start = shape - 1
15240  * else:
15241  */
15242  __pyx_t_2 = (__pyx_v_negative_step != 0);
15243  if (__pyx_t_2) {
15244 
15245  /* "View.MemoryView":848
15246  * elif start >= shape:
15247  * if negative_step:
15248  * start = shape - 1 # <<<<<<<<<<<<<<
15249  * else:
15250  * start = shape
15251  */
15252  __pyx_v_start = (__pyx_v_shape - 1);
15253 
15254  /* "View.MemoryView":847
15255  * start = 0
15256  * elif start >= shape:
15257  * if negative_step: # <<<<<<<<<<<<<<
15258  * start = shape - 1
15259  * else:
15260  */
15261  goto __pyx_L14;
15262  }
15263 
15264  /* "View.MemoryView":850
15265  * start = shape - 1
15266  * else:
15267  * start = shape # <<<<<<<<<<<<<<
15268  * else:
15269  * if negative_step:
15270  */
15271  /*else*/ {
15272  __pyx_v_start = __pyx_v_shape;
15273  }
15274  __pyx_L14:;
15275 
15276  /* "View.MemoryView":846
15277  * if start < 0:
15278  * start = 0
15279  * elif start >= shape: # <<<<<<<<<<<<<<
15280  * if negative_step:
15281  * start = shape - 1
15282  */
15283  }
15284  __pyx_L12:;
15285 
15286  /* "View.MemoryView":841
15287  *
15288  *
15289  * if have_start: # <<<<<<<<<<<<<<
15290  * if start < 0:
15291  * start += shape
15292  */
15293  goto __pyx_L11;
15294  }
15295 
15296  /* "View.MemoryView":852
15297  * start = shape
15298  * else:
15299  * if negative_step: # <<<<<<<<<<<<<<
15300  * start = shape - 1
15301  * else:
15302  */
15303  /*else*/ {
15304  __pyx_t_2 = (__pyx_v_negative_step != 0);
15305  if (__pyx_t_2) {
15306 
15307  /* "View.MemoryView":853
15308  * else:
15309  * if negative_step:
15310  * start = shape - 1 # <<<<<<<<<<<<<<
15311  * else:
15312  * start = 0
15313  */
15314  __pyx_v_start = (__pyx_v_shape - 1);
15315 
15316  /* "View.MemoryView":852
15317  * start = shape
15318  * else:
15319  * if negative_step: # <<<<<<<<<<<<<<
15320  * start = shape - 1
15321  * else:
15322  */
15323  goto __pyx_L15;
15324  }
15325 
15326  /* "View.MemoryView":855
15327  * start = shape - 1
15328  * else:
15329  * start = 0 # <<<<<<<<<<<<<<
15330  *
15331  * if have_stop:
15332  */
15333  /*else*/ {
15334  __pyx_v_start = 0;
15335  }
15336  __pyx_L15:;
15337  }
15338  __pyx_L11:;
15339 
15340  /* "View.MemoryView":857
15341  * start = 0
15342  *
15343  * if have_stop: # <<<<<<<<<<<<<<
15344  * if stop < 0:
15345  * stop += shape
15346  */
15347  __pyx_t_2 = (__pyx_v_have_stop != 0);
15348  if (__pyx_t_2) {
15349 
15350  /* "View.MemoryView":858
15351  *
15352  * if have_stop:
15353  * if stop < 0: # <<<<<<<<<<<<<<
15354  * stop += shape
15355  * if stop < 0:
15356  */
15357  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15358  if (__pyx_t_2) {
15359 
15360  /* "View.MemoryView":859
15361  * if have_stop:
15362  * if stop < 0:
15363  * stop += shape # <<<<<<<<<<<<<<
15364  * if stop < 0:
15365  * stop = 0
15366  */
15367  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
15368 
15369  /* "View.MemoryView":860
15370  * if stop < 0:
15371  * stop += shape
15372  * if stop < 0: # <<<<<<<<<<<<<<
15373  * stop = 0
15374  * elif stop > shape:
15375  */
15376  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15377  if (__pyx_t_2) {
15378 
15379  /* "View.MemoryView":861
15380  * stop += shape
15381  * if stop < 0:
15382  * stop = 0 # <<<<<<<<<<<<<<
15383  * elif stop > shape:
15384  * stop = shape
15385  */
15386  __pyx_v_stop = 0;
15387 
15388  /* "View.MemoryView":860
15389  * if stop < 0:
15390  * stop += shape
15391  * if stop < 0: # <<<<<<<<<<<<<<
15392  * stop = 0
15393  * elif stop > shape:
15394  */
15395  }
15396 
15397  /* "View.MemoryView":858
15398  *
15399  * if have_stop:
15400  * if stop < 0: # <<<<<<<<<<<<<<
15401  * stop += shape
15402  * if stop < 0:
15403  */
15404  goto __pyx_L17;
15405  }
15406 
15407  /* "View.MemoryView":862
15408  * if stop < 0:
15409  * stop = 0
15410  * elif stop > shape: # <<<<<<<<<<<<<<
15411  * stop = shape
15412  * else:
15413  */
15414  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
15415  if (__pyx_t_2) {
15416 
15417  /* "View.MemoryView":863
15418  * stop = 0
15419  * elif stop > shape:
15420  * stop = shape # <<<<<<<<<<<<<<
15421  * else:
15422  * if negative_step:
15423  */
15424  __pyx_v_stop = __pyx_v_shape;
15425 
15426  /* "View.MemoryView":862
15427  * if stop < 0:
15428  * stop = 0
15429  * elif stop > shape: # <<<<<<<<<<<<<<
15430  * stop = shape
15431  * else:
15432  */
15433  }
15434  __pyx_L17:;
15435 
15436  /* "View.MemoryView":857
15437  * start = 0
15438  *
15439  * if have_stop: # <<<<<<<<<<<<<<
15440  * if stop < 0:
15441  * stop += shape
15442  */
15443  goto __pyx_L16;
15444  }
15445 
15446  /* "View.MemoryView":865
15447  * stop = shape
15448  * else:
15449  * if negative_step: # <<<<<<<<<<<<<<
15450  * stop = -1
15451  * else:
15452  */
15453  /*else*/ {
15454  __pyx_t_2 = (__pyx_v_negative_step != 0);
15455  if (__pyx_t_2) {
15456 
15457  /* "View.MemoryView":866
15458  * else:
15459  * if negative_step:
15460  * stop = -1 # <<<<<<<<<<<<<<
15461  * else:
15462  * stop = shape
15463  */
15464  __pyx_v_stop = -1L;
15465 
15466  /* "View.MemoryView":865
15467  * stop = shape
15468  * else:
15469  * if negative_step: # <<<<<<<<<<<<<<
15470  * stop = -1
15471  * else:
15472  */
15473  goto __pyx_L19;
15474  }
15475 
15476  /* "View.MemoryView":868
15477  * stop = -1
15478  * else:
15479  * stop = shape # <<<<<<<<<<<<<<
15480  *
15481  * if not have_step:
15482  */
15483  /*else*/ {
15484  __pyx_v_stop = __pyx_v_shape;
15485  }
15486  __pyx_L19:;
15487  }
15488  __pyx_L16:;
15489 
15490  /* "View.MemoryView":870
15491  * stop = shape
15492  *
15493  * if not have_step: # <<<<<<<<<<<<<<
15494  * step = 1
15495  *
15496  */
15497  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
15498  if (__pyx_t_2) {
15499 
15500  /* "View.MemoryView":871
15501  *
15502  * if not have_step:
15503  * step = 1 # <<<<<<<<<<<<<<
15504  *
15505  *
15506  */
15507  __pyx_v_step = 1;
15508 
15509  /* "View.MemoryView":870
15510  * stop = shape
15511  *
15512  * if not have_step: # <<<<<<<<<<<<<<
15513  * step = 1
15514  *
15515  */
15516  }
15517 
15518  /* "View.MemoryView":875
15519  *
15520  * with cython.cdivision(True):
15521  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
15522  *
15523  * if (stop - start) - step * new_shape:
15524  */
15525  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
15526 
15527  /* "View.MemoryView":877
15528  * new_shape = (stop - start) // step
15529  *
15530  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
15531  * new_shape += 1
15532  *
15533  */
15534  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
15535  if (__pyx_t_2) {
15536 
15537  /* "View.MemoryView":878
15538  *
15539  * if (stop - start) - step * new_shape:
15540  * new_shape += 1 # <<<<<<<<<<<<<<
15541  *
15542  * if new_shape < 0:
15543  */
15544  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
15545 
15546  /* "View.MemoryView":877
15547  * new_shape = (stop - start) // step
15548  *
15549  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
15550  * new_shape += 1
15551  *
15552  */
15553  }
15554 
15555  /* "View.MemoryView":880
15556  * new_shape += 1
15557  *
15558  * if new_shape < 0: # <<<<<<<<<<<<<<
15559  * new_shape = 0
15560  *
15561  */
15562  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
15563  if (__pyx_t_2) {
15564 
15565  /* "View.MemoryView":881
15566  *
15567  * if new_shape < 0:
15568  * new_shape = 0 # <<<<<<<<<<<<<<
15569  *
15570  *
15571  */
15572  __pyx_v_new_shape = 0;
15573 
15574  /* "View.MemoryView":880
15575  * new_shape += 1
15576  *
15577  * if new_shape < 0: # <<<<<<<<<<<<<<
15578  * new_shape = 0
15579  *
15580  */
15581  }
15582 
15583  /* "View.MemoryView":884
15584  *
15585  *
15586  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
15587  * dst.shape[new_ndim] = new_shape
15588  * dst.suboffsets[new_ndim] = suboffset
15589  */
15590  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
15591 
15592  /* "View.MemoryView":885
15593  *
15594  * dst.strides[new_ndim] = stride * step
15595  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
15596  * dst.suboffsets[new_ndim] = suboffset
15597  *
15598  */
15599  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
15600 
15601  /* "View.MemoryView":886
15602  * dst.strides[new_ndim] = stride * step
15603  * dst.shape[new_ndim] = new_shape
15604  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
15605  *
15606  *
15607  */
15608  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
15609  }
15610  __pyx_L3:;
15611 
15612  /* "View.MemoryView":889
15613  *
15614  *
15615  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
15616  * dst.data += start * stride
15617  * else:
15618  */
15619  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
15620  if (__pyx_t_2) {
15621 
15622  /* "View.MemoryView":890
15623  *
15624  * if suboffset_dim[0] < 0:
15625  * dst.data += start * stride # <<<<<<<<<<<<<<
15626  * else:
15627  * dst.suboffsets[suboffset_dim[0]] += start * stride
15628  */
15629  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
15630 
15631  /* "View.MemoryView":889
15632  *
15633  *
15634  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
15635  * dst.data += start * stride
15636  * else:
15637  */
15638  goto __pyx_L23;
15639  }
15640 
15641  /* "View.MemoryView":892
15642  * dst.data += start * stride
15643  * else:
15644  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
15645  *
15646  * if suboffset >= 0:
15647  */
15648  /*else*/ {
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));
15651  }
15652  __pyx_L23:;
15653 
15654  /* "View.MemoryView":894
15655  * dst.suboffsets[suboffset_dim[0]] += start * stride
15656  *
15657  * if suboffset >= 0: # <<<<<<<<<<<<<<
15658  * if not is_slice:
15659  * if new_ndim == 0:
15660  */
15661  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
15662  if (__pyx_t_2) {
15663 
15664  /* "View.MemoryView":895
15665  *
15666  * if suboffset >= 0:
15667  * if not is_slice: # <<<<<<<<<<<<<<
15668  * if new_ndim == 0:
15669  * dst.data = (<char **> dst.data)[0] + suboffset
15670  */
15671  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
15672  if (__pyx_t_2) {
15673 
15674  /* "View.MemoryView":896
15675  * if suboffset >= 0:
15676  * if not is_slice:
15677  * if new_ndim == 0: # <<<<<<<<<<<<<<
15678  * dst.data = (<char **> dst.data)[0] + suboffset
15679  * else:
15680  */
15681  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
15682  if (__pyx_t_2) {
15683 
15684  /* "View.MemoryView":897
15685  * if not is_slice:
15686  * if new_ndim == 0:
15687  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
15688  * else:
15689  * _err_dim(IndexError, "All dimensions preceding dimension %d "
15690  */
15691  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
15692 
15693  /* "View.MemoryView":896
15694  * if suboffset >= 0:
15695  * if not is_slice:
15696  * if new_ndim == 0: # <<<<<<<<<<<<<<
15697  * dst.data = (<char **> dst.data)[0] + suboffset
15698  * else:
15699  */
15700  goto __pyx_L26;
15701  }
15702 
15703  /* "View.MemoryView":899
15704  * dst.data = (<char **> dst.data)[0] + suboffset
15705  * else:
15706  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
15707  * "must be indexed and not sliced", dim)
15708  * else:
15709  */
15710  /*else*/ {
15711 
15712  /* "View.MemoryView":900
15713  * else:
15714  * _err_dim(IndexError, "All dimensions preceding dimension %d "
15715  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
15716  * else:
15717  * suboffset_dim[0] = new_ndim
15718  */
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)
15720  }
15721  __pyx_L26:;
15722 
15723  /* "View.MemoryView":895
15724  *
15725  * if suboffset >= 0:
15726  * if not is_slice: # <<<<<<<<<<<<<<
15727  * if new_ndim == 0:
15728  * dst.data = (<char **> dst.data)[0] + suboffset
15729  */
15730  goto __pyx_L25;
15731  }
15732 
15733  /* "View.MemoryView":902
15734  * "must be indexed and not sliced", dim)
15735  * else:
15736  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
15737  *
15738  * return 0
15739  */
15740  /*else*/ {
15741  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
15742  }
15743  __pyx_L25:;
15744 
15745  /* "View.MemoryView":894
15746  * dst.suboffsets[suboffset_dim[0]] += start * stride
15747  *
15748  * if suboffset >= 0: # <<<<<<<<<<<<<<
15749  * if not is_slice:
15750  * if new_ndim == 0:
15751  */
15752  }
15753 
15754  /* "View.MemoryView":904
15755  * suboffset_dim[0] = new_ndim
15756  *
15757  * return 0 # <<<<<<<<<<<<<<
15758  *
15759  *
15760  */
15761  __pyx_r = 0;
15762  goto __pyx_L0;
15763 
15764  /* "View.MemoryView":807
15765  *
15766  * @cname('__pyx_memoryview_slice_memviewslice')
15767  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15768  * __Pyx_memviewslice *dst,
15769  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15770  */
15771 
15772  /* function exit code */
15773  __pyx_L1_error:;
15774  {
15775  #ifdef WITH_THREAD
15776  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15777  #endif
15778  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15779  #ifdef WITH_THREAD
15780  __Pyx_PyGILState_Release(__pyx_gilstate_save);
15781  #endif
15782  }
15783  __pyx_r = -1;
15784  __pyx_L0:;
15785  return __pyx_r;
15786 }
15787 
15788 /* "View.MemoryView":910
15789  *
15790  * @cname('__pyx_pybuffer_index')
15791  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
15792  * Py_ssize_t dim) except NULL:
15793  * cdef Py_ssize_t shape, stride, suboffset = -1
15794  */
15795 
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;
15802  char *__pyx_r;
15803  __Pyx_RefNannyDeclarations
15804  Py_ssize_t __pyx_t_1;
15805  int __pyx_t_2;
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);
15812 
15813  /* "View.MemoryView":912
15814  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
15815  * Py_ssize_t dim) except NULL:
15816  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
15817  * cdef Py_ssize_t itemsize = view.itemsize
15818  * cdef char *resultp
15819  */
15820  __pyx_v_suboffset = -1L;
15821 
15822  /* "View.MemoryView":913
15823  * Py_ssize_t dim) except NULL:
15824  * cdef Py_ssize_t shape, stride, suboffset = -1
15825  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
15826  * cdef char *resultp
15827  *
15828  */
15829  __pyx_t_1 = __pyx_v_view->itemsize;
15830  __pyx_v_itemsize = __pyx_t_1;
15831 
15832  /* "View.MemoryView":916
15833  * cdef char *resultp
15834  *
15835  * if view.ndim == 0: # <<<<<<<<<<<<<<
15836  * shape = view.len / itemsize
15837  * stride = itemsize
15838  */
15839  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
15840  if (__pyx_t_2) {
15841 
15842  /* "View.MemoryView":917
15843  *
15844  * if view.ndim == 0:
15845  * shape = view.len / itemsize # <<<<<<<<<<<<<<
15846  * stride = itemsize
15847  * else:
15848  */
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)
15852  }
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)
15856  }
15857  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
15858 
15859  /* "View.MemoryView":918
15860  * if view.ndim == 0:
15861  * shape = view.len / itemsize
15862  * stride = itemsize # <<<<<<<<<<<<<<
15863  * else:
15864  * shape = view.shape[dim]
15865  */
15866  __pyx_v_stride = __pyx_v_itemsize;
15867 
15868  /* "View.MemoryView":916
15869  * cdef char *resultp
15870  *
15871  * if view.ndim == 0: # <<<<<<<<<<<<<<
15872  * shape = view.len / itemsize
15873  * stride = itemsize
15874  */
15875  goto __pyx_L3;
15876  }
15877 
15878  /* "View.MemoryView":920
15879  * stride = itemsize
15880  * else:
15881  * shape = view.shape[dim] # <<<<<<<<<<<<<<
15882  * stride = view.strides[dim]
15883  * if view.suboffsets != NULL:
15884  */
15885  /*else*/ {
15886  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
15887 
15888  /* "View.MemoryView":921
15889  * else:
15890  * shape = view.shape[dim]
15891  * stride = view.strides[dim] # <<<<<<<<<<<<<<
15892  * if view.suboffsets != NULL:
15893  * suboffset = view.suboffsets[dim]
15894  */
15895  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
15896 
15897  /* "View.MemoryView":922
15898  * shape = view.shape[dim]
15899  * stride = view.strides[dim]
15900  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
15901  * suboffset = view.suboffsets[dim]
15902  *
15903  */
15904  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
15905  if (__pyx_t_2) {
15906 
15907  /* "View.MemoryView":923
15908  * stride = view.strides[dim]
15909  * if view.suboffsets != NULL:
15910  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
15911  *
15912  * if index < 0:
15913  */
15914  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
15915 
15916  /* "View.MemoryView":922
15917  * shape = view.shape[dim]
15918  * stride = view.strides[dim]
15919  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
15920  * suboffset = view.suboffsets[dim]
15921  *
15922  */
15923  }
15924  }
15925  __pyx_L3:;
15926 
15927  /* "View.MemoryView":925
15928  * suboffset = view.suboffsets[dim]
15929  *
15930  * if index < 0: # <<<<<<<<<<<<<<
15931  * index += view.shape[dim]
15932  * if index < 0:
15933  */
15934  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15935  if (__pyx_t_2) {
15936 
15937  /* "View.MemoryView":926
15938  *
15939  * if index < 0:
15940  * index += view.shape[dim] # <<<<<<<<<<<<<<
15941  * if index < 0:
15942  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15943  */
15944  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
15945 
15946  /* "View.MemoryView":927
15947  * if index < 0:
15948  * index += view.shape[dim]
15949  * if index < 0: # <<<<<<<<<<<<<<
15950  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15951  *
15952  */
15953  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15954  if (unlikely(__pyx_t_2)) {
15955 
15956  /* "View.MemoryView":928
15957  * index += view.shape[dim]
15958  * if index < 0:
15959  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
15960  *
15961  * if index >= shape:
15962  */
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)
15974 
15975  /* "View.MemoryView":927
15976  * if index < 0:
15977  * index += view.shape[dim]
15978  * if index < 0: # <<<<<<<<<<<<<<
15979  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15980  *
15981  */
15982  }
15983 
15984  /* "View.MemoryView":925
15985  * suboffset = view.suboffsets[dim]
15986  *
15987  * if index < 0: # <<<<<<<<<<<<<<
15988  * index += view.shape[dim]
15989  * if index < 0:
15990  */
15991  }
15992 
15993  /* "View.MemoryView":930
15994  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15995  *
15996  * if index >= shape: # <<<<<<<<<<<<<<
15997  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15998  *
15999  */
16000  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16001  if (unlikely(__pyx_t_2)) {
16002 
16003  /* "View.MemoryView":931
16004  *
16005  * if index >= shape:
16006  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16007  *
16008  * resultp = bufp + index * stride
16009  */
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)
16021 
16022  /* "View.MemoryView":930
16023  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16024  *
16025  * if index >= shape: # <<<<<<<<<<<<<<
16026  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16027  *
16028  */
16029  }
16030 
16031  /* "View.MemoryView":933
16032  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16033  *
16034  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
16035  * if suboffset >= 0:
16036  * resultp = (<char **> resultp)[0] + suboffset
16037  */
16038  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16039 
16040  /* "View.MemoryView":934
16041  *
16042  * resultp = bufp + index * stride
16043  * if suboffset >= 0: # <<<<<<<<<<<<<<
16044  * resultp = (<char **> resultp)[0] + suboffset
16045  *
16046  */
16047  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16048  if (__pyx_t_2) {
16049 
16050  /* "View.MemoryView":935
16051  * resultp = bufp + index * stride
16052  * if suboffset >= 0:
16053  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
16054  *
16055  * return resultp
16056  */
16057  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16058 
16059  /* "View.MemoryView":934
16060  *
16061  * resultp = bufp + index * stride
16062  * if suboffset >= 0: # <<<<<<<<<<<<<<
16063  * resultp = (<char **> resultp)[0] + suboffset
16064  *
16065  */
16066  }
16067 
16068  /* "View.MemoryView":937
16069  * resultp = (<char **> resultp)[0] + suboffset
16070  *
16071  * return resultp # <<<<<<<<<<<<<<
16072  *
16073  *
16074  */
16075  __pyx_r = __pyx_v_resultp;
16076  goto __pyx_L0;
16077 
16078  /* "View.MemoryView":910
16079  *
16080  * @cname('__pyx_pybuffer_index')
16081  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16082  * Py_ssize_t dim) except NULL:
16083  * cdef Py_ssize_t shape, stride, suboffset = -1
16084  */
16085 
16086  /* function exit code */
16087  __pyx_L1_error:;
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);
16091  __pyx_r = NULL;
16092  __pyx_L0:;
16093  __Pyx_RefNannyFinishContext();
16094  return __pyx_r;
16095 }
16096 
16097 /* "View.MemoryView":943
16098  *
16099  * @cname('__pyx_memslice_transpose')
16100  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16101  * cdef int ndim = memslice.memview.view.ndim
16102  *
16103  */
16104 
16105 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16106  int __pyx_v_ndim;
16107  Py_ssize_t *__pyx_v_shape;
16108  Py_ssize_t *__pyx_v_strides;
16109  int __pyx_v_i;
16110  int __pyx_v_j;
16111  int __pyx_r;
16112  int __pyx_t_1;
16113  Py_ssize_t *__pyx_t_2;
16114  long __pyx_t_3;
16115  long __pyx_t_4;
16116  Py_ssize_t __pyx_t_5;
16117  Py_ssize_t __pyx_t_6;
16118  int __pyx_t_7;
16119  int __pyx_t_8;
16120  int __pyx_t_9;
16121  int __pyx_lineno = 0;
16122  const char *__pyx_filename = NULL;
16123  int __pyx_clineno = 0;
16124 
16125  /* "View.MemoryView":944
16126  * @cname('__pyx_memslice_transpose')
16127  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
16128  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
16129  *
16130  * cdef Py_ssize_t *shape = memslice.shape
16131  */
16132  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16133  __pyx_v_ndim = __pyx_t_1;
16134 
16135  /* "View.MemoryView":946
16136  * cdef int ndim = memslice.memview.view.ndim
16137  *
16138  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
16139  * cdef Py_ssize_t *strides = memslice.strides
16140  *
16141  */
16142  __pyx_t_2 = __pyx_v_memslice->shape;
16143  __pyx_v_shape = __pyx_t_2;
16144 
16145  /* "View.MemoryView":947
16146  *
16147  * cdef Py_ssize_t *shape = memslice.shape
16148  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
16149  *
16150  *
16151  */
16152  __pyx_t_2 = __pyx_v_memslice->strides;
16153  __pyx_v_strides = __pyx_t_2;
16154 
16155  /* "View.MemoryView":951
16156  *
16157  * cdef int i, j
16158  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
16159  * j = ndim - 1 - i
16160  * strides[i], strides[j] = strides[j], strides[i]
16161  */
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;
16166 
16167  /* "View.MemoryView":952
16168  * cdef int i, j
16169  * for i in range(ndim / 2):
16170  * j = ndim - 1 - i # <<<<<<<<<<<<<<
16171  * strides[i], strides[j] = strides[j], strides[i]
16172  * shape[i], shape[j] = shape[j], shape[i]
16173  */
16174  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16175 
16176  /* "View.MemoryView":953
16177  * for i in range(ndim / 2):
16178  * j = ndim - 1 - i
16179  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
16180  * shape[i], shape[j] = shape[j], shape[i]
16181  *
16182  */
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;
16187 
16188  /* "View.MemoryView":954
16189  * j = ndim - 1 - i
16190  * strides[i], strides[j] = strides[j], strides[i]
16191  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
16192  *
16193  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16194  */
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;
16199 
16200  /* "View.MemoryView":956
16201  * shape[i], shape[j] = shape[j], shape[i]
16202  *
16203  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16204  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16205  *
16206  */
16207  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16208  if (!__pyx_t_8) {
16209  } else {
16210  __pyx_t_7 = __pyx_t_8;
16211  goto __pyx_L6_bool_binop_done;
16212  }
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:;
16216  if (__pyx_t_7) {
16217 
16218  /* "View.MemoryView":957
16219  *
16220  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16221  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
16222  *
16223  * return 1
16224  */
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)
16226 
16227  /* "View.MemoryView":956
16228  * shape[i], shape[j] = shape[j], shape[i]
16229  *
16230  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16231  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16232  *
16233  */
16234  }
16235  }
16236 
16237  /* "View.MemoryView":959
16238  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16239  *
16240  * return 1 # <<<<<<<<<<<<<<
16241  *
16242  *
16243  */
16244  __pyx_r = 1;
16245  goto __pyx_L0;
16246 
16247  /* "View.MemoryView":943
16248  *
16249  * @cname('__pyx_memslice_transpose')
16250  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16251  * cdef int ndim = memslice.memview.view.ndim
16252  *
16253  */
16254 
16255  /* function exit code */
16256  __pyx_L1_error:;
16257  {
16258  #ifdef WITH_THREAD
16259  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16260  #endif
16261  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16262  #ifdef WITH_THREAD
16263  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16264  #endif
16265  }
16266  __pyx_r = 0;
16267  __pyx_L0:;
16268  return __pyx_r;
16269 }
16270 
16271 /* "View.MemoryView":976
16272  * cdef int (*to_dtype_func)(char *, object) except 0
16273  *
16274  * def __dealloc__(self): # <<<<<<<<<<<<<<
16275  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16276  *
16277  */
16278 
16279 /* Python wrapper */
16280 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
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));
16285 
16286  /* function exit code */
16287  __Pyx_RefNannyFinishContext();
16288 }
16289 
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);
16293 
16294  /* "View.MemoryView":977
16295  *
16296  * def __dealloc__(self):
16297  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
16298  *
16299  * cdef convert_item_to_object(self, char *itemp):
16300  */
16301  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
16302 
16303  /* "View.MemoryView":976
16304  * cdef int (*to_dtype_func)(char *, object) except 0
16305  *
16306  * def __dealloc__(self): # <<<<<<<<<<<<<<
16307  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16308  *
16309  */
16310 
16311  /* function exit code */
16312  __Pyx_RefNannyFinishContext();
16313 }
16314 
16315 /* "View.MemoryView":979
16316  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16317  *
16318  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16319  * if self.to_object_func != NULL:
16320  * return self.to_object_func(itemp)
16321  */
16322 
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
16326  int __pyx_t_1;
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);
16332 
16333  /* "View.MemoryView":980
16334  *
16335  * cdef convert_item_to_object(self, char *itemp):
16336  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
16337  * return self.to_object_func(itemp)
16338  * else:
16339  */
16340  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
16341  if (__pyx_t_1) {
16342 
16343  /* "View.MemoryView":981
16344  * cdef convert_item_to_object(self, char *itemp):
16345  * if self.to_object_func != NULL:
16346  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
16347  * else:
16348  * return memoryview.convert_item_to_object(self, itemp)
16349  */
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;
16354  __pyx_t_2 = 0;
16355  goto __pyx_L0;
16356 
16357  /* "View.MemoryView":980
16358  *
16359  * cdef convert_item_to_object(self, char *itemp):
16360  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
16361  * return self.to_object_func(itemp)
16362  * else:
16363  */
16364  }
16365 
16366  /* "View.MemoryView":983
16367  * return self.to_object_func(itemp)
16368  * else:
16369  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
16370  *
16371  * cdef assign_item_from_object(self, char *itemp, object value):
16372  */
16373  /*else*/ {
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;
16378  __pyx_t_2 = 0;
16379  goto __pyx_L0;
16380  }
16381 
16382  /* "View.MemoryView":979
16383  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16384  *
16385  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16386  * if self.to_object_func != NULL:
16387  * return self.to_object_func(itemp)
16388  */
16389 
16390  /* function exit code */
16391  __pyx_L1_error:;
16392  __Pyx_XDECREF(__pyx_t_2);
16393  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16394  __pyx_r = 0;
16395  __pyx_L0:;
16396  __Pyx_XGIVEREF(__pyx_r);
16397  __Pyx_RefNannyFinishContext();
16398  return __pyx_r;
16399 }
16400 
16401 /* "View.MemoryView":985
16402  * return memoryview.convert_item_to_object(self, itemp)
16403  *
16404  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16405  * if self.to_dtype_func != NULL:
16406  * self.to_dtype_func(itemp, value)
16407  */
16408 
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
16412  int __pyx_t_1;
16413  int __pyx_t_2;
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);
16419 
16420  /* "View.MemoryView":986
16421  *
16422  * cdef assign_item_from_object(self, char *itemp, object value):
16423  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
16424  * self.to_dtype_func(itemp, value)
16425  * else:
16426  */
16427  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
16428  if (__pyx_t_1) {
16429 
16430  /* "View.MemoryView":987
16431  * cdef assign_item_from_object(self, char *itemp, object value):
16432  * if self.to_dtype_func != NULL:
16433  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
16434  * else:
16435  * memoryview.assign_item_from_object(self, itemp, value)
16436  */
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)
16438 
16439  /* "View.MemoryView":986
16440  *
16441  * cdef assign_item_from_object(self, char *itemp, object value):
16442  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
16443  * self.to_dtype_func(itemp, value)
16444  * else:
16445  */
16446  goto __pyx_L3;
16447  }
16448 
16449  /* "View.MemoryView":989
16450  * self.to_dtype_func(itemp, value)
16451  * else:
16452  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
16453  *
16454  * @property
16455  */
16456  /*else*/ {
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;
16460  }
16461  __pyx_L3:;
16462 
16463  /* "View.MemoryView":985
16464  * return memoryview.convert_item_to_object(self, itemp)
16465  *
16466  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16467  * if self.to_dtype_func != NULL:
16468  * self.to_dtype_func(itemp, value)
16469  */
16470 
16471  /* function exit code */
16472  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16473  goto __pyx_L0;
16474  __pyx_L1_error:;
16475  __Pyx_XDECREF(__pyx_t_3);
16476  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16477  __pyx_r = 0;
16478  __pyx_L0:;
16479  __Pyx_XGIVEREF(__pyx_r);
16480  __Pyx_RefNannyFinishContext();
16481  return __pyx_r;
16482 }
16483 
16484 /* "View.MemoryView":992
16485  *
16486  * @property
16487  * def base(self): # <<<<<<<<<<<<<<
16488  * return self.from_object
16489  *
16490  */
16491 
16492 /* Python wrapper */
16493 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
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));
16499 
16500  /* function exit code */
16501  __Pyx_RefNannyFinishContext();
16502  return __pyx_r;
16503 }
16504 
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);
16509 
16510  /* "View.MemoryView":993
16511  * @property
16512  * def base(self):
16513  * return self.from_object # <<<<<<<<<<<<<<
16514  *
16515  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
16516  */
16517  __Pyx_XDECREF(__pyx_r);
16518  __Pyx_INCREF(__pyx_v_self->from_object);
16519  __pyx_r = __pyx_v_self->from_object;
16520  goto __pyx_L0;
16521 
16522  /* "View.MemoryView":992
16523  *
16524  * @property
16525  * def base(self): # <<<<<<<<<<<<<<
16526  * return self.from_object
16527  *
16528  */
16529 
16530  /* function exit code */
16531  __pyx_L0:;
16532  __Pyx_XGIVEREF(__pyx_r);
16533  __Pyx_RefNannyFinishContext();
16534  return __pyx_r;
16535 }
16536 
16537 /* "(tree fragment)":1
16538  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
16539  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16540  * def __setstate_cython__(self, __pyx_state):
16541  */
16542 
16543 /* Python wrapper */
16544 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
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));
16550 
16551  /* function exit code */
16552  __Pyx_RefNannyFinishContext();
16553  return __pyx_r;
16554 }
16555 
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);
16564 
16565  /* "(tree fragment)":2
16566  * def __reduce_cython__(self):
16567  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
16568  * def __setstate_cython__(self, __pyx_state):
16569  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16570  */
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)
16576 
16577  /* "(tree fragment)":1
16578  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
16579  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16580  * def __setstate_cython__(self, __pyx_state):
16581  */
16582 
16583  /* function exit code */
16584  __pyx_L1_error:;
16585  __Pyx_XDECREF(__pyx_t_1);
16586  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16587  __pyx_r = NULL;
16588  __Pyx_XGIVEREF(__pyx_r);
16589  __Pyx_RefNannyFinishContext();
16590  return __pyx_r;
16591 }
16592 
16593 /* "(tree fragment)":3
16594  * def __reduce_cython__(self):
16595  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16596  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
16597  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16598  */
16599 
16600 /* Python wrapper */
16601 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
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));
16607 
16608  /* function exit code */
16609  __Pyx_RefNannyFinishContext();
16610  return __pyx_r;
16611 }
16612 
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);
16621 
16622  /* "(tree fragment)":4
16623  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16624  * def __setstate_cython__(self, __pyx_state):
16625  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
16626  */
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)
16632 
16633  /* "(tree fragment)":3
16634  * def __reduce_cython__(self):
16635  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16636  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
16637  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16638  */
16639 
16640  /* function exit code */
16641  __pyx_L1_error:;
16642  __Pyx_XDECREF(__pyx_t_1);
16643  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16644  __pyx_r = NULL;
16645  __Pyx_XGIVEREF(__pyx_r);
16646  __Pyx_RefNannyFinishContext();
16647  return __pyx_r;
16648 }
16649 
16650 /* "View.MemoryView":999
16651  *
16652  * @cname('__pyx_memoryview_fromslice')
16653  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
16654  * int ndim,
16655  * object (*to_object_func)(char *),
16656  */
16657 
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
16664  int __pyx_t_1;
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);
16677 
16678  /* "View.MemoryView":1007
16679  * cdef _memoryviewslice result
16680  *
16681  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
16682  * return None
16683  *
16684  */
16685  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
16686  if (__pyx_t_1) {
16687 
16688  /* "View.MemoryView":1008
16689  *
16690  * if <PyObject *> memviewslice.memview == Py_None:
16691  * return None # <<<<<<<<<<<<<<
16692  *
16693  *
16694  */
16695  __Pyx_XDECREF(__pyx_r);
16696  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16697  goto __pyx_L0;
16698 
16699  /* "View.MemoryView":1007
16700  * cdef _memoryviewslice result
16701  *
16702  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
16703  * return None
16704  *
16705  */
16706  }
16707 
16708  /* "View.MemoryView":1013
16709  *
16710  *
16711  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
16712  *
16713  * result.from_slice = memviewslice
16714  */
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);
16727  __pyx_t_2 = 0;
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);
16732  __pyx_t_2 = 0;
16733 
16734  /* "View.MemoryView":1015
16735  * result = _memoryviewslice(None, 0, dtype_is_object)
16736  *
16737  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
16738  * __PYX_INC_MEMVIEW(&memviewslice, 1)
16739  *
16740  */
16741  __pyx_v_result->from_slice = __pyx_v_memviewslice;
16742 
16743  /* "View.MemoryView":1016
16744  *
16745  * result.from_slice = memviewslice
16746  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
16747  *
16748  * result.from_object = (<memoryview> memviewslice.memview).base
16749  */
16750  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
16751 
16752  /* "View.MemoryView":1018
16753  * __PYX_INC_MEMVIEW(&memviewslice, 1)
16754  *
16755  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
16756  * result.typeinfo = memviewslice.memview.typeinfo
16757  *
16758  */
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;
16765  __pyx_t_2 = 0;
16766 
16767  /* "View.MemoryView":1019
16768  *
16769  * result.from_object = (<memoryview> memviewslice.memview).base
16770  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
16771  *
16772  * result.view = memviewslice.memview.view
16773  */
16774  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
16775  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
16776 
16777  /* "View.MemoryView":1021
16778  * result.typeinfo = memviewslice.memview.typeinfo
16779  *
16780  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
16781  * result.view.buf = <void *> memviewslice.data
16782  * result.view.ndim = ndim
16783  */
16784  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
16785  __pyx_v_result->__pyx_base.view = __pyx_t_5;
16786 
16787  /* "View.MemoryView":1022
16788  *
16789  * result.view = memviewslice.memview.view
16790  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
16791  * result.view.ndim = ndim
16792  * (<__pyx_buffer *> &result.view).obj = Py_None
16793  */
16794  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
16795 
16796  /* "View.MemoryView":1023
16797  * result.view = memviewslice.memview.view
16798  * result.view.buf = <void *> memviewslice.data
16799  * result.view.ndim = ndim # <<<<<<<<<<<<<<
16800  * (<__pyx_buffer *> &result.view).obj = Py_None
16801  * Py_INCREF(Py_None)
16802  */
16803  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
16804 
16805  /* "View.MemoryView":1024
16806  * result.view.buf = <void *> memviewslice.data
16807  * result.view.ndim = ndim
16808  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
16809  * Py_INCREF(Py_None)
16810  *
16811  */
16812  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
16813 
16814  /* "View.MemoryView":1025
16815  * result.view.ndim = ndim
16816  * (<__pyx_buffer *> &result.view).obj = Py_None
16817  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
16818  *
16819  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
16820  */
16821  Py_INCREF(Py_None);
16822 
16823  /* "View.MemoryView":1027
16824  * Py_INCREF(Py_None)
16825  *
16826  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
16827  * result.flags = PyBUF_RECORDS
16828  * else:
16829  */
16830  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
16831  if (__pyx_t_1) {
16832 
16833  /* "View.MemoryView":1028
16834  *
16835  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
16836  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
16837  * else:
16838  * result.flags = PyBUF_RECORDS_RO
16839  */
16840  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
16841 
16842  /* "View.MemoryView":1027
16843  * Py_INCREF(Py_None)
16844  *
16845  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
16846  * result.flags = PyBUF_RECORDS
16847  * else:
16848  */
16849  goto __pyx_L4;
16850  }
16851 
16852  /* "View.MemoryView":1030
16853  * result.flags = PyBUF_RECORDS
16854  * else:
16855  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
16856  *
16857  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
16858  */
16859  /*else*/ {
16860  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
16861  }
16862  __pyx_L4:;
16863 
16864  /* "View.MemoryView":1032
16865  * result.flags = PyBUF_RECORDS_RO
16866  *
16867  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
16868  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
16869  *
16870  */
16871  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
16872 
16873  /* "View.MemoryView":1033
16874  *
16875  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
16876  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
16877  *
16878  *
16879  */
16880  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
16881 
16882  /* "View.MemoryView":1036
16883  *
16884  *
16885  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
16886  * for suboffset in result.from_slice.suboffsets[:ndim]:
16887  * if suboffset >= 0:
16888  */
16889  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
16890 
16891  /* "View.MemoryView":1037
16892  *
16893  * result.view.suboffsets = NULL
16894  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
16895  * if suboffset >= 0:
16896  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16897  */
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]);
16902 
16903  /* "View.MemoryView":1038
16904  * result.view.suboffsets = NULL
16905  * for suboffset in result.from_slice.suboffsets[:ndim]:
16906  * if suboffset >= 0: # <<<<<<<<<<<<<<
16907  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16908  * break
16909  */
16910  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
16911  if (__pyx_t_1) {
16912 
16913  /* "View.MemoryView":1039
16914  * for suboffset in result.from_slice.suboffsets[:ndim]:
16915  * if suboffset >= 0:
16916  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
16917  * break
16918  *
16919  */
16920  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
16921 
16922  /* "View.MemoryView":1040
16923  * if suboffset >= 0:
16924  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16925  * break # <<<<<<<<<<<<<<
16926  *
16927  * result.view.len = result.view.itemsize
16928  */
16929  goto __pyx_L6_break;
16930 
16931  /* "View.MemoryView":1038
16932  * result.view.suboffsets = NULL
16933  * for suboffset in result.from_slice.suboffsets[:ndim]:
16934  * if suboffset >= 0: # <<<<<<<<<<<<<<
16935  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16936  * break
16937  */
16938  }
16939  }
16940  __pyx_L6_break:;
16941 
16942  /* "View.MemoryView":1042
16943  * break
16944  *
16945  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
16946  * for length in result.view.shape[:ndim]:
16947  * result.view.len *= length
16948  */
16949  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
16950  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16951 
16952  /* "View.MemoryView":1043
16953  *
16954  * result.view.len = result.view.itemsize
16955  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
16956  * result.view.len *= length
16957  *
16958  */
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);
16965  __pyx_t_2 = 0;
16966 
16967  /* "View.MemoryView":1044
16968  * result.view.len = result.view.itemsize
16969  * for length in result.view.shape[:ndim]:
16970  * result.view.len *= length # <<<<<<<<<<<<<<
16971  *
16972  * result.to_object_func = to_object_func
16973  */
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;
16982  }
16983 
16984  /* "View.MemoryView":1046
16985  * result.view.len *= length
16986  *
16987  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
16988  * result.to_dtype_func = to_dtype_func
16989  *
16990  */
16991  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
16992 
16993  /* "View.MemoryView":1047
16994  *
16995  * result.to_object_func = to_object_func
16996  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
16997  *
16998  * return result
16999  */
17000  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17001 
17002  /* "View.MemoryView":1049
17003  * result.to_dtype_func = to_dtype_func
17004  *
17005  * return result # <<<<<<<<<<<<<<
17006  *
17007  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17008  */
17009  __Pyx_XDECREF(__pyx_r);
17010  __Pyx_INCREF(((PyObject *)__pyx_v_result));
17011  __pyx_r = ((PyObject *)__pyx_v_result);
17012  goto __pyx_L0;
17013 
17014  /* "View.MemoryView":999
17015  *
17016  * @cname('__pyx_memoryview_fromslice')
17017  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17018  * int ndim,
17019  * object (*to_object_func)(char *),
17020  */
17021 
17022  /* function exit code */
17023  __pyx_L1_error:;
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);
17027  __pyx_r = 0;
17028  __pyx_L0:;
17029  __Pyx_XDECREF((PyObject *)__pyx_v_result);
17030  __Pyx_XDECREF(__pyx_v_length);
17031  __Pyx_XGIVEREF(__pyx_r);
17032  __Pyx_RefNannyFinishContext();
17033  return __pyx_r;
17034 }
17035 
17036 /* "View.MemoryView":1052
17037  *
17038  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17039  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17040  * __Pyx_memviewslice *mslice) except NULL:
17041  * cdef _memoryviewslice obj
17042  */
17043 
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
17048  int __pyx_t_1;
17049  int __pyx_t_2;
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);
17055 
17056  /* "View.MemoryView":1055
17057  * __Pyx_memviewslice *mslice) except NULL:
17058  * cdef _memoryviewslice obj
17059  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17060  * obj = memview
17061  * return &obj.from_slice
17062  */
17063  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17064  __pyx_t_2 = (__pyx_t_1 != 0);
17065  if (__pyx_t_2) {
17066 
17067  /* "View.MemoryView":1056
17068  * cdef _memoryviewslice obj
17069  * if isinstance(memview, _memoryviewslice):
17070  * obj = memview # <<<<<<<<<<<<<<
17071  * return &obj.from_slice
17072  * else:
17073  */
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);
17078  __pyx_t_3 = 0;
17079 
17080  /* "View.MemoryView":1057
17081  * if isinstance(memview, _memoryviewslice):
17082  * obj = memview
17083  * return &obj.from_slice # <<<<<<<<<<<<<<
17084  * else:
17085  * slice_copy(memview, mslice)
17086  */
17087  __pyx_r = (&__pyx_v_obj->from_slice);
17088  goto __pyx_L0;
17089 
17090  /* "View.MemoryView":1055
17091  * __Pyx_memviewslice *mslice) except NULL:
17092  * cdef _memoryviewslice obj
17093  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17094  * obj = memview
17095  * return &obj.from_slice
17096  */
17097  }
17098 
17099  /* "View.MemoryView":1059
17100  * return &obj.from_slice
17101  * else:
17102  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
17103  * return mslice
17104  *
17105  */
17106  /*else*/ {
17107  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17108 
17109  /* "View.MemoryView":1060
17110  * else:
17111  * slice_copy(memview, mslice)
17112  * return mslice # <<<<<<<<<<<<<<
17113  *
17114  * @cname('__pyx_memoryview_slice_copy')
17115  */
17116  __pyx_r = __pyx_v_mslice;
17117  goto __pyx_L0;
17118  }
17119 
17120  /* "View.MemoryView":1052
17121  *
17122  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17123  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17124  * __Pyx_memviewslice *mslice) except NULL:
17125  * cdef _memoryviewslice obj
17126  */
17127 
17128  /* function exit code */
17129  __pyx_L1_error:;
17130  __Pyx_XDECREF(__pyx_t_3);
17131  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
17132  __pyx_r = NULL;
17133  __pyx_L0:;
17134  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17135  __Pyx_RefNannyFinishContext();
17136  return __pyx_r;
17137 }
17138 
17139 /* "View.MemoryView":1063
17140  *
17141  * @cname('__pyx_memoryview_slice_copy')
17142  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17143  * cdef int dim
17144  * cdef (Py_ssize_t*) shape, strides, suboffsets
17145  */
17146 
17147 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17148  int __pyx_v_dim;
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;
17154  int __pyx_t_2;
17155  int __pyx_t_3;
17156  int __pyx_t_4;
17157  Py_ssize_t __pyx_t_5;
17158  __Pyx_RefNannySetupContext("slice_copy", 0);
17159 
17160  /* "View.MemoryView":1067
17161  * cdef (Py_ssize_t*) shape, strides, suboffsets
17162  *
17163  * shape = memview.view.shape # <<<<<<<<<<<<<<
17164  * strides = memview.view.strides
17165  * suboffsets = memview.view.suboffsets
17166  */
17167  __pyx_t_1 = __pyx_v_memview->view.shape;
17168  __pyx_v_shape = __pyx_t_1;
17169 
17170  /* "View.MemoryView":1068
17171  *
17172  * shape = memview.view.shape
17173  * strides = memview.view.strides # <<<<<<<<<<<<<<
17174  * suboffsets = memview.view.suboffsets
17175  *
17176  */
17177  __pyx_t_1 = __pyx_v_memview->view.strides;
17178  __pyx_v_strides = __pyx_t_1;
17179 
17180  /* "View.MemoryView":1069
17181  * shape = memview.view.shape
17182  * strides = memview.view.strides
17183  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
17184  *
17185  * dst.memview = <__pyx_memoryview *> memview
17186  */
17187  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17188  __pyx_v_suboffsets = __pyx_t_1;
17189 
17190  /* "View.MemoryView":1071
17191  * suboffsets = memview.view.suboffsets
17192  *
17193  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
17194  * dst.data = <char *> memview.view.buf
17195  *
17196  */
17197  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
17198 
17199  /* "View.MemoryView":1072
17200  *
17201  * dst.memview = <__pyx_memoryview *> memview
17202  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
17203  *
17204  * for dim in range(memview.view.ndim):
17205  */
17206  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
17207 
17208  /* "View.MemoryView":1074
17209  * dst.data = <char *> memview.view.buf
17210  *
17211  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
17212  * dst.shape[dim] = shape[dim]
17213  * dst.strides[dim] = strides[dim]
17214  */
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;
17219 
17220  /* "View.MemoryView":1075
17221  *
17222  * for dim in range(memview.view.ndim):
17223  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
17224  * dst.strides[dim] = strides[dim]
17225  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17226  */
17227  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17228 
17229  /* "View.MemoryView":1076
17230  * for dim in range(memview.view.ndim):
17231  * dst.shape[dim] = shape[dim]
17232  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
17233  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17234  *
17235  */
17236  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17237 
17238  /* "View.MemoryView":1077
17239  * dst.shape[dim] = shape[dim]
17240  * dst.strides[dim] = strides[dim]
17241  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
17242  *
17243  * @cname('__pyx_memoryview_copy_object')
17244  */
17245  if ((__pyx_v_suboffsets != 0)) {
17246  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
17247  } else {
17248  __pyx_t_5 = -1L;
17249  }
17250  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
17251  }
17252 
17253  /* "View.MemoryView":1063
17254  *
17255  * @cname('__pyx_memoryview_slice_copy')
17256  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17257  * cdef int dim
17258  * cdef (Py_ssize_t*) shape, strides, suboffsets
17259  */
17260 
17261  /* function exit code */
17262  __Pyx_RefNannyFinishContext();
17263 }
17264 
17265 /* "View.MemoryView":1080
17266  *
17267  * @cname('__pyx_memoryview_copy_object')
17268  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
17269  * "Create a new memoryview object"
17270  * cdef __Pyx_memviewslice memviewslice
17271  */
17272 
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);
17282 
17283  /* "View.MemoryView":1083
17284  * "Create a new memoryview object"
17285  * cdef __Pyx_memviewslice memviewslice
17286  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
17287  * return memoryview_copy_from_slice(memview, &memviewslice)
17288  *
17289  */
17290  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
17291 
17292  /* "View.MemoryView":1084
17293  * cdef __Pyx_memviewslice memviewslice
17294  * slice_copy(memview, &memviewslice)
17295  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
17296  *
17297  * @cname('__pyx_memoryview_copy_object_from_slice')
17298  */
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;
17303  __pyx_t_1 = 0;
17304  goto __pyx_L0;
17305 
17306  /* "View.MemoryView":1080
17307  *
17308  * @cname('__pyx_memoryview_copy_object')
17309  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
17310  * "Create a new memoryview object"
17311  * cdef __Pyx_memviewslice memviewslice
17312  */
17313 
17314  /* function exit code */
17315  __pyx_L1_error:;
17316  __Pyx_XDECREF(__pyx_t_1);
17317  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
17318  __pyx_r = 0;
17319  __pyx_L0:;
17320  __Pyx_XGIVEREF(__pyx_r);
17321  __Pyx_RefNannyFinishContext();
17322  return __pyx_r;
17323 }
17324 
17325 /* "View.MemoryView":1087
17326  *
17327  * @cname('__pyx_memoryview_copy_object_from_slice')
17328  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
17329  * """
17330  * Create a new memoryview object from a given memoryview object and slice.
17331  */
17332 
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
17338  int __pyx_t_1;
17339  int __pyx_t_2;
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);
17347 
17348  /* "View.MemoryView":1094
17349  * cdef int (*to_dtype_func)(char *, object) except 0
17350  *
17351  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17352  * to_object_func = (<_memoryviewslice> memview).to_object_func
17353  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17354  */
17355  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17356  __pyx_t_2 = (__pyx_t_1 != 0);
17357  if (__pyx_t_2) {
17358 
17359  /* "View.MemoryView":1095
17360  *
17361  * if isinstance(memview, _memoryviewslice):
17362  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
17363  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17364  * else:
17365  */
17366  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
17367  __pyx_v_to_object_func = __pyx_t_3;
17368 
17369  /* "View.MemoryView":1096
17370  * if isinstance(memview, _memoryviewslice):
17371  * to_object_func = (<_memoryviewslice> memview).to_object_func
17372  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
17373  * else:
17374  * to_object_func = NULL
17375  */
17376  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
17377  __pyx_v_to_dtype_func = __pyx_t_4;
17378 
17379  /* "View.MemoryView":1094
17380  * cdef int (*to_dtype_func)(char *, object) except 0
17381  *
17382  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17383  * to_object_func = (<_memoryviewslice> memview).to_object_func
17384  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17385  */
17386  goto __pyx_L3;
17387  }
17388 
17389  /* "View.MemoryView":1098
17390  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17391  * else:
17392  * to_object_func = NULL # <<<<<<<<<<<<<<
17393  * to_dtype_func = NULL
17394  *
17395  */
17396  /*else*/ {
17397  __pyx_v_to_object_func = NULL;
17398 
17399  /* "View.MemoryView":1099
17400  * else:
17401  * to_object_func = NULL
17402  * to_dtype_func = NULL # <<<<<<<<<<<<<<
17403  *
17404  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17405  */
17406  __pyx_v_to_dtype_func = NULL;
17407  }
17408  __pyx_L3:;
17409 
17410  /* "View.MemoryView":1101
17411  * to_dtype_func = NULL
17412  *
17413  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
17414  * to_object_func, to_dtype_func,
17415  * memview.dtype_is_object)
17416  */
17417  __Pyx_XDECREF(__pyx_r);
17418 
17419  /* "View.MemoryView":1103
17420  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17421  * to_object_func, to_dtype_func,
17422  * memview.dtype_is_object) # <<<<<<<<<<<<<<
17423  *
17424  *
17425  */
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;
17429  __pyx_t_5 = 0;
17430  goto __pyx_L0;
17431 
17432  /* "View.MemoryView":1087
17433  *
17434  * @cname('__pyx_memoryview_copy_object_from_slice')
17435  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
17436  * """
17437  * Create a new memoryview object from a given memoryview object and slice.
17438  */
17439 
17440  /* function exit code */
17441  __pyx_L1_error:;
17442  __Pyx_XDECREF(__pyx_t_5);
17443  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17444  __pyx_r = 0;
17445  __pyx_L0:;
17446  __Pyx_XGIVEREF(__pyx_r);
17447  __Pyx_RefNannyFinishContext();
17448  return __pyx_r;
17449 }
17450 
17451 /* "View.MemoryView":1109
17452  *
17453  *
17454  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
17455  * if arg < 0:
17456  * return -arg
17457  */
17458 
17459 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
17460  Py_ssize_t __pyx_r;
17461  int __pyx_t_1;
17462 
17463  /* "View.MemoryView":1110
17464  *
17465  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17466  * if arg < 0: # <<<<<<<<<<<<<<
17467  * return -arg
17468  * else:
17469  */
17470  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
17471  if (__pyx_t_1) {
17472 
17473  /* "View.MemoryView":1111
17474  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17475  * if arg < 0:
17476  * return -arg # <<<<<<<<<<<<<<
17477  * else:
17478  * return arg
17479  */
17480  __pyx_r = (-__pyx_v_arg);
17481  goto __pyx_L0;
17482 
17483  /* "View.MemoryView":1110
17484  *
17485  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17486  * if arg < 0: # <<<<<<<<<<<<<<
17487  * return -arg
17488  * else:
17489  */
17490  }
17491 
17492  /* "View.MemoryView":1113
17493  * return -arg
17494  * else:
17495  * return arg # <<<<<<<<<<<<<<
17496  *
17497  * @cname('__pyx_get_best_slice_order')
17498  */
17499  /*else*/ {
17500  __pyx_r = __pyx_v_arg;
17501  goto __pyx_L0;
17502  }
17503 
17504  /* "View.MemoryView":1109
17505  *
17506  *
17507  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
17508  * if arg < 0:
17509  * return -arg
17510  */
17511 
17512  /* function exit code */
17513  __pyx_L0:;
17514  return __pyx_r;
17515 }
17516 
17517 /* "View.MemoryView":1116
17518  *
17519  * @cname('__pyx_get_best_slice_order')
17520  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
17521  * """
17522  * Figure out the best memory access order for a given slice.
17523  */
17524 
17525 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
17526  int __pyx_v_i;
17527  Py_ssize_t __pyx_v_c_stride;
17528  Py_ssize_t __pyx_v_f_stride;
17529  char __pyx_r;
17530  int __pyx_t_1;
17531  int __pyx_t_2;
17532  int __pyx_t_3;
17533  int __pyx_t_4;
17534 
17535  /* "View.MemoryView":1121
17536  * """
17537  * cdef int i
17538  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
17539  * cdef Py_ssize_t f_stride = 0
17540  *
17541  */
17542  __pyx_v_c_stride = 0;
17543 
17544  /* "View.MemoryView":1122
17545  * cdef int i
17546  * cdef Py_ssize_t c_stride = 0
17547  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
17548  *
17549  * for i in range(ndim - 1, -1, -1):
17550  */
17551  __pyx_v_f_stride = 0;
17552 
17553  /* "View.MemoryView":1124
17554  * cdef Py_ssize_t f_stride = 0
17555  *
17556  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17557  * if mslice.shape[i] > 1:
17558  * c_stride = mslice.strides[i]
17559  */
17560  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17561  __pyx_v_i = __pyx_t_1;
17562 
17563  /* "View.MemoryView":1125
17564  *
17565  * for i in range(ndim - 1, -1, -1):
17566  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17567  * c_stride = mslice.strides[i]
17568  * break
17569  */
17570  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17571  if (__pyx_t_2) {
17572 
17573  /* "View.MemoryView":1126
17574  * for i in range(ndim - 1, -1, -1):
17575  * if mslice.shape[i] > 1:
17576  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
17577  * break
17578  *
17579  */
17580  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17581 
17582  /* "View.MemoryView":1127
17583  * if mslice.shape[i] > 1:
17584  * c_stride = mslice.strides[i]
17585  * break # <<<<<<<<<<<<<<
17586  *
17587  * for i in range(ndim):
17588  */
17589  goto __pyx_L4_break;
17590 
17591  /* "View.MemoryView":1125
17592  *
17593  * for i in range(ndim - 1, -1, -1):
17594  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17595  * c_stride = mslice.strides[i]
17596  * break
17597  */
17598  }
17599  }
17600  __pyx_L4_break:;
17601 
17602  /* "View.MemoryView":1129
17603  * break
17604  *
17605  * for i in range(ndim): # <<<<<<<<<<<<<<
17606  * if mslice.shape[i] > 1:
17607  * f_stride = mslice.strides[i]
17608  */
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;
17613 
17614  /* "View.MemoryView":1130
17615  *
17616  * for i in range(ndim):
17617  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17618  * f_stride = mslice.strides[i]
17619  * break
17620  */
17621  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17622  if (__pyx_t_2) {
17623 
17624  /* "View.MemoryView":1131
17625  * for i in range(ndim):
17626  * if mslice.shape[i] > 1:
17627  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
17628  * break
17629  *
17630  */
17631  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17632 
17633  /* "View.MemoryView":1132
17634  * if mslice.shape[i] > 1:
17635  * f_stride = mslice.strides[i]
17636  * break # <<<<<<<<<<<<<<
17637  *
17638  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
17639  */
17640  goto __pyx_L7_break;
17641 
17642  /* "View.MemoryView":1130
17643  *
17644  * for i in range(ndim):
17645  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17646  * f_stride = mslice.strides[i]
17647  * break
17648  */
17649  }
17650  }
17651  __pyx_L7_break:;
17652 
17653  /* "View.MemoryView":1134
17654  * break
17655  *
17656  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
17657  * return 'C'
17658  * else:
17659  */
17660  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
17661  if (__pyx_t_2) {
17662 
17663  /* "View.MemoryView":1135
17664  *
17665  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
17666  * return 'C' # <<<<<<<<<<<<<<
17667  * else:
17668  * return 'F'
17669  */
17670  __pyx_r = 'C';
17671  goto __pyx_L0;
17672 
17673  /* "View.MemoryView":1134
17674  * break
17675  *
17676  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
17677  * return 'C'
17678  * else:
17679  */
17680  }
17681 
17682  /* "View.MemoryView":1137
17683  * return 'C'
17684  * else:
17685  * return 'F' # <<<<<<<<<<<<<<
17686  *
17687  * @cython.cdivision(True)
17688  */
17689  /*else*/ {
17690  __pyx_r = 'F';
17691  goto __pyx_L0;
17692  }
17693 
17694  /* "View.MemoryView":1116
17695  *
17696  * @cname('__pyx_get_best_slice_order')
17697  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
17698  * """
17699  * Figure out the best memory access order for a given slice.
17700  */
17701 
17702  /* function exit code */
17703  __pyx_L0:;
17704  return __pyx_r;
17705 }
17706 
17707 /* "View.MemoryView":1140
17708  *
17709  * @cython.cdivision(True)
17710  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
17711  * char *dst_data, Py_ssize_t *dst_strides,
17712  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
17713  */
17714 
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;
17721  int __pyx_t_1;
17722  int __pyx_t_2;
17723  int __pyx_t_3;
17724  Py_ssize_t __pyx_t_4;
17725  Py_ssize_t __pyx_t_5;
17726  Py_ssize_t __pyx_t_6;
17727 
17728  /* "View.MemoryView":1147
17729  *
17730  * cdef Py_ssize_t i
17731  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
17732  * cdef Py_ssize_t dst_extent = dst_shape[0]
17733  * cdef Py_ssize_t src_stride = src_strides[0]
17734  */
17735  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
17736 
17737  /* "View.MemoryView":1148
17738  * cdef Py_ssize_t i
17739  * cdef Py_ssize_t src_extent = src_shape[0]
17740  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
17741  * cdef Py_ssize_t src_stride = src_strides[0]
17742  * cdef Py_ssize_t dst_stride = dst_strides[0]
17743  */
17744  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
17745 
17746  /* "View.MemoryView":1149
17747  * cdef Py_ssize_t src_extent = src_shape[0]
17748  * cdef Py_ssize_t dst_extent = dst_shape[0]
17749  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
17750  * cdef Py_ssize_t dst_stride = dst_strides[0]
17751  *
17752  */
17753  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
17754 
17755  /* "View.MemoryView":1150
17756  * cdef Py_ssize_t dst_extent = dst_shape[0]
17757  * cdef Py_ssize_t src_stride = src_strides[0]
17758  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
17759  *
17760  * if ndim == 1:
17761  */
17762  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
17763 
17764  /* "View.MemoryView":1152
17765  * cdef Py_ssize_t dst_stride = dst_strides[0]
17766  *
17767  * if ndim == 1: # <<<<<<<<<<<<<<
17768  * if (src_stride > 0 and dst_stride > 0 and
17769  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17770  */
17771  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
17772  if (__pyx_t_1) {
17773 
17774  /* "View.MemoryView":1153
17775  *
17776  * if ndim == 1:
17777  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
17778  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17779  * memcpy(dst_data, src_data, itemsize * dst_extent)
17780  */
17781  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
17782  if (__pyx_t_2) {
17783  } else {
17784  __pyx_t_1 = __pyx_t_2;
17785  goto __pyx_L5_bool_binop_done;
17786  }
17787  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
17788  if (__pyx_t_2) {
17789  } else {
17790  __pyx_t_1 = __pyx_t_2;
17791  goto __pyx_L5_bool_binop_done;
17792  }
17793 
17794  /* "View.MemoryView":1154
17795  * if ndim == 1:
17796  * if (src_stride > 0 and dst_stride > 0 and
17797  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
17798  * memcpy(dst_data, src_data, itemsize * dst_extent)
17799  * else:
17800  */
17801  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
17802  if (__pyx_t_2) {
17803  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
17804  }
17805  __pyx_t_3 = (__pyx_t_2 != 0);
17806  __pyx_t_1 = __pyx_t_3;
17807  __pyx_L5_bool_binop_done:;
17808 
17809  /* "View.MemoryView":1153
17810  *
17811  * if ndim == 1:
17812  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
17813  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17814  * memcpy(dst_data, src_data, itemsize * dst_extent)
17815  */
17816  if (__pyx_t_1) {
17817 
17818  /* "View.MemoryView":1155
17819  * if (src_stride > 0 and dst_stride > 0 and
17820  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17821  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
17822  * else:
17823  * for i in range(dst_extent):
17824  */
17825  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
17826 
17827  /* "View.MemoryView":1153
17828  *
17829  * if ndim == 1:
17830  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
17831  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17832  * memcpy(dst_data, src_data, itemsize * dst_extent)
17833  */
17834  goto __pyx_L4;
17835  }
17836 
17837  /* "View.MemoryView":1157
17838  * memcpy(dst_data, src_data, itemsize * dst_extent)
17839  * else:
17840  * for i in range(dst_extent): # <<<<<<<<<<<<<<
17841  * memcpy(dst_data, src_data, itemsize)
17842  * src_data += src_stride
17843  */
17844  /*else*/ {
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;
17849 
17850  /* "View.MemoryView":1158
17851  * else:
17852  * for i in range(dst_extent):
17853  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
17854  * src_data += src_stride
17855  * dst_data += dst_stride
17856  */
17857  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
17858 
17859  /* "View.MemoryView":1159
17860  * for i in range(dst_extent):
17861  * memcpy(dst_data, src_data, itemsize)
17862  * src_data += src_stride # <<<<<<<<<<<<<<
17863  * dst_data += dst_stride
17864  * else:
17865  */
17866  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17867 
17868  /* "View.MemoryView":1160
17869  * memcpy(dst_data, src_data, itemsize)
17870  * src_data += src_stride
17871  * dst_data += dst_stride # <<<<<<<<<<<<<<
17872  * else:
17873  * for i in range(dst_extent):
17874  */
17875  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17876  }
17877  }
17878  __pyx_L4:;
17879 
17880  /* "View.MemoryView":1152
17881  * cdef Py_ssize_t dst_stride = dst_strides[0]
17882  *
17883  * if ndim == 1: # <<<<<<<<<<<<<<
17884  * if (src_stride > 0 and dst_stride > 0 and
17885  * <size_t> src_stride == itemsize == <size_t> dst_stride):
17886  */
17887  goto __pyx_L3;
17888  }
17889 
17890  /* "View.MemoryView":1162
17891  * dst_data += dst_stride
17892  * else:
17893  * for i in range(dst_extent): # <<<<<<<<<<<<<<
17894  * _copy_strided_to_strided(src_data, src_strides + 1,
17895  * dst_data, dst_strides + 1,
17896  */
17897  /*else*/ {
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;
17902 
17903  /* "View.MemoryView":1163
17904  * else:
17905  * for i in range(dst_extent):
17906  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
17907  * dst_data, dst_strides + 1,
17908  * src_shape + 1, dst_shape + 1,
17909  */
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);
17911 
17912  /* "View.MemoryView":1167
17913  * src_shape + 1, dst_shape + 1,
17914  * ndim - 1, itemsize)
17915  * src_data += src_stride # <<<<<<<<<<<<<<
17916  * dst_data += dst_stride
17917  *
17918  */
17919  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17920 
17921  /* "View.MemoryView":1168
17922  * ndim - 1, itemsize)
17923  * src_data += src_stride
17924  * dst_data += dst_stride # <<<<<<<<<<<<<<
17925  *
17926  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
17927  */
17928  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17929  }
17930  }
17931  __pyx_L3:;
17932 
17933  /* "View.MemoryView":1140
17934  *
17935  * @cython.cdivision(True)
17936  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
17937  * char *dst_data, Py_ssize_t *dst_strides,
17938  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
17939  */
17940 
17941  /* function exit code */
17942 }
17943 
17944 /* "View.MemoryView":1170
17945  * dst_data += dst_stride
17946  *
17947  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17948  * __Pyx_memviewslice *dst,
17949  * int ndim, size_t itemsize) nogil:
17950  */
17951 
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) {
17953 
17954  /* "View.MemoryView":1173
17955  * __Pyx_memviewslice *dst,
17956  * int ndim, size_t itemsize) nogil:
17957  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
17958  * src.shape, dst.shape, ndim, itemsize)
17959  *
17960  */
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);
17962 
17963  /* "View.MemoryView":1170
17964  * dst_data += dst_stride
17965  *
17966  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17967  * __Pyx_memviewslice *dst,
17968  * int ndim, size_t itemsize) nogil:
17969  */
17970 
17971  /* function exit code */
17972 }
17973 
17974 /* "View.MemoryView":1177
17975  *
17976  * @cname('__pyx_memoryview_slice_get_size')
17977  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
17978  * "Return the size of the memory occupied by the slice in number of bytes"
17979  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17980  */
17981 
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;
17990 
17991  /* "View.MemoryView":1179
17992  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
17993  * "Return the size of the memory occupied by the slice in number of bytes"
17994  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
17995  *
17996  * for shape in src.shape[:ndim]:
17997  */
17998  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17999  __pyx_v_size = __pyx_t_1;
18000 
18001  /* "View.MemoryView":1181
18002  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18003  *
18004  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
18005  * size *= shape
18006  *
18007  */
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]);
18012 
18013  /* "View.MemoryView":1182
18014  *
18015  * for shape in src.shape[:ndim]:
18016  * size *= shape # <<<<<<<<<<<<<<
18017  *
18018  * return size
18019  */
18020  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18021  }
18022 
18023  /* "View.MemoryView":1184
18024  * size *= shape
18025  *
18026  * return size # <<<<<<<<<<<<<<
18027  *
18028  * @cname('__pyx_fill_contig_strides_array')
18029  */
18030  __pyx_r = __pyx_v_size;
18031  goto __pyx_L0;
18032 
18033  /* "View.MemoryView":1177
18034  *
18035  * @cname('__pyx_memoryview_slice_get_size')
18036  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18037  * "Return the size of the memory occupied by the slice in number of bytes"
18038  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18039  */
18040 
18041  /* function exit code */
18042  __pyx_L0:;
18043  return __pyx_r;
18044 }
18045 
18046 /* "View.MemoryView":1187
18047  *
18048  * @cname('__pyx_fill_contig_strides_array')
18049  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18050  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18051  * int ndim, char order) nogil:
18052  */
18053 
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) {
18055  int __pyx_v_idx;
18056  Py_ssize_t __pyx_r;
18057  int __pyx_t_1;
18058  int __pyx_t_2;
18059  int __pyx_t_3;
18060  int __pyx_t_4;
18061 
18062  /* "View.MemoryView":1196
18063  * cdef int idx
18064  *
18065  * if order == 'F': # <<<<<<<<<<<<<<
18066  * for idx in range(ndim):
18067  * strides[idx] = stride
18068  */
18069  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
18070  if (__pyx_t_1) {
18071 
18072  /* "View.MemoryView":1197
18073  *
18074  * if order == 'F':
18075  * for idx in range(ndim): # <<<<<<<<<<<<<<
18076  * strides[idx] = stride
18077  * stride *= shape[idx]
18078  */
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;
18083 
18084  /* "View.MemoryView":1198
18085  * if order == 'F':
18086  * for idx in range(ndim):
18087  * strides[idx] = stride # <<<<<<<<<<<<<<
18088  * stride *= shape[idx]
18089  * else:
18090  */
18091  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18092 
18093  /* "View.MemoryView":1199
18094  * for idx in range(ndim):
18095  * strides[idx] = stride
18096  * stride *= shape[idx] # <<<<<<<<<<<<<<
18097  * else:
18098  * for idx in range(ndim - 1, -1, -1):
18099  */
18100  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18101  }
18102 
18103  /* "View.MemoryView":1196
18104  * cdef int idx
18105  *
18106  * if order == 'F': # <<<<<<<<<<<<<<
18107  * for idx in range(ndim):
18108  * strides[idx] = stride
18109  */
18110  goto __pyx_L3;
18111  }
18112 
18113  /* "View.MemoryView":1201
18114  * stride *= shape[idx]
18115  * else:
18116  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18117  * strides[idx] = stride
18118  * stride *= shape[idx]
18119  */
18120  /*else*/ {
18121  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18122  __pyx_v_idx = __pyx_t_2;
18123 
18124  /* "View.MemoryView":1202
18125  * else:
18126  * for idx in range(ndim - 1, -1, -1):
18127  * strides[idx] = stride # <<<<<<<<<<<<<<
18128  * stride *= shape[idx]
18129  *
18130  */
18131  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18132 
18133  /* "View.MemoryView":1203
18134  * for idx in range(ndim - 1, -1, -1):
18135  * strides[idx] = stride
18136  * stride *= shape[idx] # <<<<<<<<<<<<<<
18137  *
18138  * return stride
18139  */
18140  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18141  }
18142  }
18143  __pyx_L3:;
18144 
18145  /* "View.MemoryView":1205
18146  * stride *= shape[idx]
18147  *
18148  * return stride # <<<<<<<<<<<<<<
18149  *
18150  * @cname('__pyx_memoryview_copy_data_to_temp')
18151  */
18152  __pyx_r = __pyx_v_stride;
18153  goto __pyx_L0;
18154 
18155  /* "View.MemoryView":1187
18156  *
18157  * @cname('__pyx_fill_contig_strides_array')
18158  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18159  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18160  * int ndim, char order) nogil:
18161  */
18162 
18163  /* function exit code */
18164  __pyx_L0:;
18165  return __pyx_r;
18166 }
18167 
18168 /* "View.MemoryView":1208
18169  *
18170  * @cname('__pyx_memoryview_copy_data_to_temp')
18171  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18172  * __Pyx_memviewslice *tmpslice,
18173  * char order,
18174  */
18175 
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) {
18177  int __pyx_v_i;
18178  void *__pyx_v_result;
18179  size_t __pyx_v_itemsize;
18180  size_t __pyx_v_size;
18181  void *__pyx_r;
18182  Py_ssize_t __pyx_t_1;
18183  int __pyx_t_2;
18184  int __pyx_t_3;
18185  struct __pyx_memoryview_obj *__pyx_t_4;
18186  int __pyx_t_5;
18187  int __pyx_t_6;
18188  int __pyx_lineno = 0;
18189  const char *__pyx_filename = NULL;
18190  int __pyx_clineno = 0;
18191 
18192  /* "View.MemoryView":1219
18193  * cdef void *result
18194  *
18195  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
18196  * cdef size_t size = slice_get_size(src, ndim)
18197  *
18198  */
18199  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18200  __pyx_v_itemsize = __pyx_t_1;
18201 
18202  /* "View.MemoryView":1220
18203  *
18204  * cdef size_t itemsize = src.memview.view.itemsize
18205  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
18206  *
18207  * result = malloc(size)
18208  */
18209  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18210 
18211  /* "View.MemoryView":1222
18212  * cdef size_t size = slice_get_size(src, ndim)
18213  *
18214  * result = malloc(size) # <<<<<<<<<<<<<<
18215  * if not result:
18216  * _err(MemoryError, NULL)
18217  */
18218  __pyx_v_result = malloc(__pyx_v_size);
18219 
18220  /* "View.MemoryView":1223
18221  *
18222  * result = malloc(size)
18223  * if not result: # <<<<<<<<<<<<<<
18224  * _err(MemoryError, NULL)
18225  *
18226  */
18227  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
18228  if (__pyx_t_2) {
18229 
18230  /* "View.MemoryView":1224
18231  * result = malloc(size)
18232  * if not result:
18233  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
18234  *
18235  *
18236  */
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)
18238 
18239  /* "View.MemoryView":1223
18240  *
18241  * result = malloc(size)
18242  * if not result: # <<<<<<<<<<<<<<
18243  * _err(MemoryError, NULL)
18244  *
18245  */
18246  }
18247 
18248  /* "View.MemoryView":1227
18249  *
18250  *
18251  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
18252  * tmpslice.memview = src.memview
18253  * for i in range(ndim):
18254  */
18255  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
18256 
18257  /* "View.MemoryView":1228
18258  *
18259  * tmpslice.data = <char *> result
18260  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
18261  * for i in range(ndim):
18262  * tmpslice.shape[i] = src.shape[i]
18263  */
18264  __pyx_t_4 = __pyx_v_src->memview;
18265  __pyx_v_tmpslice->memview = __pyx_t_4;
18266 
18267  /* "View.MemoryView":1229
18268  * tmpslice.data = <char *> result
18269  * tmpslice.memview = src.memview
18270  * for i in range(ndim): # <<<<<<<<<<<<<<
18271  * tmpslice.shape[i] = src.shape[i]
18272  * tmpslice.suboffsets[i] = -1
18273  */
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;
18278 
18279  /* "View.MemoryView":1230
18280  * tmpslice.memview = src.memview
18281  * for i in range(ndim):
18282  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
18283  * tmpslice.suboffsets[i] = -1
18284  *
18285  */
18286  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
18287 
18288  /* "View.MemoryView":1231
18289  * for i in range(ndim):
18290  * tmpslice.shape[i] = src.shape[i]
18291  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
18292  *
18293  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
18294  */
18295  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
18296  }
18297 
18298  /* "View.MemoryView":1233
18299  * tmpslice.suboffsets[i] = -1
18300  *
18301  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
18302  * ndim, order)
18303  *
18304  */
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));
18306 
18307  /* "View.MemoryView":1237
18308  *
18309  *
18310  * for i in range(ndim): # <<<<<<<<<<<<<<
18311  * if tmpslice.shape[i] == 1:
18312  * tmpslice.strides[i] = 0
18313  */
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;
18318 
18319  /* "View.MemoryView":1238
18320  *
18321  * for i in range(ndim):
18322  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
18323  * tmpslice.strides[i] = 0
18324  *
18325  */
18326  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
18327  if (__pyx_t_2) {
18328 
18329  /* "View.MemoryView":1239
18330  * for i in range(ndim):
18331  * if tmpslice.shape[i] == 1:
18332  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
18333  *
18334  * if slice_is_contig(src[0], order, ndim):
18335  */
18336  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
18337 
18338  /* "View.MemoryView":1238
18339  *
18340  * for i in range(ndim):
18341  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
18342  * tmpslice.strides[i] = 0
18343  *
18344  */
18345  }
18346  }
18347 
18348  /* "View.MemoryView":1241
18349  * tmpslice.strides[i] = 0
18350  *
18351  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
18352  * memcpy(result, src.data, size)
18353  * else:
18354  */
18355  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
18356  if (__pyx_t_2) {
18357 
18358  /* "View.MemoryView":1242
18359  *
18360  * if slice_is_contig(src[0], order, ndim):
18361  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
18362  * else:
18363  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18364  */
18365  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
18366 
18367  /* "View.MemoryView":1241
18368  * tmpslice.strides[i] = 0
18369  *
18370  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
18371  * memcpy(result, src.data, size)
18372  * else:
18373  */
18374  goto __pyx_L9;
18375  }
18376 
18377  /* "View.MemoryView":1244
18378  * memcpy(result, src.data, size)
18379  * else:
18380  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
18381  *
18382  * return result
18383  */
18384  /*else*/ {
18385  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
18386  }
18387  __pyx_L9:;
18388 
18389  /* "View.MemoryView":1246
18390  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18391  *
18392  * return result # <<<<<<<<<<<<<<
18393  *
18394  *
18395  */
18396  __pyx_r = __pyx_v_result;
18397  goto __pyx_L0;
18398 
18399  /* "View.MemoryView":1208
18400  *
18401  * @cname('__pyx_memoryview_copy_data_to_temp')
18402  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18403  * __Pyx_memviewslice *tmpslice,
18404  * char order,
18405  */
18406 
18407  /* function exit code */
18408  __pyx_L1_error:;
18409  {
18410  #ifdef WITH_THREAD
18411  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18412  #endif
18413  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
18414  #ifdef WITH_THREAD
18415  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18416  #endif
18417  }
18418  __pyx_r = NULL;
18419  __pyx_L0:;
18420  return __pyx_r;
18421 }
18422 
18423 /* "View.MemoryView":1251
18424  *
18425  * @cname('__pyx_memoryview_err_extents')
18426  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
18427  * Py_ssize_t extent2) except -1 with gil:
18428  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18429  */
18430 
18431 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
18432  int __pyx_r;
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;
18441  #ifdef WITH_THREAD
18442  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18443  #endif
18444  __Pyx_RefNannySetupContext("_err_extents", 0);
18445 
18446  /* "View.MemoryView":1254
18447  * Py_ssize_t extent2) except -1 with gil:
18448  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18449  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
18450  *
18451  * @cname('__pyx_memoryview_err_dim')
18452  */
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);
18467  __pyx_t_1 = 0;
18468  __pyx_t_2 = 0;
18469  __pyx_t_3 = 0;
18470 
18471  /* "View.MemoryView":1253
18472  * cdef int _err_extents(int i, Py_ssize_t extent1,
18473  * Py_ssize_t extent2) except -1 with gil:
18474  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
18475  * (i, extent1, extent2))
18476  *
18477  */
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)
18487 
18488  /* "View.MemoryView":1251
18489  *
18490  * @cname('__pyx_memoryview_err_extents')
18491  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
18492  * Py_ssize_t extent2) except -1 with gil:
18493  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18494  */
18495 
18496  /* function exit code */
18497  __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);
18503  __pyx_r = -1;
18504  __Pyx_RefNannyFinishContext();
18505  #ifdef WITH_THREAD
18506  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18507  #endif
18508  return __pyx_r;
18509 }
18510 
18511 /* "View.MemoryView":1257
18512  *
18513  * @cname('__pyx_memoryview_err_dim')
18514  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
18515  * raise error(msg.decode('ascii') % dim)
18516  *
18517  */
18518 
18519 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
18520  int __pyx_r;
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;
18529  #ifdef WITH_THREAD
18530  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18531  #endif
18532  __Pyx_RefNannySetupContext("_err_dim", 0);
18533  __Pyx_INCREF(__pyx_v_error);
18534 
18535  /* "View.MemoryView":1258
18536  * @cname('__pyx_memoryview_err_dim')
18537  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
18538  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
18539  *
18540  * @cname('__pyx_memoryview_err')
18541  */
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);
18559  }
18560  }
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)
18570 
18571  /* "View.MemoryView":1257
18572  *
18573  * @cname('__pyx_memoryview_err_dim')
18574  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
18575  * raise error(msg.decode('ascii') % dim)
18576  *
18577  */
18578 
18579  /* function exit code */
18580  __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);
18586  __pyx_r = -1;
18587  __Pyx_XDECREF(__pyx_v_error);
18588  __Pyx_RefNannyFinishContext();
18589  #ifdef WITH_THREAD
18590  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18591  #endif
18592  return __pyx_r;
18593 }
18594 
18595 /* "View.MemoryView":1261
18596  *
18597  * @cname('__pyx_memoryview_err')
18598  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
18599  * if msg != NULL:
18600  * raise error(msg.decode('ascii'))
18601  */
18602 
18603 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
18604  int __pyx_r;
18605  __Pyx_RefNannyDeclarations
18606  int __pyx_t_1;
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;
18614  #ifdef WITH_THREAD
18615  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18616  #endif
18617  __Pyx_RefNannySetupContext("_err", 0);
18618  __Pyx_INCREF(__pyx_v_error);
18619 
18620  /* "View.MemoryView":1262
18621  * @cname('__pyx_memoryview_err')
18622  * cdef int _err(object error, char *msg) except -1 with gil:
18623  * if msg != NULL: # <<<<<<<<<<<<<<
18624  * raise error(msg.decode('ascii'))
18625  * else:
18626  */
18627  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
18628  if (unlikely(__pyx_t_1)) {
18629 
18630  /* "View.MemoryView":1263
18631  * cdef int _err(object error, char *msg) except -1 with gil:
18632  * if msg != NULL:
18633  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
18634  * else:
18635  * raise error
18636  */
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);
18648  }
18649  }
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)
18659 
18660  /* "View.MemoryView":1262
18661  * @cname('__pyx_memoryview_err')
18662  * cdef int _err(object error, char *msg) except -1 with gil:
18663  * if msg != NULL: # <<<<<<<<<<<<<<
18664  * raise error(msg.decode('ascii'))
18665  * else:
18666  */
18667  }
18668 
18669  /* "View.MemoryView":1265
18670  * raise error(msg.decode('ascii'))
18671  * else:
18672  * raise error # <<<<<<<<<<<<<<
18673  *
18674  * @cname('__pyx_memoryview_copy_contents')
18675  */
18676  /*else*/ {
18677  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
18678  __PYX_ERR(1, 1265, __pyx_L1_error)
18679  }
18680 
18681  /* "View.MemoryView":1261
18682  *
18683  * @cname('__pyx_memoryview_err')
18684  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
18685  * if msg != NULL:
18686  * raise error(msg.decode('ascii'))
18687  */
18688 
18689  /* function exit code */
18690  __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);
18696  __pyx_r = -1;
18697  __Pyx_XDECREF(__pyx_v_error);
18698  __Pyx_RefNannyFinishContext();
18699  #ifdef WITH_THREAD
18700  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18701  #endif
18702  return __pyx_r;
18703 }
18704 
18705 /* "View.MemoryView":1268
18706  *
18707  * @cname('__pyx_memoryview_copy_contents')
18708  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
18709  * __Pyx_memviewslice dst,
18710  * int src_ndim, int dst_ndim,
18711  */
18712 
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;
18716  int __pyx_v_i;
18717  char __pyx_v_order;
18718  int __pyx_v_broadcasting;
18719  int __pyx_v_direct_copy;
18720  __Pyx_memviewslice __pyx_v_tmp;
18721  int __pyx_v_ndim;
18722  int __pyx_r;
18723  Py_ssize_t __pyx_t_1;
18724  int __pyx_t_2;
18725  int __pyx_t_3;
18726  int __pyx_t_4;
18727  int __pyx_t_5;
18728  int __pyx_t_6;
18729  void *__pyx_t_7;
18730  int __pyx_t_8;
18731  int __pyx_lineno = 0;
18732  const char *__pyx_filename = NULL;
18733  int __pyx_clineno = 0;
18734 
18735  /* "View.MemoryView":1276
18736  * Check for overlapping memory and verify the shapes.
18737  * """
18738  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
18739  * cdef size_t itemsize = src.memview.view.itemsize
18740  * cdef int i
18741  */
18742  __pyx_v_tmpdata = NULL;
18743 
18744  /* "View.MemoryView":1277
18745  * """
18746  * cdef void *tmpdata = NULL
18747  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
18748  * cdef int i
18749  * cdef char order = get_best_order(&src, src_ndim)
18750  */
18751  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
18752  __pyx_v_itemsize = __pyx_t_1;
18753 
18754  /* "View.MemoryView":1279
18755  * cdef size_t itemsize = src.memview.view.itemsize
18756  * cdef int i
18757  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
18758  * cdef bint broadcasting = False
18759  * cdef bint direct_copy = False
18760  */
18761  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
18762 
18763  /* "View.MemoryView":1280
18764  * cdef int i
18765  * cdef char order = get_best_order(&src, src_ndim)
18766  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
18767  * cdef bint direct_copy = False
18768  * cdef __Pyx_memviewslice tmp
18769  */
18770  __pyx_v_broadcasting = 0;
18771 
18772  /* "View.MemoryView":1281
18773  * cdef char order = get_best_order(&src, src_ndim)
18774  * cdef bint broadcasting = False
18775  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
18776  * cdef __Pyx_memviewslice tmp
18777  *
18778  */
18779  __pyx_v_direct_copy = 0;
18780 
18781  /* "View.MemoryView":1284
18782  * cdef __Pyx_memviewslice tmp
18783  *
18784  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
18785  * broadcast_leading(&src, src_ndim, dst_ndim)
18786  * elif dst_ndim < src_ndim:
18787  */
18788  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
18789  if (__pyx_t_2) {
18790 
18791  /* "View.MemoryView":1285
18792  *
18793  * if src_ndim < dst_ndim:
18794  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
18795  * elif dst_ndim < src_ndim:
18796  * broadcast_leading(&dst, dst_ndim, src_ndim)
18797  */
18798  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
18799 
18800  /* "View.MemoryView":1284
18801  * cdef __Pyx_memviewslice tmp
18802  *
18803  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
18804  * broadcast_leading(&src, src_ndim, dst_ndim)
18805  * elif dst_ndim < src_ndim:
18806  */
18807  goto __pyx_L3;
18808  }
18809 
18810  /* "View.MemoryView":1286
18811  * if src_ndim < dst_ndim:
18812  * broadcast_leading(&src, src_ndim, dst_ndim)
18813  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
18814  * broadcast_leading(&dst, dst_ndim, src_ndim)
18815  *
18816  */
18817  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
18818  if (__pyx_t_2) {
18819 
18820  /* "View.MemoryView":1287
18821  * broadcast_leading(&src, src_ndim, dst_ndim)
18822  * elif dst_ndim < src_ndim:
18823  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
18824  *
18825  * cdef int ndim = max(src_ndim, dst_ndim)
18826  */
18827  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
18828 
18829  /* "View.MemoryView":1286
18830  * if src_ndim < dst_ndim:
18831  * broadcast_leading(&src, src_ndim, dst_ndim)
18832  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
18833  * broadcast_leading(&dst, dst_ndim, src_ndim)
18834  *
18835  */
18836  }
18837  __pyx_L3:;
18838 
18839  /* "View.MemoryView":1289
18840  * broadcast_leading(&dst, dst_ndim, src_ndim)
18841  *
18842  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
18843  *
18844  * for i in range(ndim):
18845  */
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;
18850  } else {
18851  __pyx_t_5 = __pyx_t_4;
18852  }
18853  __pyx_v_ndim = __pyx_t_5;
18854 
18855  /* "View.MemoryView":1291
18856  * cdef int ndim = max(src_ndim, dst_ndim)
18857  *
18858  * for i in range(ndim): # <<<<<<<<<<<<<<
18859  * if src.shape[i] != dst.shape[i]:
18860  * if src.shape[i] == 1:
18861  */
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;
18866 
18867  /* "View.MemoryView":1292
18868  *
18869  * for i in range(ndim):
18870  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
18871  * if src.shape[i] == 1:
18872  * broadcasting = True
18873  */
18874  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
18875  if (__pyx_t_2) {
18876 
18877  /* "View.MemoryView":1293
18878  * for i in range(ndim):
18879  * if src.shape[i] != dst.shape[i]:
18880  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
18881  * broadcasting = True
18882  * src.strides[i] = 0
18883  */
18884  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
18885  if (__pyx_t_2) {
18886 
18887  /* "View.MemoryView":1294
18888  * if src.shape[i] != dst.shape[i]:
18889  * if src.shape[i] == 1:
18890  * broadcasting = True # <<<<<<<<<<<<<<
18891  * src.strides[i] = 0
18892  * else:
18893  */
18894  __pyx_v_broadcasting = 1;
18895 
18896  /* "View.MemoryView":1295
18897  * if src.shape[i] == 1:
18898  * broadcasting = True
18899  * src.strides[i] = 0 # <<<<<<<<<<<<<<
18900  * else:
18901  * _err_extents(i, dst.shape[i], src.shape[i])
18902  */
18903  (__pyx_v_src.strides[__pyx_v_i]) = 0;
18904 
18905  /* "View.MemoryView":1293
18906  * for i in range(ndim):
18907  * if src.shape[i] != dst.shape[i]:
18908  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
18909  * broadcasting = True
18910  * src.strides[i] = 0
18911  */
18912  goto __pyx_L7;
18913  }
18914 
18915  /* "View.MemoryView":1297
18916  * src.strides[i] = 0
18917  * else:
18918  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
18919  *
18920  * if src.suboffsets[i] >= 0:
18921  */
18922  /*else*/ {
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)
18924  }
18925  __pyx_L7:;
18926 
18927  /* "View.MemoryView":1292
18928  *
18929  * for i in range(ndim):
18930  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
18931  * if src.shape[i] == 1:
18932  * broadcasting = True
18933  */
18934  }
18935 
18936  /* "View.MemoryView":1299
18937  * _err_extents(i, dst.shape[i], src.shape[i])
18938  *
18939  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
18940  * _err_dim(ValueError, "Dimension %d is not direct", i)
18941  *
18942  */
18943  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
18944  if (__pyx_t_2) {
18945 
18946  /* "View.MemoryView":1300
18947  *
18948  * if src.suboffsets[i] >= 0:
18949  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
18950  *
18951  * if slices_overlap(&src, &dst, ndim, itemsize):
18952  */
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)
18954 
18955  /* "View.MemoryView":1299
18956  * _err_extents(i, dst.shape[i], src.shape[i])
18957  *
18958  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
18959  * _err_dim(ValueError, "Dimension %d is not direct", i)
18960  *
18961  */
18962  }
18963  }
18964 
18965  /* "View.MemoryView":1302
18966  * _err_dim(ValueError, "Dimension %d is not direct", i)
18967  *
18968  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
18969  *
18970  * if not slice_is_contig(src, order, ndim):
18971  */
18972  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
18973  if (__pyx_t_2) {
18974 
18975  /* "View.MemoryView":1304
18976  * if slices_overlap(&src, &dst, ndim, itemsize):
18977  *
18978  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
18979  * order = get_best_order(&dst, ndim)
18980  *
18981  */
18982  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
18983  if (__pyx_t_2) {
18984 
18985  /* "View.MemoryView":1305
18986  *
18987  * if not slice_is_contig(src, order, ndim):
18988  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
18989  *
18990  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
18991  */
18992  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
18993 
18994  /* "View.MemoryView":1304
18995  * if slices_overlap(&src, &dst, ndim, itemsize):
18996  *
18997  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
18998  * order = get_best_order(&dst, ndim)
18999  *
19000  */
19001  }
19002 
19003  /* "View.MemoryView":1307
19004  * order = get_best_order(&dst, ndim)
19005  *
19006  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
19007  * src = tmp
19008  *
19009  */
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;
19012 
19013  /* "View.MemoryView":1308
19014  *
19015  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19016  * src = tmp # <<<<<<<<<<<<<<
19017  *
19018  * if not broadcasting:
19019  */
19020  __pyx_v_src = __pyx_v_tmp;
19021 
19022  /* "View.MemoryView":1302
19023  * _err_dim(ValueError, "Dimension %d is not direct", i)
19024  *
19025  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19026  *
19027  * if not slice_is_contig(src, order, ndim):
19028  */
19029  }
19030 
19031  /* "View.MemoryView":1310
19032  * src = tmp
19033  *
19034  * if not broadcasting: # <<<<<<<<<<<<<<
19035  *
19036  *
19037  */
19038  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19039  if (__pyx_t_2) {
19040 
19041  /* "View.MemoryView":1313
19042  *
19043  *
19044  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19045  * direct_copy = slice_is_contig(dst, 'C', ndim)
19046  * elif slice_is_contig(src, 'F', ndim):
19047  */
19048  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
19049  if (__pyx_t_2) {
19050 
19051  /* "View.MemoryView":1314
19052  *
19053  * if slice_is_contig(src, 'C', ndim):
19054  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
19055  * elif slice_is_contig(src, 'F', ndim):
19056  * direct_copy = slice_is_contig(dst, 'F', ndim)
19057  */
19058  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
19059 
19060  /* "View.MemoryView":1313
19061  *
19062  *
19063  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19064  * direct_copy = slice_is_contig(dst, 'C', ndim)
19065  * elif slice_is_contig(src, 'F', ndim):
19066  */
19067  goto __pyx_L12;
19068  }
19069 
19070  /* "View.MemoryView":1315
19071  * if slice_is_contig(src, 'C', ndim):
19072  * direct_copy = slice_is_contig(dst, 'C', ndim)
19073  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19074  * direct_copy = slice_is_contig(dst, 'F', ndim)
19075  *
19076  */
19077  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
19078  if (__pyx_t_2) {
19079 
19080  /* "View.MemoryView":1316
19081  * direct_copy = slice_is_contig(dst, 'C', ndim)
19082  * elif slice_is_contig(src, 'F', ndim):
19083  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
19084  *
19085  * if direct_copy:
19086  */
19087  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
19088 
19089  /* "View.MemoryView":1315
19090  * if slice_is_contig(src, 'C', ndim):
19091  * direct_copy = slice_is_contig(dst, 'C', ndim)
19092  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19093  * direct_copy = slice_is_contig(dst, 'F', ndim)
19094  *
19095  */
19096  }
19097  __pyx_L12:;
19098 
19099  /* "View.MemoryView":1318
19100  * direct_copy = slice_is_contig(dst, 'F', ndim)
19101  *
19102  * if direct_copy: # <<<<<<<<<<<<<<
19103  *
19104  * refcount_copying(&dst, dtype_is_object, ndim, False)
19105  */
19106  __pyx_t_2 = (__pyx_v_direct_copy != 0);
19107  if (__pyx_t_2) {
19108 
19109  /* "View.MemoryView":1320
19110  * if direct_copy:
19111  *
19112  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19113  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19114  * refcount_copying(&dst, dtype_is_object, ndim, True)
19115  */
19116  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19117 
19118  /* "View.MemoryView":1321
19119  *
19120  * refcount_copying(&dst, dtype_is_object, ndim, False)
19121  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
19122  * refcount_copying(&dst, dtype_is_object, ndim, True)
19123  * free(tmpdata)
19124  */
19125  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19126 
19127  /* "View.MemoryView":1322
19128  * refcount_copying(&dst, dtype_is_object, ndim, False)
19129  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19130  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19131  * free(tmpdata)
19132  * return 0
19133  */
19134  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19135 
19136  /* "View.MemoryView":1323
19137  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19138  * refcount_copying(&dst, dtype_is_object, ndim, True)
19139  * free(tmpdata) # <<<<<<<<<<<<<<
19140  * return 0
19141  *
19142  */
19143  free(__pyx_v_tmpdata);
19144 
19145  /* "View.MemoryView":1324
19146  * refcount_copying(&dst, dtype_is_object, ndim, True)
19147  * free(tmpdata)
19148  * return 0 # <<<<<<<<<<<<<<
19149  *
19150  * if order == 'F' == get_best_order(&dst, ndim):
19151  */
19152  __pyx_r = 0;
19153  goto __pyx_L0;
19154 
19155  /* "View.MemoryView":1318
19156  * direct_copy = slice_is_contig(dst, 'F', ndim)
19157  *
19158  * if direct_copy: # <<<<<<<<<<<<<<
19159  *
19160  * refcount_copying(&dst, dtype_is_object, ndim, False)
19161  */
19162  }
19163 
19164  /* "View.MemoryView":1310
19165  * src = tmp
19166  *
19167  * if not broadcasting: # <<<<<<<<<<<<<<
19168  *
19169  *
19170  */
19171  }
19172 
19173  /* "View.MemoryView":1326
19174  * return 0
19175  *
19176  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
19177  *
19178  *
19179  */
19180  __pyx_t_2 = (__pyx_v_order == 'F');
19181  if (__pyx_t_2) {
19182  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
19183  }
19184  __pyx_t_8 = (__pyx_t_2 != 0);
19185  if (__pyx_t_8) {
19186 
19187  /* "View.MemoryView":1329
19188  *
19189  *
19190  * transpose_memslice(&src) # <<<<<<<<<<<<<<
19191  * transpose_memslice(&dst)
19192  *
19193  */
19194  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
19195 
19196  /* "View.MemoryView":1330
19197  *
19198  * transpose_memslice(&src)
19199  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
19200  *
19201  * refcount_copying(&dst, dtype_is_object, ndim, False)
19202  */
19203  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
19204 
19205  /* "View.MemoryView":1326
19206  * return 0
19207  *
19208  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
19209  *
19210  *
19211  */
19212  }
19213 
19214  /* "View.MemoryView":1332
19215  * transpose_memslice(&dst)
19216  *
19217  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19218  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
19219  * refcount_copying(&dst, dtype_is_object, ndim, True)
19220  */
19221  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19222 
19223  /* "View.MemoryView":1333
19224  *
19225  * refcount_copying(&dst, dtype_is_object, ndim, False)
19226  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
19227  * refcount_copying(&dst, dtype_is_object, ndim, True)
19228  *
19229  */
19230  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
19231 
19232  /* "View.MemoryView":1334
19233  * refcount_copying(&dst, dtype_is_object, ndim, False)
19234  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
19235  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19236  *
19237  * free(tmpdata)
19238  */
19239  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19240 
19241  /* "View.MemoryView":1336
19242  * refcount_copying(&dst, dtype_is_object, ndim, True)
19243  *
19244  * free(tmpdata) # <<<<<<<<<<<<<<
19245  * return 0
19246  *
19247  */
19248  free(__pyx_v_tmpdata);
19249 
19250  /* "View.MemoryView":1337
19251  *
19252  * free(tmpdata)
19253  * return 0 # <<<<<<<<<<<<<<
19254  *
19255  * @cname('__pyx_memoryview_broadcast_leading')
19256  */
19257  __pyx_r = 0;
19258  goto __pyx_L0;
19259 
19260  /* "View.MemoryView":1268
19261  *
19262  * @cname('__pyx_memoryview_copy_contents')
19263  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19264  * __Pyx_memviewslice dst,
19265  * int src_ndim, int dst_ndim,
19266  */
19267 
19268  /* function exit code */
19269  __pyx_L1_error:;
19270  {
19271  #ifdef WITH_THREAD
19272  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19273  #endif
19274  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19275  #ifdef WITH_THREAD
19276  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19277  #endif
19278  }
19279  __pyx_r = -1;
19280  __pyx_L0:;
19281  return __pyx_r;
19282 }
19283 
19284 /* "View.MemoryView":1340
19285  *
19286  * @cname('__pyx_memoryview_broadcast_leading')
19287  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
19288  * int ndim,
19289  * int ndim_other) nogil:
19290  */
19291 
19292 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
19293  int __pyx_v_i;
19294  int __pyx_v_offset;
19295  int __pyx_t_1;
19296  int __pyx_t_2;
19297  int __pyx_t_3;
19298 
19299  /* "View.MemoryView":1344
19300  * int ndim_other) nogil:
19301  * cdef int i
19302  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
19303  *
19304  * for i in range(ndim - 1, -1, -1):
19305  */
19306  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
19307 
19308  /* "View.MemoryView":1346
19309  * cdef int offset = ndim_other - ndim
19310  *
19311  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19312  * mslice.shape[i + offset] = mslice.shape[i]
19313  * mslice.strides[i + offset] = mslice.strides[i]
19314  */
19315  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19316  __pyx_v_i = __pyx_t_1;
19317 
19318  /* "View.MemoryView":1347
19319  *
19320  * for i in range(ndim - 1, -1, -1):
19321  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
19322  * mslice.strides[i + offset] = mslice.strides[i]
19323  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19324  */
19325  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
19326 
19327  /* "View.MemoryView":1348
19328  * for i in range(ndim - 1, -1, -1):
19329  * mslice.shape[i + offset] = mslice.shape[i]
19330  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
19331  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19332  *
19333  */
19334  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
19335 
19336  /* "View.MemoryView":1349
19337  * mslice.shape[i + offset] = mslice.shape[i]
19338  * mslice.strides[i + offset] = mslice.strides[i]
19339  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
19340  *
19341  * for i in range(offset):
19342  */
19343  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
19344  }
19345 
19346  /* "View.MemoryView":1351
19347  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19348  *
19349  * for i in range(offset): # <<<<<<<<<<<<<<
19350  * mslice.shape[i] = 1
19351  * mslice.strides[i] = mslice.strides[0]
19352  */
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;
19357 
19358  /* "View.MemoryView":1352
19359  *
19360  * for i in range(offset):
19361  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
19362  * mslice.strides[i] = mslice.strides[0]
19363  * mslice.suboffsets[i] = -1
19364  */
19365  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
19366 
19367  /* "View.MemoryView":1353
19368  * for i in range(offset):
19369  * mslice.shape[i] = 1
19370  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
19371  * mslice.suboffsets[i] = -1
19372  *
19373  */
19374  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
19375 
19376  /* "View.MemoryView":1354
19377  * mslice.shape[i] = 1
19378  * mslice.strides[i] = mslice.strides[0]
19379  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19380  *
19381  *
19382  */
19383  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
19384  }
19385 
19386  /* "View.MemoryView":1340
19387  *
19388  * @cname('__pyx_memoryview_broadcast_leading')
19389  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
19390  * int ndim,
19391  * int ndim_other) nogil:
19392  */
19393 
19394  /* function exit code */
19395 }
19396 
19397 /* "View.MemoryView":1362
19398  *
19399  * @cname('__pyx_memoryview_refcount_copying')
19400  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
19401  * int ndim, bint inc) nogil:
19402  *
19403  */
19404 
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) {
19406  int __pyx_t_1;
19407 
19408  /* "View.MemoryView":1366
19409  *
19410  *
19411  * if dtype_is_object: # <<<<<<<<<<<<<<
19412  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
19413  * dst.strides, ndim, inc)
19414  */
19415  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
19416  if (__pyx_t_1) {
19417 
19418  /* "View.MemoryView":1367
19419  *
19420  * if dtype_is_object:
19421  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
19422  * dst.strides, ndim, inc)
19423  *
19424  */
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);
19426 
19427  /* "View.MemoryView":1366
19428  *
19429  *
19430  * if dtype_is_object: # <<<<<<<<<<<<<<
19431  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
19432  * dst.strides, ndim, inc)
19433  */
19434  }
19435 
19436  /* "View.MemoryView":1362
19437  *
19438  * @cname('__pyx_memoryview_refcount_copying')
19439  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
19440  * int ndim, bint inc) nogil:
19441  *
19442  */
19443 
19444  /* function exit code */
19445 }
19446 
19447 /* "View.MemoryView":1371
19448  *
19449  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19450  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19451  * Py_ssize_t *strides, int ndim,
19452  * bint inc) with gil:
19453  */
19454 
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
19457  #ifdef WITH_THREAD
19458  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19459  #endif
19460  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
19461 
19462  /* "View.MemoryView":1374
19463  * Py_ssize_t *strides, int ndim,
19464  * bint inc) with gil:
19465  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
19466  *
19467  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19468  */
19469  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
19470 
19471  /* "View.MemoryView":1371
19472  *
19473  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19474  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19475  * Py_ssize_t *strides, int ndim,
19476  * bint inc) with gil:
19477  */
19478 
19479  /* function exit code */
19480  __Pyx_RefNannyFinishContext();
19481  #ifdef WITH_THREAD
19482  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19483  #endif
19484 }
19485 
19486 /* "View.MemoryView":1377
19487  *
19488  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19489  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19490  * Py_ssize_t *strides, int ndim, bint inc):
19491  * cdef Py_ssize_t i
19492  */
19493 
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;
19500  int __pyx_t_4;
19501  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
19502 
19503  /* "View.MemoryView":1381
19504  * cdef Py_ssize_t i
19505  *
19506  * for i in range(shape[0]): # <<<<<<<<<<<<<<
19507  * if ndim == 1:
19508  * if inc:
19509  */
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;
19514 
19515  /* "View.MemoryView":1382
19516  *
19517  * for i in range(shape[0]):
19518  * if ndim == 1: # <<<<<<<<<<<<<<
19519  * if inc:
19520  * Py_INCREF((<PyObject **> data)[0])
19521  */
19522  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
19523  if (__pyx_t_4) {
19524 
19525  /* "View.MemoryView":1383
19526  * for i in range(shape[0]):
19527  * if ndim == 1:
19528  * if inc: # <<<<<<<<<<<<<<
19529  * Py_INCREF((<PyObject **> data)[0])
19530  * else:
19531  */
19532  __pyx_t_4 = (__pyx_v_inc != 0);
19533  if (__pyx_t_4) {
19534 
19535  /* "View.MemoryView":1384
19536  * if ndim == 1:
19537  * if inc:
19538  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
19539  * else:
19540  * Py_DECREF((<PyObject **> data)[0])
19541  */
19542  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
19543 
19544  /* "View.MemoryView":1383
19545  * for i in range(shape[0]):
19546  * if ndim == 1:
19547  * if inc: # <<<<<<<<<<<<<<
19548  * Py_INCREF((<PyObject **> data)[0])
19549  * else:
19550  */
19551  goto __pyx_L6;
19552  }
19553 
19554  /* "View.MemoryView":1386
19555  * Py_INCREF((<PyObject **> data)[0])
19556  * else:
19557  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
19558  * else:
19559  * refcount_objects_in_slice(data, shape + 1, strides + 1,
19560  */
19561  /*else*/ {
19562  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
19563  }
19564  __pyx_L6:;
19565 
19566  /* "View.MemoryView":1382
19567  *
19568  * for i in range(shape[0]):
19569  * if ndim == 1: # <<<<<<<<<<<<<<
19570  * if inc:
19571  * Py_INCREF((<PyObject **> data)[0])
19572  */
19573  goto __pyx_L5;
19574  }
19575 
19576  /* "View.MemoryView":1388
19577  * Py_DECREF((<PyObject **> data)[0])
19578  * else:
19579  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
19580  * ndim - 1, inc)
19581  *
19582  */
19583  /*else*/ {
19584 
19585  /* "View.MemoryView":1389
19586  * else:
19587  * refcount_objects_in_slice(data, shape + 1, strides + 1,
19588  * ndim - 1, inc) # <<<<<<<<<<<<<<
19589  *
19590  * data += strides[0]
19591  */
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);
19593  }
19594  __pyx_L5:;
19595 
19596  /* "View.MemoryView":1391
19597  * ndim - 1, inc)
19598  *
19599  * data += strides[0] # <<<<<<<<<<<<<<
19600  *
19601  *
19602  */
19603  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
19604  }
19605 
19606  /* "View.MemoryView":1377
19607  *
19608  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19609  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19610  * Py_ssize_t *strides, int ndim, bint inc):
19611  * cdef Py_ssize_t i
19612  */
19613 
19614  /* function exit code */
19615  __Pyx_RefNannyFinishContext();
19616 }
19617 
19618 /* "View.MemoryView":1397
19619  *
19620  * @cname('__pyx_memoryview_slice_assign_scalar')
19621  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
19622  * size_t itemsize, void *item,
19623  * bint dtype_is_object) nogil:
19624  */
19625 
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) {
19627 
19628  /* "View.MemoryView":1400
19629  * size_t itemsize, void *item,
19630  * bint dtype_is_object) nogil:
19631  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19632  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
19633  * itemsize, item)
19634  */
19635  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19636 
19637  /* "View.MemoryView":1401
19638  * bint dtype_is_object) nogil:
19639  * refcount_copying(dst, dtype_is_object, ndim, False)
19640  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
19641  * itemsize, item)
19642  * refcount_copying(dst, dtype_is_object, ndim, True)
19643  */
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);
19645 
19646  /* "View.MemoryView":1403
19647  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
19648  * itemsize, item)
19649  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19650  *
19651  *
19652  */
19653  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19654 
19655  /* "View.MemoryView":1397
19656  *
19657  * @cname('__pyx_memoryview_slice_assign_scalar')
19658  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
19659  * size_t itemsize, void *item,
19660  * bint dtype_is_object) nogil:
19661  */
19662 
19663  /* function exit code */
19664 }
19665 
19666 /* "View.MemoryView":1407
19667  *
19668  * @cname('__pyx_memoryview__slice_assign_scalar')
19669  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19670  * Py_ssize_t *strides, int ndim,
19671  * size_t itemsize, void *item) nogil:
19672  */
19673 
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;
19678  int __pyx_t_1;
19679  Py_ssize_t __pyx_t_2;
19680  Py_ssize_t __pyx_t_3;
19681  Py_ssize_t __pyx_t_4;
19682 
19683  /* "View.MemoryView":1411
19684  * size_t itemsize, void *item) nogil:
19685  * cdef Py_ssize_t i
19686  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
19687  * cdef Py_ssize_t extent = shape[0]
19688  *
19689  */
19690  __pyx_v_stride = (__pyx_v_strides[0]);
19691 
19692  /* "View.MemoryView":1412
19693  * cdef Py_ssize_t i
19694  * cdef Py_ssize_t stride = strides[0]
19695  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
19696  *
19697  * if ndim == 1:
19698  */
19699  __pyx_v_extent = (__pyx_v_shape[0]);
19700 
19701  /* "View.MemoryView":1414
19702  * cdef Py_ssize_t extent = shape[0]
19703  *
19704  * if ndim == 1: # <<<<<<<<<<<<<<
19705  * for i in range(extent):
19706  * memcpy(data, item, itemsize)
19707  */
19708  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
19709  if (__pyx_t_1) {
19710 
19711  /* "View.MemoryView":1415
19712  *
19713  * if ndim == 1:
19714  * for i in range(extent): # <<<<<<<<<<<<<<
19715  * memcpy(data, item, itemsize)
19716  * data += stride
19717  */
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;
19722 
19723  /* "View.MemoryView":1416
19724  * if ndim == 1:
19725  * for i in range(extent):
19726  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
19727  * data += stride
19728  * else:
19729  */
19730  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
19731 
19732  /* "View.MemoryView":1417
19733  * for i in range(extent):
19734  * memcpy(data, item, itemsize)
19735  * data += stride # <<<<<<<<<<<<<<
19736  * else:
19737  * for i in range(extent):
19738  */
19739  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
19740  }
19741 
19742  /* "View.MemoryView":1414
19743  * cdef Py_ssize_t extent = shape[0]
19744  *
19745  * if ndim == 1: # <<<<<<<<<<<<<<
19746  * for i in range(extent):
19747  * memcpy(data, item, itemsize)
19748  */
19749  goto __pyx_L3;
19750  }
19751 
19752  /* "View.MemoryView":1419
19753  * data += stride
19754  * else:
19755  * for i in range(extent): # <<<<<<<<<<<<<<
19756  * _slice_assign_scalar(data, shape + 1, strides + 1,
19757  * ndim - 1, itemsize, item)
19758  */
19759  /*else*/ {
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;
19764 
19765  /* "View.MemoryView":1420
19766  * else:
19767  * for i in range(extent):
19768  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
19769  * ndim - 1, itemsize, item)
19770  * data += stride
19771  */
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);
19773 
19774  /* "View.MemoryView":1422
19775  * _slice_assign_scalar(data, shape + 1, strides + 1,
19776  * ndim - 1, itemsize, item)
19777  * data += stride # <<<<<<<<<<<<<<
19778  *
19779  *
19780  */
19781  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
19782  }
19783  }
19784  __pyx_L3:;
19785 
19786  /* "View.MemoryView":1407
19787  *
19788  * @cname('__pyx_memoryview__slice_assign_scalar')
19789  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19790  * Py_ssize_t *strides, int ndim,
19791  * size_t itemsize, void *item) nogil:
19792  */
19793 
19794  /* function exit code */
19795 }
19796 
19797 /* "(tree fragment)":1
19798  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
19799  * cdef object __pyx_PickleError
19800  * cdef object __pyx_result
19801  */
19802 
19803 /* Python wrapper */
19804 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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);
19816  {
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;
19829  case 0: break;
19830  default: goto __pyx_L5_argtuple_error;
19831  }
19832  kw_args = PyDict_Size(__pyx_kwds);
19833  switch (pos_args) {
19834  case 0:
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;
19838  case 1:
19839  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
19840  else {
19841  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
19842  }
19843  CYTHON_FALLTHROUGH;
19844  case 2:
19845  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
19846  else {
19847  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
19848  }
19849  }
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)
19852  }
19853  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
19854  goto __pyx_L5_argtuple_error;
19855  } else {
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);
19859  }
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];
19863  }
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)
19867  __pyx_L3_error:;
19868  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
19869  __Pyx_RefNannyFinishContext();
19870  return NULL;
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);
19873 
19874  /* function exit code */
19875  __Pyx_RefNannyFinishContext();
19876  return __pyx_r;
19877 }
19878 
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;
19885  int __pyx_t_2;
19886  int __pyx_t_3;
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);
19894 
19895  /* "(tree fragment)":4
19896  * cdef object __pyx_PickleError
19897  * cdef object __pyx_result
19898  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
19899  * from pickle import PickleError as __pyx_PickleError
19900  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19901  */
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);
19907  if (__pyx_t_3) {
19908 
19909  /* "(tree fragment)":5
19910  * cdef object __pyx_result
19911  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
19912  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
19913  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19914  * __pyx_result = Enum.__new__(__pyx_type)
19915  */
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;
19930 
19931  /* "(tree fragment)":6
19932  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
19933  * from pickle import PickleError as __pyx_PickleError
19934  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
19935  * __pyx_result = Enum.__new__(__pyx_type)
19936  * if __pyx_state is not None:
19937  */
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);
19952  }
19953  }
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)
19963 
19964  /* "(tree fragment)":4
19965  * cdef object __pyx_PickleError
19966  * cdef object __pyx_result
19967  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
19968  * from pickle import PickleError as __pyx_PickleError
19969  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19970  */
19971  }
19972 
19973  /* "(tree fragment)":7
19974  * from pickle import PickleError as __pyx_PickleError
19975  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19976  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
19977  * if __pyx_state is not None:
19978  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19979  */
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);
19982  __pyx_t_5 = NULL;
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);
19990  }
19991  }
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;
19998  __pyx_t_4 = 0;
19999 
20000  /* "(tree fragment)":8
20001  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20002  * __pyx_result = Enum.__new__(__pyx_type)
20003  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20004  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20005  * return __pyx_result
20006  */
20007  __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
20008  __pyx_t_2 = (__pyx_t_3 != 0);
20009  if (__pyx_t_2) {
20010 
20011  /* "(tree fragment)":9
20012  * __pyx_result = Enum.__new__(__pyx_type)
20013  * if __pyx_state is not None:
20014  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
20015  * return __pyx_result
20016  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20017  */
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;
20022 
20023  /* "(tree fragment)":8
20024  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20025  * __pyx_result = Enum.__new__(__pyx_type)
20026  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20027  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20028  * return __pyx_result
20029  */
20030  }
20031 
20032  /* "(tree fragment)":10
20033  * if __pyx_state is not None:
20034  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20035  * return __pyx_result # <<<<<<<<<<<<<<
20036  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20037  * __pyx_result.name = __pyx_state[0]
20038  */
20039  __Pyx_XDECREF(__pyx_r);
20040  __Pyx_INCREF(__pyx_v___pyx_result);
20041  __pyx_r = __pyx_v___pyx_result;
20042  goto __pyx_L0;
20043 
20044  /* "(tree fragment)":1
20045  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20046  * cdef object __pyx_PickleError
20047  * cdef object __pyx_result
20048  */
20049 
20050  /* function exit code */
20051  __pyx_L1_error:;
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);
20057  __pyx_r = NULL;
20058  __pyx_L0:;
20059  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20060  __Pyx_XDECREF(__pyx_v___pyx_result);
20061  __Pyx_XGIVEREF(__pyx_r);
20062  __Pyx_RefNannyFinishContext();
20063  return __pyx_r;
20064 }
20065 
20066 /* "(tree fragment)":11
20067  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20068  * return __pyx_result
20069  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
20070  * __pyx_result.name = __pyx_state[0]
20071  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20072  */
20073 
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;
20078  int __pyx_t_2;
20079  Py_ssize_t __pyx_t_3;
20080  int __pyx_t_4;
20081  int __pyx_t_5;
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);
20089 
20090  /* "(tree fragment)":12
20091  * return __pyx_result
20092  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20093  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
20094  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20095  * __pyx_result.__dict__.update(__pyx_state[1])
20096  */
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)
20100  }
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;
20107  __pyx_t_1 = 0;
20108 
20109  /* "(tree fragment)":13
20110  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20111  * __pyx_result.name = __pyx_state[0]
20112  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20113  * __pyx_result.__dict__.update(__pyx_state[1])
20114  */
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)
20118  }
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);
20121  if (__pyx_t_4) {
20122  } else {
20123  __pyx_t_2 = __pyx_t_4;
20124  goto __pyx_L4_bool_binop_done;
20125  }
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:;
20130  if (__pyx_t_2) {
20131 
20132  /* "(tree fragment)":14
20133  * __pyx_result.name = __pyx_state[0]
20134  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20135  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
20136  */
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)
20145  }
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);
20148  __pyx_t_8 = NULL;
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);
20156  }
20157  }
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;
20165 
20166  /* "(tree fragment)":13
20167  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20168  * __pyx_result.name = __pyx_state[0]
20169  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20170  * __pyx_result.__dict__.update(__pyx_state[1])
20171  */
20172  }
20173 
20174  /* "(tree fragment)":11
20175  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20176  * return __pyx_result
20177  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
20178  * __pyx_result.name = __pyx_state[0]
20179  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20180  */
20181 
20182  /* function exit code */
20183  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20184  goto __pyx_L0;
20185  __pyx_L1_error:;
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);
20191  __pyx_r = 0;
20192  __pyx_L0:;
20193  __Pyx_XGIVEREF(__pyx_r);
20194  __Pyx_RefNannyFinishContext();
20195  return __pyx_r;
20196 }
20197 
20198 static PyObject *__pyx_tp_new_15superluWrappers_cSparseMatrix(PyTypeObject *t, PyObject *a, PyObject *k) {
20199  PyObject *o;
20200  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20201  o = (*t->tp_alloc)(t, 0);
20202  } else {
20203  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20204  }
20205  if (unlikely(!o)) return 0;
20206  if (unlikely(__pyx_pw_15superluWrappers_13cSparseMatrix_1__cinit__(o, a, k) < 0)) goto bad;
20207  return o;
20208  bad:
20209  Py_DECREF(o); o = 0;
20210  return NULL;
20211 }
20212 
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;
20217  }
20218  #endif
20219  (*Py_TYPE(o)->tp_free)(o);
20220 }
20221 
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},
20225  {0, 0, 0, 0}
20226 };
20227 
20228 static PyTypeObject __pyx_type_15superluWrappers_cSparseMatrix = {
20229  PyVarObject_HEAD_INIT(0, 0)
20230  "superluWrappers.cSparseMatrix", /*tp_name*/
20231  sizeof(struct __pyx_obj_15superluWrappers_cSparseMatrix), /*tp_basicsize*/
20232  0, /*tp_itemsize*/
20233  __pyx_tp_dealloc_15superluWrappers_cSparseMatrix, /*tp_dealloc*/
20234  #if PY_VERSION_HEX < 0x030800b4
20235  0, /*tp_print*/
20236  #endif
20237  #if PY_VERSION_HEX >= 0x030800b4
20238  0, /*tp_vectorcall_offset*/
20239  #endif
20240  0, /*tp_getattr*/
20241  0, /*tp_setattr*/
20242  #if PY_MAJOR_VERSION < 3
20243  0, /*tp_compare*/
20244  #endif
20245  #if PY_MAJOR_VERSION >= 3
20246  0, /*tp_as_async*/
20247  #endif
20248  0, /*tp_repr*/
20249  0, /*tp_as_number*/
20250  0, /*tp_as_sequence*/
20251  0, /*tp_as_mapping*/
20252  0, /*tp_hash*/
20253  0, /*tp_call*/
20254  0, /*tp_str*/
20255  0, /*tp_getattro*/
20256  0, /*tp_setattro*/
20257  0, /*tp_as_buffer*/
20258  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
20259  0, /*tp_doc*/
20260  0, /*tp_traverse*/
20261  0, /*tp_clear*/
20262  0, /*tp_richcompare*/
20263  0, /*tp_weaklistoffset*/
20264  0, /*tp_iter*/
20265  0, /*tp_iternext*/
20266  __pyx_methods_15superluWrappers_cSparseMatrix, /*tp_methods*/
20267  0, /*tp_members*/
20268  0, /*tp_getset*/
20269  0, /*tp_base*/
20270  0, /*tp_dict*/
20271  0, /*tp_descr_get*/
20272  0, /*tp_descr_set*/
20273  0, /*tp_dictoffset*/
20274  0, /*tp_init*/
20275  0, /*tp_alloc*/
20276  __pyx_tp_new_15superluWrappers_cSparseMatrix, /*tp_new*/
20277  0, /*tp_free*/
20278  0, /*tp_is_gc*/
20279  0, /*tp_bases*/
20280  0, /*tp_mro*/
20281  0, /*tp_cache*/
20282  0, /*tp_subclasses*/
20283  0, /*tp_weaklist*/
20284  0, /*tp_del*/
20285  0, /*tp_version_tag*/
20286  #if PY_VERSION_HEX >= 0x030400a1
20287  0, /*tp_finalize*/
20288  #endif
20289  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20290  0, /*tp_vectorcall*/
20291  #endif
20292  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20293  0, /*tp_print*/
20294  #endif
20295  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20296  0, /*tp_pypy_flags*/
20297  #endif
20298 };
20299 static struct __pyx_vtabstruct_15superluWrappers_SparseFactor __pyx_vtable_15superluWrappers_SparseFactor;
20300 
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;
20303  PyObject *o;
20304  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20305  o = (*t->tp_alloc)(t, 0);
20306  } else {
20307  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20308  }
20309  if (unlikely(!o)) return 0;
20310  p = ((struct __pyx_obj_15superluWrappers_SparseFactor *)o);
20311  p->__pyx_vtab = __pyx_vtabptr_15superluWrappers_SparseFactor;
20312  return o;
20313 }
20314 
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;
20319  }
20320  #endif
20321  (*Py_TYPE(o)->tp_free)(o);
20322 }
20323 
20324 static PyObject *__pyx_getprop_15superluWrappers_12SparseFactor_dim(PyObject *o, CYTHON_UNUSED void *x) {
20325  return __pyx_pw_15superluWrappers_12SparseFactor_3dim_1__get__(o);
20326 }
20327 
20328 static int __pyx_setprop_15superluWrappers_12SparseFactor_dim(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20329  if (v) {
20330  return __pyx_pw_15superluWrappers_12SparseFactor_3dim_3__set__(o, v);
20331  }
20332  else {
20333  PyErr_SetString(PyExc_NotImplementedError, "__del__");
20334  return -1;
20335  }
20336 }
20337 
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},
20341  {0, 0, 0, 0}
20342 };
20343 
20344 static struct PyGetSetDef __pyx_getsets_15superluWrappers_SparseFactor[] = {
20345  {(char *)"dim", __pyx_getprop_15superluWrappers_12SparseFactor_dim, __pyx_setprop_15superluWrappers_12SparseFactor_dim, (char *)0, 0},
20346  {0, 0, 0, 0, 0}
20347 };
20348 
20349 static PyTypeObject __pyx_type_15superluWrappers_SparseFactor = {
20350  PyVarObject_HEAD_INIT(0, 0)
20351  "superluWrappers.SparseFactor", /*tp_name*/
20352  sizeof(struct __pyx_obj_15superluWrappers_SparseFactor), /*tp_basicsize*/
20353  0, /*tp_itemsize*/
20354  __pyx_tp_dealloc_15superluWrappers_SparseFactor, /*tp_dealloc*/
20355  #if PY_VERSION_HEX < 0x030800b4
20356  0, /*tp_print*/
20357  #endif
20358  #if PY_VERSION_HEX >= 0x030800b4
20359  0, /*tp_vectorcall_offset*/
20360  #endif
20361  0, /*tp_getattr*/
20362  0, /*tp_setattr*/
20363  #if PY_MAJOR_VERSION < 3
20364  0, /*tp_compare*/
20365  #endif
20366  #if PY_MAJOR_VERSION >= 3
20367  0, /*tp_as_async*/
20368  #endif
20369  0, /*tp_repr*/
20370  0, /*tp_as_number*/
20371  0, /*tp_as_sequence*/
20372  0, /*tp_as_mapping*/
20373  0, /*tp_hash*/
20374  0, /*tp_call*/
20375  0, /*tp_str*/
20376  0, /*tp_getattro*/
20377  0, /*tp_setattro*/
20378  0, /*tp_as_buffer*/
20379  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
20380  0, /*tp_doc*/
20381  0, /*tp_traverse*/
20382  0, /*tp_clear*/
20383  0, /*tp_richcompare*/
20384  0, /*tp_weaklistoffset*/
20385  0, /*tp_iter*/
20386  0, /*tp_iternext*/
20387  __pyx_methods_15superluWrappers_SparseFactor, /*tp_methods*/
20388  0, /*tp_members*/
20389  __pyx_getsets_15superluWrappers_SparseFactor, /*tp_getset*/
20390  0, /*tp_base*/
20391  0, /*tp_dict*/
20392  0, /*tp_descr_get*/
20393  0, /*tp_descr_set*/
20394  0, /*tp_dictoffset*/
20395  __pyx_pw_15superluWrappers_12SparseFactor_1__init__, /*tp_init*/
20396  0, /*tp_alloc*/
20397  __pyx_tp_new_15superluWrappers_SparseFactor, /*tp_new*/
20398  0, /*tp_free*/
20399  0, /*tp_is_gc*/
20400  0, /*tp_bases*/
20401  0, /*tp_mro*/
20402  0, /*tp_cache*/
20403  0, /*tp_subclasses*/
20404  0, /*tp_weaklist*/
20405  0, /*tp_del*/
20406  0, /*tp_version_tag*/
20407  #if PY_VERSION_HEX >= 0x030400a1
20408  0, /*tp_finalize*/
20409  #endif
20410  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20411  0, /*tp_vectorcall*/
20412  #endif
20413  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20414  0, /*tp_print*/
20415  #endif
20416  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20417  0, /*tp_pypy_flags*/
20418  #endif
20419 };
20420 static struct __pyx_vtabstruct_array __pyx_vtable_array;
20421 
20422 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
20423  struct __pyx_array_obj *p;
20424  PyObject *o;
20425  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20426  o = (*t->tp_alloc)(t, 0);
20427  } else {
20428  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20429  }
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;
20436  return o;
20437  bad:
20438  Py_DECREF(o); o = 0;
20439  return NULL;
20440 }
20441 
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;
20447  }
20448  #endif
20449  {
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);
20456  }
20457  Py_CLEAR(p->mode);
20458  Py_CLEAR(p->_format);
20459  (*Py_TYPE(o)->tp_free)(o);
20460 }
20461 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
20462  PyObject *r;
20463  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
20464  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20465  Py_DECREF(x);
20466  return r;
20467 }
20468 
20469 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
20470  if (v) {
20471  return __pyx_array___setitem__(o, i, v);
20472  }
20473  else {
20474  PyErr_Format(PyExc_NotImplementedError,
20475  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20476  return -1;
20477  }
20478 }
20479 
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)) {
20483  PyErr_Clear();
20484  v = __pyx_array___getattr__(o, n);
20485  }
20486  return v;
20487 }
20488 
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);
20491 }
20492 
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},
20497  {0, 0, 0, 0}
20498 };
20499 
20500 static struct PyGetSetDef __pyx_getsets_array[] = {
20501  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
20502  {0, 0, 0, 0, 0}
20503 };
20504 
20505 static PySequenceMethods __pyx_tp_as_sequence_array = {
20506  __pyx_array___len__, /*sq_length*/
20507  0, /*sq_concat*/
20508  0, /*sq_repeat*/
20509  __pyx_sq_item_array, /*sq_item*/
20510  0, /*sq_slice*/
20511  0, /*sq_ass_item*/
20512  0, /*sq_ass_slice*/
20513  0, /*sq_contains*/
20514  0, /*sq_inplace_concat*/
20515  0, /*sq_inplace_repeat*/
20516 };
20517 
20518 static PyMappingMethods __pyx_tp_as_mapping_array = {
20519  __pyx_array___len__, /*mp_length*/
20520  __pyx_array___getitem__, /*mp_subscript*/
20521  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
20522 };
20523 
20524 static PyBufferProcs __pyx_tp_as_buffer_array = {
20525  #if PY_MAJOR_VERSION < 3
20526  0, /*bf_getreadbuffer*/
20527  #endif
20528  #if PY_MAJOR_VERSION < 3
20529  0, /*bf_getwritebuffer*/
20530  #endif
20531  #if PY_MAJOR_VERSION < 3
20532  0, /*bf_getsegcount*/
20533  #endif
20534  #if PY_MAJOR_VERSION < 3
20535  0, /*bf_getcharbuffer*/
20536  #endif
20537  __pyx_array_getbuffer, /*bf_getbuffer*/
20538  0, /*bf_releasebuffer*/
20539 };
20540 
20541 static PyTypeObject __pyx_type___pyx_array = {
20542  PyVarObject_HEAD_INIT(0, 0)
20543  "superluWrappers.array", /*tp_name*/
20544  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
20545  0, /*tp_itemsize*/
20546  __pyx_tp_dealloc_array, /*tp_dealloc*/
20547  #if PY_VERSION_HEX < 0x030800b4
20548  0, /*tp_print*/
20549  #endif
20550  #if PY_VERSION_HEX >= 0x030800b4
20551  0, /*tp_vectorcall_offset*/
20552  #endif
20553  0, /*tp_getattr*/
20554  0, /*tp_setattr*/
20555  #if PY_MAJOR_VERSION < 3
20556  0, /*tp_compare*/
20557  #endif
20558  #if PY_MAJOR_VERSION >= 3
20559  0, /*tp_as_async*/
20560  #endif
20561  0, /*tp_repr*/
20562  0, /*tp_as_number*/
20563  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
20564  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
20565  0, /*tp_hash*/
20566  0, /*tp_call*/
20567  0, /*tp_str*/
20568  __pyx_tp_getattro_array, /*tp_getattro*/
20569  0, /*tp_setattro*/
20570  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
20571  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
20572  0, /*tp_doc*/
20573  0, /*tp_traverse*/
20574  0, /*tp_clear*/
20575  0, /*tp_richcompare*/
20576  0, /*tp_weaklistoffset*/
20577  0, /*tp_iter*/
20578  0, /*tp_iternext*/
20579  __pyx_methods_array, /*tp_methods*/
20580  0, /*tp_members*/
20581  __pyx_getsets_array, /*tp_getset*/
20582  0, /*tp_base*/
20583  0, /*tp_dict*/
20584  0, /*tp_descr_get*/
20585  0, /*tp_descr_set*/
20586  0, /*tp_dictoffset*/
20587  0, /*tp_init*/
20588  0, /*tp_alloc*/
20589  __pyx_tp_new_array, /*tp_new*/
20590  0, /*tp_free*/
20591  0, /*tp_is_gc*/
20592  0, /*tp_bases*/
20593  0, /*tp_mro*/
20594  0, /*tp_cache*/
20595  0, /*tp_subclasses*/
20596  0, /*tp_weaklist*/
20597  0, /*tp_del*/
20598  0, /*tp_version_tag*/
20599  #if PY_VERSION_HEX >= 0x030400a1
20600  0, /*tp_finalize*/
20601  #endif
20602  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20603  0, /*tp_vectorcall*/
20604  #endif
20605  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20606  0, /*tp_print*/
20607  #endif
20608  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20609  0, /*tp_pypy_flags*/
20610  #endif
20611 };
20612 
20613 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20614  struct __pyx_MemviewEnum_obj *p;
20615  PyObject *o;
20616  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20617  o = (*t->tp_alloc)(t, 0);
20618  } else {
20619  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20620  }
20621  if (unlikely(!o)) return 0;
20622  p = ((struct __pyx_MemviewEnum_obj *)o);
20623  p->name = Py_None; Py_INCREF(Py_None);
20624  return o;
20625 }
20626 
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;
20632  }
20633  #endif
20634  PyObject_GC_UnTrack(o);
20635  Py_CLEAR(p->name);
20636  (*Py_TYPE(o)->tp_free)(o);
20637 }
20638 
20639 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
20640  int e;
20641  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
20642  if (p->name) {
20643  e = (*v)(p->name, a); if (e) return e;
20644  }
20645  return 0;
20646 }
20647 
20648 static int __pyx_tp_clear_Enum(PyObject *o) {
20649  PyObject* tmp;
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);
20653  Py_XDECREF(tmp);
20654  return 0;
20655 }
20656 
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},
20660  {0, 0, 0, 0}
20661 };
20662 
20663 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
20664  PyVarObject_HEAD_INIT(0, 0)
20665  "superluWrappers.Enum", /*tp_name*/
20666  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
20667  0, /*tp_itemsize*/
20668  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
20669  #if PY_VERSION_HEX < 0x030800b4
20670  0, /*tp_print*/
20671  #endif
20672  #if PY_VERSION_HEX >= 0x030800b4
20673  0, /*tp_vectorcall_offset*/
20674  #endif
20675  0, /*tp_getattr*/
20676  0, /*tp_setattr*/
20677  #if PY_MAJOR_VERSION < 3
20678  0, /*tp_compare*/
20679  #endif
20680  #if PY_MAJOR_VERSION >= 3
20681  0, /*tp_as_async*/
20682  #endif
20683  __pyx_MemviewEnum___repr__, /*tp_repr*/
20684  0, /*tp_as_number*/
20685  0, /*tp_as_sequence*/
20686  0, /*tp_as_mapping*/
20687  0, /*tp_hash*/
20688  0, /*tp_call*/
20689  0, /*tp_str*/
20690  0, /*tp_getattro*/
20691  0, /*tp_setattro*/
20692  0, /*tp_as_buffer*/
20693  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20694  0, /*tp_doc*/
20695  __pyx_tp_traverse_Enum, /*tp_traverse*/
20696  __pyx_tp_clear_Enum, /*tp_clear*/
20697  0, /*tp_richcompare*/
20698  0, /*tp_weaklistoffset*/
20699  0, /*tp_iter*/
20700  0, /*tp_iternext*/
20701  __pyx_methods_Enum, /*tp_methods*/
20702  0, /*tp_members*/
20703  0, /*tp_getset*/
20704  0, /*tp_base*/
20705  0, /*tp_dict*/
20706  0, /*tp_descr_get*/
20707  0, /*tp_descr_set*/
20708  0, /*tp_dictoffset*/
20709  __pyx_MemviewEnum___init__, /*tp_init*/
20710  0, /*tp_alloc*/
20711  __pyx_tp_new_Enum, /*tp_new*/
20712  0, /*tp_free*/
20713  0, /*tp_is_gc*/
20714  0, /*tp_bases*/
20715  0, /*tp_mro*/
20716  0, /*tp_cache*/
20717  0, /*tp_subclasses*/
20718  0, /*tp_weaklist*/
20719  0, /*tp_del*/
20720  0, /*tp_version_tag*/
20721  #if PY_VERSION_HEX >= 0x030400a1
20722  0, /*tp_finalize*/
20723  #endif
20724  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20725  0, /*tp_vectorcall*/
20726  #endif
20727  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20728  0, /*tp_print*/
20729  #endif
20730  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20731  0, /*tp_pypy_flags*/
20732  #endif
20733 };
20734 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
20735 
20736 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
20737  struct __pyx_memoryview_obj *p;
20738  PyObject *o;
20739  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20740  o = (*t->tp_alloc)(t, 0);
20741  } else {
20742  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20743  }
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;
20752  return o;
20753  bad:
20754  Py_DECREF(o); o = 0;
20755  return NULL;
20756 }
20757 
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;
20763  }
20764  #endif
20765  PyObject_GC_UnTrack(o);
20766  {
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);
20773  }
20774  Py_CLEAR(p->obj);
20775  Py_CLEAR(p->_size);
20776  Py_CLEAR(p->_array_interface);
20777  (*Py_TYPE(o)->tp_free)(o);
20778 }
20779 
20780 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
20781  int e;
20782  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
20783  if (p->obj) {
20784  e = (*v)(p->obj, a); if (e) return e;
20785  }
20786  if (p->_size) {
20787  e = (*v)(p->_size, a); if (e) return e;
20788  }
20789  if (p->_array_interface) {
20790  e = (*v)(p->_array_interface, a); if (e) return e;
20791  }
20792  if (p->view.obj) {
20793  e = (*v)(p->view.obj, a); if (e) return e;
20794  }
20795  return 0;
20796 }
20797 
20798 static int __pyx_tp_clear_memoryview(PyObject *o) {
20799  PyObject* tmp;
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);
20803  Py_XDECREF(tmp);
20804  tmp = ((PyObject*)p->_size);
20805  p->_size = Py_None; Py_INCREF(Py_None);
20806  Py_XDECREF(tmp);
20807  tmp = ((PyObject*)p->_array_interface);
20808  p->_array_interface = Py_None; Py_INCREF(Py_None);
20809  Py_XDECREF(tmp);
20810  Py_CLEAR(p->view.obj);
20811  return 0;
20812 }
20813 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
20814  PyObject *r;
20815  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
20816  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20817  Py_DECREF(x);
20818  return r;
20819 }
20820 
20821 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
20822  if (v) {
20823  return __pyx_memoryview___setitem__(o, i, v);
20824  }
20825  else {
20826  PyErr_Format(PyExc_NotImplementedError,
20827  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20828  return -1;
20829  }
20830 }
20831 
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);
20834 }
20835 
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);
20838 }
20839 
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);
20842 }
20843 
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);
20846 }
20847 
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);
20850 }
20851 
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);
20854 }
20855 
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);
20858 }
20859 
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);
20862 }
20863 
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);
20866 }
20867 
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},
20875  {0, 0, 0, 0}
20876 };
20877 
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},
20888  {0, 0, 0, 0, 0}
20889 };
20890 
20891 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
20892  __pyx_memoryview___len__, /*sq_length*/
20893  0, /*sq_concat*/
20894  0, /*sq_repeat*/
20895  __pyx_sq_item_memoryview, /*sq_item*/
20896  0, /*sq_slice*/
20897  0, /*sq_ass_item*/
20898  0, /*sq_ass_slice*/
20899  0, /*sq_contains*/
20900  0, /*sq_inplace_concat*/
20901  0, /*sq_inplace_repeat*/
20902 };
20903 
20904 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
20905  __pyx_memoryview___len__, /*mp_length*/
20906  __pyx_memoryview___getitem__, /*mp_subscript*/
20907  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
20908 };
20909 
20910 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
20911  #if PY_MAJOR_VERSION < 3
20912  0, /*bf_getreadbuffer*/
20913  #endif
20914  #if PY_MAJOR_VERSION < 3
20915  0, /*bf_getwritebuffer*/
20916  #endif
20917  #if PY_MAJOR_VERSION < 3
20918  0, /*bf_getsegcount*/
20919  #endif
20920  #if PY_MAJOR_VERSION < 3
20921  0, /*bf_getcharbuffer*/
20922  #endif
20923  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
20924  0, /*bf_releasebuffer*/
20925 };
20926 
20927 static PyTypeObject __pyx_type___pyx_memoryview = {
20928  PyVarObject_HEAD_INIT(0, 0)
20929  "superluWrappers.memoryview", /*tp_name*/
20930  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
20931  0, /*tp_itemsize*/
20932  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
20933  #if PY_VERSION_HEX < 0x030800b4
20934  0, /*tp_print*/
20935  #endif
20936  #if PY_VERSION_HEX >= 0x030800b4
20937  0, /*tp_vectorcall_offset*/
20938  #endif
20939  0, /*tp_getattr*/
20940  0, /*tp_setattr*/
20941  #if PY_MAJOR_VERSION < 3
20942  0, /*tp_compare*/
20943  #endif
20944  #if PY_MAJOR_VERSION >= 3
20945  0, /*tp_as_async*/
20946  #endif
20947  __pyx_memoryview___repr__, /*tp_repr*/
20948  0, /*tp_as_number*/
20949  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
20950  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
20951  0, /*tp_hash*/
20952  0, /*tp_call*/
20953  __pyx_memoryview___str__, /*tp_str*/
20954  0, /*tp_getattro*/
20955  0, /*tp_setattro*/
20956  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
20957  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20958  0, /*tp_doc*/
20959  __pyx_tp_traverse_memoryview, /*tp_traverse*/
20960  __pyx_tp_clear_memoryview, /*tp_clear*/
20961  0, /*tp_richcompare*/
20962  0, /*tp_weaklistoffset*/
20963  0, /*tp_iter*/
20964  0, /*tp_iternext*/
20965  __pyx_methods_memoryview, /*tp_methods*/
20966  0, /*tp_members*/
20967  __pyx_getsets_memoryview, /*tp_getset*/
20968  0, /*tp_base*/
20969  0, /*tp_dict*/
20970  0, /*tp_descr_get*/
20971  0, /*tp_descr_set*/
20972  0, /*tp_dictoffset*/
20973  0, /*tp_init*/
20974  0, /*tp_alloc*/
20975  __pyx_tp_new_memoryview, /*tp_new*/
20976  0, /*tp_free*/
20977  0, /*tp_is_gc*/
20978  0, /*tp_bases*/
20979  0, /*tp_mro*/
20980  0, /*tp_cache*/
20981  0, /*tp_subclasses*/
20982  0, /*tp_weaklist*/
20983  0, /*tp_del*/
20984  0, /*tp_version_tag*/
20985  #if PY_VERSION_HEX >= 0x030400a1
20986  0, /*tp_finalize*/
20987  #endif
20988  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20989  0, /*tp_vectorcall*/
20990  #endif
20991  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20992  0, /*tp_print*/
20993  #endif
20994  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20995  0, /*tp_pypy_flags*/
20996  #endif
20997 };
20998 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
20999 
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;
21008  return o;
21009 }
21010 
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;
21016  }
21017  #endif
21018  PyObject_GC_UnTrack(o);
21019  {
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);
21026  }
21027  Py_CLEAR(p->from_object);
21028  PyObject_GC_Track(o);
21029  __pyx_tp_dealloc_memoryview(o);
21030 }
21031 
21032 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
21033  int e;
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;
21038  }
21039  return 0;
21040 }
21041 
21042 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21043  PyObject* tmp;
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);
21048  Py_XDECREF(tmp);
21049  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21050  return 0;
21051 }
21052 
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);
21055 }
21056 
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},
21060  {0, 0, 0, 0}
21061 };
21062 
21063 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21064  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
21065  {0, 0, 0, 0, 0}
21066 };
21067 
21068 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
21069  PyVarObject_HEAD_INIT(0, 0)
21070  "superluWrappers._memoryviewslice", /*tp_name*/
21071  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
21072  0, /*tp_itemsize*/
21073  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
21074  #if PY_VERSION_HEX < 0x030800b4
21075  0, /*tp_print*/
21076  #endif
21077  #if PY_VERSION_HEX >= 0x030800b4
21078  0, /*tp_vectorcall_offset*/
21079  #endif
21080  0, /*tp_getattr*/
21081  0, /*tp_setattr*/
21082  #if PY_MAJOR_VERSION < 3
21083  0, /*tp_compare*/
21084  #endif
21085  #if PY_MAJOR_VERSION >= 3
21086  0, /*tp_as_async*/
21087  #endif
21088  #if CYTHON_COMPILING_IN_PYPY
21089  __pyx_memoryview___repr__, /*tp_repr*/
21090  #else
21091  0, /*tp_repr*/
21092  #endif
21093  0, /*tp_as_number*/
21094  0, /*tp_as_sequence*/
21095  0, /*tp_as_mapping*/
21096  0, /*tp_hash*/
21097  0, /*tp_call*/
21098  #if CYTHON_COMPILING_IN_PYPY
21099  __pyx_memoryview___str__, /*tp_str*/
21100  #else
21101  0, /*tp_str*/
21102  #endif
21103  0, /*tp_getattro*/
21104  0, /*tp_setattro*/
21105  0, /*tp_as_buffer*/
21106  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21107  "Internal class for passing memoryview slices to Python", /*tp_doc*/
21108  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
21109  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
21110  0, /*tp_richcompare*/
21111  0, /*tp_weaklistoffset*/
21112  0, /*tp_iter*/
21113  0, /*tp_iternext*/
21114  __pyx_methods__memoryviewslice, /*tp_methods*/
21115  0, /*tp_members*/
21116  __pyx_getsets__memoryviewslice, /*tp_getset*/
21117  0, /*tp_base*/
21118  0, /*tp_dict*/
21119  0, /*tp_descr_get*/
21120  0, /*tp_descr_set*/
21121  0, /*tp_dictoffset*/
21122  0, /*tp_init*/
21123  0, /*tp_alloc*/
21124  __pyx_tp_new__memoryviewslice, /*tp_new*/
21125  0, /*tp_free*/
21126  0, /*tp_is_gc*/
21127  0, /*tp_bases*/
21128  0, /*tp_mro*/
21129  0, /*tp_cache*/
21130  0, /*tp_subclasses*/
21131  0, /*tp_weaklist*/
21132  0, /*tp_del*/
21133  0, /*tp_version_tag*/
21134  #if PY_VERSION_HEX >= 0x030400a1
21135  0, /*tp_finalize*/
21136  #endif
21137  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21138  0, /*tp_vectorcall*/
21139  #endif
21140  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21141  0, /*tp_print*/
21142  #endif
21143  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21144  0, /*tp_pypy_flags*/
21145  #endif
21146 };
21147 
21148 static PyMethodDef __pyx_methods[] = {
21149  {0, 0, 0, 0}
21150 };
21151 
21152 #if PY_MAJOR_VERSION >= 3
21153 #if CYTHON_PEP489_MULTI_PHASE_INIT
21154 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
21155 static int __pyx_pymod_exec_superluWrappers(PyObject* module); /*proto*/
21156 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
21157  {Py_mod_create, (void*)__pyx_pymod_create},
21158  {Py_mod_exec, (void*)__pyx_pymod_exec_superluWrappers},
21159  {0, NULL}
21160 };
21161 #endif
21162 
21163 static struct PyModuleDef __pyx_moduledef = {
21164  PyModuleDef_HEAD_INIT,
21165  "superluWrappers",
21166  0, /* m_doc */
21167  #if CYTHON_PEP489_MULTI_PHASE_INIT
21168  0, /* m_size */
21169  #else
21170  -1, /* m_size */
21171  #endif
21172  __pyx_methods /* m_methods */,
21173  #if CYTHON_PEP489_MULTI_PHASE_INIT
21174  __pyx_moduledef_slots, /* m_slots */
21175  #else
21176  NULL, /* m_reload */
21177  #endif
21178  NULL, /* m_traverse */
21179  NULL, /* m_clear */
21180  NULL /* m_free */
21181 };
21182 #endif
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))
21188 #else
21189  #define CYTHON_SMALL_CODE
21190 #endif
21191 #endif
21192 
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}
21338 };
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)
21351  return 0;
21352  __pyx_L1_error:;
21353  return -1;
21354 }
21355 
21356 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
21357  __Pyx_RefNannyDeclarations
21358  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
21359 
21360  /* "superluWrappers.pyx":56
21361  * ?!Possibly something to do with parallel?!
21362  * """
21363  * with open(filename, 'w') as output_file: # <<<<<<<<<<<<<<
21364  * output_file.write('%i %i %i \n' % (self.nr, self.nc, self.rowptr[self.nr]) )
21365  * for i in range(self.nr):
21366  */
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_);
21370 
21371  /* "(tree fragment)":2
21372  * def __reduce_cython__(self):
21373  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21374  * def __setstate_cython__(self, __pyx_state):
21375  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21376  */
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);
21380 
21381  /* "(tree fragment)":4
21382  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21383  * def __setstate_cython__(self, __pyx_state):
21384  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21385  */
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);
21389 
21390  /* "(tree fragment)":2
21391  * def __reduce_cython__(self):
21392  * raise TypeError("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") # <<<<<<<<<<<<<<
21393  * def __setstate_cython__(self, __pyx_state):
21394  * raise TypeError("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")
21395  */
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);
21399 
21400  /* "(tree fragment)":4
21401  * raise TypeError("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")
21402  * def __setstate_cython__(self, __pyx_state):
21403  * raise TypeError("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") # <<<<<<<<<<<<<<
21404  */
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);
21408 
21409  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
21410  * __pyx_import_array()
21411  * except Exception:
21412  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
21413  *
21414  * cdef inline int import_umath() except -1:
21415  */
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);
21419 
21420  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
21421  * _import_umath()
21422  * except Exception:
21423  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
21424  *
21425  * cdef inline int import_ufunc() except -1:
21426  */
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);
21430 
21431  /* "View.MemoryView":133
21432  *
21433  * if not self.ndim:
21434  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
21435  *
21436  * if itemsize <= 0:
21437  */
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);
21441 
21442  /* "View.MemoryView":136
21443  *
21444  * if itemsize <= 0:
21445  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
21446  *
21447  * if not isinstance(format, bytes):
21448  */
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);
21452 
21453  /* "View.MemoryView":148
21454  *
21455  * if not self._shape:
21456  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
21457  *
21458  *
21459  */
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);
21463 
21464  /* "View.MemoryView":176
21465  * self.data = <char *>malloc(self.len)
21466  * if not self.data:
21467  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
21468  *
21469  * if self.dtype_is_object:
21470  */
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);
21474 
21475  /* "View.MemoryView":192
21476  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
21477  * if not (flags & bufmode):
21478  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
21479  * info.buf = self.data
21480  * info.len = self.len
21481  */
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);
21485 
21486  /* "(tree fragment)":2
21487  * def __reduce_cython__(self):
21488  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21489  * def __setstate_cython__(self, __pyx_state):
21490  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21491  */
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);
21495 
21496  /* "(tree fragment)":4
21497  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21498  * def __setstate_cython__(self, __pyx_state):
21499  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21500  */
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);
21504 
21505  /* "View.MemoryView":418
21506  * def __setitem__(memoryview self, object index, object value):
21507  * if self.view.readonly:
21508  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
21509  *
21510  * have_slices, index = _unellipsify(index, self.view.ndim)
21511  */
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);
21515 
21516  /* "View.MemoryView":495
21517  * result = struct.unpack(self.view.format, bytesitem)
21518  * except struct.error:
21519  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
21520  * else:
21521  * if len(self.view.format) == 1:
21522  */
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);
21526 
21527  /* "View.MemoryView":520
21528  * def __getbuffer__(self, Py_buffer *info, int flags):
21529  * if flags & PyBUF_WRITABLE and self.view.readonly:
21530  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
21531  *
21532  * if flags & PyBUF_ND:
21533  */
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);
21537 
21538  /* "View.MemoryView":570
21539  * if self.view.strides == NULL:
21540  *
21541  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
21542  *
21543  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
21544  */
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);
21548 
21549  /* "View.MemoryView":577
21550  * def suboffsets(self):
21551  * if self.view.suboffsets == NULL:
21552  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
21553  *
21554  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
21555  */
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);
21562 
21563  /* "(tree fragment)":2
21564  * def __reduce_cython__(self):
21565  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21566  * def __setstate_cython__(self, __pyx_state):
21567  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21568  */
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);
21572 
21573  /* "(tree fragment)":4
21574  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21575  * def __setstate_cython__(self, __pyx_state):
21576  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21577  */
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);
21581 
21582  /* "View.MemoryView":682
21583  * if item is Ellipsis:
21584  * if not seen_ellipsis:
21585  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
21586  * seen_ellipsis = True
21587  * else:
21588  */
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);
21592 
21593  /* "View.MemoryView":703
21594  * for suboffset in suboffsets[:ndim]:
21595  * if suboffset >= 0:
21596  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
21597  *
21598  *
21599  */
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);
21603 
21604  /* "(tree fragment)":2
21605  * def __reduce_cython__(self):
21606  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21607  * def __setstate_cython__(self, __pyx_state):
21608  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21609  */
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);
21613 
21614  /* "(tree fragment)":4
21615  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21616  * def __setstate_cython__(self, __pyx_state):
21617  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21618  */
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);
21625 
21626  /* "superluWrappers.pyx":13
21627  * from libc.stdlib cimport malloc
21628  *
21629  * class SparseMatrix(object): # <<<<<<<<<<<<<<
21630  *
21631  * def __init__(self,
21632  */
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);
21636 
21637  /* "superluWrappers.pyx":15
21638  * class SparseMatrix(object):
21639  *
21640  * def __init__(self, # <<<<<<<<<<<<<<
21641  * nr,
21642  * nc,
21643  */
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)
21648 
21649  /* "superluWrappers.pyx":35
21650  * self.rowptr)
21651  *
21652  * def matvec(self, x, y): # <<<<<<<<<<<<<<
21653  * """
21654  * Compute the sparse matrix-vector product y = Ax
21655  */
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)
21660 
21661  /* "superluWrappers.pyx":46
21662  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
21663  *
21664  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
21665  * """ Write the sparse matrix to a file
21666  *
21667  */
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)
21672 
21673  /* "superluWrappers.pyx":62
21674  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
21675  *
21676  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
21677  * """ Get the CSR representation of the sparse matrix.
21678  *
21679  */
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)
21684 
21685  /* "superluWrappers.pyx":72
21686  * return (self.rowptr, self.colind, self.nzvals)
21687  *
21688  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
21689  * range_start,
21690  * range_end):
21691  */
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)
21696 
21697  /* "superluWrappers.pyx":219
21698  * self.X.Store = &self.storeX
21699  *
21700  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
21701  * sparseFactor):
21702  * """ Python wrapper for superlu Sparse Factor Prepare function.
21703  */
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)
21708 
21709  /* "superluWrappers.pyx":286
21710  * &info)
21711  *
21712  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
21713  * x):
21714  * """ Sparse factor solve wrappers
21715  */
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)
21720 
21721  /* "View.MemoryView":286
21722  * return self.name
21723  *
21724  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
21725  * cdef strided = Enum("<strided and direct>") # default
21726  * cdef indirect = Enum("<strided and indirect>")
21727  */
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);
21731 
21732  /* "View.MemoryView":287
21733  *
21734  * cdef generic = Enum("<strided and direct or indirect>")
21735  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
21736  * cdef indirect = Enum("<strided and indirect>")
21737  *
21738  */
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);
21742 
21743  /* "View.MemoryView":288
21744  * cdef generic = Enum("<strided and direct or indirect>")
21745  * cdef strided = Enum("<strided and direct>") # default
21746  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
21747  *
21748  *
21749  */
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);
21753 
21754  /* "View.MemoryView":291
21755  *
21756  *
21757  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
21758  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
21759  *
21760  */
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);
21764 
21765  /* "View.MemoryView":292
21766  *
21767  * cdef contiguous = Enum("<contiguous and direct>")
21768  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
21769  *
21770  *
21771  */
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);
21775 
21776  /* "(tree fragment)":1
21777  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21778  * cdef object __pyx_PickleError
21779  * cdef object __pyx_result
21780  */
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();
21786  return 0;
21787  __pyx_L1_error:;
21788  __Pyx_RefNannyFinishContext();
21789  return -1;
21790 }
21791 
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(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
21797  __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
21798  __pyx_int_184977713 = PyInt_FromLong(184977713L); 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)
21800  return 0;
21801  __pyx_L1_error:;
21802  return -1;
21803 }
21804 
21805 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
21806 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
21807 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
21808 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
21809 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
21810 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
21811 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
21812 
21813 static int __Pyx_modinit_global_init_code(void) {
21814  __Pyx_RefNannyDeclarations
21815  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
21816  /*--- Global init code ---*/
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();
21823  return 0;
21824 }
21825 
21826 static int __Pyx_modinit_variable_export_code(void) {
21827  __Pyx_RefNannyDeclarations
21828  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
21829  /*--- Variable export code ---*/
21830  __Pyx_RefNannyFinishContext();
21831  return 0;
21832 }
21833 
21834 static int __Pyx_modinit_function_export_code(void) {
21835  __Pyx_RefNannyDeclarations
21836  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
21837  /*--- Function export code ---*/
21838  __Pyx_RefNannyFinishContext();
21839  return 0;
21840 }
21841 
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);
21848  /*--- Type init code ---*/
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;
21852  #endif
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;
21855  }
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;
21864  #endif
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;
21867  }
21868  #if CYTHON_UPDATE_DESCRIPTOR_DOC
21869  {
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__;
21875  }
21876  }
21877  #endif
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;
21887  #endif
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;
21894  #endif
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;
21897  }
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;
21911  #endif
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;
21914  }
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;
21926  #endif
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;
21929  }
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();
21934  return 0;
21935  __pyx_L1_error:;
21936  __Pyx_RefNannyFinishContext();
21937  return -1;
21938 }
21939 
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);
21947  /*--- Type import code ---*/
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),
21953  #else
21954  sizeof(PyHeapTypeObject),
21955  #endif
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();
21993  return 0;
21994  __pyx_L1_error:;
21995  __Pyx_XDECREF(__pyx_t_1);
21996  __Pyx_RefNannyFinishContext();
21997  return -1;
21998 }
21999 
22000 static int __Pyx_modinit_variable_import_code(void) {
22001  __Pyx_RefNannyDeclarations
22002  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
22003  /*--- Variable import code ---*/
22004  __Pyx_RefNannyFinishContext();
22005  return 0;
22006 }
22007 
22008 static int __Pyx_modinit_function_import_code(void) {
22009  __Pyx_RefNannyDeclarations
22010  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
22011  /*--- Function import code ---*/
22012  __Pyx_RefNannyFinishContext();
22013  return 0;
22014 }
22015 
22016 
22017 #ifndef CYTHON_NO_PYINIT_EXPORT
22018 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22019 #elif PY_MAJOR_VERSION < 3
22020 #ifdef __cplusplus
22021 #define __Pyx_PyMODINIT_FUNC extern "C" void
22022 #else
22023 #define __Pyx_PyMODINIT_FUNC void
22024 #endif
22025 #else
22026 #ifdef __cplusplus
22027 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
22028 #else
22029 #define __Pyx_PyMODINIT_FUNC PyObject *
22030 #endif
22031 #endif
22032 
22033 
22034 #if PY_MAJOR_VERSION < 3
22035 __Pyx_PyMODINIT_FUNC initsuperluWrappers(void) CYTHON_SMALL_CODE; /*proto*/
22036 __Pyx_PyMODINIT_FUNC initsuperluWrappers(void)
22037 #else
22038 __Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void) CYTHON_SMALL_CODE; /*proto*/
22039 __Pyx_PyMODINIT_FUNC PyInit_superluWrappers(void)
22040 #if CYTHON_PEP489_MULTI_PHASE_INIT
22041 {
22042  return PyModuleDef_Init(&__pyx_moduledef);
22043 }
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))
22052  #else
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))
22058  #endif
22059  {
22060  PyErr_SetString(
22061  PyExc_ImportError,
22062  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
22063  return -1;
22064  }
22065  return 0;
22066 }
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);
22069  int result = 0;
22070  if (likely(value)) {
22071  if (allow_none || value != Py_None) {
22072  result = PyDict_SetItemString(moddict, to_name, value);
22073  }
22074  Py_DECREF(value);
22075  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
22076  PyErr_Clear();
22077  } else {
22078  result = -1;
22079  }
22080  return result;
22081 }
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())
22085  return NULL;
22086  if (__pyx_m)
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;
22099  return module;
22100 bad:
22101  Py_XDECREF(module);
22102  return NULL;
22103 }
22104 
22105 
22106 static CYTHON_SMALL_CODE int __pyx_pymod_exec_superluWrappers(PyObject *__pyx_pyinit_module)
22107 #endif
22108 #endif
22109 {
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
22119  if (__pyx_m) {
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.");
22122  return -1;
22123  }
22124  #elif PY_MAJOR_VERSION >= 3
22125  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
22126  #endif
22127  #if CYTHON_REFNANNY
22128 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
22129 if (!__Pyx_RefNanny) {
22130  PyErr_Clear();
22131  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
22132  if (!__Pyx_RefNanny)
22133  Py_FatalError("failed to import 'refnanny' module");
22134 }
22135 #endif
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();
22140  #endif
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)
22146  #endif
22147  #ifdef __Pyx_FusedFunction_USED
22148  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22149  #endif
22150  #ifdef __Pyx_Coroutine_USED
22151  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22152  #endif
22153  #ifdef __Pyx_Generator_USED
22154  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22155  #endif
22156  #ifdef __Pyx_AsyncGen_USED
22157  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22158  #endif
22159  #ifdef __Pyx_StopAsyncIteration_USED
22160  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22161  #endif
22162  /*--- Library function declarations ---*/
22163  /*--- Threads initialization code ---*/
22164  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
22165  PyEval_InitThreads();
22166  #endif
22167  /*--- Module creation code ---*/
22168  #if CYTHON_PEP489_MULTI_PHASE_INIT
22169  __pyx_m = __pyx_pyinit_module;
22170  Py_INCREF(__pyx_m);
22171  #else
22172  #if PY_MAJOR_VERSION < 3
22173  __pyx_m = Py_InitModule4("superluWrappers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
22174  #else
22175  __pyx_m = PyModule_Create(&__pyx_moduledef);
22176  #endif
22177  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
22178  #endif
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);
22186  /*--- Initialize various global constants etc. ---*/
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)
22190  #endif
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)
22193  }
22194  #if PY_MAJOR_VERSION >= 3
22195  {
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)
22199  }
22200  }
22201  #endif
22202  /*--- Builtin init code ---*/
22203  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22204  /*--- Constants init code ---*/
22205  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22206  /*--- Global type/function init code ---*/
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();
22214  /*--- Execution code ---*/
22215  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
22216  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22217  #endif
22218 
22219  /* "superluWrappers.pyx":7
22220  * # correctly. perhaps they should only be enabled when not in debug mode?
22221  *
22222  * import numpy as np # <<<<<<<<<<<<<<
22223  * import cython
22224  * cimport numpy as np
22225  */
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;
22230 
22231  /* "superluWrappers.pyx":13
22232  * from libc.stdlib cimport malloc
22233  *
22234  * class SparseMatrix(object): # <<<<<<<<<<<<<<
22235  *
22236  * def __init__(self,
22237  */
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);
22242 
22243  /* "superluWrappers.pyx":15
22244  * class SparseMatrix(object):
22245  *
22246  * def __init__(self, # <<<<<<<<<<<<<<
22247  * nr,
22248  * nc,
22249  */
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;
22254 
22255  /* "superluWrappers.pyx":35
22256  * self.rowptr)
22257  *
22258  * def matvec(self, x, y): # <<<<<<<<<<<<<<
22259  * """
22260  * Compute the sparse matrix-vector product y = Ax
22261  */
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;
22266 
22267  /* "superluWrappers.pyx":46
22268  * SparseMatrix_matvec(self._cSparseMatrix, x, y)
22269  *
22270  * def fwrite(self, filename, base): # <<<<<<<<<<<<<<
22271  * """ Write the sparse matrix to a file
22272  *
22273  */
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;
22278 
22279  /* "superluWrappers.pyx":62
22280  * output_file.write('%d %d %13.8e\n' % (i+base, self.colind[k]+base, self.nzvals[k]) )
22281  *
22282  * def getCSRrepresentation(self): # <<<<<<<<<<<<<<
22283  * """ Get the CSR representation of the sparse matrix.
22284  *
22285  */
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;
22290 
22291  /* "superluWrappers.pyx":72
22292  * return (self.rowptr, self.colind, self.nzvals)
22293  *
22294  * def getSubMatCSRrepresentation(self, # <<<<<<<<<<<<<<
22295  * range_start,
22296  * range_end):
22297  */
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;
22302 
22303  /* "superluWrappers.pyx":13
22304  * from libc.stdlib cimport malloc
22305  *
22306  * class SparseMatrix(object): # <<<<<<<<<<<<<<
22307  *
22308  * def __init__(self,
22309  */
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;
22316 
22317  /* "superluWrappers.pyx":219
22318  * self.X.Store = &self.storeX
22319  *
22320  * def sparseFactorPrepare(sparse_matrix, # <<<<<<<<<<<<<<
22321  * sparseFactor):
22322  * """ Python wrapper for superlu Sparse Factor Prepare function.
22323  */
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;
22328 
22329  /* "superluWrappers.pyx":286
22330  * &info)
22331  *
22332  * def sparseFactorSolve(sparseFactor, # <<<<<<<<<<<<<<
22333  * x):
22334  * """ Sparse factor solve wrappers
22335  */
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;
22340 
22341  /* "superluWrappers.pyx":1
22342  * #cython: boundscheck=False, wraparound=False, nonecheck=False, initializedcheck=False # <<<<<<<<<<<<<<
22343  *
22344  * # ARB - the cython directives above allow code to run much faster. it is worth noting
22345  */
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;
22350 
22351  /* "View.MemoryView":209
22352  * info.obj = self
22353  *
22354  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
22355  *
22356  * def __dealloc__(array self):
22357  */
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);
22363 
22364  /* "View.MemoryView":286
22365  * return self.name
22366  *
22367  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
22368  * cdef strided = Enum("<strided and direct>") # default
22369  * cdef indirect = Enum("<strided and indirect>")
22370  */
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);
22376  __pyx_t_1 = 0;
22377 
22378  /* "View.MemoryView":287
22379  *
22380  * cdef generic = Enum("<strided and direct or indirect>")
22381  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
22382  * cdef indirect = Enum("<strided and indirect>")
22383  *
22384  */
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);
22390  __pyx_t_1 = 0;
22391 
22392  /* "View.MemoryView":288
22393  * cdef generic = Enum("<strided and direct or indirect>")
22394  * cdef strided = Enum("<strided and direct>") # default
22395  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
22396  *
22397  *
22398  */
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);
22404  __pyx_t_1 = 0;
22405 
22406  /* "View.MemoryView":291
22407  *
22408  *
22409  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
22410  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
22411  *
22412  */
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);
22418  __pyx_t_1 = 0;
22419 
22420  /* "View.MemoryView":292
22421  *
22422  * cdef contiguous = Enum("<contiguous and direct>")
22423  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
22424  *
22425  *
22426  */
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);
22432  __pyx_t_1 = 0;
22433 
22434  /* "View.MemoryView":316
22435  *
22436  * DEF THREAD_LOCKS_PREALLOCATED = 8
22437  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
22438  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
22439  * PyThread_allocate_lock(),
22440  */
22441  __pyx_memoryview_thread_locks_used = 0;
22442 
22443  /* "View.MemoryView":317
22444  * DEF THREAD_LOCKS_PREALLOCATED = 8
22445  * cdef int __pyx_memoryview_thread_locks_used = 0
22446  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
22447  * PyThread_allocate_lock(),
22448  * PyThread_allocate_lock(),
22449  */
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));
22459 
22460  /* "View.MemoryView":549
22461  * info.obj = self
22462  *
22463  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
22464  *
22465  *
22466  */
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);
22472 
22473  /* "View.MemoryView":995
22474  * return self.from_object
22475  *
22476  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
22477  *
22478  *
22479  */
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);
22485 
22486  /* "(tree fragment)":1
22487  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22488  * cdef object __pyx_PickleError
22489  * cdef object __pyx_result
22490  */
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;
22495 
22496  /* "(tree fragment)":11
22497  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
22498  * return __pyx_result
22499  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
22500  * __pyx_result.name = __pyx_state[0]
22501  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
22502  */
22503 
22504  /*--- Wrapped vars code ---*/
22505 
22506  goto __pyx_L0;
22507  __pyx_L1_error:;
22508  __Pyx_XDECREF(__pyx_t_1);
22509  __Pyx_XDECREF(__pyx_t_2);
22510  __Pyx_XDECREF(__pyx_t_3);
22511  if (__pyx_m) {
22512  if (__pyx_d) {
22513  __Pyx_AddTraceback("init superluWrappers", __pyx_clineno, __pyx_lineno, __pyx_filename);
22514  }
22515  Py_CLEAR(__pyx_m);
22516  } else if (!PyErr_Occurred()) {
22517  PyErr_SetString(PyExc_ImportError, "init superluWrappers");
22518  }
22519  __pyx_L0:;
22520  __Pyx_RefNannyFinishContext();
22521  #if CYTHON_PEP489_MULTI_PHASE_INIT
22522  return (__pyx_m != NULL) ? 0 : -1;
22523  #elif PY_MAJOR_VERSION >= 3
22524  return __pyx_m;
22525  #else
22526  return;
22527  #endif
22528 }
22529 
22530 /* --- Runtime support code --- */
22531 /* Refnanny */
22532 #if CYTHON_REFNANNY
22533 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
22534  PyObject *m = NULL, *p = NULL;
22535  void *r = NULL;
22536  m = PyImport_ImportModule(modname);
22537  if (!m) goto end;
22538  p = PyObject_GetAttrString(m, "RefNannyAPI");
22539  if (!p) goto end;
22540  r = PyLong_AsVoidPtr(p);
22541 end:
22542  Py_XDECREF(p);
22543  Py_XDECREF(m);
22544  return (__Pyx_RefNannyAPIStruct *)r;
22545 }
22546 #endif
22547 
22548 /* PyObjectGetAttrStr */
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));
22557 #endif
22558  return PyObject_GetAttr(obj, attr_name);
22559 }
22560 #endif
22561 
22562 /* GetBuiltinName */
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);
22569 #else
22570  "name '%.200s' is not defined", PyString_AS_STRING(name));
22571 #endif
22572  }
22573  return result;
22574 }
22575 
22576 /* RaiseArgTupleInvalid */
22577 static void __Pyx_RaiseArgtupleInvalid(
22578  const char* func_name,
22579  int exact,
22580  Py_ssize_t num_min,
22581  Py_ssize_t num_max,
22582  Py_ssize_t num_found)
22583 {
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";
22589  } else {
22590  num_expected = num_max;
22591  more_or_less = "at most";
22592  }
22593  if (exact) {
22594  more_or_less = "exactly";
22595  }
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);
22600 }
22601 
22602 /* RaiseDoubleKeywords */
22603 static void __Pyx_RaiseDoubleKeywordsError(
22604  const char* func_name,
22605  PyObject* kw_name)
22606 {
22607  PyErr_Format(PyExc_TypeError,
22608  #if PY_MAJOR_VERSION >= 3
22609  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
22610  #else
22611  "%s() got multiple values for keyword argument '%s'", func_name,
22612  PyString_AsString(kw_name));
22613  #endif
22614 }
22615 
22616 /* ParseKeywords */
22617 static int __Pyx_ParseOptionalKeywords(
22618  PyObject *kwds,
22619  PyObject **argnames[],
22620  PyObject *kwds2,
22621  PyObject *values[],
22622  Py_ssize_t num_pos_args,
22623  const char* function_name)
22624 {
22625  PyObject *key = 0, *value = 0;
22626  Py_ssize_t pos = 0;
22627  PyObject*** name;
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++;
22632  if (*name) {
22633  values[name-argnames] = value;
22634  continue;
22635  }
22636  name = first_kw_arg;
22637  #if PY_MAJOR_VERSION < 3
22638  if (likely(PyString_Check(key))) {
22639  while (*name) {
22640  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
22641  && _PyString_Eq(**name, key)) {
22642  values[name-argnames] = value;
22643  break;
22644  }
22645  name++;
22646  }
22647  if (*name) continue;
22648  else {
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;
22655  }
22656  argname++;
22657  }
22658  }
22659  } else
22660  #endif
22661  if (likely(PyUnicode_Check(key))) {
22662  while (*name) {
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 :
22666  #endif
22667  PyUnicode_Compare(**name, key);
22668  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
22669  if (cmp == 0) {
22670  values[name-argnames] = value;
22671  break;
22672  }
22673  name++;
22674  }
22675  if (*name) continue;
22676  else {
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 :
22682  #endif
22683  PyUnicode_Compare(**argname, key);
22684  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
22685  if (cmp == 0) goto arg_passed_twice;
22686  argname++;
22687  }
22688  }
22689  } else
22690  goto invalid_keyword_type;
22691  if (kwds2) {
22692  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
22693  } else {
22694  goto invalid_keyword;
22695  }
22696  }
22697  return 0;
22698 arg_passed_twice:
22699  __Pyx_RaiseDoubleKeywordsError(function_name, key);
22700  goto bad;
22701 invalid_keyword_type:
22702  PyErr_Format(PyExc_TypeError,
22703  "%.200s() keywords must be strings", function_name);
22704  goto bad;
22705 invalid_keyword:
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));
22710  #else
22711  "%s() got an unexpected keyword argument '%U'",
22712  function_name, key);
22713  #endif
22714 bad:
22715  return -1;
22716 }
22717 
22718 /* PyObjectSetAttrStr */
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);
22727 #endif
22728  return PyObject_SetAttr(obj, attr_name, value);
22729 }
22730 #endif
22731 
22732 /* PyObjectCall */
22733 #if CYTHON_COMPILING_IN_CPYTHON
22734 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
22735  PyObject *result;
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")))
22740  return NULL;
22741  result = (*call)(func, arg, kw);
22742  Py_LeaveRecursiveCall();
22743  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
22744  PyErr_SetString(
22745  PyExc_SystemError,
22746  "NULL result without error in PyObject_Call");
22747  }
22748  return result;
22749 }
22750 #endif
22751 
22752 /* ExtTypeTest */
22753 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
22754  if (unlikely(!type)) {
22755  PyErr_SetString(PyExc_SystemError, "Missing type object");
22756  return 0;
22757  }
22758  if (likely(__Pyx_TypeCheck(obj, type)))
22759  return 1;
22760  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
22761  Py_TYPE(obj)->tp_name, type->tp_name);
22762  return 0;
22763 }
22764 
22765 /* MemviewSliceInit */
22766 static int
22767 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
22768  int ndim,
22769  __Pyx_memviewslice *memviewslice,
22770  int memview_is_new_reference)
22771 {
22772  __Pyx_RefNannyDeclarations
22773  int i, retval=-1;
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!");
22779  goto fail;
22780  }
22781  if (buf->strides) {
22782  for (i = 0; i < ndim; i++) {
22783  memviewslice->strides[i] = buf->strides[i];
22784  }
22785  } else {
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];
22790  }
22791  }
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];
22796  } else {
22797  memviewslice->suboffsets[i] = -1;
22798  }
22799  }
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);
22804  }
22805  retval = 0;
22806  goto no_fail;
22807 fail:
22808  memviewslice->memview = 0;
22809  memviewslice->data = 0;
22810  retval = -1;
22811 no_fail:
22812  __Pyx_RefNannyFinishContext();
22813  return retval;
22814 }
22815 #ifndef Py_NO_RETURN
22816 #define Py_NO_RETURN
22817 #endif
22818 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
22819  va_list vargs;
22820  char msg[200];
22821 #ifdef HAVE_STDARG_PROTOTYPES
22822  va_start(vargs, fmt);
22823 #else
22824  va_start(vargs);
22825 #endif
22826  vsnprintf(msg, 200, fmt, vargs);
22827  va_end(vargs);
22828  Py_FatalError(msg);
22829 }
22830 static CYTHON_INLINE int
22831 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
22832  PyThread_type_lock lock)
22833 {
22834  int result;
22835  PyThread_acquire_lock(lock, 1);
22836  result = (*acquisition_count)++;
22837  PyThread_release_lock(lock);
22838  return result;
22839 }
22840 static CYTHON_INLINE int
22841 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
22842  PyThread_type_lock lock)
22843 {
22844  int result;
22845  PyThread_acquire_lock(lock, 1);
22846  result = (*acquisition_count)--;
22847  PyThread_release_lock(lock);
22848  return result;
22849 }
22850 static CYTHON_INLINE void
22851 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
22852 {
22853  int first_time;
22854  struct __pyx_memoryview_obj *memview = memslice->memview;
22855  if (unlikely(!memview || (PyObject *) memview == Py_None))
22856  return;
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)) {
22862  if (have_gil) {
22863  Py_INCREF((PyObject *) memview);
22864  } else {
22865  PyGILState_STATE _gilstate = PyGILState_Ensure();
22866  Py_INCREF((PyObject *) memview);
22867  PyGILState_Release(_gilstate);
22868  }
22869  }
22870 }
22871 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
22872  int have_gil, int lineno) {
22873  int last_time;
22874  struct __pyx_memoryview_obj *memview = memslice->memview;
22875  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
22876  memslice->memview = NULL;
22877  return;
22878  }
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)) {
22885  if (have_gil) {
22886  Py_CLEAR(memslice->memview);
22887  } else {
22888  PyGILState_STATE _gilstate = PyGILState_Ensure();
22889  Py_CLEAR(memslice->memview);
22890  PyGILState_Release(_gilstate);
22891  }
22892  } else {
22893  memslice->memview = NULL;
22894  }
22895 }
22896 
22897 /* PyFunctionFastCall */
22898 #if CYTHON_FAST_PYCALL
22899 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
22900  PyObject *globals) {
22901  PyFrameObject *f;
22902  PyThreadState *tstate = __Pyx_PyThreadState_Current;
22903  PyObject **fastlocals;
22904  Py_ssize_t i;
22905  PyObject *result;
22906  assert(globals != NULL);
22907  /* XXX Perhaps we should create a specialized
22908  PyFrame_New() that doesn't take locals, but does
22909  take builtins without sanity checking them.
22910  */
22911  assert(tstate != NULL);
22912  f = PyFrame_New(tstate, co, globals, NULL);
22913  if (f == NULL) {
22914  return NULL;
22915  }
22916  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
22917  for (i = 0; i < na; i++) {
22918  Py_INCREF(*args);
22919  fastlocals[i] = *args++;
22920  }
22921  result = PyEval_EvalFrameEx(f,0);
22922  ++tstate->recursion_depth;
22923  Py_DECREF(f);
22924  --tstate->recursion_depth;
22925  return result;
22926 }
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);
22932  PyObject *closure;
22933 #if PY_MAJOR_VERSION >= 3
22934  PyObject *kwdefs;
22935 #endif
22936  PyObject *kwtuple, **k;
22937  PyObject **d;
22938  Py_ssize_t nd;
22939  Py_ssize_t nk;
22940  PyObject *result;
22941  assert(kwargs == NULL || PyDict_Check(kwargs));
22942  nk = kwargs ? PyDict_Size(kwargs) : 0;
22943  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
22944  return NULL;
22945  }
22946  if (
22947 #if PY_MAJOR_VERSION >= 3
22948  co->co_kwonlyargcount == 0 &&
22949 #endif
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);
22954  goto done;
22955  }
22956  else if (nargs == 0 && argdefs != NULL
22957  && co->co_argcount == Py_SIZE(argdefs)) {
22958  /* function called with no arguments, but all parameters have
22959  a default value: use default values as arguments .*/
22960  args = &PyTuple_GET_ITEM(argdefs, 0);
22961  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
22962  goto done;
22963  }
22964  }
22965  if (kwargs != NULL) {
22966  Py_ssize_t pos, i;
22967  kwtuple = PyTuple_New(2 * nk);
22968  if (kwtuple == NULL) {
22969  result = NULL;
22970  goto done;
22971  }
22972  k = &PyTuple_GET_ITEM(kwtuple, 0);
22973  pos = i = 0;
22974  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
22975  Py_INCREF(k[i]);
22976  Py_INCREF(k[i+1]);
22977  i += 2;
22978  }
22979  nk = i / 2;
22980  }
22981  else {
22982  kwtuple = NULL;
22983  k = NULL;
22984  }
22985  closure = PyFunction_GET_CLOSURE(func);
22986 #if PY_MAJOR_VERSION >= 3
22987  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
22988 #endif
22989  if (argdefs != NULL) {
22990  d = &PyTuple_GET_ITEM(argdefs, 0);
22991  nd = Py_SIZE(argdefs);
22992  }
22993  else {
22994  d = NULL;
22995  nd = 0;
22996  }
22997 #if PY_MAJOR_VERSION >= 3
22998  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
22999  args, (int)nargs,
23000  k, (int)nk,
23001  d, (int)nd, kwdefs, closure);
23002 #else
23003  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
23004  args, (int)nargs,
23005  k, (int)nk,
23006  d, (int)nd, closure);
23007 #endif
23008  Py_XDECREF(kwtuple);
23009 done:
23010  Py_LeaveRecursiveCall();
23011  return result;
23012 }
23013 #endif
23014 #endif
23015 
23016 /* PyObjectCallMethO */
23017 #if CYTHON_COMPILING_IN_CPYTHON
23018 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
23019  PyObject *self, *result;
23020  PyCFunction cfunc;
23021  cfunc = PyCFunction_GET_FUNCTION(func);
23022  self = PyCFunction_GET_SELF(func);
23023  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
23024  return NULL;
23025  result = cfunc(self, arg);
23026  Py_LeaveRecursiveCall();
23027  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23028  PyErr_SetString(
23029  PyExc_SystemError,
23030  "NULL result without error in PyObject_Call");
23031  }
23032  return result;
23033 }
23034 #endif
23035 
23036 /* PyObjectCallNoArg */
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);
23042  }
23043 #endif
23044 #ifdef __Pyx_CyFunction_USED
23045  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
23046 #else
23047  if (likely(PyCFunction_Check(func)))
23048 #endif
23049  {
23050  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
23051  return __Pyx_PyObject_CallMethO(func, NULL);
23052  }
23053  }
23054  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
23055 }
23056 #endif
23057 
23058 /* PyCFunctionFastCall */
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);
23069  /* _PyCFunction_FastCallDict() must not be called with an exception set,
23070  because it may clear it (directly or indirectly) and so the
23071  caller loses its exception */
23072  assert(!PyErr_Occurred());
23073  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
23074  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
23075  } else {
23076  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
23077  }
23078 }
23079 #endif
23080 
23081 /* PyObjectCallOneArg */
23082 #if CYTHON_COMPILING_IN_CPYTHON
23083 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23084  PyObject *result;
23085  PyObject *args = PyTuple_New(1);
23086  if (unlikely(!args)) return NULL;
23087  Py_INCREF(arg);
23088  PyTuple_SET_ITEM(args, 0, arg);
23089  result = __Pyx_PyObject_Call(func, args, NULL);
23090  Py_DECREF(args);
23091  return result;
23092 }
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);
23097  }
23098 #endif
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);
23105 #endif
23106  }
23107  }
23108  return __Pyx__PyObject_CallOneArg(func, arg);
23109 }
23110 #else
23111 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23112  PyObject *result;
23113  PyObject *args = PyTuple_Pack(1, arg);
23114  if (unlikely(!args)) return NULL;
23115  result = __Pyx_PyObject_Call(func, args, NULL);
23116  Py_DECREF(args);
23117  return result;
23118 }
23119 #endif
23120 
23121 /* GetItemInt */
23122 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
23123  PyObject *r;
23124  if (!j) return NULL;
23125  r = PyObject_GetItem(o, j);
23126  Py_DECREF(j);
23127  return r;
23128 }
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);
23136  }
23137  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
23138  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
23139  Py_INCREF(r);
23140  return r;
23141  }
23142  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23143 #else
23144  return PySequence_GetItem(o, i);
23145 #endif
23146 }
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);
23154  }
23155  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
23156  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
23157  Py_INCREF(r);
23158  return r;
23159  }
23160  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23161 #else
23162  return PySequence_GetItem(o, i);
23163 #endif
23164 }
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);
23173  Py_INCREF(r);
23174  return r;
23175  }
23176  }
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);
23181  Py_INCREF(r);
23182  return r;
23183  }
23184  } else {
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)) {
23190  i += l;
23191  } else {
23192  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23193  return NULL;
23194  PyErr_Clear();
23195  }
23196  }
23197  return m->sq_item(o, i);
23198  }
23199  }
23200 #else
23201  if (is_list || PySequence_Check(o)) {
23202  return PySequence_GetItem(o, i);
23203  }
23204 #endif
23205  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23206 }
23207 
23208 /* ObjectGetItem */
23209 #if CYTHON_USE_TYPE_SLOTS
23210 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
23211  PyObject *runerr;
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);
23216  return NULL;
23217  }
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);
23221  }
23222  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
23223  PyErr_Clear();
23224  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
23225  }
23226  return NULL;
23227 }
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);
23232  }
23233  return __Pyx_PyObject_GetIndex(obj, key);
23234 }
23235 #endif
23236 
23237 /* PyObjectCall2Args */
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);
23244  }
23245  #endif
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);
23250  }
23251  #endif
23252  args = PyTuple_New(2);
23253  if (unlikely(!args)) goto done;
23254  Py_INCREF(arg1);
23255  PyTuple_SET_ITEM(args, 0, arg1);
23256  Py_INCREF(arg2);
23257  PyTuple_SET_ITEM(args, 1, arg2);
23258  Py_INCREF(function);
23259  result = __Pyx_PyObject_Call(function, args, NULL);
23260  Py_DECREF(args);
23261  Py_DECREF(function);
23262 done:
23263  return result;
23264 }
23265 
23266 /* PyIntBinop */
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) {
23269  (void)inplace;
23270  (void)zerodivision_check;
23271  #if PY_MAJOR_VERSION < 3
23272  if (likely(PyInt_CheckExact(op1))) {
23273  const long b = intval;
23274  long x;
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);
23280  }
23281  #endif
23282  #if CYTHON_USE_PYLONG_INTERNALS
23283  if (likely(PyLong_CheckExact(op1))) {
23284  const long b = intval;
23285  long a, x;
23286 #ifdef HAVE_LONG_LONG
23287  const PY_LONG_LONG llb = intval;
23288  PY_LONG_LONG lla, llx;
23289 #endif
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;
23295  } else {
23296  switch (size) {
23297  case -2:
23298  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
23299  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23300  break;
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]));
23304  goto long_long;
23305 #endif
23306  }
23307  CYTHON_FALLTHROUGH;
23308  case 2:
23309  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
23310  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23311  break;
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]));
23315  goto long_long;
23316 #endif
23317  }
23318  CYTHON_FALLTHROUGH;
23319  case -3:
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]));
23322  break;
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]));
23326  goto long_long;
23327 #endif
23328  }
23329  CYTHON_FALLTHROUGH;
23330  case 3:
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]));
23333  break;
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]));
23337  goto long_long;
23338 #endif
23339  }
23340  CYTHON_FALLTHROUGH;
23341  case -4:
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]));
23344  break;
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]));
23348  goto long_long;
23349 #endif
23350  }
23351  CYTHON_FALLTHROUGH;
23352  case 4:
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]));
23355  break;
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]));
23359  goto long_long;
23360 #endif
23361  }
23362  CYTHON_FALLTHROUGH;
23363  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
23364  }
23365  }
23366  x = a + b;
23367  return PyLong_FromLong(x);
23368 #ifdef HAVE_LONG_LONG
23369  long_long:
23370  llx = lla + llb;
23371  return PyLong_FromLongLong(llx);
23372 #endif
23373 
23374 
23375  }
23376  #endif
23377  if (PyFloat_CheckExact(op1)) {
23378  const long b = intval;
23379  double a = PyFloat_AS_DOUBLE(op1);
23380  double result;
23381  PyFPE_START_PROTECT("add", return NULL)
23382  result = ((double)a) + (double)b;
23383  PyFPE_END_PROTECT(result)
23384  return PyFloat_FromDouble(result);
23385  }
23386  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
23387 }
23388 #endif
23389 
23390 /* GetTopmostException */
23391 #if CYTHON_USE_EXC_INFO_STACK
23392 static _PyErr_StackItem *
23393 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
23394 {
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)
23398  {
23399  exc_info = exc_info->previous_item;
23400  }
23401  return exc_info;
23402 }
23403 #endif
23404 
23405 /* SaveResetException */
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;
23413  #else
23414  *type = tstate->exc_type;
23415  *value = tstate->exc_value;
23416  *tb = tstate->exc_traceback;
23417  #endif
23418  Py_XINCREF(*type);
23419  Py_XINCREF(*value);
23420  Py_XINCREF(*tb);
23421 }
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;
23432  #else
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;
23439  #endif
23440  Py_XDECREF(tmp_type);
23441  Py_XDECREF(tmp_value);
23442  Py_XDECREF(tmp_tb);
23443 }
23444 #endif
23445 
23446 /* GetException */
23447 #if CYTHON_FAST_THREAD_STATE
23448 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
23449 #else
23450 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
23451 #endif
23452 {
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;
23462 #else
23463  PyErr_Fetch(&local_type, &local_value, &local_tb);
23464 #endif
23465  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
23466 #if CYTHON_FAST_THREAD_STATE
23467  if (unlikely(tstate->curexc_type))
23468 #else
23469  if (unlikely(PyErr_Occurred()))
23470 #endif
23471  goto bad;
23472  #if PY_MAJOR_VERSION >= 3
23473  if (local_tb) {
23474  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
23475  goto bad;
23476  }
23477  #endif
23478  Py_XINCREF(local_tb);
23479  Py_XINCREF(local_type);
23480  Py_XINCREF(local_value);
23481  *type = local_type;
23482  *value = local_value;
23483  *tb = local_tb;
23484 #if CYTHON_FAST_THREAD_STATE
23485  #if CYTHON_USE_EXC_INFO_STACK
23486  {
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;
23494  }
23495  #else
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;
23502  #endif
23503  Py_XDECREF(tmp_type);
23504  Py_XDECREF(tmp_value);
23505  Py_XDECREF(tmp_tb);
23506 #else
23507  PyErr_SetExcInfo(local_type, local_value, local_tb);
23508 #endif
23509  return 0;
23510 bad:
23511  *type = 0;
23512  *value = 0;
23513  *tb = 0;
23514  Py_XDECREF(local_type);
23515  Py_XDECREF(local_value);
23516  Py_XDECREF(local_tb);
23517  return -1;
23518 }
23519 
23520 /* PyErrFetchRestore */
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);
23533 }
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;
23541 }
23542 #endif
23543 
23544 /* SliceObject */
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)) {
23554  if (!has_cstart) {
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;
23558  } else
23559  cstart = 0;
23560  }
23561  if (!has_cstop) {
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;
23565  } else
23566  cstop = PY_SSIZE_T_MAX;
23567  }
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)) {
23571  if (cstop < 0) {
23572  cstop += l;
23573  if (cstop < 0) cstop = 0;
23574  }
23575  if (cstart < 0) {
23576  cstart += l;
23577  if (cstart < 0) cstart = 0;
23578  }
23579  } else {
23580  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23581  goto bad;
23582  PyErr_Clear();
23583  }
23584  }
23585  return ms->sq_slice(obj, cstart, cstop);
23586  }
23587 #endif
23588  mp = Py_TYPE(obj)->tp_as_mapping;
23589  if (likely(mp && mp->mp_subscript))
23590 #endif
23591  {
23592  PyObject* result;
23593  PyObject *py_slice, *py_start, *py_stop;
23594  if (_py_slice) {
23595  py_slice = *_py_slice;
23596  } else {
23597  PyObject* owned_start = NULL;
23598  PyObject* owned_stop = NULL;
23599  if (_py_start) {
23600  py_start = *_py_start;
23601  } else {
23602  if (has_cstart) {
23603  owned_start = py_start = PyInt_FromSsize_t(cstart);
23604  if (unlikely(!py_start)) goto bad;
23605  } else
23606  py_start = Py_None;
23607  }
23608  if (_py_stop) {
23609  py_stop = *_py_stop;
23610  } else {
23611  if (has_cstop) {
23612  owned_stop = py_stop = PyInt_FromSsize_t(cstop);
23613  if (unlikely(!py_stop)) {
23614  Py_XDECREF(owned_start);
23615  goto bad;
23616  }
23617  } else
23618  py_stop = Py_None;
23619  }
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;
23624  }
23625 #if CYTHON_USE_TYPE_SLOTS
23626  result = mp->mp_subscript(obj, py_slice);
23627 #else
23628  result = PyObject_GetItem(obj, py_slice);
23629 #endif
23630  if (!_py_slice) {
23631  Py_DECREF(py_slice);
23632  }
23633  return result;
23634  }
23635  PyErr_Format(PyExc_TypeError,
23636  "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
23637 bad:
23638  return NULL;
23639 }
23640 
23641 /* RaiseException */
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
23646  Py_XINCREF(type);
23647  if (!value || value == Py_None)
23648  value = NULL;
23649  else
23650  Py_INCREF(value);
23651  if (!tb || tb == Py_None)
23652  tb = NULL;
23653  else {
23654  Py_INCREF(tb);
23655  if (!PyTraceBack_Check(tb)) {
23656  PyErr_SetString(PyExc_TypeError,
23657  "raise: arg 3 must be a traceback or None");
23658  goto raise_error;
23659  }
23660  }
23661  if (PyType_Check(type)) {
23662 #if CYTHON_COMPILING_IN_PYPY
23663  if (!value) {
23664  Py_INCREF(Py_None);
23665  value = Py_None;
23666  }
23667 #endif
23668  PyErr_NormalizeException(&type, &value, &tb);
23669  } else {
23670  if (value) {
23671  PyErr_SetString(PyExc_TypeError,
23672  "instance exception may not have a separate value");
23673  goto raise_error;
23674  }
23675  value = type;
23676  type = (PyObject*) Py_TYPE(type);
23677  Py_INCREF(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");
23681  goto raise_error;
23682  }
23683  }
23684  __Pyx_PyThreadState_assign
23685  __Pyx_ErrRestore(type, value, tb);
23686  return;
23687 raise_error:
23688  Py_XDECREF(value);
23689  Py_XDECREF(type);
23690  Py_XDECREF(tb);
23691  return;
23692 }
23693 #else
23694 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
23695  PyObject* owned_instance = NULL;
23696  if (tb == Py_None) {
23697  tb = 0;
23698  } else if (tb && !PyTraceBack_Check(tb)) {
23699  PyErr_SetString(PyExc_TypeError,
23700  "raise: arg 3 must be a traceback or None");
23701  goto bad;
23702  }
23703  if (value == Py_None)
23704  value = 0;
23705  if (PyExceptionInstance_Check(type)) {
23706  if (value) {
23707  PyErr_SetString(PyExc_TypeError,
23708  "instance exception may not have a separate value");
23709  goto bad;
23710  }
23711  value = type;
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)) {
23722  goto bad;
23723  } else {
23724  type = instance_class;
23725  }
23726  }
23727  }
23728  if (!instance_class) {
23729  PyObject *args;
23730  if (!value)
23731  args = PyTuple_New(0);
23732  else if (PyTuple_Check(value)) {
23733  Py_INCREF(value);
23734  args = value;
23735  } else
23736  args = PyTuple_Pack(1, value);
23737  if (!args)
23738  goto bad;
23739  owned_instance = PyObject_Call(type, args, NULL);
23740  Py_DECREF(args);
23741  if (!owned_instance)
23742  goto bad;
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));
23749  goto bad;
23750  }
23751  }
23752  } else {
23753  PyErr_SetString(PyExc_TypeError,
23754  "raise: exception class must be a subclass of BaseException");
23755  goto bad;
23756  }
23757  if (cause) {
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)
23764  goto bad;
23765  } else if (PyExceptionInstance_Check(cause)) {
23766  fixed_cause = cause;
23767  Py_INCREF(fixed_cause);
23768  } else {
23769  PyErr_SetString(PyExc_TypeError,
23770  "exception causes must derive from "
23771  "BaseException");
23772  goto bad;
23773  }
23774  PyException_SetCause(value, fixed_cause);
23775  }
23776  PyErr_SetObject(type, value);
23777  if (tb) {
23778 #if CYTHON_COMPILING_IN_PYPY
23779  PyObject *tmp_type, *tmp_value, *tmp_tb;
23780  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
23781  Py_INCREF(tb);
23782  PyErr_Restore(tmp_type, tmp_value, tb);
23783  Py_XDECREF(tmp_tb);
23784 #else
23785  PyThreadState *tstate = __Pyx_PyThreadState_Current;
23786  PyObject* tmp_tb = tstate->curexc_traceback;
23787  if (tb != tmp_tb) {
23788  Py_INCREF(tb);
23789  tstate->curexc_traceback = tb;
23790  Py_XDECREF(tmp_tb);
23791  }
23792 #endif
23793  }
23794 bad:
23795  Py_XDECREF(owned_instance);
23796  return;
23797 }
23798 #endif
23799 
23800 /* WriteUnraisableException */
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;
23805  PyObject *ctx;
23806  __Pyx_PyThreadState_declare
23807 #ifdef WITH_THREAD
23808  PyGILState_STATE state;
23809  if (nogil)
23810  state = PyGILState_Ensure();
23811 #ifdef _MSC_VER
23812  else state = (PyGILState_STATE)-1;
23813 #endif
23814 #endif
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);
23822  PyErr_PrintEx(1);
23823  }
23824  #if PY_MAJOR_VERSION < 3
23825  ctx = PyString_FromString(name);
23826  #else
23827  ctx = PyUnicode_FromString(name);
23828  #endif
23829  __Pyx_ErrRestore(old_exc, old_val, old_tb);
23830  if (!ctx) {
23831  PyErr_WriteUnraisable(Py_None);
23832  } else {
23833  PyErr_WriteUnraisable(ctx);
23834  Py_DECREF(ctx);
23835  }
23836 #ifdef WITH_THREAD
23837  if (nogil)
23838  PyGILState_Release(state);
23839 #endif
23840 }
23841 
23842 /* PyErrExceptionMatches */
23843 #if CYTHON_FAST_THREAD_STATE
23844 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
23845  Py_ssize_t i, n;
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;
23850  }
23851 #endif
23852  for (i=0; i<n; i++) {
23853  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
23854  }
23855  return 0;
23856 }
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);
23864 }
23865 #endif
23866 
23867 /* ArgTypeTest */
23868 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
23869 {
23870  if (unlikely(!type)) {
23871  PyErr_SetString(PyExc_SystemError, "Missing type object");
23872  return 0;
23873  }
23874  else if (exact) {
23875  #if PY_MAJOR_VERSION == 2
23876  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
23877  #endif
23878  }
23879  else {
23880  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
23881  }
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);
23885  return 0;
23886 }
23887 
23888 /* BytesEquals */
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);
23892 #else
23893  if (s1 == s2) {
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);
23906  } else {
23907  int result;
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);
23914  }
23915 #endif
23916  result = memcmp(ps1, ps2, (size_t)length);
23917  return (equals == Py_EQ) ? (result == 0) : (result != 0);
23918  }
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);
23923  } else {
23924  int result;
23925  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
23926  if (!py_result)
23927  return -1;
23928  result = __Pyx_PyObject_IsTrue(py_result);
23929  Py_DECREF(py_result);
23930  return result;
23931  }
23932 #endif
23933 }
23934 
23935 /* UnicodeEquals */
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);
23939 #else
23940 #if PY_MAJOR_VERSION < 3
23941  PyObject* owned_ref = NULL;
23942 #endif
23943  int s1_is_unicode, s2_is_unicode;
23944  if (s1 == s2) {
23945  goto return_eq;
23946  }
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))
23953  return -1;
23954  s2 = owned_ref;
23955  s2_is_unicode = 1;
23956  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
23957  owned_ref = PyUnicode_FromObject(s1);
23958  if (unlikely(!owned_ref))
23959  return -1;
23960  s1 = owned_ref;
23961  s1_is_unicode = 1;
23962  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
23963  return __Pyx_PyBytes_Equals(s1, s2, equals);
23964  }
23965 #endif
23966  if (s1_is_unicode & s2_is_unicode) {
23967  Py_ssize_t length;
23968  int kind;
23969  void *data1, *data2;
23970  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
23971  return -1;
23972  length = __Pyx_PyUnicode_GET_LENGTH(s1);
23973  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
23974  goto return_ne;
23975  }
23976 #if CYTHON_USE_UNICODE_INTERNALS
23977  {
23978  Py_hash_t hash1, hash2;
23979  #if CYTHON_PEP393_ENABLED
23980  hash1 = ((PyASCIIObject*)s1)->hash;
23981  hash2 = ((PyASCIIObject*)s2)->hash;
23982  #else
23983  hash1 = ((PyUnicodeObject*)s1)->hash;
23984  hash2 = ((PyUnicodeObject*)s2)->hash;
23985  #endif
23986  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
23987  goto return_ne;
23988  }
23989  }
23990 #endif
23991  kind = __Pyx_PyUnicode_KIND(s1);
23992  if (kind != __Pyx_PyUnicode_KIND(s2)) {
23993  goto return_ne;
23994  }
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)) {
23998  goto return_ne;
23999  } else if (length == 1) {
24000  goto return_eq;
24001  } else {
24002  int result = memcmp(data1, data2, (size_t)(length * kind));
24003  #if PY_MAJOR_VERSION < 3
24004  Py_XDECREF(owned_ref);
24005  #endif
24006  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24007  }
24008  } else if ((s1 == Py_None) & s2_is_unicode) {
24009  goto return_ne;
24010  } else if ((s2 == Py_None) & s1_is_unicode) {
24011  goto return_ne;
24012  } else {
24013  int result;
24014  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24015  #if PY_MAJOR_VERSION < 3
24016  Py_XDECREF(owned_ref);
24017  #endif
24018  if (!py_result)
24019  return -1;
24020  result = __Pyx_PyObject_IsTrue(py_result);
24021  Py_DECREF(py_result);
24022  return result;
24023  }
24024 return_eq:
24025  #if PY_MAJOR_VERSION < 3
24026  Py_XDECREF(owned_ref);
24027  #endif
24028  return (equals == Py_EQ);
24029 return_ne:
24030  #if PY_MAJOR_VERSION < 3
24031  Py_XDECREF(owned_ref);
24032  #endif
24033  return (equals == Py_NE);
24034 #endif
24035 }
24036 
24037 /* DivInt[Py_ssize_t] */
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));
24042  return q;
24043 }
24044 
24045 /* GetAttr */
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)))
24050 #else
24051  if (likely(PyString_Check(n)))
24052 #endif
24053  return __Pyx_PyObject_GetAttrStr(o, n);
24054 #endif
24055  return PyObject_GetAttr(o, n);
24056 }
24057 
24058 /* decode_c_string */
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)) {
24063  Py_ssize_t length;
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");
24069  return NULL;
24070  }
24071  length = (Py_ssize_t) slen;
24072  if (start < 0) {
24073  start += length;
24074  if (start < 0)
24075  start = 0;
24076  }
24077  if (stop < 0)
24078  stop += length;
24079  }
24080  if (unlikely(stop <= start))
24081  return __Pyx_NewRef(__pyx_empty_unicode);
24082  length = stop - start;
24083  cstring += start;
24084  if (decode_func) {
24085  return decode_func(cstring, length, errors);
24086  } else {
24087  return PyUnicode_Decode(cstring, length, encoding, errors);
24088  }
24089 }
24090 
24091 /* GetAttr3 */
24092 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24093  __Pyx_PyThreadState_declare
24094  __Pyx_PyThreadState_assign
24095  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24096  return NULL;
24097  __Pyx_PyErr_Clear();
24098  Py_INCREF(d);
24099  return d;
24100 }
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);
24104 }
24105 
24106 /* PyDictVersioning */
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;
24111 }
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;
24115  if (offset) {
24116 #if CYTHON_COMPILING_IN_CPYTHON
24117  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
24118 #else
24119  dictptr = _PyObject_GetDictPtr(obj);
24120 #endif
24121  }
24122  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24123 }
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)))
24127  return 0;
24128  return obj_dict_version == __Pyx_get_object_dict_version(obj);
24129 }
24130 #endif
24131 
24132 /* GetModuleGlobalName */
24133 #if CYTHON_USE_DICT_VERSIONS
24134 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24135 #else
24136 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24137 #endif
24138 {
24139  PyObject *result;
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())) {
24147  return NULL;
24148  }
24149 #else
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);
24154  }
24155 #endif
24156 #else
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);
24161  }
24162  PyErr_Clear();
24163 #endif
24164  return __Pyx_GetBuiltinName(name);
24165 }
24166 
24167 /* RaiseTooManyValuesToUnpack */
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);
24171 }
24172 
24173 /* RaiseNeedMoreValuesToUnpack */
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");
24178 }
24179 
24180 /* RaiseNoneIterError */
24181 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
24182  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
24183 }
24184 
24185 /* SwapException */
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;
24197  #else
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;
24204  #endif
24205  *type = tmp_type;
24206  *value = tmp_value;
24207  *tb = tmp_tb;
24208 }
24209 #else
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);
24214  *type = tmp_type;
24215  *value = tmp_value;
24216  *tb = tmp_tb;
24217 }
24218 #endif
24219 
24220 /* Import */
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;
24226  PyObject *list;
24227  #if PY_MAJOR_VERSION < 3
24228  PyObject *py_import;
24229  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
24230  if (!py_import)
24231  goto bad;
24232  #endif
24233  if (from_list)
24234  list = from_list;
24235  else {
24236  empty_list = PyList_New(0);
24237  if (!empty_list)
24238  goto bad;
24239  list = empty_list;
24240  }
24241  global_dict = PyModule_GetDict(__pyx_m);
24242  if (!global_dict)
24243  goto bad;
24244  empty_dict = PyDict_New();
24245  if (!empty_dict)
24246  goto bad;
24247  {
24248  #if PY_MAJOR_VERSION >= 3
24249  if (level == -1) {
24250  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
24251  module = PyImport_ImportModuleLevelObject(
24252  name, global_dict, empty_dict, list, 1);
24253  if (!module) {
24254  if (!PyErr_ExceptionMatches(PyExc_ImportError))
24255  goto bad;
24256  PyErr_Clear();
24257  }
24258  }
24259  level = 0;
24260  }
24261  #endif
24262  if (!module) {
24263  #if PY_MAJOR_VERSION < 3
24264  PyObject *py_level = PyInt_FromLong(level);
24265  if (!py_level)
24266  goto bad;
24267  module = PyObject_CallFunctionObjArgs(py_import,
24268  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
24269  Py_DECREF(py_level);
24270  #else
24271  module = PyImport_ImportModuleLevelObject(
24272  name, global_dict, empty_dict, list, level);
24273  #endif
24274  }
24275  }
24276 bad:
24277  #if PY_MAJOR_VERSION < 3
24278  Py_XDECREF(py_import);
24279  #endif
24280  Py_XDECREF(empty_list);
24281  Py_XDECREF(empty_dict);
24282  return module;
24283 }
24284 
24285 /* FastTypeChecks */
24286 #if CYTHON_COMPILING_IN_CPYTHON
24287 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
24288  while (a) {
24289  a = a->tp_base;
24290  if (a == b)
24291  return 1;
24292  }
24293  return b == &PyBaseObject_Type;
24294 }
24295 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
24296  PyObject *mro;
24297  if (a == b) return 1;
24298  mro = a->tp_mro;
24299  if (likely(mro)) {
24300  Py_ssize_t i, n;
24301  n = PyTuple_GET_SIZE(mro);
24302  for (i = 0; i < n; i++) {
24303  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
24304  return 1;
24305  }
24306  return 0;
24307  }
24308  return __Pyx_InBases(a, b);
24309 }
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;
24313  int res;
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);
24320  res = 0;
24321  }
24322  if (!res) {
24323  res = PyObject_IsSubclass(err, exc_type2);
24324  if (unlikely(res == -1)) {
24325  PyErr_WriteUnraisable(err);
24326  res = 0;
24327  }
24328  }
24329  __Pyx_ErrRestore(exception, value, tb);
24330  return res;
24331 }
24332 #else
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;
24335  if (!res) {
24336  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
24337  }
24338  return res;
24339 }
24340 #endif
24341 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24342  Py_ssize_t i, n;
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;
24348  }
24349 #endif
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;
24354  #endif
24355  if (likely(PyExceptionClass_Check(t))) {
24356  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
24357  } else {
24358  }
24359  }
24360  return 0;
24361 }
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);
24369  } else {
24370  }
24371  }
24372  return PyErr_GivenExceptionMatches(err, exc_type);
24373 }
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);
24380  }
24381  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
24382 }
24383 #endif
24384 
24385 /* None */
24386 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
24387  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
24388 }
24389 
24390 /* DivInt[long] */
24391 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
24392  long q = a / b;
24393  long r = a - q*b;
24394  q -= ((r != 0) & ((r ^ b) < 0));
24395  return q;
24396 }
24397 
24398 /* ImportFrom */
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));
24405  #else
24406  "cannot import name %S", name);
24407  #endif
24408  }
24409  return value;
24410 }
24411 
24412 /* HasAttr */
24413 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
24414  PyObject *r;
24415  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
24416  PyErr_SetString(PyExc_TypeError,
24417  "hasattr(): attribute name must be string");
24418  return -1;
24419  }
24420  r = __Pyx_GetAttr(o, n);
24421  if (unlikely(!r)) {
24422  PyErr_Clear();
24423  return 0;
24424  } else {
24425  Py_DECREF(r);
24426  return 1;
24427  }
24428 }
24429 
24430 /* PyObject_GenericGetAttrNoDict */
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);
24437 #else
24438  "'%.50s' object has no attribute '%.400s'",
24439  tp->tp_name, PyString_AS_STRING(attr_name));
24440 #endif
24441  return NULL;
24442 }
24443 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
24444  PyObject *descr;
24445  PyTypeObject *tp = Py_TYPE(obj);
24446  if (unlikely(!PyString_Check(attr_name))) {
24447  return PyObject_GenericGetAttr(obj, attr_name);
24448  }
24449  assert(!tp->tp_dictoffset);
24450  descr = _PyType_Lookup(tp, attr_name);
24451  if (unlikely(!descr)) {
24452  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
24453  }
24454  Py_INCREF(descr);
24455  #if PY_MAJOR_VERSION < 3
24456  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
24457  #endif
24458  {
24459  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
24460  if (unlikely(f)) {
24461  PyObject *res = f(descr, obj, (PyObject *)tp);
24462  Py_DECREF(descr);
24463  return res;
24464  }
24465  }
24466  return descr;
24467 }
24468 #endif
24469 
24470 /* PyObject_GenericGetAttr */
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);
24475  }
24476  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
24477 }
24478 #endif
24479 
24480 /* PyObjectGetAttrStrNoError */
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();
24486 }
24487 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
24488  PyObject *result;
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);
24493  }
24494 #endif
24495  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
24496  if (unlikely(!result)) {
24497  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
24498  }
24499  return result;
24500 }
24501 
24502 /* SetupReduce */
24503 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
24504  int ret;
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);
24509  } else {
24510  ret = -1;
24511  }
24512  if (unlikely(ret < 0)) {
24513  PyErr_Clear();
24514  ret = 0;
24515  }
24516  Py_XDECREF(name_attr);
24517  return ret;
24518 }
24519 static int __Pyx_setup_reduce(PyObject* type_obj) {
24520  int ret = 0;
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);
24532 #else
24533  getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
24534  if (!getstate && PyErr_Occurred()) {
24535  goto __PYX_BAD;
24536  }
24537 #endif
24538  if (getstate) {
24539 #if CYTHON_USE_PYTYPE_LOOKUP
24540  object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
24541 #else
24542  object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
24543  if (!object_getstate && PyErr_Occurred()) {
24544  goto __PYX_BAD;
24545  }
24546 #endif
24547  if (object_getstate != getstate) {
24548  goto __PYX_GOOD;
24549  }
24550  }
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;
24553 #else
24554  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
24555 #endif
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;
24560 #else
24561  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
24562 #endif
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()) {
24570  goto __PYX_BAD;
24571  }
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()) {
24580  goto __PYX_BAD;
24581  }
24582  }
24583  PyType_Modified((PyTypeObject*)type_obj);
24584  }
24585  }
24586  goto __PYX_GOOD;
24587 __PYX_BAD:
24588  if (!PyErr_Occurred())
24589  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
24590  ret = -1;
24591 __PYX_GOOD:
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);
24597 #endif
24598  Py_XDECREF(reduce);
24599  Py_XDECREF(reduce_ex);
24600  Py_XDECREF(reduce_cython);
24601  Py_XDECREF(setstate);
24602  Py_XDECREF(setstate_cython);
24603  return ret;
24604 }
24605 
24606 /* SetVTable */
24607 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
24608 #if PY_VERSION_HEX >= 0x02070000
24609  PyObject *ob = PyCapsule_New(vtable, 0, 0);
24610 #else
24611  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
24612 #endif
24613  if (!ob)
24614  goto bad;
24615  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
24616  goto bad;
24617  Py_DECREF(ob);
24618  return 0;
24619 bad:
24620  Py_XDECREF(ob);
24621  return -1;
24622 }
24623 
24624 /* TypeImport */
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)
24629 {
24630  PyObject *result = 0;
24631  char warning[200];
24632  Py_ssize_t basicsize;
24633 #ifdef Py_LIMITED_API
24634  PyObject *py_basicsize;
24635 #endif
24636  result = PyObject_GetAttrString(module, class_name);
24637  if (!result)
24638  goto bad;
24639  if (!PyType_Check(result)) {
24640  PyErr_Format(PyExc_TypeError,
24641  "%.200s.%.200s is not a type object",
24642  module_name, class_name);
24643  goto bad;
24644  }
24645 #ifndef Py_LIMITED_API
24646  basicsize = ((PyTypeObject *)result)->tp_basicsize;
24647 #else
24648  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
24649  if (!py_basicsize)
24650  goto bad;
24651  basicsize = PyLong_AsSsize_t(py_basicsize);
24652  Py_DECREF(py_basicsize);
24653  py_basicsize = 0;
24654  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
24655  goto bad;
24656 #endif
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);
24662  goto bad;
24663  }
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);
24669  goto bad;
24670  }
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;
24677  }
24678  return (PyTypeObject *)result;
24679 bad:
24680  Py_XDECREF(result);
24681  return NULL;
24682 }
24683 #endif
24684 
24685 /* CalculateMetaclass */
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)
24694  continue;
24695 #endif
24696  if (!metaclass) {
24697  metaclass = tmptype;
24698  continue;
24699  }
24700  if (PyType_IsSubtype(metaclass, tmptype))
24701  continue;
24702  if (PyType_IsSubtype(tmptype, metaclass)) {
24703  metaclass = tmptype;
24704  continue;
24705  }
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");
24711  return NULL;
24712  }
24713  if (!metaclass) {
24714 #if PY_MAJOR_VERSION < 3
24715  metaclass = &PyClass_Type;
24716 #else
24717  metaclass = &PyType_Type;
24718 #endif
24719  }
24720  Py_INCREF((PyObject*) metaclass);
24721  return (PyObject*) metaclass;
24722 }
24723 
24724 /* FetchCommonType */
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);
24732  if (cached_type) {
24733  if (!PyType_Check((PyObject*)cached_type)) {
24734  PyErr_Format(PyExc_TypeError,
24735  "Shared Cython type %.200s is not a type object",
24736  type->tp_name);
24737  goto bad;
24738  }
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",
24742  type->tp_name);
24743  goto bad;
24744  }
24745  } else {
24746  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
24747  PyErr_Clear();
24748  if (PyType_Ready(type) < 0) goto bad;
24749  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
24750  goto bad;
24751  Py_INCREF(type);
24752  cached_type = type;
24753  }
24754 done:
24755  Py_DECREF(fake_module);
24756  return cached_type;
24757 bad:
24758  Py_XDECREF(cached_type);
24759  cached_type = NULL;
24760  goto done;
24761 }
24762 
24763 /* CythonFunctionShared */
24764 #include <structmember.h>
24765 static PyObject *
24766 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
24767 {
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);
24772 #else
24773  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
24774 #endif
24775  if (unlikely(op->func_doc == NULL))
24776  return NULL;
24777  } else {
24778  Py_INCREF(Py_None);
24779  return Py_None;
24780  }
24781  }
24782  Py_INCREF(op->func_doc);
24783  return op->func_doc;
24784 }
24785 static int
24786 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
24787 {
24788  PyObject *tmp = op->func_doc;
24789  if (value == NULL) {
24790  value = Py_None;
24791  }
24792  Py_INCREF(value);
24793  op->func_doc = value;
24794  Py_XDECREF(tmp);
24795  return 0;
24796 }
24797 static PyObject *
24798 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24799 {
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);
24803 #else
24804  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
24805 #endif
24806  if (unlikely(op->func_name == NULL))
24807  return NULL;
24808  }
24809  Py_INCREF(op->func_name);
24810  return op->func_name;
24811 }
24812 static int
24813 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
24814 {
24815  PyObject *tmp;
24816 #if PY_MAJOR_VERSION >= 3
24817  if (unlikely(value == NULL || !PyUnicode_Check(value)))
24818 #else
24819  if (unlikely(value == NULL || !PyString_Check(value)))
24820 #endif
24821  {
24822  PyErr_SetString(PyExc_TypeError,
24823  "__name__ must be set to a string object");
24824  return -1;
24825  }
24826  tmp = op->func_name;
24827  Py_INCREF(value);
24828  op->func_name = value;
24829  Py_XDECREF(tmp);
24830  return 0;
24831 }
24832 static PyObject *
24833 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24834 {
24835  Py_INCREF(op->func_qualname);
24836  return op->func_qualname;
24837 }
24838 static int
24839 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
24840 {
24841  PyObject *tmp;
24842 #if PY_MAJOR_VERSION >= 3
24843  if (unlikely(value == NULL || !PyUnicode_Check(value)))
24844 #else
24845  if (unlikely(value == NULL || !PyString_Check(value)))
24846 #endif
24847  {
24848  PyErr_SetString(PyExc_TypeError,
24849  "__qualname__ must be set to a string object");
24850  return -1;
24851  }
24852  tmp = op->func_qualname;
24853  Py_INCREF(value);
24854  op->func_qualname = value;
24855  Py_XDECREF(tmp);
24856  return 0;
24857 }
24858 static PyObject *
24859 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
24860 {
24861  PyObject *self;
24862  self = m->func_closure;
24863  if (self == NULL)
24864  self = Py_None;
24865  Py_INCREF(self);
24866  return self;
24867 }
24868 static PyObject *
24869 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24870 {
24871  if (unlikely(op->func_dict == NULL)) {
24872  op->func_dict = PyDict_New();
24873  if (unlikely(op->func_dict == NULL))
24874  return NULL;
24875  }
24876  Py_INCREF(op->func_dict);
24877  return op->func_dict;
24878 }
24879 static int
24880 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
24881 {
24882  PyObject *tmp;
24883  if (unlikely(value == NULL)) {
24884  PyErr_SetString(PyExc_TypeError,
24885  "function's dictionary may not be deleted");
24886  return -1;
24887  }
24888  if (unlikely(!PyDict_Check(value))) {
24889  PyErr_SetString(PyExc_TypeError,
24890  "setting function's dictionary to a non-dict");
24891  return -1;
24892  }
24893  tmp = op->func_dict;
24894  Py_INCREF(value);
24895  op->func_dict = value;
24896  Py_XDECREF(tmp);
24897  return 0;
24898 }
24899 static PyObject *
24900 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24901 {
24902  Py_INCREF(op->func_globals);
24903  return op->func_globals;
24904 }
24905 static PyObject *
24906 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24907 {
24908  Py_INCREF(Py_None);
24909  return Py_None;
24910 }
24911 static PyObject *
24912 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
24913 {
24914  PyObject* result = (op->func_code) ? op->func_code : Py_None;
24915  Py_INCREF(result);
24916  return result;
24917 }
24918 static int
24919 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
24920  int result = 0;
24921  PyObject *res = op->defaults_getter((PyObject *) op);
24922  if (unlikely(!res))
24923  return -1;
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);
24929  #else
24930  op->defaults_tuple = PySequence_ITEM(res, 0);
24931  if (unlikely(!op->defaults_tuple)) result = -1;
24932  else {
24933  op->defaults_kwdict = PySequence_ITEM(res, 1);
24934  if (unlikely(!op->defaults_kwdict)) result = -1;
24935  }
24936  #endif
24937  Py_DECREF(res);
24938  return result;
24939 }
24940 static int
24941 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
24942  PyObject* tmp;
24943  if (!value) {
24944  value = Py_None;
24945  } else if (value != Py_None && !PyTuple_Check(value)) {
24946  PyErr_SetString(PyExc_TypeError,
24947  "__defaults__ must be set to a tuple object");
24948  return -1;
24949  }
24950  Py_INCREF(value);
24951  tmp = op->defaults_tuple;
24952  op->defaults_tuple = value;
24953  Py_XDECREF(tmp);
24954  return 0;
24955 }
24956 static PyObject *
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;
24963  } else {
24964  result = Py_None;
24965  }
24966  }
24967  Py_INCREF(result);
24968  return result;
24969 }
24970 static int
24971 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
24972  PyObject* tmp;
24973  if (!value) {
24974  value = Py_None;
24975  } else if (value != Py_None && !PyDict_Check(value)) {
24976  PyErr_SetString(PyExc_TypeError,
24977  "__kwdefaults__ must be set to a dict object");
24978  return -1;
24979  }
24980  Py_INCREF(value);
24981  tmp = op->defaults_kwdict;
24982  op->defaults_kwdict = value;
24983  Py_XDECREF(tmp);
24984  return 0;
24985 }
24986 static PyObject *
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;
24993  } else {
24994  result = Py_None;
24995  }
24996  }
24997  Py_INCREF(result);
24998  return result;
24999 }
25000 static int
25001 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25002  PyObject* tmp;
25003  if (!value || value == Py_None) {
25004  value = NULL;
25005  } else if (!PyDict_Check(value)) {
25006  PyErr_SetString(PyExc_TypeError,
25007  "__annotations__ must be set to a dict object");
25008  return -1;
25009  }
25010  Py_XINCREF(value);
25011  tmp = op->func_annotations;
25012  op->func_annotations = value;
25013  Py_XDECREF(tmp);
25014  return 0;
25015 }
25016 static PyObject *
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;
25023  }
25024  Py_INCREF(result);
25025  return result;
25026 }
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},
25046  {0, 0, 0, 0, 0}
25047 };
25048 static PyMemberDef __pyx_CyFunction_members[] = {
25049  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25050  {0, 0, 0, 0, 0}
25051 };
25052 static PyObject *
25053 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25054 {
25055 #if PY_MAJOR_VERSION >= 3
25056  Py_INCREF(m->func_qualname);
25057  return m->func_qualname;
25058 #else
25059  return PyString_FromString(m->func.m_ml->ml_name);
25060 #endif
25061 }
25062 static PyMethodDef __pyx_CyFunction_methods[] = {
25063  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
25064  {0, 0, 0, 0}
25065 };
25066 #if PY_VERSION_HEX < 0x030500A0
25067 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
25068 #else
25069 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
25070 #endif
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))
25074  return NULL;
25075  op->flags = flags;
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);
25091  Py_XINCREF(code);
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;
25101 }
25102 static int
25103 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25104 {
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);
25117  if (m->defaults) {
25118  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25119  int i;
25120  for (i = 0; i < m->defaults_pyobjects; i++)
25121  Py_XDECREF(pydefaults[i]);
25122  PyObject_Free(m->defaults);
25123  m->defaults = NULL;
25124  }
25125  return 0;
25126 }
25127 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
25128 {
25129  if (__Pyx_CyFunction_weakreflist(m) != NULL)
25130  PyObject_ClearWeakRefs((PyObject *) m);
25131  __Pyx_CyFunction_clear(m);
25132  PyObject_GC_Del(m);
25133 }
25134 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
25135 {
25136  PyObject_GC_UnTrack(m);
25137  __Pyx__CyFunction_dealloc(m);
25138 }
25139 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
25140 {
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);
25152  if (m->defaults) {
25153  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25154  int i;
25155  for (i = 0; i < m->defaults_pyobjects; i++)
25156  Py_VISIT(pydefaults[i]);
25157  }
25158  return 0;
25159 }
25160 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
25161 {
25162 #if PY_MAJOR_VERSION < 3
25163  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25164  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
25165  Py_INCREF(func);
25166  return func;
25167  }
25168  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
25169  if (type == NULL)
25170  type = (PyObject *)(Py_TYPE(obj));
25171  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
25172  }
25173  if (obj == Py_None)
25174  obj = NULL;
25175 #endif
25176  return __Pyx_PyMethod_New(func, obj, type);
25177 }
25178 static PyObject*
25179 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
25180 {
25181 #if PY_MAJOR_VERSION >= 3
25182  return PyUnicode_FromFormat("<cyfunction %U at %p>",
25183  op->func_qualname, (void *)op);
25184 #else
25185  return PyString_FromFormat("<cyfunction %s at %p>",
25186  PyString_AsString(op->func_qualname), (void *)op);
25187 #endif
25188 }
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;
25192  Py_ssize_t size;
25193  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
25194  case METH_VARARGS:
25195  if (likely(kw == NULL || PyDict_Size(kw) == 0))
25196  return (*meth)(self, arg);
25197  break;
25198  case METH_VARARGS | METH_KEYWORDS:
25199  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
25200  case METH_NOARGS:
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);
25208  return NULL;
25209  }
25210  break;
25211  case METH_O:
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);
25218  #else
25219  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
25220  #endif
25221  result = (*meth)(self, arg0);
25222  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
25223  Py_DECREF(arg0);
25224  #endif
25225  return result;
25226  }
25227  PyErr_Format(PyExc_TypeError,
25228  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
25229  f->m_ml->ml_name, size);
25230  return NULL;
25231  }
25232  break;
25233  default:
25234  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
25235  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
25236  "longer supported!");
25237  return NULL;
25238  }
25239  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
25240  f->m_ml->ml_name);
25241  return NULL;
25242 }
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);
25245 }
25246 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
25247  PyObject *result;
25248  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
25249  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
25250  Py_ssize_t argc;
25251  PyObject *new_args;
25252  PyObject *self;
25253  argc = PyTuple_GET_SIZE(args);
25254  new_args = PyTuple_GetSlice(args, 1, argc);
25255  if (unlikely(!new_args))
25256  return NULL;
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);
25263  return NULL;
25264  }
25265  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
25266  Py_DECREF(new_args);
25267  } else {
25268  result = __Pyx_CyFunction_Call(func, args, kw);
25269  }
25270  return result;
25271 }
25272 static PyTypeObject __pyx_CyFunctionType_type = {
25273  PyVarObject_HEAD_INIT(0, 0)
25274  "cython_function_or_method",
25275  sizeof(__pyx_CyFunctionObject),
25276  0,
25277  (destructor) __Pyx_CyFunction_dealloc,
25278  0,
25279  0,
25280  0,
25281 #if PY_MAJOR_VERSION < 3
25282  0,
25283 #else
25284  0,
25285 #endif
25286  (reprfunc) __Pyx_CyFunction_repr,
25287  0,
25288  0,
25289  0,
25290  0,
25291  __Pyx_CyFunction_CallAsMethod,
25292  0,
25293  0,
25294  0,
25295  0,
25296  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
25297  0,
25298  (traverseproc) __Pyx_CyFunction_traverse,
25299  (inquiry) __Pyx_CyFunction_clear,
25300  0,
25301 #if PY_VERSION_HEX < 0x030500A0
25302  offsetof(__pyx_CyFunctionObject, func_weakreflist),
25303 #else
25304  offsetof(PyCFunctionObject, m_weakreflist),
25305 #endif
25306  0,
25307  0,
25308  __pyx_CyFunction_methods,
25309  __pyx_CyFunction_members,
25310  __pyx_CyFunction_getsets,
25311  0,
25312  0,
25313  __Pyx_CyFunction_descr_get,
25314  0,
25315  offsetof(__pyx_CyFunctionObject, func_dict),
25316  0,
25317  0,
25318  0,
25319  0,
25320  0,
25321  0,
25322  0,
25323  0,
25324  0,
25325  0,
25326  0,
25327  0,
25328 #if PY_VERSION_HEX >= 0x030400a1
25329  0,
25330 #endif
25331 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25332  0,
25333 #endif
25334 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25335  0,
25336 #endif
25337 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
25338  0,
25339 #endif
25340 };
25341 static int __pyx_CyFunction_init(void) {
25342  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
25343  if (unlikely(__pyx_CyFunctionType == NULL)) {
25344  return -1;
25345  }
25346  return 0;
25347 }
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;
25357 }
25358 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
25359  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25360  m->defaults_tuple = tuple;
25361  Py_INCREF(tuple);
25362 }
25363 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
25364  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25365  m->defaults_kwdict = dict;
25366  Py_INCREF(dict);
25367 }
25368 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
25369  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25370  m->func_annotations = dict;
25371  Py_INCREF(dict);
25372 }
25373 
25374 /* CythonFunction */
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
25380  );
25381  if (likely(op)) {
25382  PyObject_GC_Track(op);
25383  }
25384  return op;
25385 }
25386 
25387 /* Py3ClassCreate */
25388 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
25389  PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
25390  PyObject *ns;
25391  if (metaclass) {
25392  PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
25393  if (prep) {
25394  PyObject *pargs = PyTuple_Pack(2, name, bases);
25395  if (unlikely(!pargs)) {
25396  Py_DECREF(prep);
25397  return NULL;
25398  }
25399  ns = PyObject_Call(prep, pargs, mkw);
25400  Py_DECREF(prep);
25401  Py_DECREF(pargs);
25402  } else {
25403  if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
25404  return NULL;
25405  PyErr_Clear();
25406  ns = PyDict_New();
25407  }
25408  } else {
25409  ns = PyDict_New();
25410  }
25411  if (unlikely(!ns))
25412  return NULL;
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;
25416  return ns;
25417 bad:
25418  Py_DECREF(ns);
25419  return NULL;
25420 }
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))) {
25431  PyErr_Clear();
25432  } else {
25433  return NULL;
25434  }
25435  }
25436  if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
25437  metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
25438  Py_XDECREF(owned_metaclass);
25439  if (unlikely(!metaclass))
25440  return NULL;
25441  owned_metaclass = metaclass;
25442  }
25443  margs = PyTuple_Pack(3, name, bases, dict);
25444  if (unlikely(!margs)) {
25445  result = NULL;
25446  } else {
25447  result = PyObject_Call(metaclass, margs, mkw);
25448  Py_DECREF(margs);
25449  }
25450  Py_XDECREF(owned_metaclass);
25451  return result;
25452 }
25453 
25454 /* CLineInTraceback */
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;
25461 #endif
25462  if (unlikely(!__pyx_cython_runtime)) {
25463  return c_line;
25464  }
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))
25472  } else
25473 #endif
25474  {
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);
25479  } else {
25480  PyErr_Clear();
25481  use_cline = NULL;
25482  }
25483  }
25484  if (!use_cline) {
25485  c_line = 0;
25486  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25487  }
25488  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
25489  c_line = 0;
25490  }
25491  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25492  return c_line;
25493 }
25494 #endif
25495 
25496 /* CodeObjectCache */
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) {
25500  return count;
25501  }
25502  while (start < end) {
25503  mid = start + (end - start) / 2;
25504  if (code_line < entries[mid].code_line) {
25505  end = mid;
25506  } else if (code_line > entries[mid].code_line) {
25507  start = mid + 1;
25508  } else {
25509  return mid;
25510  }
25511  }
25512  if (code_line <= entries[mid].code_line) {
25513  return mid;
25514  } else {
25515  return mid + 1;
25516  }
25517 }
25518 static PyCodeObject *__pyx_find_code_object(int code_line) {
25519  PyCodeObject* code_object;
25520  int pos;
25521  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25522  return NULL;
25523  }
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)) {
25526  return NULL;
25527  }
25528  code_object = __pyx_code_cache.entries[pos].code_object;
25529  Py_INCREF(code_object);
25530  return code_object;
25531 }
25532 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
25533  int pos, i;
25534  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25535  if (unlikely(!code_line)) {
25536  return;
25537  }
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);
25547  }
25548  return;
25549  }
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;
25554  Py_DECREF(tmp);
25555  return;
25556  }
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)) {
25562  return;
25563  }
25564  __pyx_code_cache.entries = entries;
25565  __pyx_code_cache.max_count = new_max;
25566  }
25567  for (i=__pyx_code_cache.count; i>pos; i--) {
25568  entries[i] = entries[i-1];
25569  }
25570  entries[pos].code_line = code_line;
25571  entries[pos].code_object = code_object;
25572  __pyx_code_cache.count++;
25573  Py_INCREF(code_object);
25574 }
25575 
25576 /* AddTraceback */
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
25583  #endif
25584  #include "internal/pycore_frame.h"
25585 #endif
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;
25595  #endif
25596  if (c_line) {
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;
25600  #else
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;
25605  #endif
25606  }
25607  else {
25608  #if PY_MAJOR_VERSION < 3
25609  py_funcname = PyString_FromString(funcname);
25610  if (!py_funcname) goto bad;
25611  #endif
25612  }
25613  #if PY_MAJOR_VERSION < 3
25614  py_code = __Pyx_PyCode_New(
25615  0,
25616  0,
25617  0,
25618  0,
25619  0,
25620  __pyx_empty_bytes, /*PyObject *code,*/
25621  __pyx_empty_tuple, /*PyObject *consts,*/
25622  __pyx_empty_tuple, /*PyObject *names,*/
25623  __pyx_empty_tuple, /*PyObject *varnames,*/
25624  __pyx_empty_tuple, /*PyObject *freevars,*/
25625  __pyx_empty_tuple, /*PyObject *cellvars,*/
25626  py_srcfile, /*PyObject *filename,*/
25627  py_funcname, /*PyObject *name,*/
25628  py_line,
25629  __pyx_empty_bytes /*PyObject *lnotab*/
25630  );
25631  Py_DECREF(py_srcfile);
25632  #else
25633  py_code = PyCode_NewEmpty(filename, funcname, py_line);
25634  #endif
25635  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
25636  return py_code;
25637 bad:
25638  Py_XDECREF(py_funcname);
25639  #if PY_MAJOR_VERSION < 3
25640  Py_XDECREF(py_srcfile);
25641  #endif
25642  return NULL;
25643 }
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;
25650  if (c_line) {
25651  c_line = __Pyx_CLineForTraceback(tstate, c_line);
25652  }
25653  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
25654  if (!py_code) {
25655  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25656  py_code = __Pyx_CreateCodeObjectForTraceback(
25657  funcname, c_line, py_line, filename);
25658  if (!py_code) {
25659  /* If the code object creation fails, then we should clear the
25660  fetched exception references and propagate the new exception */
25661  Py_XDECREF(ptype);
25662  Py_XDECREF(pvalue);
25663  Py_XDECREF(ptraceback);
25664  goto bad;
25665  }
25666  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25667  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
25668  }
25669  py_frame = PyFrame_New(
25670  tstate, /*PyThreadState *tstate,*/
25671  py_code, /*PyCodeObject *code,*/
25672  __pyx_d, /*PyObject *globals,*/
25673  0 /*PyObject *locals*/
25674  );
25675  if (!py_frame) goto bad;
25676  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
25677  PyTraceBack_Here(py_frame);
25678 bad:
25679  Py_XDECREF(py_code);
25680  Py_XDECREF(py_frame);
25681 }
25682 
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);
25689  return -1;
25690 }
25691 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
25692  PyObject *obj = view->obj;
25693  if (!obj) return;
25694  if (PyObject_CheckBuffer(obj)) {
25695  PyBuffer_Release(view);
25696  return;
25697  }
25698  if ((0)) {}
25699  view->obj = NULL;
25700  Py_DECREF(obj);
25701 }
25702 #endif
25703 
25704 
25705 /* MemviewSliceIsContig */
25706 static int
25707 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
25708 {
25709  int i, index, step, start;
25710  Py_ssize_t itemsize = mvs.memview->view.itemsize;
25711  if (order == 'F') {
25712  step = 1;
25713  start = 0;
25714  } else {
25715  step = -1;
25716  start = ndim - 1;
25717  }
25718  for (i = 0; i < ndim; i++) {
25719  index = start + step * i;
25720  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
25721  return 0;
25722  itemsize *= mvs.shape[index];
25723  }
25724  return 1;
25725 }
25726 
25727 /* OverlappingSlices */
25728 static void
25729 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
25730  void **out_start, void **out_end,
25731  int ndim, size_t itemsize)
25732 {
25733  char *start, *end;
25734  int i;
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];
25739  if (extent == 0) {
25740  *out_start = *out_end = start;
25741  return;
25742  } else {
25743  if (stride > 0)
25744  end += stride * (extent - 1);
25745  else
25746  start += stride * (extent - 1);
25747  }
25748  }
25749  *out_start = start;
25750  *out_end = end + itemsize;
25751 }
25752 static int
25753 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
25754  __Pyx_memviewslice *slice2,
25755  int ndim, size_t itemsize)
25756 {
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);
25761 }
25762 
25763 /* Capsule */
25764 static CYTHON_INLINE PyObject *
25765 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
25766 {
25767  PyObject *cobj;
25768 #if PY_VERSION_HEX >= 0x02070000
25769  cobj = PyCapsule_New(p, sig, NULL);
25770 #else
25771  cobj = PyCObject_FromVoidPtr(p, NULL);
25772 #endif
25773  return cobj;
25774 }
25775 
25776 /* CIntFromPyVerify */
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)\
25782  {\
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;\
25791  else\
25792  goto raise_overflow;\
25793  }\
25794  }\
25795  return (target_type) value;\
25796  }
25797 
25798 /* IsLittleEndian */
25799 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
25800 {
25801  union {
25802  uint32_t u32;
25803  uint8_t u8[4];
25804  } S;
25805  S.u32 = 0x01020304;
25806  return S.u8[0] == 4;
25807 }
25808 
25809 /* BufferFormatCheck */
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;
25818  ctx->head = stack;
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;
25826  ctx->enc_type = 0;
25827  ctx->is_complex = 0;
25828  ctx->is_valid_array = 0;
25829  ctx->struct_alignment = 0;
25830  while (type->typegroup == 'S') {
25831  ++ctx->head;
25832  ctx->head->field = type->fields;
25833  ctx->head->parent_offset = 0;
25834  type = type->fields->type;
25835  }
25836 }
25837 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
25838  int count;
25839  const char* t = *ts;
25840  if (*t < '0' || *t > '9') {
25841  return -1;
25842  } else {
25843  count = *t++ - '0';
25844  while (*t >= '0' && *t <= '9') {
25845  count *= 10;
25846  count += *t++ - '0';
25847  }
25848  }
25849  *ts = t;
25850  return count;
25851 }
25852 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
25853  int number = __Pyx_BufFmt_ParseNumber(ts);
25854  if (number == -1)
25855  PyErr_Format(PyExc_ValueError,\
25856  "Does not understand character buffer dtype format string ('%c')", **ts);
25857  return number;
25858 }
25859 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
25860  PyErr_Format(PyExc_ValueError,
25861  "Unexpected format string character: '%c'", ch);
25862 }
25863 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
25864  switch (ch) {
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";
25886  }
25887 }
25888 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
25889  switch (ch) {
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);
25896  case 'g': {
25897  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
25898  return 0;
25899  }
25900  case 'O': case 'P': return sizeof(void*);
25901  default:
25902  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25903  return 0;
25904  }
25905 }
25906 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
25907  switch (ch) {
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);
25914  #endif
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*);
25919  default: {
25920  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25921  return 0;
25922  }
25923  }
25924 }
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;
25934 #endif
25935 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
25936  switch (ch) {
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);
25943 #endif
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*);
25948  default:
25949  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25950  return 0;
25951  }
25952 }
25953 /* These are for computing the padding at the end of the struct to align
25954  on the first member of the struct. This will probably the same as above,
25955  but we don't have any guarantees.
25956  */
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;
25966 #endif
25967 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
25968  switch (ch) {
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);
25975 #endif
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*);
25980  default:
25981  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
25982  return 0;
25983  }
25984 }
25985 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
25986  switch (ch) {
25987  case 'c':
25988  return 'H';
25989  case 'b': case 'h': case 'i':
25990  case 'l': case 'q': case 's': case 'p':
25991  return 'I';
25992  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
25993  return 'U';
25994  case 'f': case 'd': case 'g':
25995  return (is_complex ? 'C' : 'R');
25996  case 'O':
25997  return 'O';
25998  case 'P':
25999  return 'P';
26000  default: {
26001  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26002  return 0;
26003  }
26004  }
26005 }
26006 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26007  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26008  const char* expected;
26009  const char* quote;
26010  if (ctx->head == NULL) {
26011  expected = "end";
26012  quote = "";
26013  } else {
26014  expected = ctx->head->field->type->name;
26015  quote = "'";
26016  }
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));
26021  } else {
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);
26028  }
26029 }
26030 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
26031  char group;
26032  size_t size, offset, arraysize = 1;
26033  if (ctx->enc_type == 0) return 0;
26034  if (ctx->head->field->type->arraysize[0]) {
26035  int i, ndim = 0;
26036  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
26037  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
26038  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);
26043  return -1;
26044  }
26045  }
26046  if (!ctx->is_valid_array) {
26047  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
26048  ctx->head->field->type->ndim, ndim);
26049  return -1;
26050  }
26051  for (i = 0; i < ctx->head->field->type->ndim; i++) {
26052  arraysize *= ctx->head->field->type->arraysize[i];
26053  }
26054  ctx->is_valid_array = 0;
26055  ctx->enc_count = 1;
26056  }
26057  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
26058  do {
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);
26063  } else {
26064  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
26065  }
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,
26074  ctx->is_complex);
26075  }
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;
26079  ++ctx->head;
26080  ctx->head->field = type->fields;
26081  ctx->head->parent_offset = parent_offset;
26082  continue;
26083  }
26084  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
26085  } else {
26086  __Pyx_BufFmt_RaiseExpected(ctx);
26087  return -1;
26088  }
26089  }
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);
26095  return -1;
26096  }
26097  ctx->fmt_offset += size;
26098  if (arraysize)
26099  ctx->fmt_offset += (arraysize - 1) * size;
26100  --ctx->enc_count;
26101  while (1) {
26102  if (field == &ctx->root) {
26103  ctx->head = NULL;
26104  if (ctx->enc_count != 0) {
26105  __Pyx_BufFmt_RaiseExpected(ctx);
26106  return -1;
26107  }
26108  break;
26109  }
26110  ctx->head->field = ++field;
26111  if (field->type == NULL) {
26112  --ctx->head;
26113  field = ctx->head->field;
26114  continue;
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;
26119  ++ctx->head;
26120  ctx->head->field = field;
26121  ctx->head->parent_offset = parent_offset;
26122  break;
26123  } else {
26124  break;
26125  }
26126  }
26127  } while (ctx->enc_count);
26128  ctx->enc_type = 0;
26129  ctx->is_complex = 0;
26130  return 0;
26131 }
26132 static PyObject *
26133 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
26134 {
26135  const char *ts = *tsp;
26136  int i = 0, number, ndim;
26137  ++ts;
26138  if (ctx->new_count != 1) {
26139  PyErr_SetString(PyExc_ValueError,
26140  "Cannot handle repeated arrays in format string");
26141  return NULL;
26142  }
26143  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26144  ndim = ctx->head->field->type->ndim;
26145  while (*ts && *ts != ')') {
26146  switch (*ts) {
26147  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
26148  default: break;
26149  }
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++;
26160  i++;
26161  }
26162  if (i != ndim)
26163  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
26164  ctx->head->field->type->ndim, i);
26165  if (!*ts) {
26166  PyErr_SetString(PyExc_ValueError,
26167  "Unexpected end of format string, expected ')'");
26168  return NULL;
26169  }
26170  ctx->is_valid_array = 1;
26171  ctx->new_count = 1;
26172  *tsp = ++ts;
26173  return Py_None;
26174 }
26175 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
26176  int got_Z = 0;
26177  while (1) {
26178  switch(*ts) {
26179  case 0:
26180  if (ctx->enc_type != 0 && ctx->head == NULL) {
26181  __Pyx_BufFmt_RaiseExpected(ctx);
26182  return NULL;
26183  }
26184  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26185  if (ctx->head != NULL) {
26186  __Pyx_BufFmt_RaiseExpected(ctx);
26187  return NULL;
26188  }
26189  return ts;
26190  case ' ':
26191  case '\r':
26192  case '\n':
26193  ++ts;
26194  break;
26195  case '<':
26196  if (!__Pyx_Is_Little_Endian()) {
26197  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
26198  return NULL;
26199  }
26200  ctx->new_packmode = '=';
26201  ++ts;
26202  break;
26203  case '>':
26204  case '!':
26205  if (__Pyx_Is_Little_Endian()) {
26206  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
26207  return NULL;
26208  }
26209  ctx->new_packmode = '=';
26210  ++ts;
26211  break;
26212  case '=':
26213  case '@':
26214  case '^':
26215  ctx->new_packmode = *ts++;
26216  break;
26217  case 'T':
26218  {
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;
26223  ++ts;
26224  if (*ts != '{') {
26225  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
26226  return NULL;
26227  }
26228  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26229  ctx->enc_type = 0;
26230  ctx->enc_count = 0;
26231  ctx->struct_alignment = 0;
26232  ++ts;
26233  ts_after_sub = ts;
26234  for (i = 0; i != struct_count; ++i) {
26235  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
26236  if (!ts_after_sub) return NULL;
26237  }
26238  ts = ts_after_sub;
26239  if (struct_alignment) ctx->struct_alignment = struct_alignment;
26240  }
26241  break;
26242  case '}':
26243  {
26244  size_t alignment = ctx->struct_alignment;
26245  ++ts;
26246  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26247  ctx->enc_type = 0;
26248  if (alignment && ctx->fmt_offset % alignment) {
26249  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
26250  }
26251  }
26252  return ts;
26253  case 'x':
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;
26258  ctx->enc_type = 0;
26259  ctx->enc_packmode = ctx->new_packmode;
26260  ++ts;
26261  break;
26262  case 'Z':
26263  got_Z = 1;
26264  ++ts;
26265  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
26266  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
26267  return NULL;
26268  }
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;
26278  got_Z = 0;
26279  ++ts;
26280  break;
26281  }
26282  CYTHON_FALLTHROUGH;
26283  case 's':
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;
26289  ++ts;
26290  ctx->new_count = 1;
26291  got_Z = 0;
26292  break;
26293  case ':':
26294  ++ts;
26295  while(*ts != ':') ++ts;
26296  ++ts;
26297  break;
26298  case '(':
26299  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
26300  break;
26301  default:
26302  {
26303  int number = __Pyx_BufFmt_ExpectNumber(&ts);
26304  if (number == -1) return NULL;
26305  ctx->new_count = (size_t)number;
26306  }
26307  }
26308  }
26309 }
26310 
26311 /* TypeInfoCompare */
26312  static int
26313 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
26314 {
26315  int i;
26316  if (!a || !b)
26317  return 0;
26318  if (a == b)
26319  return 1;
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;
26324  } else {
26325  return 0;
26326  }
26327  }
26328  if (a->ndim) {
26329  for (i = 0; i < a->ndim; i++)
26330  if (a->arraysize[i] != b->arraysize[i])
26331  return 0;
26332  }
26333  if (a->typegroup == 'S') {
26334  if (a->flags != b->flags)
26335  return 0;
26336  if (a->fields || b->fields) {
26337  if (!(a->fields && b->fields))
26338  return 0;
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))
26344  return 0;
26345  }
26346  return !a->fields[i].type && !b->fields[i].type;
26347  }
26348  }
26349  return 1;
26350 }
26351 
26352 /* MemviewSliceValidateAndInit */
26353  static int
26354 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
26355 {
26356  if (buf->shape[dim] <= 1)
26357  return 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);
26365  goto fail;
26366  }
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.");
26371  goto fail;
26372  }
26373  }
26374  if (spec & __Pyx_MEMVIEW_FOLLOW) {
26375  Py_ssize_t stride = buf->strides[dim];
26376  if (stride < 0)
26377  stride = -stride;
26378  if (unlikely(stride < buf->itemsize)) {
26379  PyErr_SetString(PyExc_ValueError,
26380  "Buffer and memoryview are not contiguous "
26381  "in the same dimension.");
26382  goto fail;
26383  }
26384  }
26385  } else {
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);
26390  goto fail;
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);
26395  goto fail;
26396  } else if (unlikely(buf->suboffsets)) {
26397  PyErr_SetString(PyExc_ValueError,
26398  "Buffer exposes suboffsets but no strides");
26399  goto fail;
26400  }
26401  }
26402  return 1;
26403 fail:
26404  return 0;
26405 }
26406 static int
26407 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
26408 {
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);
26414  goto fail;
26415  }
26416  }
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);
26422  goto fail;
26423  }
26424  }
26425  return 1;
26426 fail:
26427  return 0;
26428 }
26429 static int
26430 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
26431 {
26432  int i;
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.");
26439  goto fail;
26440  }
26441  stride = stride * buf->shape[i];
26442  }
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.");
26449  goto fail;
26450  }
26451  stride = stride * buf->shape[i];
26452  }
26453  }
26454  return 1;
26455 fail:
26456  return 0;
26457 }
26458 static int __Pyx_ValidateAndInit_memviewslice(
26459  int *axes_specs,
26460  int c_or_f_flag,
26461  int buf_flags,
26462  int ndim,
26463  __Pyx_TypeInfo *dtype,
26464  __Pyx_BufFmt_StackElem stack[],
26465  __Pyx_memviewslice *memviewslice,
26466  PyObject *original_obj)
26467 {
26468  struct __pyx_memoryview_obj *memview, *new_memview;
26469  __Pyx_RefNannyDeclarations
26470  Py_buffer *buf;
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;
26479  } else {
26480  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26481  original_obj, buf_flags, 0, dtype);
26482  new_memview = memview;
26483  if (unlikely(!memview))
26484  goto fail;
26485  }
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)",
26490  ndim, buf->ndim);
26491  goto fail;
26492  }
26493  if (new_memview) {
26494  __Pyx_BufFmt_Init(&ctx, stack, dtype);
26495  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
26496  }
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)",
26501  buf->itemsize,
26502  (buf->itemsize > 1) ? "s" : "",
26503  dtype->name,
26504  dtype->size,
26505  (dtype->size > 1) ? "s" : "");
26506  goto fail;
26507  }
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)))
26512  goto fail;
26513  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
26514  goto fail;
26515  }
26516  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
26517  goto fail;
26518  }
26519  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
26520  new_memview != NULL) == -1)) {
26521  goto fail;
26522  }
26523  retval = 0;
26524  goto no_fail;
26525 fail:
26526  Py_XDECREF(new_memview);
26527  retval = -1;
26528 no_fail:
26529  __Pyx_RefNannyFinishContext();
26530  return retval;
26531 }
26532 
26533 /* ObjectToMemviewSlice */
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) };
26538  int retcode;
26539  if (obj == Py_None) {
26540  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26541  return result;
26542  }
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,
26546  &result, obj);
26547  if (unlikely(retcode == -1))
26548  goto __pyx_fail;
26549  return result;
26550 __pyx_fail:
26551  result.memview = NULL;
26552  result.data = NULL;
26553  return result;
26554 }
26555 
26556 /* ObjectToMemviewSlice */
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) };
26561  int retcode;
26562  if (obj == Py_None) {
26563  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26564  return result;
26565  }
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,
26569  &result, obj);
26570  if (unlikely(retcode == -1))
26571  goto __pyx_fail;
26572  return result;
26573 __pyx_fail:
26574  result.memview = NULL;
26575  result.data = NULL;
26576  return result;
26577 }
26578 
26579 /* Declarations */
26580  #if CYTHON_CCOMPLEX
26581  #ifdef __cplusplus
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);
26584  }
26585  #else
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;
26588  }
26589  #endif
26590 #else
26591  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
26592  __pyx_t_float_complex z;
26593  z.real = x;
26594  z.imag = y;
26595  return z;
26596  }
26597 #endif
26598 
26599 /* Arithmetic */
26600  #if CYTHON_CCOMPLEX
26601 #else
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);
26604  }
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;
26609  return z;
26610  }
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;
26615  return z;
26616  }
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;
26621  return z;
26622  }
26623  #if 1
26624  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26625  if (b.imag == 0) {
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);
26630  } else {
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);
26635  }
26636  } else {
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);
26641  }
26642  }
26643  #else
26644  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26645  if (b.imag == 0) {
26646  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26647  } else {
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);
26652  }
26653  }
26654  #endif
26655  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
26656  __pyx_t_float_complex z;
26657  z.real = -a.real;
26658  z.imag = -a.imag;
26659  return z;
26660  }
26661  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
26662  return (a.real == 0) && (a.imag == 0);
26663  }
26664  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
26665  __pyx_t_float_complex z;
26666  z.real = a.real;
26667  z.imag = -a.imag;
26668  return z;
26669  }
26670  #if 1
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);
26674  #else
26675  return hypotf(z.real, z.imag);
26676  #endif
26677  }
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) {
26682  if (b.real < 0) {
26683  float denom = a.real * a.real + a.imag * a.imag;
26684  a.real = a.real / denom;
26685  a.imag = -a.imag / denom;
26686  b.real = -b.real;
26687  }
26688  switch ((int)b.real) {
26689  case 0:
26690  z.real = 1;
26691  z.imag = 0;
26692  return z;
26693  case 1:
26694  return a;
26695  case 2:
26696  return __Pyx_c_prod_float(a, a);
26697  case 3:
26698  z = __Pyx_c_prod_float(a, a);
26699  return __Pyx_c_prod_float(z, a);
26700  case 4:
26701  z = __Pyx_c_prod_float(a, a);
26702  return __Pyx_c_prod_float(z, z);
26703  }
26704  }
26705  if (a.imag == 0) {
26706  if (a.real == 0) {
26707  return a;
26708  } else if (b.imag == 0) {
26709  z.real = powf(a.real, b.real);
26710  z.imag = 0;
26711  return z;
26712  } else if (a.real > 0) {
26713  r = a.real;
26714  theta = 0;
26715  } else {
26716  r = -a.real;
26717  theta = atan2f(0.0, -1.0);
26718  }
26719  } else {
26720  r = __Pyx_c_abs_float(a);
26721  theta = atan2f(a.imag, a.real);
26722  }
26723  lnr = logf(r);
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);
26728  return z;
26729  }
26730  #endif
26731 #endif
26732 
26733 /* Declarations */
26734  #if CYTHON_CCOMPLEX
26735  #ifdef __cplusplus
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);
26738  }
26739  #else
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;
26742  }
26743  #endif
26744 #else
26745  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26746  __pyx_t_double_complex z;
26747  z.real = x;
26748  z.imag = y;
26749  return z;
26750  }
26751 #endif
26752 
26753 /* Arithmetic */
26754  #if CYTHON_CCOMPLEX
26755 #else
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);
26758  }
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;
26763  return z;
26764  }
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;
26769  return z;
26770  }
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;
26775  return z;
26776  }
26777  #if 1
26778  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26779  if (b.imag == 0) {
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);
26784  } else {
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);
26789  }
26790  } else {
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);
26795  }
26796  }
26797  #else
26798  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26799  if (b.imag == 0) {
26800  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26801  } else {
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);
26806  }
26807  }
26808  #endif
26809  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
26810  __pyx_t_double_complex z;
26811  z.real = -a.real;
26812  z.imag = -a.imag;
26813  return z;
26814  }
26815  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
26816  return (a.real == 0) && (a.imag == 0);
26817  }
26818  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
26819  __pyx_t_double_complex z;
26820  z.real = a.real;
26821  z.imag = -a.imag;
26822  return z;
26823  }
26824  #if 1
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);
26828  #else
26829  return hypot(z.real, z.imag);
26830  #endif
26831  }
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) {
26836  if (b.real < 0) {
26837  double denom = a.real * a.real + a.imag * a.imag;
26838  a.real = a.real / denom;
26839  a.imag = -a.imag / denom;
26840  b.real = -b.real;
26841  }
26842  switch ((int)b.real) {
26843  case 0:
26844  z.real = 1;
26845  z.imag = 0;
26846  return z;
26847  case 1:
26848  return a;
26849  case 2:
26850  return __Pyx_c_prod_double(a, a);
26851  case 3:
26852  z = __Pyx_c_prod_double(a, a);
26853  return __Pyx_c_prod_double(z, a);
26854  case 4:
26855  z = __Pyx_c_prod_double(a, a);
26856  return __Pyx_c_prod_double(z, z);
26857  }
26858  }
26859  if (a.imag == 0) {
26860  if (a.real == 0) {
26861  return a;
26862  } else if (b.imag == 0) {
26863  z.real = pow(a.real, b.real);
26864  z.imag = 0;
26865  return z;
26866  } else if (a.real > 0) {
26867  r = a.real;
26868  theta = 0;
26869  } else {
26870  r = -a.real;
26871  theta = atan2(0.0, -1.0);
26872  }
26873  } else {
26874  r = __Pyx_c_abs_double(a);
26875  theta = atan2(a.imag, a.real);
26876  }
26877  lnr = log(r);
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);
26882  return z;
26883  }
26884  #endif
26885 #endif
26886 
26887 /* MemviewSliceCopyTemplate */
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)
26893 {
26894  __Pyx_RefNannyDeclarations
26895  int i;
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);
26908  goto fail;
26909  }
26910  }
26911  shape_tuple = PyTuple_New(ndim);
26912  if (unlikely(!shape_tuple)) {
26913  goto fail;
26914  }
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)) {
26919  goto fail;
26920  } else {
26921  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
26922  temp_int = NULL;
26923  }
26924  }
26925  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
26926  if (unlikely(!array_obj)) {
26927  goto fail;
26928  }
26929  __Pyx_GOTREF(array_obj);
26930  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26931  (PyObject *) array_obj, contig_flag,
26932  dtype_is_object,
26933  from_mvs->memview->typeinfo);
26934  if (unlikely(!memview_obj))
26935  goto fail;
26936  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
26937  goto fail;
26938  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
26939  dtype_is_object) < 0))
26940  goto fail;
26941  goto no_fail;
26942 fail:
26943  __Pyx_XDECREF(new_mvs.memview);
26944  new_mvs.memview = NULL;
26945  new_mvs.data = NULL;
26946 no_fail:
26947  __Pyx_XDECREF(shape_tuple);
26948  __Pyx_XDECREF(temp_int);
26949  __Pyx_XDECREF(array_obj);
26950  __Pyx_RefNannyFinishContext();
26951  return new_mvs;
26952 }
26953 
26954 /* CIntFromPy */
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"
26959 #endif
26960  const int neg_one = (int) -1, const_zero = (int) 0;
26961 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26962 #pragma GCC diagnostic pop
26963 #endif
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))
26969  } else {
26970  long val = PyInt_AS_LONG(x);
26971  if (is_unsigned && unlikely(val < 0)) {
26972  goto raise_neg_overflow;
26973  }
26974  return (int) val;
26975  }
26976  } else
26977 #endif
26978  if (likely(PyLong_Check(x))) {
26979  if (is_unsigned) {
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])
26985  case 2:
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]));
26991  }
26992  }
26993  break;
26994  case 3:
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]));
27000  }
27001  }
27002  break;
27003  case 4:
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]));
27009  }
27010  }
27011  break;
27012  }
27013 #endif
27014 #if CYTHON_COMPILING_IN_CPYTHON
27015  if (unlikely(Py_SIZE(x) < 0)) {
27016  goto raise_neg_overflow;
27017  }
27018 #else
27019  {
27020  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27021  if (unlikely(result < 0))
27022  return (int) -1;
27023  if (unlikely(result == 1))
27024  goto raise_neg_overflow;
27025  }
27026 #endif
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))
27032 #endif
27033  }
27034  } else {
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])
27041  case -2:
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])));
27047  }
27048  }
27049  break;
27050  case 2:
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])));
27056  }
27057  }
27058  break;
27059  case -3:
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])));
27065  }
27066  }
27067  break;
27068  case 3:
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])));
27074  }
27075  }
27076  break;
27077  case -4:
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])));
27083  }
27084  }
27085  break;
27086  case 4:
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])));
27092  }
27093  }
27094  break;
27095  }
27096 #endif
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))
27102 #endif
27103  }
27104  }
27105  {
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");
27109 #else
27110  int val;
27111  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27112  #if PY_MAJOR_VERSION < 3
27113  if (likely(v) && !PyLong_Check(v)) {
27114  PyObject *tmp = v;
27115  v = PyNumber_Long(tmp);
27116  Py_DECREF(tmp);
27117  }
27118  #endif
27119  if (likely(v)) {
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);
27125  Py_DECREF(v);
27126  if (likely(!ret))
27127  return val;
27128  }
27129 #endif
27130  return (int) -1;
27131  }
27132  } else {
27133  int val;
27134  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27135  if (!tmp) return (int) -1;
27136  val = __Pyx_PyInt_As_int(tmp);
27137  Py_DECREF(tmp);
27138  return val;
27139  }
27140 raise_overflow:
27141  PyErr_SetString(PyExc_OverflowError,
27142  "value too large to convert to int");
27143  return (int) -1;
27144 raise_neg_overflow:
27145  PyErr_SetString(PyExc_OverflowError,
27146  "can't convert negative value to int");
27147  return (int) -1;
27148 }
27149 
27150 /* CIntToPy */
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"
27155 #endif
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
27159 #endif
27160  const int is_unsigned = neg_one > const_zero;
27161  if (is_unsigned) {
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);
27169 #endif
27170  }
27171  } else {
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);
27177 #endif
27178  }
27179  }
27180  {
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);
27185  }
27186 }
27187 
27188 /* CIntFromPy */
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"
27193 #endif
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
27197 #endif
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))
27203  } else {
27204  long val = PyInt_AS_LONG(x);
27205  if (is_unsigned && unlikely(val < 0)) {
27206  goto raise_neg_overflow;
27207  }
27208  return (npy_int32) val;
27209  }
27210  } else
27211 #endif
27212  if (likely(PyLong_Check(x))) {
27213  if (is_unsigned) {
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])
27219  case 2:
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]));
27225  }
27226  }
27227  break;
27228  case 3:
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]));
27234  }
27235  }
27236  break;
27237  case 4:
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]));
27243  }
27244  }
27245  break;
27246  }
27247 #endif
27248 #if CYTHON_COMPILING_IN_CPYTHON
27249  if (unlikely(Py_SIZE(x) < 0)) {
27250  goto raise_neg_overflow;
27251  }
27252 #else
27253  {
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;
27259  }
27260 #endif
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))
27266 #endif
27267  }
27268  } else {
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])
27275  case -2:
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])));
27281  }
27282  }
27283  break;
27284  case 2:
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])));
27290  }
27291  }
27292  break;
27293  case -3:
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])));
27299  }
27300  }
27301  break;
27302  case 3:
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])));
27308  }
27309  }
27310  break;
27311  case -4:
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])));
27317  }
27318  }
27319  break;
27320  case 4:
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])));
27326  }
27327  }
27328  break;
27329  }
27330 #endif
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))
27336 #endif
27337  }
27338  }
27339  {
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");
27343 #else
27344  npy_int32 val;
27345  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27346  #if PY_MAJOR_VERSION < 3
27347  if (likely(v) && !PyLong_Check(v)) {
27348  PyObject *tmp = v;
27349  v = PyNumber_Long(tmp);
27350  Py_DECREF(tmp);
27351  }
27352  #endif
27353  if (likely(v)) {
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);
27359  Py_DECREF(v);
27360  if (likely(!ret))
27361  return val;
27362  }
27363 #endif
27364  return (npy_int32) -1;
27365  }
27366  } else {
27367  npy_int32 val;
27368  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27369  if (!tmp) return (npy_int32) -1;
27370  val = __Pyx_PyInt_As_npy_int32(tmp);
27371  Py_DECREF(tmp);
27372  return val;
27373  }
27374 raise_overflow:
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;
27382 }
27383 
27384 /* CIntFromPy */
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"
27389 #endif
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
27393 #endif
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))
27399  } else {
27400  long val = PyInt_AS_LONG(x);
27401  if (is_unsigned && unlikely(val < 0)) {
27402  goto raise_neg_overflow;
27403  }
27404  return (size_t) val;
27405  }
27406  } else
27407 #endif
27408  if (likely(PyLong_Check(x))) {
27409  if (is_unsigned) {
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])
27415  case 2:
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]));
27421  }
27422  }
27423  break;
27424  case 3:
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]));
27430  }
27431  }
27432  break;
27433  case 4:
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]));
27439  }
27440  }
27441  break;
27442  }
27443 #endif
27444 #if CYTHON_COMPILING_IN_CPYTHON
27445  if (unlikely(Py_SIZE(x) < 0)) {
27446  goto raise_neg_overflow;
27447  }
27448 #else
27449  {
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;
27455  }
27456 #endif
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))
27462 #endif
27463  }
27464  } else {
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])
27471  case -2:
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])));
27477  }
27478  }
27479  break;
27480  case 2:
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])));
27486  }
27487  }
27488  break;
27489  case -3:
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])));
27495  }
27496  }
27497  break;
27498  case 3:
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])));
27504  }
27505  }
27506  break;
27507  case -4:
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])));
27513  }
27514  }
27515  break;
27516  case 4:
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])));
27522  }
27523  }
27524  break;
27525  }
27526 #endif
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))
27532 #endif
27533  }
27534  }
27535  {
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");
27539 #else
27540  size_t val;
27541  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27542  #if PY_MAJOR_VERSION < 3
27543  if (likely(v) && !PyLong_Check(v)) {
27544  PyObject *tmp = v;
27545  v = PyNumber_Long(tmp);
27546  Py_DECREF(tmp);
27547  }
27548  #endif
27549  if (likely(v)) {
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);
27555  Py_DECREF(v);
27556  if (likely(!ret))
27557  return val;
27558  }
27559 #endif
27560  return (size_t) -1;
27561  }
27562  } else {
27563  size_t val;
27564  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27565  if (!tmp) return (size_t) -1;
27566  val = __Pyx_PyInt_As_size_t(tmp);
27567  Py_DECREF(tmp);
27568  return val;
27569  }
27570 raise_overflow:
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;
27578 }
27579 
27580 /* CIntToPy */
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"
27585 #endif
27586  const int neg_one = (int) -1, const_zero = (int) 0;
27587 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27588 #pragma GCC diagnostic pop
27589 #endif
27590  const int is_unsigned = neg_one > const_zero;
27591  if (is_unsigned) {
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);
27599 #endif
27600  }
27601  } else {
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);
27607 #endif
27608  }
27609  }
27610  {
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);
27615  }
27616 }
27617 
27618 /* CIntFromPy */
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"
27623 #endif
27624  const long neg_one = (long) -1, const_zero = (long) 0;
27625 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27626 #pragma GCC diagnostic pop
27627 #endif
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))
27633  } else {
27634  long val = PyInt_AS_LONG(x);
27635  if (is_unsigned && unlikely(val < 0)) {
27636  goto raise_neg_overflow;
27637  }
27638  return (long) val;
27639  }
27640  } else
27641 #endif
27642  if (likely(PyLong_Check(x))) {
27643  if (is_unsigned) {
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])
27649  case 2:
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]));
27655  }
27656  }
27657  break;
27658  case 3:
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]));
27664  }
27665  }
27666  break;
27667  case 4:
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]));
27673  }
27674  }
27675  break;
27676  }
27677 #endif
27678 #if CYTHON_COMPILING_IN_CPYTHON
27679  if (unlikely(Py_SIZE(x) < 0)) {
27680  goto raise_neg_overflow;
27681  }
27682 #else
27683  {
27684  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27685  if (unlikely(result < 0))
27686  return (long) -1;
27687  if (unlikely(result == 1))
27688  goto raise_neg_overflow;
27689  }
27690 #endif
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))
27696 #endif
27697  }
27698  } else {
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])
27705  case -2:
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])));
27711  }
27712  }
27713  break;
27714  case 2:
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])));
27720  }
27721  }
27722  break;
27723  case -3:
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])));
27729  }
27730  }
27731  break;
27732  case 3:
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])));
27738  }
27739  }
27740  break;
27741  case -4:
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])));
27747  }
27748  }
27749  break;
27750  case 4:
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])));
27756  }
27757  }
27758  break;
27759  }
27760 #endif
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))
27766 #endif
27767  }
27768  }
27769  {
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");
27773 #else
27774  long val;
27775  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27776  #if PY_MAJOR_VERSION < 3
27777  if (likely(v) && !PyLong_Check(v)) {
27778  PyObject *tmp = v;
27779  v = PyNumber_Long(tmp);
27780  Py_DECREF(tmp);
27781  }
27782  #endif
27783  if (likely(v)) {
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);
27789  Py_DECREF(v);
27790  if (likely(!ret))
27791  return val;
27792  }
27793 #endif
27794  return (long) -1;
27795  }
27796  } else {
27797  long val;
27798  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27799  if (!tmp) return (long) -1;
27800  val = __Pyx_PyInt_As_long(tmp);
27801  Py_DECREF(tmp);
27802  return val;
27803  }
27804 raise_overflow:
27805  PyErr_SetString(PyExc_OverflowError,
27806  "value too large to convert to long");
27807  return (long) -1;
27808 raise_neg_overflow:
27809  PyErr_SetString(PyExc_OverflowError,
27810  "can't convert negative value to long");
27811  return (long) -1;
27812 }
27813 
27814 /* CIntToPy */
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"
27819 #endif
27820  const long neg_one = (long) -1, const_zero = (long) 0;
27821 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27822 #pragma GCC diagnostic pop
27823 #endif
27824  const int is_unsigned = neg_one > const_zero;
27825  if (is_unsigned) {
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);
27833 #endif
27834  }
27835  } else {
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);
27841 #endif
27842  }
27843  }
27844  {
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);
27849  }
27850 }
27851 
27852 /* CIntFromPy */
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"
27857 #endif
27858  const char neg_one = (char) -1, const_zero = (char) 0;
27859 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27860 #pragma GCC diagnostic pop
27861 #endif
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))
27867  } else {
27868  long val = PyInt_AS_LONG(x);
27869  if (is_unsigned && unlikely(val < 0)) {
27870  goto raise_neg_overflow;
27871  }
27872  return (char) val;
27873  }
27874  } else
27875 #endif
27876  if (likely(PyLong_Check(x))) {
27877  if (is_unsigned) {
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])
27883  case 2:
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]));
27889  }
27890  }
27891  break;
27892  case 3:
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]));
27898  }
27899  }
27900  break;
27901  case 4:
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]));
27907  }
27908  }
27909  break;
27910  }
27911 #endif
27912 #if CYTHON_COMPILING_IN_CPYTHON
27913  if (unlikely(Py_SIZE(x) < 0)) {
27914  goto raise_neg_overflow;
27915  }
27916 #else
27917  {
27918  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27919  if (unlikely(result < 0))
27920  return (char) -1;
27921  if (unlikely(result == 1))
27922  goto raise_neg_overflow;
27923  }
27924 #endif
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))
27930 #endif
27931  }
27932  } else {
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])
27939  case -2:
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])));
27945  }
27946  }
27947  break;
27948  case 2:
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])));
27954  }
27955  }
27956  break;
27957  case -3:
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])));
27963  }
27964  }
27965  break;
27966  case 3:
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])));
27972  }
27973  }
27974  break;
27975  case -4:
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])));
27981  }
27982  }
27983  break;
27984  case 4:
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])));
27990  }
27991  }
27992  break;
27993  }
27994 #endif
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))
28000 #endif
28001  }
28002  }
28003  {
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");
28007 #else
28008  char val;
28009  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28010  #if PY_MAJOR_VERSION < 3
28011  if (likely(v) && !PyLong_Check(v)) {
28012  PyObject *tmp = v;
28013  v = PyNumber_Long(tmp);
28014  Py_DECREF(tmp);
28015  }
28016  #endif
28017  if (likely(v)) {
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);
28023  Py_DECREF(v);
28024  if (likely(!ret))
28025  return val;
28026  }
28027 #endif
28028  return (char) -1;
28029  }
28030  } else {
28031  char val;
28032  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28033  if (!tmp) return (char) -1;
28034  val = __Pyx_PyInt_As_char(tmp);
28035  Py_DECREF(tmp);
28036  return val;
28037  }
28038 raise_overflow:
28039  PyErr_SetString(PyExc_OverflowError,
28040  "value too large to convert to char");
28041  return (char) -1;
28042 raise_neg_overflow:
28043  PyErr_SetString(PyExc_OverflowError,
28044  "can't convert negative value to char");
28045  return (char) -1;
28046 }
28047 
28048 /* CheckBinaryVersion */
28049  static int __Pyx_check_binary_version(void) {
28050  char ctversion[5];
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);
28054  found_dot = 0;
28055  for (i = 0; i < 4; i++) {
28056  if (!ctversion[i]) {
28057  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
28058  break;
28059  }
28060  if (rt_from_call[i] != ctversion[i]) {
28061  same = 0;
28062  break;
28063  }
28064  }
28065  if (!same) {
28066  char rtversion[5] = {'\0'};
28067  char message[200];
28068  for (i=0; i<4; ++i) {
28069  if (rt_from_call[i] == '.') {
28070  if (found_dot) break;
28071  found_dot = 1;
28072  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
28073  break;
28074  }
28075  rtversion[i] = rt_from_call[i];
28076  }
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);
28082  }
28083  return 0;
28084 }
28085 
28086 /* InitStrings */
28087  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28088  while (t->p) {
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);
28094  } else {
28095  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28096  }
28097  #else
28098  if (t->is_unicode | t->is_str) {
28099  if (t->intern) {
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);
28103  } else {
28104  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28105  }
28106  } else {
28107  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28108  }
28109  #endif
28110  if (!*t->p)
28111  return -1;
28112  if (PyObject_Hash(*t->p) == -1)
28113  return -1;
28114  ++t;
28115  }
28116  return 0;
28117 }
28118 
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));
28121 }
28122 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
28123  Py_ssize_t ignore;
28124  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
28125 }
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) {
28129  char* defenc_c;
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
28134  {
28135  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
28136  char* c;
28137  for (c = defenc_c; c < end; c++) {
28138  if ((unsigned char) (*c) >= 128) {
28139  PyUnicode_AsASCIIString(o);
28140  return NULL;
28141  }
28142  }
28143  }
28144 #endif
28145  *length = PyBytes_GET_SIZE(defenc);
28146  return defenc_c;
28147 }
28148 #else
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);
28155  } else {
28156  PyUnicode_AsASCIIString(o);
28157  return NULL;
28158  }
28159 #else
28160  return PyUnicode_AsUTF8AndSize(o, length);
28161 #endif
28162 }
28163 #endif
28164 #endif
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
28167  if (
28168 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28169  __Pyx_sys_getdefaultencoding_not_ascii &&
28170 #endif
28171  PyUnicode_Check(o)) {
28172  return __Pyx_PyUnicode_AsStringAndSize(o, length);
28173  } else
28174 #endif
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);
28179  } else
28180 #endif
28181  {
28182  char* result;
28183  int r = PyBytes_AsStringAndSize(o, &result, length);
28184  if (unlikely(r < 0)) {
28185  return NULL;
28186  } else {
28187  return result;
28188  }
28189  }
28190 }
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);
28195 }
28196 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
28197  int retval;
28198  if (unlikely(!x)) return -1;
28199  retval = __Pyx_PyObject_IsTrue(x);
28200  Py_DECREF(x);
28201  return retval;
28202 }
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)) {
28211  Py_DECREF(result);
28212  return NULL;
28213  }
28214  return result;
28215  }
28216 #endif
28217  PyErr_Format(PyExc_TypeError,
28218  "__%.4s__ returned non-%.4s (type %.200s)",
28219  type_name, type_name, Py_TYPE(result)->tp_name);
28220  Py_DECREF(result);
28221  return NULL;
28222 }
28223 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
28224 #if CYTHON_USE_TYPE_SLOTS
28225  PyNumberMethods *m;
28226 #endif
28227  const char *name = NULL;
28228  PyObject *res = NULL;
28229 #if PY_MAJOR_VERSION < 3
28230  if (likely(PyInt_Check(x) || PyLong_Check(x)))
28231 #else
28232  if (likely(PyLong_Check(x)))
28233 #endif
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) {
28239  name = "int";
28240  res = m->nb_int(x);
28241  }
28242  else if (m && m->nb_long) {
28243  name = "long";
28244  res = m->nb_long(x);
28245  }
28246  #else
28247  if (likely(m && m->nb_int)) {
28248  name = "int";
28249  res = m->nb_int(x);
28250  }
28251  #endif
28252 #else
28253  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
28254  res = PyNumber_Int(x);
28255  }
28256 #endif
28257  if (likely(res)) {
28258 #if PY_MAJOR_VERSION < 3
28259  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
28260 #else
28261  if (unlikely(!PyLong_CheckExact(res))) {
28262 #endif
28263  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
28264  }
28265  }
28266  else if (!PyErr_Occurred()) {
28267  PyErr_SetString(PyExc_TypeError,
28268  "an integer is required");
28269  }
28270  return res;
28271 }
28272 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
28273  Py_ssize_t ival;
28274  PyObject *x;
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);
28279  else
28280  return PyInt_AsSsize_t(b);
28281  }
28282 #endif
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;
28290  return ival;
28291  } else {
28292  switch (size) {
28293  case 2:
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]));
28296  }
28297  break;
28298  case -2:
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]));
28301  }
28302  break;
28303  case 3:
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]));
28306  }
28307  break;
28308  case -3:
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]));
28311  }
28312  break;
28313  case 4:
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]));
28316  }
28317  break;
28318  case -4:
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]));
28321  }
28322  break;
28323  }
28324  }
28325  #endif
28326  return PyLong_AsSsize_t(b);
28327  }
28328  x = PyNumber_Index(b);
28329  if (!x) return -1;
28330  ival = PyInt_AsSsize_t(x);
28331  Py_DECREF(x);
28332  return ival;
28333 }
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);
28340 #endif
28341  } else {
28342  Py_ssize_t ival;
28343  PyObject *x;
28344  x = PyNumber_Index(o);
28345  if (!x) return -1;
28346  ival = PyInt_AsLong(x);
28347  Py_DECREF(x);
28348  return ival;
28349  }
28350 }
28351 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
28352  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28353 }
28354 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
28355  return PyInt_FromSize_t(ival);
28356 }
28357 
28358 
28359 #endif /* Py_PYTHON_H */
f
Double f
Definition: Headers.h:64
number
Int number
Definition: Headers.h:33
s
Double s
Definition: Headers.h:84
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
q
Double q
Definition: Headers.h:81
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
T
Double T
Definition: Headers.h:87
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
ns
Int ns
Definition: Headers.h:30
c
Double c
Definition: Headers.h:54
proteus_superlu.h
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
nnz
#define nnz
Definition: Richards.h:9