proteus  1.8.1
C/C++/Fortran libraries
csparsity.cpp
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 __cplusplus
307  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
308 #endif
309 #ifndef CYTHON_INLINE
310  #if defined(__clang__)
311  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
312  #else
313  #define CYTHON_INLINE inline
314  #endif
315 #endif
316 template<typename T>
317 void __Pyx_call_destructor(T& x) {
318  x.~T();
319 }
320 template<typename T>
321 class __Pyx_FakeReference {
322  public:
323  __Pyx_FakeReference() : ptr(NULL) { }
324  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
325  T *operator->() { return ptr; }
326  T *operator&() { return ptr; }
327  operator T&() { return *ptr; }
328  template<typename U> bool operator ==(U other) { return *ptr == other; }
329  template<typename U> bool operator !=(U other) { return *ptr != other; }
330  private:
331  T *ptr;
332 };
333 
334 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
335  #define Py_OptimizeFlag 0
336 #endif
337 #define __PYX_BUILD_PY_SSIZE_T "n"
338 #define CYTHON_FORMAT_SSIZE_T "z"
339 #if PY_MAJOR_VERSION < 3
340  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
341  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
342  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
343  #define __Pyx_DefaultClassType PyClass_Type
344 #else
345  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
346  #define __Pyx_DefaultClassType PyType_Type
347 #if PY_VERSION_HEX >= 0x030B00A1
348  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
349  PyObject *code, PyObject *c, PyObject* n, PyObject *v,
350  PyObject *fv, PyObject *cell, PyObject* fn,
351  PyObject *name, int fline, PyObject *lnos) {
352  PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
353  PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
354  const char *fn_cstr=NULL;
355  const char *name_cstr=NULL;
356  PyCodeObject* co=NULL;
357  PyObject *type, *value, *traceback;
358  PyErr_Fetch(&type, &value, &traceback);
359  if (!(kwds=PyDict_New())) goto end;
360  if (!(argcount=PyLong_FromLong(a))) goto end;
361  if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
362  if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
363  if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
364  if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
365  if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
366  if (!(nlocals=PyLong_FromLong(l))) goto end;
367  if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
368  if (!(stacksize=PyLong_FromLong(s))) goto end;
369  if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
370  if (!(flags=PyLong_FromLong(f))) goto end;
371  if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
372  if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
373  if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
374  if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
375  if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
376  if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
377  if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
378  if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
379  if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
380  if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
381  if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
382  if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
383  if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
384  if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
385  Py_XDECREF((PyObject*)co);
386  co = (PyCodeObject*)call_result;
387  call_result = NULL;
388  if (0) {
389  cleanup_code_too:
390  Py_XDECREF((PyObject*)co);
391  co = NULL;
392  }
393  end:
394  Py_XDECREF(kwds);
395  Py_XDECREF(argcount);
396  Py_XDECREF(posonlyargcount);
397  Py_XDECREF(kwonlyargcount);
398  Py_XDECREF(nlocals);
399  Py_XDECREF(stacksize);
400  Py_XDECREF(replace);
401  Py_XDECREF(call_result);
402  Py_XDECREF(empty);
403  if (type) {
404  PyErr_Restore(type, value, traceback);
405  }
406  return co;
407  }
408 #else
409  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
410  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
411 #endif
412  #define __Pyx_DefaultClassType PyType_Type
413 #endif
414 #ifndef Py_TPFLAGS_CHECKTYPES
415  #define Py_TPFLAGS_CHECKTYPES 0
416 #endif
417 #ifndef Py_TPFLAGS_HAVE_INDEX
418  #define Py_TPFLAGS_HAVE_INDEX 0
419 #endif
420 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
421  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
422 #endif
423 #ifndef Py_TPFLAGS_HAVE_FINALIZE
424  #define Py_TPFLAGS_HAVE_FINALIZE 0
425 #endif
426 #ifndef METH_STACKLESS
427  #define METH_STACKLESS 0
428 #endif
429 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
430  #ifndef METH_FASTCALL
431  #define METH_FASTCALL 0x80
432  #endif
433  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
434  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
435  Py_ssize_t nargs, PyObject *kwnames);
436 #else
437  #define __Pyx_PyCFunctionFast _PyCFunctionFast
438  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
439 #endif
440 #if CYTHON_FAST_PYCCALL
441 #define __Pyx_PyFastCFunction_Check(func)\
442  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
443 #else
444 #define __Pyx_PyFastCFunction_Check(func) 0
445 #endif
446 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
447  #define PyObject_Malloc(s) PyMem_Malloc(s)
448  #define PyObject_Free(p) PyMem_Free(p)
449  #define PyObject_Realloc(p) PyMem_Realloc(p)
450 #endif
451 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
452  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
453  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
454  #define PyMem_RawFree(p) PyMem_Free(p)
455 #endif
456 #if CYTHON_COMPILING_IN_PYSTON
457  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
458  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
459 #else
460  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
461  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
462 #endif
463 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
464  #define __Pyx_PyThreadState_Current PyThreadState_GET()
465 #elif PY_VERSION_HEX >= 0x03060000
466  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
467 #elif PY_VERSION_HEX >= 0x03000000
468  #define __Pyx_PyThreadState_Current PyThreadState_GET()
469 #else
470  #define __Pyx_PyThreadState_Current _PyThreadState_Current
471 #endif
472 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
473 #include "pythread.h"
474 #define Py_tss_NEEDS_INIT 0
475 typedef int Py_tss_t;
476 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
477  *key = PyThread_create_key();
478  return 0;
479 }
480 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
481  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
482  *key = Py_tss_NEEDS_INIT;
483  return key;
484 }
485 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
486  PyObject_Free(key);
487 }
488 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
489  return *key != Py_tss_NEEDS_INIT;
490 }
491 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
492  PyThread_delete_key(*key);
493  *key = Py_tss_NEEDS_INIT;
494 }
495 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
496  return PyThread_set_key_value(*key, value);
497 }
498 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
499  return PyThread_get_key_value(*key);
500 }
501 #endif
502 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
503 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
504 #else
505 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
506 #endif
507 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
508  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
509  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
510 #else
511  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
512  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
513 #endif
514 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
515 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
516 #else
517 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
518 #endif
519 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
520  #define CYTHON_PEP393_ENABLED 1
521  #if defined(PyUnicode_IS_READY)
522  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
523  0 : _PyUnicode_Ready((PyObject *)(op)))
524  #else
525  #define __Pyx_PyUnicode_READY(op) (0)
526  #endif
527  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
528  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
529  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
530  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
531  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
532  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
533  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
534  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
535  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
536  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
537  #else
538  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
539  #endif
540  #else
541  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
542  #endif
543 #else
544  #define CYTHON_PEP393_ENABLED 0
545  #define PyUnicode_1BYTE_KIND 1
546  #define PyUnicode_2BYTE_KIND 2
547  #define PyUnicode_4BYTE_KIND 4
548  #define __Pyx_PyUnicode_READY(op) (0)
549  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
550  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
551  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
552  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
553  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
554  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
555  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
556  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
557 #endif
558 #if CYTHON_COMPILING_IN_PYPY
559  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
560  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
561 #else
562  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
563  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
564  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
565 #endif
566 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
567  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
568 #endif
569 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
570  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
571 #endif
572 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
573  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
574 #endif
575 #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))
576 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
577 #if PY_MAJOR_VERSION >= 3
578  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
579 #else
580  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
581 #endif
582 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
583  #define PyObject_ASCII(o) PyObject_Repr(o)
584 #endif
585 #if PY_MAJOR_VERSION >= 3
586  #define PyBaseString_Type PyUnicode_Type
587  #define PyStringObject PyUnicodeObject
588  #define PyString_Type PyUnicode_Type
589  #define PyString_Check PyUnicode_Check
590  #define PyString_CheckExact PyUnicode_CheckExact
591 #ifndef PyObject_Unicode
592  #define PyObject_Unicode PyObject_Str
593 #endif
594 #endif
595 #if PY_MAJOR_VERSION >= 3
596  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
597  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
598 #else
599  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
600  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
601 #endif
602 #ifndef PySet_CheckExact
603  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
604 #endif
605 #if PY_VERSION_HEX >= 0x030900A4
606  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
607  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
608 #else
609  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
610  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
611 #endif
612 #if CYTHON_ASSUME_SAFE_MACROS
613  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
614 #else
615  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
616 #endif
617 #if PY_MAJOR_VERSION >= 3
618  #define PyIntObject PyLongObject
619  #define PyInt_Type PyLong_Type
620  #define PyInt_Check(op) PyLong_Check(op)
621  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
622  #define PyInt_FromString PyLong_FromString
623  #define PyInt_FromUnicode PyLong_FromUnicode
624  #define PyInt_FromLong PyLong_FromLong
625  #define PyInt_FromSize_t PyLong_FromSize_t
626  #define PyInt_FromSsize_t PyLong_FromSsize_t
627  #define PyInt_AsLong PyLong_AsLong
628  #define PyInt_AS_LONG PyLong_AS_LONG
629  #define PyInt_AsSsize_t PyLong_AsSsize_t
630  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
631  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
632  #define PyNumber_Int PyNumber_Long
633 #endif
634 #if PY_MAJOR_VERSION >= 3
635  #define PyBoolObject PyLongObject
636 #endif
637 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
638  #ifndef PyUnicode_InternFromString
639  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
640  #endif
641 #endif
642 #if PY_VERSION_HEX < 0x030200A4
643  typedef long Py_hash_t;
644  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
645  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
646 #else
647  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
648  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
649 #endif
650 #if PY_MAJOR_VERSION >= 3
651  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
652 #else
653  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
654 #endif
655 #if CYTHON_USE_ASYNC_SLOTS
656  #if PY_VERSION_HEX >= 0x030500B1
657  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
658  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
659  #else
660  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
661  #endif
662 #else
663  #define __Pyx_PyType_AsAsync(obj) NULL
664 #endif
665 #ifndef __Pyx_PyAsyncMethodsStruct
666  typedef struct {
667  unaryfunc am_await;
668  unaryfunc am_aiter;
669  unaryfunc am_anext;
670  } __Pyx_PyAsyncMethodsStruct;
671 #endif
672 
673 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
674  #if !defined(_USE_MATH_DEFINES)
675  #define _USE_MATH_DEFINES
676  #endif
677 #endif
678 #include <math.h>
679 #ifdef NAN
680 #define __PYX_NAN() ((float) NAN)
681 #else
682 static CYTHON_INLINE float __PYX_NAN() {
683  float value;
684  memset(&value, 0xFF, sizeof(value));
685  return value;
686 }
687 #endif
688 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
689 #define __Pyx_truncl trunc
690 #else
691 #define __Pyx_truncl truncl
692 #endif
693 
694 #define __PYX_MARK_ERR_POS(f_index, lineno) \
695  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
696 #define __PYX_ERR(f_index, lineno, Ln_error) \
697  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
698 
699 #ifndef __PYX_EXTERN_C
700  #ifdef __cplusplus
701  #define __PYX_EXTERN_C extern "C"
702  #else
703  #define __PYX_EXTERN_C extern
704  #endif
705 #endif
706 
707 #define __PYX_HAVE__csparsity
708 #define __PYX_HAVE_API__csparsity
709 /* Early includes */
710 #include "sparsity.h"
711 #include <string.h>
712 #include <stdio.h>
713 #include "numpy/arrayobject.h"
714 #include "numpy/ndarrayobject.h"
715 #include "numpy/ndarraytypes.h"
716 #include "numpy/arrayscalars.h"
717 #include "numpy/ufuncobject.h"
718 
719  /* NumPy API declarations from "numpy/__init__.pxd" */
720 
721 #include "pythread.h"
722 #include <stdlib.h>
723 #include "pystate.h"
724 #ifdef _OPENMP
725 #include <omp.h>
726 #endif /* _OPENMP */
727 
728 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
729 #define CYTHON_WITHOUT_ASSERTIONS
730 #endif
731 
732 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
733  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
734 
735 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
736 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
737 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
738 #define __PYX_DEFAULT_STRING_ENCODING ""
739 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
740 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
741 #define __Pyx_uchar_cast(c) ((unsigned char)c)
742 #define __Pyx_long_cast(x) ((long)x)
743 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
744  (sizeof(type) < sizeof(Py_ssize_t)) ||\
745  (sizeof(type) > sizeof(Py_ssize_t) &&\
746  likely(v < (type)PY_SSIZE_T_MAX ||\
747  v == (type)PY_SSIZE_T_MAX) &&\
748  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
749  v == (type)PY_SSIZE_T_MIN))) ||\
750  (sizeof(type) == sizeof(Py_ssize_t) &&\
751  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
752  v == (type)PY_SSIZE_T_MAX))) )
753 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
754  return (size_t) i < (size_t) limit;
755 }
756 #if defined (__cplusplus) && __cplusplus >= 201103L
757  #include <cstdlib>
758  #define __Pyx_sst_abs(value) std::abs(value)
759 #elif SIZEOF_INT >= SIZEOF_SIZE_T
760  #define __Pyx_sst_abs(value) abs(value)
761 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
762  #define __Pyx_sst_abs(value) labs(value)
763 #elif defined (_MSC_VER)
764  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
765 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
766  #define __Pyx_sst_abs(value) llabs(value)
767 #elif defined (__GNUC__)
768  #define __Pyx_sst_abs(value) __builtin_llabs(value)
769 #else
770  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
771 #endif
772 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
773 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
774 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
775 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
776 #define __Pyx_PyBytes_FromString PyBytes_FromString
777 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
778 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
779 #if PY_MAJOR_VERSION < 3
780  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
781  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
782 #else
783  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
784  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
785 #endif
786 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
787 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
788 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
789 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
790 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
791 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
792 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
793 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
794 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
795 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
796 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
797 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
798 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
799 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
800 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
801 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
802 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
803  const Py_UNICODE *u_end = u;
804  while (*u_end++) ;
805  return (size_t)(u_end - u - 1);
806 }
807 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
808 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
809 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
810 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
811 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
812 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
813 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
814 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
815 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
816 #define __Pyx_PySequence_Tuple(obj)\
817  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
818 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
819 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
820 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
821 #if CYTHON_ASSUME_SAFE_MACROS
822 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
823 #else
824 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
825 #endif
826 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
827 #if PY_MAJOR_VERSION >= 3
828 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
829 #else
830 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
831 #endif
832 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
833 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
834 static int __Pyx_sys_getdefaultencoding_not_ascii;
835 static int __Pyx_init_sys_getdefaultencoding_params(void) {
836  PyObject* sys;
837  PyObject* default_encoding = NULL;
838  PyObject* ascii_chars_u = NULL;
839  PyObject* ascii_chars_b = NULL;
840  const char* default_encoding_c;
841  sys = PyImport_ImportModule("sys");
842  if (!sys) goto bad;
843  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
844  Py_DECREF(sys);
845  if (!default_encoding) goto bad;
846  default_encoding_c = PyBytes_AsString(default_encoding);
847  if (!default_encoding_c) goto bad;
848  if (strcmp(default_encoding_c, "ascii") == 0) {
849  __Pyx_sys_getdefaultencoding_not_ascii = 0;
850  } else {
851  char ascii_chars[128];
852  int c;
853  for (c = 0; c < 128; c++) {
854  ascii_chars[c] = c;
855  }
856  __Pyx_sys_getdefaultencoding_not_ascii = 1;
857  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
858  if (!ascii_chars_u) goto bad;
859  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
860  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
861  PyErr_Format(
862  PyExc_ValueError,
863  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
864  default_encoding_c);
865  goto bad;
866  }
867  Py_DECREF(ascii_chars_u);
868  Py_DECREF(ascii_chars_b);
869  }
870  Py_DECREF(default_encoding);
871  return 0;
872 bad:
873  Py_XDECREF(default_encoding);
874  Py_XDECREF(ascii_chars_u);
875  Py_XDECREF(ascii_chars_b);
876  return -1;
877 }
878 #endif
879 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
880 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
881 #else
882 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
883 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
884 static char* __PYX_DEFAULT_STRING_ENCODING;
885 static int __Pyx_init_sys_getdefaultencoding_params(void) {
886  PyObject* sys;
887  PyObject* default_encoding = NULL;
888  char* default_encoding_c;
889  sys = PyImport_ImportModule("sys");
890  if (!sys) goto bad;
891  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
892  Py_DECREF(sys);
893  if (!default_encoding) goto bad;
894  default_encoding_c = PyBytes_AsString(default_encoding);
895  if (!default_encoding_c) goto bad;
896  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
897  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
898  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
899  Py_DECREF(default_encoding);
900  return 0;
901 bad:
902  Py_XDECREF(default_encoding);
903  return -1;
904 }
905 #endif
906 #endif
907 
908 
909 /* Test for GCC > 2.95 */
910 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
911  #define likely(x) __builtin_expect(!!(x), 1)
912  #define unlikely(x) __builtin_expect(!!(x), 0)
913 #else /* !__GNUC__ or GCC < 2.95 */
914  #define likely(x) (x)
915  #define unlikely(x) (x)
916 #endif /* __GNUC__ */
917 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
918 
919 static PyObject *__pyx_m = NULL;
920 static PyObject *__pyx_d;
921 static PyObject *__pyx_b;
922 static PyObject *__pyx_cython_runtime = NULL;
923 static PyObject *__pyx_empty_tuple;
924 static PyObject *__pyx_empty_bytes;
925 static PyObject *__pyx_empty_unicode;
926 static int __pyx_lineno;
927 static int __pyx_clineno = 0;
928 static const char * __pyx_cfilenm= __FILE__;
929 static const char *__pyx_filename;
930 
931 /* Header.proto */
932 #if !defined(CYTHON_CCOMPLEX)
933  #if defined(__cplusplus)
934  #define CYTHON_CCOMPLEX 1
935  #elif defined(_Complex_I)
936  #define CYTHON_CCOMPLEX 1
937  #else
938  #define CYTHON_CCOMPLEX 0
939  #endif
940 #endif
941 #if CYTHON_CCOMPLEX
942  #ifdef __cplusplus
943  #include <complex>
944  #else
945  #include <complex.h>
946  #endif
947 #endif
948 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
949  #undef _Complex_I
950  #define _Complex_I 1.0fj
951 #endif
952 
953 
954 static const char *__pyx_f[] = {
955  "stringsource",
956  "proteus/csparsity.pyx",
957  "__init__.pxd",
958  "type.pxd",
959 };
960 /* ForceInitThreads.proto */
961 #ifndef __PYX_FORCE_INIT_THREADS
962  #define __PYX_FORCE_INIT_THREADS 0
963 #endif
964 
965 /* NoFastGil.proto */
966 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
967 #define __Pyx_PyGILState_Release PyGILState_Release
968 #define __Pyx_FastGIL_Remember()
969 #define __Pyx_FastGIL_Forget()
970 #define __Pyx_FastGilFuncInit()
971 
972 /* BufferFormatStructs.proto */
973 #define IS_UNSIGNED(type) (((type) -1) > 0)
974 struct __Pyx_StructField_;
975 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
976 typedef struct {
977  const char* name;
978  struct __Pyx_StructField_* fields;
979  size_t size;
980  size_t arraysize[8];
981  int ndim;
982  char typegroup;
983  char is_unsigned;
984  int flags;
985 } __Pyx_TypeInfo;
986 typedef struct __Pyx_StructField_ {
987  __Pyx_TypeInfo* type;
988  const char* name;
989  size_t offset;
990 } __Pyx_StructField;
991 typedef struct {
992  __Pyx_StructField* field;
993  size_t parent_offset;
994 } __Pyx_BufFmt_StackElem;
995 typedef struct {
996  __Pyx_StructField root;
997  __Pyx_BufFmt_StackElem* head;
998  size_t fmt_offset;
999  size_t new_count, enc_count;
1000  size_t struct_alignment;
1001  int is_complex;
1002  char enc_type;
1003  char new_packmode;
1004  char enc_packmode;
1005  char is_valid_array;
1006 } __Pyx_BufFmt_Context;
1007 
1008 /* Atomics.proto */
1009 #include <pythread.h>
1010 #ifndef CYTHON_ATOMICS
1011  #define CYTHON_ATOMICS 1
1012 #endif
1013 #define __pyx_atomic_int_type int
1014 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
1015  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
1016  !defined(__i386__)
1017  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
1018  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
1019  #ifdef __PYX_DEBUG_ATOMICS
1020  #warning "Using GNU atomics"
1021  #endif
1022 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
1023  #include <Windows.h>
1024  #undef __pyx_atomic_int_type
1025  #define __pyx_atomic_int_type LONG
1026  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
1027  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
1028  #ifdef __PYX_DEBUG_ATOMICS
1029  #pragma message ("Using MSVC atomics")
1030  #endif
1031 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
1032  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
1033  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
1034  #ifdef __PYX_DEBUG_ATOMICS
1035  #warning "Using Intel atomics"
1036  #endif
1037 #else
1038  #undef CYTHON_ATOMICS
1039  #define CYTHON_ATOMICS 0
1040  #ifdef __PYX_DEBUG_ATOMICS
1041  #warning "Not using atomics"
1042  #endif
1043 #endif
1044 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1045 #if CYTHON_ATOMICS
1046  #define __pyx_add_acquisition_count(memview)\
1047  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1048  #define __pyx_sub_acquisition_count(memview)\
1049  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1050 #else
1051  #define __pyx_add_acquisition_count(memview)\
1052  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1053  #define __pyx_sub_acquisition_count(memview)\
1054  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1055 #endif
1056 
1057 /* MemviewSliceStruct.proto */
1058 struct __pyx_memoryview_obj;
1059 typedef struct {
1060  struct __pyx_memoryview_obj *memview;
1061  char *data;
1062  Py_ssize_t shape[8];
1063  Py_ssize_t strides[8];
1064  Py_ssize_t suboffsets[8];
1065 } __Pyx_memviewslice;
1066 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1067 
1068 
1069 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":690
1070  * # in Cython to enable them only on the right systems.
1071  *
1072  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1073  * ctypedef npy_int16 int16_t
1074  * ctypedef npy_int32 int32_t
1075  */
1076 typedef npy_int8 __pyx_t_5numpy_int8_t;
1077 
1078 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":691
1079  *
1080  * ctypedef npy_int8 int8_t
1081  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1082  * ctypedef npy_int32 int32_t
1083  * ctypedef npy_int64 int64_t
1084  */
1085 typedef npy_int16 __pyx_t_5numpy_int16_t;
1086 
1087 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":692
1088  * ctypedef npy_int8 int8_t
1089  * ctypedef npy_int16 int16_t
1090  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1091  * ctypedef npy_int64 int64_t
1092  * #ctypedef npy_int96 int96_t
1093  */
1094 typedef npy_int32 __pyx_t_5numpy_int32_t;
1095 
1096 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":693
1097  * ctypedef npy_int16 int16_t
1098  * ctypedef npy_int32 int32_t
1099  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1100  * #ctypedef npy_int96 int96_t
1101  * #ctypedef npy_int128 int128_t
1102  */
1103 typedef npy_int64 __pyx_t_5numpy_int64_t;
1104 
1105 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":697
1106  * #ctypedef npy_int128 int128_t
1107  *
1108  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1109  * ctypedef npy_uint16 uint16_t
1110  * ctypedef npy_uint32 uint32_t
1111  */
1112 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1113 
1114 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":698
1115  *
1116  * ctypedef npy_uint8 uint8_t
1117  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1118  * ctypedef npy_uint32 uint32_t
1119  * ctypedef npy_uint64 uint64_t
1120  */
1121 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1122 
1123 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":699
1124  * ctypedef npy_uint8 uint8_t
1125  * ctypedef npy_uint16 uint16_t
1126  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1127  * ctypedef npy_uint64 uint64_t
1128  * #ctypedef npy_uint96 uint96_t
1129  */
1130 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1131 
1132 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":700
1133  * ctypedef npy_uint16 uint16_t
1134  * ctypedef npy_uint32 uint32_t
1135  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1136  * #ctypedef npy_uint96 uint96_t
1137  * #ctypedef npy_uint128 uint128_t
1138  */
1139 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1140 
1141 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":704
1142  * #ctypedef npy_uint128 uint128_t
1143  *
1144  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1145  * ctypedef npy_float64 float64_t
1146  * #ctypedef npy_float80 float80_t
1147  */
1148 typedef npy_float32 __pyx_t_5numpy_float32_t;
1149 
1150 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":705
1151  *
1152  * ctypedef npy_float32 float32_t
1153  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1154  * #ctypedef npy_float80 float80_t
1155  * #ctypedef npy_float128 float128_t
1156  */
1157 typedef npy_float64 __pyx_t_5numpy_float64_t;
1158 
1159 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":714
1160  * # The int types are mapped a bit surprising --
1161  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1162  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1163  * ctypedef npy_longlong long_t
1164  * ctypedef npy_longlong longlong_t
1165  */
1166 typedef npy_long __pyx_t_5numpy_int_t;
1167 
1168 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":715
1169  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1170  * ctypedef npy_long int_t
1171  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1172  * ctypedef npy_longlong longlong_t
1173  *
1174  */
1175 typedef npy_longlong __pyx_t_5numpy_long_t;
1176 
1177 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":716
1178  * ctypedef npy_long int_t
1179  * ctypedef npy_longlong long_t
1180  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1181  *
1182  * ctypedef npy_ulong uint_t
1183  */
1184 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1185 
1186 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":718
1187  * ctypedef npy_longlong longlong_t
1188  *
1189  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1190  * ctypedef npy_ulonglong ulong_t
1191  * ctypedef npy_ulonglong ulonglong_t
1192  */
1193 typedef npy_ulong __pyx_t_5numpy_uint_t;
1194 
1195 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":719
1196  *
1197  * ctypedef npy_ulong uint_t
1198  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1199  * ctypedef npy_ulonglong ulonglong_t
1200  *
1201  */
1202 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1203 
1204 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":720
1205  * ctypedef npy_ulong uint_t
1206  * ctypedef npy_ulonglong ulong_t
1207  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1208  *
1209  * ctypedef npy_intp intp_t
1210  */
1211 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1212 
1213 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":722
1214  * ctypedef npy_ulonglong ulonglong_t
1215  *
1216  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1217  * ctypedef npy_uintp uintp_t
1218  *
1219  */
1220 typedef npy_intp __pyx_t_5numpy_intp_t;
1221 
1222 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":723
1223  *
1224  * ctypedef npy_intp intp_t
1225  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1226  *
1227  * ctypedef npy_double float_t
1228  */
1229 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1230 
1231 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":725
1232  * ctypedef npy_uintp uintp_t
1233  *
1234  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1235  * ctypedef npy_double double_t
1236  * ctypedef npy_longdouble longdouble_t
1237  */
1238 typedef npy_double __pyx_t_5numpy_float_t;
1239 
1240 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":726
1241  *
1242  * ctypedef npy_double float_t
1243  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1244  * ctypedef npy_longdouble longdouble_t
1245  *
1246  */
1247 typedef npy_double __pyx_t_5numpy_double_t;
1248 
1249 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":727
1250  * ctypedef npy_double float_t
1251  * ctypedef npy_double double_t
1252  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1253  *
1254  * ctypedef npy_cfloat cfloat_t
1255  */
1256 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1257 /* Declarations.proto */
1258 #if CYTHON_CCOMPLEX
1259  #ifdef __cplusplus
1260  typedef ::std::complex< float > __pyx_t_float_complex;
1261  #else
1262  typedef float _Complex __pyx_t_float_complex;
1263  #endif
1264 #else
1265  typedef struct { float real, imag; } __pyx_t_float_complex;
1266 #endif
1267 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1268 
1269 /* Declarations.proto */
1270 #if CYTHON_CCOMPLEX
1271  #ifdef __cplusplus
1272  typedef ::std::complex< double > __pyx_t_double_complex;
1273  #else
1274  typedef double _Complex __pyx_t_double_complex;
1275  #endif
1276 #else
1277  typedef struct { double real, imag; } __pyx_t_double_complex;
1278 #endif
1279 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1280 
1281 
1282 /*--- Type declarations ---*/
1283 struct __pyx_obj_9csparsity_PySparsityInfo;
1284 struct __pyx_array_obj;
1285 struct __pyx_MemviewEnum_obj;
1286 struct __pyx_memoryview_obj;
1287 struct __pyx_memoryviewslice_obj;
1288 
1289 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":729
1290  * ctypedef npy_longdouble longdouble_t
1291  *
1292  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1293  * ctypedef npy_cdouble cdouble_t
1294  * ctypedef npy_clongdouble clongdouble_t
1295  */
1296 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1297 
1298 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":730
1299  *
1300  * ctypedef npy_cfloat cfloat_t
1301  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1302  * ctypedef npy_clongdouble clongdouble_t
1303  *
1304  */
1305 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1306 
1307 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":731
1308  * ctypedef npy_cfloat cfloat_t
1309  * ctypedef npy_cdouble cdouble_t
1310  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1311  *
1312  * ctypedef npy_cdouble complex_t
1313  */
1314 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1315 
1316 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":733
1317  * ctypedef npy_clongdouble clongdouble_t
1318  *
1319  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1320  *
1321  * cdef inline object PyArray_MultiIterNew1(a):
1322  */
1323 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1324 
1325 /* "csparsity.pyx":6
1326  * from csparsity cimport SparsityInfo
1327  *
1328  * cdef class PySparsityInfo: # <<<<<<<<<<<<<<
1329  * cdef SparsityInfo cpp
1330  * def __cinit__(self):
1331  */
1332 struct __pyx_obj_9csparsity_PySparsityInfo {
1333  PyObject_HEAD
1335 };
1336 
1337 
1338 /* "View.MemoryView":105
1339  *
1340  * @cname("__pyx_array")
1341  * cdef class array: # <<<<<<<<<<<<<<
1342  *
1343  * cdef:
1344  */
1345 struct __pyx_array_obj {
1346  PyObject_HEAD
1347  struct __pyx_vtabstruct_array *__pyx_vtab;
1348  char *data;
1349  Py_ssize_t len;
1350  char *format;
1351  int ndim;
1352  Py_ssize_t *_shape;
1353  Py_ssize_t *_strides;
1354  Py_ssize_t itemsize;
1355  PyObject *mode;
1356  PyObject *_format;
1357  void (*callback_free_data)(void *);
1358  int free_data;
1359  int dtype_is_object;
1360 };
1361 
1362 
1363 /* "View.MemoryView":279
1364  *
1365  * @cname('__pyx_MemviewEnum')
1366  * cdef class Enum(object): # <<<<<<<<<<<<<<
1367  * cdef object name
1368  * def __init__(self, name):
1369  */
1370 struct __pyx_MemviewEnum_obj {
1371  PyObject_HEAD
1372  PyObject *name;
1373 };
1374 
1375 
1376 /* "View.MemoryView":330
1377  *
1378  * @cname('__pyx_memoryview')
1379  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1380  *
1381  * cdef object obj
1382  */
1383 struct __pyx_memoryview_obj {
1384  PyObject_HEAD
1385  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1386  PyObject *obj;
1387  PyObject *_size;
1388  PyObject *_array_interface;
1389  PyThread_type_lock lock;
1390  __pyx_atomic_int acquisition_count[2];
1391  __pyx_atomic_int *acquisition_count_aligned_p;
1392  Py_buffer view;
1393  int flags;
1394  int dtype_is_object;
1395  __Pyx_TypeInfo *typeinfo;
1396 };
1397 
1398 
1399 /* "View.MemoryView":965
1400  *
1401  * @cname('__pyx_memoryviewslice')
1402  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1403  * "Internal class for passing memoryview slices to Python"
1404  *
1405  */
1406 struct __pyx_memoryviewslice_obj {
1407  struct __pyx_memoryview_obj __pyx_base;
1408  __Pyx_memviewslice from_slice;
1409  PyObject *from_object;
1410  PyObject *(*to_object_func)(char *);
1411  int (*to_dtype_func)(char *, PyObject *);
1412 };
1413 
1414 
1415 
1416 /* "View.MemoryView":105
1417  *
1418  * @cname("__pyx_array")
1419  * cdef class array: # <<<<<<<<<<<<<<
1420  *
1421  * cdef:
1422  */
1423 
1424 struct __pyx_vtabstruct_array {
1425  PyObject *(*get_memview)(struct __pyx_array_obj *);
1426 };
1427 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1428 
1429 
1430 /* "View.MemoryView":330
1431  *
1432  * @cname('__pyx_memoryview')
1433  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1434  *
1435  * cdef object obj
1436  */
1437 
1438 struct __pyx_vtabstruct_memoryview {
1439  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1440  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1441  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1442  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1443  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1444  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1445  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1446 };
1447 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1448 
1449 
1450 /* "View.MemoryView":965
1451  *
1452  * @cname('__pyx_memoryviewslice')
1453  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1454  * "Internal class for passing memoryview slices to Python"
1455  *
1456  */
1457 
1458 struct __pyx_vtabstruct__memoryviewslice {
1459  struct __pyx_vtabstruct_memoryview __pyx_base;
1460 };
1461 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1462 
1463 /* --- Runtime support code (head) --- */
1464 /* Refnanny.proto */
1465 #ifndef CYTHON_REFNANNY
1466  #define CYTHON_REFNANNY 0
1467 #endif
1468 #if CYTHON_REFNANNY
1469  typedef struct {
1470  void (*INCREF)(void*, PyObject*, int);
1471  void (*DECREF)(void*, PyObject*, int);
1472  void (*GOTREF)(void*, PyObject*, int);
1473  void (*GIVEREF)(void*, PyObject*, int);
1474  void* (*SetupContext)(const char*, int, const char*);
1475  void (*FinishContext)(void**);
1476  } __Pyx_RefNannyAPIStruct;
1477  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1478  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1479  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1480 #ifdef WITH_THREAD
1481  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1482  if (acquire_gil) {\
1483  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1484  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1485  PyGILState_Release(__pyx_gilstate_save);\
1486  } else {\
1487  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1488  }
1489 #else
1490  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1491  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1492 #endif
1493  #define __Pyx_RefNannyFinishContext()\
1494  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1495  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1496  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1497  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1498  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1499  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1500  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1501  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1502  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1503 #else
1504  #define __Pyx_RefNannyDeclarations
1505  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1506  #define __Pyx_RefNannyFinishContext()
1507  #define __Pyx_INCREF(r) Py_INCREF(r)
1508  #define __Pyx_DECREF(r) Py_DECREF(r)
1509  #define __Pyx_GOTREF(r)
1510  #define __Pyx_GIVEREF(r)
1511  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1512  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1513  #define __Pyx_XGOTREF(r)
1514  #define __Pyx_XGIVEREF(r)
1515 #endif
1516 #define __Pyx_XDECREF_SET(r, v) do {\
1517  PyObject *tmp = (PyObject *) r;\
1518  r = v; __Pyx_XDECREF(tmp);\
1519  } while (0)
1520 #define __Pyx_DECREF_SET(r, v) do {\
1521  PyObject *tmp = (PyObject *) r;\
1522  r = v; __Pyx_DECREF(tmp);\
1523  } while (0)
1524 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1525 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1526 
1527 /* PyObjectGetAttrStr.proto */
1528 #if CYTHON_USE_TYPE_SLOTS
1529 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1530 #else
1531 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1532 #endif
1533 
1534 /* GetBuiltinName.proto */
1535 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1536 
1537 /* RaiseArgTupleInvalid.proto */
1538 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1539  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1540 
1541 /* KeywordStringCheck.proto */
1542 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
1543 
1544 /* RaiseDoubleKeywords.proto */
1545 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1546 
1547 /* ParseKeywords.proto */
1548 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1549  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1550  const char* function_name);
1551 
1552 /* ArgTypeTest.proto */
1553 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1554  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1555  __Pyx__ArgTypeTest(obj, type, name, exact))
1556 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1557 
1558 /* PyDictVersioning.proto */
1559 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1560 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1561 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1562 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1563  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1564  (cache_var) = (value);
1565 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1566  static PY_UINT64_T __pyx_dict_version = 0;\
1567  static PyObject *__pyx_dict_cached_value = NULL;\
1568  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1569  (VAR) = __pyx_dict_cached_value;\
1570  } else {\
1571  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1572  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1573  }\
1574 }
1575 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1576 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1577 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1578 #else
1579 #define __PYX_GET_DICT_VERSION(dict) (0)
1580 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1581 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1582 #endif
1583 
1584 /* GetModuleGlobalName.proto */
1585 #if CYTHON_USE_DICT_VERSIONS
1586 #define __Pyx_GetModuleGlobalName(var, name) {\
1587  static PY_UINT64_T __pyx_dict_version = 0;\
1588  static PyObject *__pyx_dict_cached_value = NULL;\
1589  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1590  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1591  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1592 }
1593 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1594  PY_UINT64_T __pyx_dict_version;\
1595  PyObject *__pyx_dict_cached_value;\
1596  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1597 }
1598 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1599 #else
1600 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1601 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1602 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1603 #endif
1604 
1605 /* PyCFunctionFastCall.proto */
1606 #if CYTHON_FAST_PYCCALL
1607 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1608 #else
1609 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1610 #endif
1611 
1612 /* PyFunctionFastCall.proto */
1613 #if CYTHON_FAST_PYCALL
1614 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1615  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1616 #if 1 || PY_VERSION_HEX < 0x030600B1
1617 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1618 #else
1619 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1620 #endif
1621 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1622  (sizeof(char [1 - 2*!(cond)]) - 1)
1623 #ifndef Py_MEMBER_SIZE
1624 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1625 #endif
1626 #if CYTHON_FAST_PYCALL
1627  static size_t __pyx_pyframe_localsplus_offset = 0;
1628  #include "frameobject.h"
1629 #if PY_VERSION_HEX >= 0x030b00a6
1630  #ifndef Py_BUILD_CORE
1631  #define Py_BUILD_CORE 1
1632  #endif
1633  #include "internal/pycore_frame.h"
1634 #endif
1635  #define __Pxy_PyFrame_Initialize_Offsets()\
1636  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1637  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1638  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1639  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1640 #endif // CYTHON_FAST_PYCALL
1641 #endif
1642 
1643 /* PyObjectCall.proto */
1644 #if CYTHON_COMPILING_IN_CPYTHON
1645 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1646 #else
1647 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1648 #endif
1649 
1650 /* PyObjectCall2Args.proto */
1651 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1652 
1653 /* PyObjectCallMethO.proto */
1654 #if CYTHON_COMPILING_IN_CPYTHON
1655 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1656 #endif
1657 
1658 /* PyObjectCallOneArg.proto */
1659 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1660 
1661 /* PyThreadStateGet.proto */
1662 #if CYTHON_FAST_THREAD_STATE
1663 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1664 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1665 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1666 #else
1667 #define __Pyx_PyThreadState_declare
1668 #define __Pyx_PyThreadState_assign
1669 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1670 #endif
1671 
1672 /* PyErrFetchRestore.proto */
1673 #if CYTHON_FAST_THREAD_STATE
1674 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1675 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1676 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1677 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1678 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1679 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1680 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1681 #if CYTHON_COMPILING_IN_CPYTHON
1682 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1683 #else
1684 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1685 #endif
1686 #else
1687 #define __Pyx_PyErr_Clear() PyErr_Clear()
1688 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1689 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1690 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1691 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1692 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1693 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1694 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1695 #endif
1696 
1697 /* RaiseException.proto */
1698 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1699 
1700 /* GetTopmostException.proto */
1701 #if CYTHON_USE_EXC_INFO_STACK
1702 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1703 #endif
1704 
1705 /* SaveResetException.proto */
1706 #if CYTHON_FAST_THREAD_STATE
1707 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1708 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1709 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1710 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1711 #else
1712 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1713 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1714 #endif
1715 
1716 /* PyErrExceptionMatches.proto */
1717 #if CYTHON_FAST_THREAD_STATE
1718 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1719 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1720 #else
1721 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1722 #endif
1723 
1724 /* GetException.proto */
1725 #if CYTHON_FAST_THREAD_STATE
1726 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1727 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1728 #else
1729 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1730 #endif
1731 
1732 /* IncludeStringH.proto */
1733 #include <string.h>
1734 
1735 /* BytesEquals.proto */
1736 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1737 
1738 /* UnicodeEquals.proto */
1739 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1740 
1741 /* StrEquals.proto */
1742 #if PY_MAJOR_VERSION >= 3
1743 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1744 #else
1745 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1746 #endif
1747 
1748 /* DivInt[Py_ssize_t].proto */
1749 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1750 
1751 /* UnaryNegOverflows.proto */
1752 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1753  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1754 
1755 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1756 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1757 /* GetAttr.proto */
1758 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1759 
1760 /* GetItemInt.proto */
1761 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1762  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1763  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1764  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1765  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1766 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1767  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1768  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1769  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1770 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1771  int wraparound, int boundscheck);
1772 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1773  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1774  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1775  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1776 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1777  int wraparound, int boundscheck);
1778 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1779 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1780  int is_list, int wraparound, int boundscheck);
1781 
1782 /* ObjectGetItem.proto */
1783 #if CYTHON_USE_TYPE_SLOTS
1784 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1785 #else
1786 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1787 #endif
1788 
1789 /* decode_c_string_utf16.proto */
1790 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1791  int byteorder = 0;
1792  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1793 }
1794 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1795  int byteorder = -1;
1796  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1797 }
1798 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1799  int byteorder = 1;
1800  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1801 }
1802 
1803 /* decode_c_string.proto */
1804 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1805  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1806  const char* encoding, const char* errors,
1807  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1808 
1809 /* GetAttr3.proto */
1810 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1811 
1812 /* RaiseTooManyValuesToUnpack.proto */
1813 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1814 
1815 /* RaiseNeedMoreValuesToUnpack.proto */
1816 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1817 
1818 /* RaiseNoneIterError.proto */
1819 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1820 
1821 /* ExtTypeTest.proto */
1822 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1823 
1824 /* SwapException.proto */
1825 #if CYTHON_FAST_THREAD_STATE
1826 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1827 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1828 #else
1829 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1830 #endif
1831 
1832 /* Import.proto */
1833 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1834 
1835 /* FastTypeChecks.proto */
1836 #if CYTHON_COMPILING_IN_CPYTHON
1837 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1838 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1839 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1840 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1841 #else
1842 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1843 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1844 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1845 #endif
1846 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1847 
1848 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1849 /* ListCompAppend.proto */
1850 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1851 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1852  PyListObject* L = (PyListObject*) list;
1853  Py_ssize_t len = Py_SIZE(list);
1854  if (likely(L->allocated > len)) {
1855  Py_INCREF(x);
1856  PyList_SET_ITEM(list, len, x);
1857  __Pyx_SET_SIZE(list, len + 1);
1858  return 0;
1859  }
1860  return PyList_Append(list, x);
1861 }
1862 #else
1863 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1864 #endif
1865 
1866 /* PyIntBinop.proto */
1867 #if !CYTHON_COMPILING_IN_PYPY
1868 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1869 #else
1870 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1871  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1872 #endif
1873 
1874 /* ListExtend.proto */
1875 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1876 #if CYTHON_COMPILING_IN_CPYTHON
1877  PyObject* none = _PyList_Extend((PyListObject*)L, v);
1878  if (unlikely(!none))
1879  return -1;
1880  Py_DECREF(none);
1881  return 0;
1882 #else
1883  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1884 #endif
1885 }
1886 
1887 /* ListAppend.proto */
1888 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1889 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1890  PyListObject* L = (PyListObject*) list;
1891  Py_ssize_t len = Py_SIZE(list);
1892  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1893  Py_INCREF(x);
1894  PyList_SET_ITEM(list, len, x);
1895  __Pyx_SET_SIZE(list, len + 1);
1896  return 0;
1897  }
1898  return PyList_Append(list, x);
1899 }
1900 #else
1901 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1902 #endif
1903 
1904 /* None.proto */
1905 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
1906 
1907 /* DivInt[long].proto */
1908 static CYTHON_INLINE long __Pyx_div_long(long, long);
1909 
1910 /* PySequenceContains.proto */
1911 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
1912  int result = PySequence_Contains(seq, item);
1913  return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1914 }
1915 
1916 /* ImportFrom.proto */
1917 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1918 
1919 /* HasAttr.proto */
1920 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1921 
1922 /* StringJoin.proto */
1923 #if PY_MAJOR_VERSION < 3
1924 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
1925 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
1926 #else
1927 #define __Pyx_PyString_Join PyUnicode_Join
1928 #define __Pyx_PyBaseString_Join PyUnicode_Join
1929 #endif
1930 #if CYTHON_COMPILING_IN_CPYTHON
1931  #if PY_MAJOR_VERSION < 3
1932  #define __Pyx_PyBytes_Join _PyString_Join
1933  #else
1934  #define __Pyx_PyBytes_Join _PyBytes_Join
1935  #endif
1936 #else
1937 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
1938 #endif
1939 
1940 /* PyObject_Unicode.proto */
1941 #if PY_MAJOR_VERSION >= 3
1942 #define __Pyx_PyObject_Unicode(obj)\
1943  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
1944 #else
1945 #define __Pyx_PyObject_Unicode(obj)\
1946  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
1947 #endif
1948 
1949 /* PyObject_GenericGetAttrNoDict.proto */
1950 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1951 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1952 #else
1953 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1954 #endif
1955 
1956 /* PyObject_GenericGetAttr.proto */
1957 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1958 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1959 #else
1960 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1961 #endif
1962 
1963 /* PyObjectGetAttrStrNoError.proto */
1964 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1965 
1966 /* SetupReduce.proto */
1967 static int __Pyx_setup_reduce(PyObject* type_obj);
1968 
1969 /* SetVTable.proto */
1970 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1971 
1972 /* TypeImport.proto */
1973 #ifndef __PYX_HAVE_RT_ImportType_proto
1974 #define __PYX_HAVE_RT_ImportType_proto
1975 enum __Pyx_ImportType_CheckSize {
1976  __Pyx_ImportType_CheckSize_Error = 0,
1977  __Pyx_ImportType_CheckSize_Warn = 1,
1978  __Pyx_ImportType_CheckSize_Ignore = 2
1979 };
1980 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1981 #endif
1982 
1983 /* CLineInTraceback.proto */
1984 #ifdef CYTHON_CLINE_IN_TRACEBACK
1985 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1986 #else
1987 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1988 #endif
1989 
1990 /* CodeObjectCache.proto */
1991 typedef struct {
1992  PyCodeObject* code_object;
1993  int code_line;
1994 } __Pyx_CodeObjectCacheEntry;
1995 struct __Pyx_CodeObjectCache {
1996  int count;
1997  int max_count;
1998  __Pyx_CodeObjectCacheEntry* entries;
1999 };
2000 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2001 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2002 static PyCodeObject *__pyx_find_code_object(int code_line);
2003 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2004 
2005 /* AddTraceback.proto */
2006 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2007  int py_line, const char *filename);
2008 
2009 /* None.proto */
2010 #include <new>
2011 
2012 /* GCCDiagnostics.proto */
2013 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2014 #define __Pyx_HAS_GCC_DIAGNOSTIC
2015 #endif
2016 
2017 /* MemviewDtypeToObject.proto */
2018 static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp);
2019 static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj);
2020 
2021 /* MemviewDtypeToObject.proto */
2022 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
2023 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
2024 
2025 /* RealImag.proto */
2026 #if CYTHON_CCOMPLEX
2027  #ifdef __cplusplus
2028  #define __Pyx_CREAL(z) ((z).real())
2029  #define __Pyx_CIMAG(z) ((z).imag())
2030  #else
2031  #define __Pyx_CREAL(z) (__real__(z))
2032  #define __Pyx_CIMAG(z) (__imag__(z))
2033  #endif
2034 #else
2035  #define __Pyx_CREAL(z) ((z).real)
2036  #define __Pyx_CIMAG(z) ((z).imag)
2037 #endif
2038 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2039  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2040  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2041  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2042 #else
2043  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2044  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2045 #endif
2046 
2047 /* Arithmetic.proto */
2048 #if CYTHON_CCOMPLEX
2049  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2050  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2051  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2052  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2053  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2054  #define __Pyx_c_neg_float(a) (-(a))
2055  #ifdef __cplusplus
2056  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2057  #define __Pyx_c_conj_float(z) (::std::conj(z))
2058  #if 1
2059  #define __Pyx_c_abs_float(z) (::std::abs(z))
2060  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2061  #endif
2062  #else
2063  #define __Pyx_c_is_zero_float(z) ((z)==0)
2064  #define __Pyx_c_conj_float(z) (conjf(z))
2065  #if 1
2066  #define __Pyx_c_abs_float(z) (cabsf(z))
2067  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2068  #endif
2069  #endif
2070 #else
2071  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2072  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2073  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2074  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2075  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2076  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2077  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2078  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2079  #if 1
2080  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2081  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2082  #endif
2083 #endif
2084 
2085 /* Arithmetic.proto */
2086 #if CYTHON_CCOMPLEX
2087  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2088  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2089  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2090  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2091  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2092  #define __Pyx_c_neg_double(a) (-(a))
2093  #ifdef __cplusplus
2094  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2095  #define __Pyx_c_conj_double(z) (::std::conj(z))
2096  #if 1
2097  #define __Pyx_c_abs_double(z) (::std::abs(z))
2098  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2099  #endif
2100  #else
2101  #define __Pyx_c_is_zero_double(z) ((z)==0)
2102  #define __Pyx_c_conj_double(z) (conj(z))
2103  #if 1
2104  #define __Pyx_c_abs_double(z) (cabs(z))
2105  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2106  #endif
2107  #endif
2108 #else
2109  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2110  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2111  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2112  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2113  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2114  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2115  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2116  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2117  #if 1
2118  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2119  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2120  #endif
2121 #endif
2122 
2123 #if PY_MAJOR_VERSION < 3
2124  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2125  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2126 #else
2127  #define __Pyx_GetBuffer PyObject_GetBuffer
2128  #define __Pyx_ReleaseBuffer PyBuffer_Release
2129 #endif
2130 
2131 
2132 /* BufferStructDeclare.proto */
2133 typedef struct {
2134  Py_ssize_t shape, strides, suboffsets;
2135 } __Pyx_Buf_DimInfo;
2136 typedef struct {
2137  size_t refcount;
2138  Py_buffer pybuffer;
2139 } __Pyx_Buffer;
2140 typedef struct {
2141  __Pyx_Buffer *rcbuffer;
2142  char *data;
2143  __Pyx_Buf_DimInfo diminfo[8];
2144 } __Pyx_LocalBuf_ND;
2145 
2146 /* MemviewSliceIsContig.proto */
2147 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2148 
2149 /* OverlappingSlices.proto */
2150 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2151  __Pyx_memviewslice *slice2,
2152  int ndim, size_t itemsize);
2153 
2154 /* Capsule.proto */
2155 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2156 
2157 /* CIntFromPy.proto */
2158 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2159 
2160 /* CIntToPy.proto */
2161 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2162 
2163 /* TypeInfoToFormat.proto */
2164 struct __pyx_typeinfo_string {
2165  char string[3];
2166 };
2167 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2168 
2169 /* MemviewSliceCopyTemplate.proto */
2170 static __Pyx_memviewslice
2171 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2172  const char *mode, int ndim,
2173  size_t sizeof_dtype, int contig_flag,
2174  int dtype_is_object);
2175 
2176 /* MemviewSliceInit.proto */
2177 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2178 #define __Pyx_MEMVIEW_DIRECT 1
2179 #define __Pyx_MEMVIEW_PTR 2
2180 #define __Pyx_MEMVIEW_FULL 4
2181 #define __Pyx_MEMVIEW_CONTIG 8
2182 #define __Pyx_MEMVIEW_STRIDED 16
2183 #define __Pyx_MEMVIEW_FOLLOW 32
2184 #define __Pyx_IS_C_CONTIG 1
2185 #define __Pyx_IS_F_CONTIG 2
2186 static int __Pyx_init_memviewslice(
2187  struct __pyx_memoryview_obj *memview,
2188  int ndim,
2189  __Pyx_memviewslice *memviewslice,
2190  int memview_is_new_reference);
2191 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
2192  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2193 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
2194  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2195 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2196 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2197 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2198 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2199 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
2200 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
2201 
2202 /* CIntFromPy.proto */
2203 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2204 
2205 /* CIntToPy.proto */
2206 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2207 
2208 /* CIntFromPy.proto */
2209 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2210 
2211 /* CheckBinaryVersion.proto */
2212 static int __Pyx_check_binary_version(void);
2213 
2214 /* InitStrings.proto */
2215 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2216 
2217 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2218 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2219 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2220 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2221 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*/
2222 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2223 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2224 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2225 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2226 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2227 
2228 /* Module declarations from 'cpython.buffer' */
2229 
2230 /* Module declarations from 'libc.string' */
2231 
2232 /* Module declarations from 'libc.stdio' */
2233 
2234 /* Module declarations from '__builtin__' */
2235 
2236 /* Module declarations from 'cpython.type' */
2237 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2238 
2239 /* Module declarations from 'cpython' */
2240 
2241 /* Module declarations from 'cpython.object' */
2242 
2243 /* Module declarations from 'cpython.ref' */
2244 
2245 /* Module declarations from 'cpython.mem' */
2246 
2247 /* Module declarations from 'numpy' */
2248 
2249 /* Module declarations from 'numpy' */
2250 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2251 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2252 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2253 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2254 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2255 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2256 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2257 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2258 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2259 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2260 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2261 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2262 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2263 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2264 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2265 
2266 /* Module declarations from 'csparsity' */
2267 static PyTypeObject *__pyx_ptype_9csparsity_PySparsityInfo = 0;
2268 static PyTypeObject *__pyx_array_type = 0;
2269 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2270 static PyTypeObject *__pyx_memoryview_type = 0;
2271 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2272 static PyObject *generic = 0;
2273 static PyObject *strided = 0;
2274 static PyObject *indirect = 0;
2275 static PyObject *contiguous = 0;
2276 static PyObject *indirect_contiguous = 0;
2277 static int __pyx_memoryview_thread_locks_used;
2278 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2279 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2280 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2281 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2282 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2283 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2284 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2285 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2286 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*/
2287 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2288 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2289 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2290 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2291 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2292 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2293 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2294 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2295 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2296 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2297 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2298 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2299 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2300 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2301 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2302 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2303 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2304 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2305 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2306 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2307 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2308 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2309 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2310 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2311 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2312 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/
2313 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2314 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2315 #define __Pyx_MODULE_NAME "csparsity"
2316 extern int __pyx_module_is_main_csparsity;
2317 int __pyx_module_is_main_csparsity = 0;
2318 
2319 /* Implementation of 'csparsity' */
2320 static PyObject *__pyx_builtin_TypeError;
2321 static PyObject *__pyx_builtin_ImportError;
2322 static PyObject *__pyx_builtin_ValueError;
2323 static PyObject *__pyx_builtin_MemoryError;
2324 static PyObject *__pyx_builtin_enumerate;
2325 static PyObject *__pyx_builtin_range;
2326 static PyObject *__pyx_builtin_Ellipsis;
2327 static PyObject *__pyx_builtin_id;
2328 static PyObject *__pyx_builtin_IndexError;
2329 static const char __pyx_k_O[] = "O";
2330 static const char __pyx_k_T[] = "T{";
2331  static const char __pyx_k_c[] = "c";
2332  static const char __pyx_k_s[] = "(%s)";
2333  static const char __pyx_k_id[] = "id";
2334  static const char __pyx_k_np[] = "np";
2335  static const char __pyx_k__24[] = "^";
2336  static const char __pyx_k__25[] = "";
2337  static const char __pyx_k__26[] = ":";
2338 static const char __pyx_k__27[] = "}";
2339 static const char __pyx_k__28[] = ",";
2340 static const char __pyx_k_new[] = "__new__";
2341 static const char __pyx_k_obj[] = "obj";
2342 static const char __pyx_k_base[] = "base";
2343 static const char __pyx_k_dict[] = "__dict__";
2344 static const char __pyx_k_join[] = "join";
2345 static const char __pyx_k_main[] = "__main__";
2346 static const char __pyx_k_mode[] = "mode";
2347 static const char __pyx_k_name[] = "name";
2348 static const char __pyx_k_ndim[] = "ndim";
2349 static const char __pyx_k_pack[] = "pack";
2350 static const char __pyx_k_size[] = "size";
2351 static const char __pyx_k_step[] = "step";
2352 static const char __pyx_k_stop[] = "stop";
2353 static const char __pyx_k_test[] = "__test__";
2354 static const char __pyx_k_ASCII[] = "ASCII";
2355 static const char __pyx_k_class[] = "__class__";
2356 static const char __pyx_k_error[] = "error";
2357 static const char __pyx_k_flags[] = "flags";
2358 static const char __pyx_k_numpy[] = "numpy";
2359 static const char __pyx_k_range[] = "range";
2360 static const char __pyx_k_shape[] = "shape";
2361 static const char __pyx_k_start[] = "start";
2362 static const char __pyx_k_encode[] = "encode";
2363 static const char __pyx_k_format[] = "format";
2364 static const char __pyx_k_import[] = "__import__";
2365 static const char __pyx_k_name_2[] = "__name__";
2366 static const char __pyx_k_pickle[] = "pickle";
2367 static const char __pyx_k_reduce[] = "__reduce__";
2368 static const char __pyx_k_rowptr[] = "rowptr";
2369 static const char __pyx_k_struct[] = "struct";
2370 static const char __pyx_k_unpack[] = "unpack";
2371 static const char __pyx_k_update[] = "update";
2372 static const char __pyx_k_asarray[] = "asarray";
2373 static const char __pyx_k_fortran[] = "fortran";
2374 static const char __pyx_k_memview[] = "memview";
2375 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2376 static const char __pyx_k_getstate[] = "__getstate__";
2377 static const char __pyx_k_itemsize[] = "itemsize";
2378 static const char __pyx_k_pyx_type[] = "__pyx_type";
2379 static const char __pyx_k_setstate[] = "__setstate__";
2380 static const char __pyx_k_TypeError[] = "TypeError";
2381 static const char __pyx_k_enumerate[] = "enumerate";
2382 static const char __pyx_k_pyx_state[] = "__pyx_state";
2383 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2384 static const char __pyx_k_IndexError[] = "IndexError";
2385 static const char __pyx_k_ValueError[] = "ValueError";
2386 static const char __pyx_k_pyx_result[] = "__pyx_result";
2387 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2388 static const char __pyx_k_ImportError[] = "ImportError";
2389 static const char __pyx_k_MemoryError[] = "MemoryError";
2390 static const char __pyx_k_PickleError[] = "PickleError";
2391 static const char __pyx_k_offset_test[] = "offset_test";
2392 static const char __pyx_k_stride_test[] = "stride_test";
2393 static const char __pyx_k_offset_trial[] = "offset_trial";
2394 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2395 static const char __pyx_k_stride_trial[] = "stride_trial";
2396 static const char __pyx_k_stringsource[] = "stringsource";
2397 static const char __pyx_k_csrRowIndeces[] = "csrRowIndeces";
2398 static const char __pyx_k_nFreeDOF_test[] = "nFreeDOF_test";
2399 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2400 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2401 static const char __pyx_k_PySparsityInfo[] = "PySparsityInfo";
2402 static const char __pyx_k_nFreeDOF_trial[] = "nFreeDOF_trial";
2403 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2404 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2405 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2406 static const char __pyx_k_freeGlobal_test[] = "freeGlobal_test";
2407 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2408 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2409 static const char __pyx_k_csrColumnOffsets[] = "csrColumnOffsets";
2410 static const char __pyx_k_freeGlobal_trial[] = "freeGlobal_trial";
2411 static const char __pyx_k_hasNumericalFlux[] = "hasNumericalFlux";
2412 static const char __pyx_k_nElements_global[] = "nElements_global";
2413 static const char __pyx_k_nDOF_test_element[] = "nDOF_test_element";
2414 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2415 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2416 static const char __pyx_k_hasOutflowBoundary[] = "hasOutflowBoundary";
2417 static const char __pyx_k_nDOF_trial_element[] = "nDOF_trial_element";
2418 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2419 static const char __pyx_k_csrColumnOffsets_eb[] = "csrColumnOffsets_eb";
2420 static const char __pyx_k_needOutflowJacobian[] = "needOutflowJacobian";
2421 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2422 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2423 static const char __pyx_k_elementNeighborsArray[] = "elementNeighborsArray";
2424 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2425 static const char __pyx_k_csrColumnOffsets_eNebN[] = "csrColumnOffsets_eNebN";
2426 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2427 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2428 static const char __pyx_k_hasDiffusionInMixedForm[] = "hasDiffusionInMixedForm";
2429 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2430 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2431 static const char __pyx_k_csrColumnOffsets_eb_eNebN[] = "csrColumnOffsets_eb_eNebN";
2432 static const char __pyx_k_hasFluxBoundaryConditions[] = "hasFluxBoundaryConditions";
2433 static const char __pyx_k_needNumericalFluxJacobian[] = "needNumericalFluxJacobian";
2434 static const char __pyx_k_nElementBoundaries_element[] = "nElementBoundaries_element";
2435 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2436 static const char __pyx_k_elementBoundaryElementsArray[] = "elementBoundaryElementsArray";
2437 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2438 static const char __pyx_k_exteriorElementBoundariesArray[] = "exteriorElementBoundariesArray";
2439 static const char __pyx_k_interiorElementBoundariesArray[] = "interiorElementBoundariesArray";
2440 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2441 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2442 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2443 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2444 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2445 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2446 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2447 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2448 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2449 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2450 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2451 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2452 static const char __pyx_k_elementBoundaryLocalElementBound[] = "elementBoundaryLocalElementBoundariesArray";
2453 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2454 static const char __pyx_k_nExteriorElementBoundaries_globa[] = "nExteriorElementBoundaries_global";
2455 static const char __pyx_k_nInteriorElementBoundaries_globa[] = "nInteriorElementBoundaries_global";
2456 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2457 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2458 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2459 static PyObject *__pyx_n_s_ASCII;
2460 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2461 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2462 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2463 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2464 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2465 static PyObject *__pyx_n_s_Ellipsis;
2466 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2467 static PyObject *__pyx_n_s_ImportError;
2468 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2469 static PyObject *__pyx_n_s_IndexError;
2470 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2471 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2472 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2473 static PyObject *__pyx_n_s_MemoryError;
2474 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2475 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2476 static PyObject *__pyx_n_b_O;
2477 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2478 static PyObject *__pyx_n_s_PickleError;
2479 static PyObject *__pyx_n_s_PySparsityInfo;
2480 static PyObject *__pyx_kp_b_T;
2481 static PyObject *__pyx_n_s_TypeError;
2482 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2483 static PyObject *__pyx_n_s_ValueError;
2484 static PyObject *__pyx_n_s_View_MemoryView;
2485 static PyObject *__pyx_kp_b__24;
2486 static PyObject *__pyx_kp_b__25;
2487 static PyObject *__pyx_kp_b__26;
2488 static PyObject *__pyx_kp_b__27;
2489 static PyObject *__pyx_kp_u__28;
2490 static PyObject *__pyx_n_s_allocate_buffer;
2491 static PyObject *__pyx_n_s_asarray;
2492 static PyObject *__pyx_n_s_base;
2493 static PyObject *__pyx_n_s_c;
2494 static PyObject *__pyx_n_u_c;
2495 static PyObject *__pyx_n_s_class;
2496 static PyObject *__pyx_n_s_cline_in_traceback;
2497 static PyObject *__pyx_kp_s_contiguous_and_direct;
2498 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2499 static PyObject *__pyx_n_s_csrColumnOffsets;
2500 static PyObject *__pyx_n_s_csrColumnOffsets_eNebN;
2501 static PyObject *__pyx_n_s_csrColumnOffsets_eb;
2502 static PyObject *__pyx_n_s_csrColumnOffsets_eb_eNebN;
2503 static PyObject *__pyx_n_s_csrRowIndeces;
2504 static PyObject *__pyx_n_s_dict;
2505 static PyObject *__pyx_n_s_dtype_is_object;
2506 static PyObject *__pyx_n_s_elementBoundaryElementsArray;
2507 static PyObject *__pyx_n_s_elementBoundaryLocalElementBound;
2508 static PyObject *__pyx_n_s_elementNeighborsArray;
2509 static PyObject *__pyx_n_s_encode;
2510 static PyObject *__pyx_n_s_enumerate;
2511 static PyObject *__pyx_n_s_error;
2512 static PyObject *__pyx_n_s_exteriorElementBoundariesArray;
2513 static PyObject *__pyx_n_s_flags;
2514 static PyObject *__pyx_n_s_format;
2515 static PyObject *__pyx_n_s_fortran;
2516 static PyObject *__pyx_n_u_fortran;
2517 static PyObject *__pyx_n_s_freeGlobal_test;
2518 static PyObject *__pyx_n_s_freeGlobal_trial;
2519 static PyObject *__pyx_n_s_getstate;
2520 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2521 static PyObject *__pyx_n_s_hasDiffusionInMixedForm;
2522 static PyObject *__pyx_n_s_hasFluxBoundaryConditions;
2523 static PyObject *__pyx_n_s_hasNumericalFlux;
2524 static PyObject *__pyx_n_s_hasOutflowBoundary;
2525 static PyObject *__pyx_n_s_id;
2526 static PyObject *__pyx_n_s_import;
2527 static PyObject *__pyx_n_s_interiorElementBoundariesArray;
2528 static PyObject *__pyx_n_s_itemsize;
2529 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2530 static PyObject *__pyx_n_s_join;
2531 static PyObject *__pyx_n_s_main;
2532 static PyObject *__pyx_n_s_memview;
2533 static PyObject *__pyx_n_s_mode;
2534 static PyObject *__pyx_n_s_nDOF_test_element;
2535 static PyObject *__pyx_n_s_nDOF_trial_element;
2536 static PyObject *__pyx_n_s_nElementBoundaries_element;
2537 static PyObject *__pyx_n_s_nElements_global;
2538 static PyObject *__pyx_n_s_nExteriorElementBoundaries_globa;
2539 static PyObject *__pyx_n_s_nFreeDOF_test;
2540 static PyObject *__pyx_n_s_nFreeDOF_trial;
2541 static PyObject *__pyx_n_s_nInteriorElementBoundaries_globa;
2542 static PyObject *__pyx_n_s_name;
2543 static PyObject *__pyx_n_s_name_2;
2544 static PyObject *__pyx_n_s_ndim;
2545 static PyObject *__pyx_n_s_needNumericalFluxJacobian;
2546 static PyObject *__pyx_n_s_needOutflowJacobian;
2547 static PyObject *__pyx_n_s_new;
2548 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2549 static PyObject *__pyx_n_s_np;
2550 static PyObject *__pyx_n_s_numpy;
2551 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2552 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2553 static PyObject *__pyx_n_s_obj;
2554 static PyObject *__pyx_n_s_offset_test;
2555 static PyObject *__pyx_n_s_offset_trial;
2556 static PyObject *__pyx_n_s_pack;
2557 static PyObject *__pyx_n_s_pickle;
2558 static PyObject *__pyx_n_s_pyx_PickleError;
2559 static PyObject *__pyx_n_s_pyx_checksum;
2560 static PyObject *__pyx_n_s_pyx_getbuffer;
2561 static PyObject *__pyx_n_s_pyx_result;
2562 static PyObject *__pyx_n_s_pyx_state;
2563 static PyObject *__pyx_n_s_pyx_type;
2564 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2565 static PyObject *__pyx_n_s_pyx_vtable;
2566 static PyObject *__pyx_n_s_range;
2567 static PyObject *__pyx_n_s_reduce;
2568 static PyObject *__pyx_n_s_reduce_cython;
2569 static PyObject *__pyx_n_s_reduce_ex;
2570 static PyObject *__pyx_n_s_rowptr;
2571 static PyObject *__pyx_kp_u_s;
2572 static PyObject *__pyx_n_s_setstate;
2573 static PyObject *__pyx_n_s_setstate_cython;
2574 static PyObject *__pyx_n_s_shape;
2575 static PyObject *__pyx_n_s_size;
2576 static PyObject *__pyx_n_s_start;
2577 static PyObject *__pyx_n_s_step;
2578 static PyObject *__pyx_n_s_stop;
2579 static PyObject *__pyx_n_s_stride_test;
2580 static PyObject *__pyx_n_s_stride_trial;
2581 static PyObject *__pyx_kp_s_strided_and_direct;
2582 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2583 static PyObject *__pyx_kp_s_strided_and_indirect;
2584 static PyObject *__pyx_kp_s_stringsource;
2585 static PyObject *__pyx_n_s_struct;
2586 static PyObject *__pyx_n_s_test;
2587 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2588 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2589 static PyObject *__pyx_n_s_unpack;
2590 static PyObject *__pyx_n_s_update;
2591 static int __pyx_pf_9csparsity_14PySparsityInfo___cinit__(CYTHON_UNUSED struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self); /* proto */
2592 static void __pyx_pf_9csparsity_14PySparsityInfo_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self); /* proto */
2593 static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_4findNonzeros(struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self, int __pyx_v_nElements_global, int __pyx_v_nDOF_test_element, int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_nFreeDOF_test, PyArrayObject *__pyx_v_freeGlobal_test, PyArrayObject *__pyx_v_nFreeDOF_trial, PyArrayObject *__pyx_v_freeGlobal_trial, int __pyx_v_offset_test, int __pyx_v_stride_test, int __pyx_v_offset_trial, int __pyx_v_stride_trial, int __pyx_v_hasNumericalFlux, int __pyx_v_hasDiffusionInMixedForm, int __pyx_v_needNumericalFluxJacobian, int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, int __pyx_v_nInteriorElementBoundaries_global, PyArrayObject *__pyx_v_interiorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray, int __pyx_v_hasFluxBoundaryConditions, int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, int __pyx_v_hasOutflowBoundary, int __pyx_v_needOutflowJacobian); /* proto */
2594 static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_6getOffsets_CSR(struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self, int __pyx_v_nElements_global, int __pyx_v_nDOF_test_element, int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_nFreeDOF_test, PyArrayObject *__pyx_v_freeGlobal_test, PyArrayObject *__pyx_v_nFreeDOF_trial, PyArrayObject *__pyx_v_freeGlobal_trial, int __pyx_v_offset_test, int __pyx_v_stride_test, int __pyx_v_offset_trial, int __pyx_v_stride_trial, int __pyx_v_hasNumericalFlux, int __pyx_v_hasDiffusionInMixedForm, int __pyx_v_needNumericalFluxJacobian, int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, int __pyx_v_nInteriorElementBoundaries_global, PyArrayObject *__pyx_v_interiorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray, int __pyx_v_hasFluxBoundaryConditions, int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, int __pyx_v_hasOutflowBoundary, int __pyx_v_needOutflowJacobian, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_csrRowIndeces, PyArrayObject *__pyx_v_csrColumnOffsets, PyArrayObject *__pyx_v_csrColumnOffsets_eNebN, PyArrayObject *__pyx_v_csrColumnOffsets_eb, PyArrayObject *__pyx_v_csrColumnOffsets_eb_eNebN); /* proto */
2595 static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_8getCSR(struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self); /* proto */
2596 static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self); /* proto */
2597 static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2598 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 */
2599 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 */
2600 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2601 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2602 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2603 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2604 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2605 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 */
2606 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2607 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 */
2608 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2609 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2610 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2611 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2612 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 */
2613 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2614 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2615 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 */
2616 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 */
2617 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2618 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2619 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2620 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2621 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2622 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2623 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2624 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2625 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2626 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2627 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2628 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2629 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2630 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2631 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2632 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2633 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2634 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 */
2635 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2636 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2637 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2638 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 */
2639 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 */
2640 static PyObject *__pyx_tp_new_9csparsity_PySparsityInfo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2641 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2642 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2643 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2644 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2645 static PyObject *__pyx_int_0;
2646 static PyObject *__pyx_int_1;
2647 static PyObject *__pyx_int_112105877;
2648 static PyObject *__pyx_int_136983863;
2649 static PyObject *__pyx_int_184977713;
2650 static PyObject *__pyx_int_neg_1;
2651 static PyObject *__pyx_tuple_;
2652 static PyObject *__pyx_tuple__2;
2653 static PyObject *__pyx_tuple__3;
2654 static PyObject *__pyx_tuple__4;
2655 static PyObject *__pyx_tuple__5;
2656 static PyObject *__pyx_tuple__6;
2657 static PyObject *__pyx_tuple__7;
2658 static PyObject *__pyx_tuple__8;
2659 static PyObject *__pyx_tuple__9;
2660 static PyObject *__pyx_slice__19;
2661 static PyObject *__pyx_tuple__10;
2662 static PyObject *__pyx_tuple__11;
2663 static PyObject *__pyx_tuple__12;
2664 static PyObject *__pyx_tuple__13;
2665 static PyObject *__pyx_tuple__14;
2666 static PyObject *__pyx_tuple__15;
2667 static PyObject *__pyx_tuple__16;
2668 static PyObject *__pyx_tuple__17;
2669 static PyObject *__pyx_tuple__18;
2670 static PyObject *__pyx_tuple__20;
2671 static PyObject *__pyx_tuple__21;
2672 static PyObject *__pyx_tuple__22;
2673 static PyObject *__pyx_tuple__23;
2674 static PyObject *__pyx_tuple__29;
2675 static PyObject *__pyx_tuple__30;
2676 static PyObject *__pyx_tuple__31;
2677 static PyObject *__pyx_tuple__32;
2678 static PyObject *__pyx_tuple__33;
2679 static PyObject *__pyx_tuple__34;
2680 static PyObject *__pyx_codeobj__35;
2681 /* Late includes */
2682 
2683 /* "csparsity.pyx":8
2684  * cdef class PySparsityInfo:
2685  * cdef SparsityInfo cpp
2686  * def __cinit__(self): # <<<<<<<<<<<<<<
2687  * pass
2688  * def __dealloc__(self):
2689  */
2690 
2691 /* Python wrapper */
2692 static int __pyx_pw_9csparsity_14PySparsityInfo_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2693 static int __pyx_pw_9csparsity_14PySparsityInfo_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2694  int __pyx_r;
2695  __Pyx_RefNannyDeclarations
2696  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
2697  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
2698  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
2699  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
2700  __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo___cinit__(((struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self));
2701 
2702  /* function exit code */
2703  __Pyx_RefNannyFinishContext();
2704  return __pyx_r;
2705 }
2706 
2707 static int __pyx_pf_9csparsity_14PySparsityInfo___cinit__(CYTHON_UNUSED struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self) {
2708  int __pyx_r;
2709  __Pyx_RefNannyDeclarations
2710  __Pyx_RefNannySetupContext("__cinit__", 0);
2711 
2712  /* function exit code */
2713  __pyx_r = 0;
2714  __Pyx_RefNannyFinishContext();
2715  return __pyx_r;
2716 }
2717 
2718 /* "csparsity.pyx":10
2719  * def __cinit__(self):
2720  * pass
2721  * def __dealloc__(self): # <<<<<<<<<<<<<<
2722  * pass
2723  * #self.cpp.columnIndecesMap.clear()
2724  */
2725 
2726 /* Python wrapper */
2727 static void __pyx_pw_9csparsity_14PySparsityInfo_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
2728 static void __pyx_pw_9csparsity_14PySparsityInfo_3__dealloc__(PyObject *__pyx_v_self) {
2729  __Pyx_RefNannyDeclarations
2730  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
2731  __pyx_pf_9csparsity_14PySparsityInfo_2__dealloc__(((struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self));
2732 
2733  /* function exit code */
2734  __Pyx_RefNannyFinishContext();
2735 }
2736 
2737 static void __pyx_pf_9csparsity_14PySparsityInfo_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self) {
2738  __Pyx_RefNannyDeclarations
2739  __Pyx_RefNannySetupContext("__dealloc__", 0);
2740 
2741  /* function exit code */
2742  __Pyx_RefNannyFinishContext();
2743 }
2744 
2745 /* "csparsity.pyx":14
2746  * #self.cpp.columnIndecesMap.clear()
2747  * #self.cpp.columnOffsetsMap.clear()
2748  * def findNonzeros(self, # <<<<<<<<<<<<<<
2749  * int nElements_global,
2750  * int nDOF_test_element,
2751  */
2752 
2753 /* Python wrapper */
2754 static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_5findNonzeros(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2755 static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_5findNonzeros(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2756  int __pyx_v_nElements_global;
2757  int __pyx_v_nDOF_test_element;
2758  int __pyx_v_nDOF_trial_element;
2759  PyArrayObject *__pyx_v_nFreeDOF_test = 0;
2760  PyArrayObject *__pyx_v_freeGlobal_test = 0;
2761  PyArrayObject *__pyx_v_nFreeDOF_trial = 0;
2762  PyArrayObject *__pyx_v_freeGlobal_trial = 0;
2763  int __pyx_v_offset_test;
2764  int __pyx_v_stride_test;
2765  int __pyx_v_offset_trial;
2766  int __pyx_v_stride_trial;
2767  int __pyx_v_hasNumericalFlux;
2768  int __pyx_v_hasDiffusionInMixedForm;
2769  int __pyx_v_needNumericalFluxJacobian;
2770  int __pyx_v_nElementBoundaries_element;
2771  PyArrayObject *__pyx_v_elementNeighborsArray = 0;
2772  int __pyx_v_nInteriorElementBoundaries_global;
2773  PyArrayObject *__pyx_v_interiorElementBoundariesArray = 0;
2774  PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
2775  PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray = 0;
2776  int __pyx_v_hasFluxBoundaryConditions;
2777  int __pyx_v_nExteriorElementBoundaries_global;
2778  PyArrayObject *__pyx_v_exteriorElementBoundariesArray = 0;
2779  int __pyx_v_hasOutflowBoundary;
2780  int __pyx_v_needOutflowJacobian;
2781  int __pyx_lineno = 0;
2782  const char *__pyx_filename = NULL;
2783  int __pyx_clineno = 0;
2784  PyObject *__pyx_r = 0;
2785  __Pyx_RefNannyDeclarations
2786  __Pyx_RefNannySetupContext("findNonzeros (wrapper)", 0);
2787  {
2788  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nElements_global,&__pyx_n_s_nDOF_test_element,&__pyx_n_s_nDOF_trial_element,&__pyx_n_s_nFreeDOF_test,&__pyx_n_s_freeGlobal_test,&__pyx_n_s_nFreeDOF_trial,&__pyx_n_s_freeGlobal_trial,&__pyx_n_s_offset_test,&__pyx_n_s_stride_test,&__pyx_n_s_offset_trial,&__pyx_n_s_stride_trial,&__pyx_n_s_hasNumericalFlux,&__pyx_n_s_hasDiffusionInMixedForm,&__pyx_n_s_needNumericalFluxJacobian,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_nInteriorElementBoundaries_globa,&__pyx_n_s_interiorElementBoundariesArray,&__pyx_n_s_elementBoundaryElementsArray,&__pyx_n_s_elementBoundaryLocalElementBound,&__pyx_n_s_hasFluxBoundaryConditions,&__pyx_n_s_nExteriorElementBoundaries_globa,&__pyx_n_s_exteriorElementBoundariesArray,&__pyx_n_s_hasOutflowBoundary,&__pyx_n_s_needOutflowJacobian,0};
2789  PyObject* values[25] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
2790  if (unlikely(__pyx_kwds)) {
2791  Py_ssize_t kw_args;
2792  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2793  switch (pos_args) {
2794  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
2795  CYTHON_FALLTHROUGH;
2796  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
2797  CYTHON_FALLTHROUGH;
2798  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
2799  CYTHON_FALLTHROUGH;
2800  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
2801  CYTHON_FALLTHROUGH;
2802  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
2803  CYTHON_FALLTHROUGH;
2804  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
2805  CYTHON_FALLTHROUGH;
2806  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
2807  CYTHON_FALLTHROUGH;
2808  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
2809  CYTHON_FALLTHROUGH;
2810  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
2811  CYTHON_FALLTHROUGH;
2812  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
2813  CYTHON_FALLTHROUGH;
2814  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
2815  CYTHON_FALLTHROUGH;
2816  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
2817  CYTHON_FALLTHROUGH;
2818  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2819  CYTHON_FALLTHROUGH;
2820  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2821  CYTHON_FALLTHROUGH;
2822  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2823  CYTHON_FALLTHROUGH;
2824  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2825  CYTHON_FALLTHROUGH;
2826  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2827  CYTHON_FALLTHROUGH;
2828  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2829  CYTHON_FALLTHROUGH;
2830  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2831  CYTHON_FALLTHROUGH;
2832  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2833  CYTHON_FALLTHROUGH;
2834  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2835  CYTHON_FALLTHROUGH;
2836  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2837  CYTHON_FALLTHROUGH;
2838  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2839  CYTHON_FALLTHROUGH;
2840  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2841  CYTHON_FALLTHROUGH;
2842  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2843  CYTHON_FALLTHROUGH;
2844  case 0: break;
2845  default: goto __pyx_L5_argtuple_error;
2846  }
2847  kw_args = PyDict_Size(__pyx_kwds);
2848  switch (pos_args) {
2849  case 0:
2850  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
2851  else goto __pyx_L5_argtuple_error;
2852  CYTHON_FALLTHROUGH;
2853  case 1:
2854  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_test_element)) != 0)) kw_args--;
2855  else {
2856  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 1); __PYX_ERR(1, 14, __pyx_L3_error)
2857  }
2858  CYTHON_FALLTHROUGH;
2859  case 2:
2860  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_trial_element)) != 0)) kw_args--;
2861  else {
2862  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 2); __PYX_ERR(1, 14, __pyx_L3_error)
2863  }
2864  CYTHON_FALLTHROUGH;
2865  case 3:
2866  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nFreeDOF_test)) != 0)) kw_args--;
2867  else {
2868  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 3); __PYX_ERR(1, 14, __pyx_L3_error)
2869  }
2870  CYTHON_FALLTHROUGH;
2871  case 4:
2872  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_freeGlobal_test)) != 0)) kw_args--;
2873  else {
2874  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 4); __PYX_ERR(1, 14, __pyx_L3_error)
2875  }
2876  CYTHON_FALLTHROUGH;
2877  case 5:
2878  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nFreeDOF_trial)) != 0)) kw_args--;
2879  else {
2880  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 5); __PYX_ERR(1, 14, __pyx_L3_error)
2881  }
2882  CYTHON_FALLTHROUGH;
2883  case 6:
2884  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_freeGlobal_trial)) != 0)) kw_args--;
2885  else {
2886  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 6); __PYX_ERR(1, 14, __pyx_L3_error)
2887  }
2888  CYTHON_FALLTHROUGH;
2889  case 7:
2890  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset_test)) != 0)) kw_args--;
2891  else {
2892  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 7); __PYX_ERR(1, 14, __pyx_L3_error)
2893  }
2894  CYTHON_FALLTHROUGH;
2895  case 8:
2896  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stride_test)) != 0)) kw_args--;
2897  else {
2898  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 8); __PYX_ERR(1, 14, __pyx_L3_error)
2899  }
2900  CYTHON_FALLTHROUGH;
2901  case 9:
2902  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset_trial)) != 0)) kw_args--;
2903  else {
2904  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 9); __PYX_ERR(1, 14, __pyx_L3_error)
2905  }
2906  CYTHON_FALLTHROUGH;
2907  case 10:
2908  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stride_trial)) != 0)) kw_args--;
2909  else {
2910  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 10); __PYX_ERR(1, 14, __pyx_L3_error)
2911  }
2912  CYTHON_FALLTHROUGH;
2913  case 11:
2914  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasNumericalFlux)) != 0)) kw_args--;
2915  else {
2916  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 11); __PYX_ERR(1, 14, __pyx_L3_error)
2917  }
2918  CYTHON_FALLTHROUGH;
2919  case 12:
2920  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasDiffusionInMixedForm)) != 0)) kw_args--;
2921  else {
2922  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 12); __PYX_ERR(1, 14, __pyx_L3_error)
2923  }
2924  CYTHON_FALLTHROUGH;
2925  case 13:
2926  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_needNumericalFluxJacobian)) != 0)) kw_args--;
2927  else {
2928  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 13); __PYX_ERR(1, 14, __pyx_L3_error)
2929  }
2930  CYTHON_FALLTHROUGH;
2931  case 14:
2932  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
2933  else {
2934  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 14); __PYX_ERR(1, 14, __pyx_L3_error)
2935  }
2936  CYTHON_FALLTHROUGH;
2937  case 15:
2938  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
2939  else {
2940  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 15); __PYX_ERR(1, 14, __pyx_L3_error)
2941  }
2942  CYTHON_FALLTHROUGH;
2943  case 16:
2944  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nInteriorElementBoundaries_globa)) != 0)) kw_args--;
2945  else {
2946  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 16); __PYX_ERR(1, 14, __pyx_L3_error)
2947  }
2948  CYTHON_FALLTHROUGH;
2949  case 17:
2950  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interiorElementBoundariesArray)) != 0)) kw_args--;
2951  else {
2952  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 17); __PYX_ERR(1, 14, __pyx_L3_error)
2953  }
2954  CYTHON_FALLTHROUGH;
2955  case 18:
2956  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryElementsArray)) != 0)) kw_args--;
2957  else {
2958  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 18); __PYX_ERR(1, 14, __pyx_L3_error)
2959  }
2960  CYTHON_FALLTHROUGH;
2961  case 19:
2962  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryLocalElementBound)) != 0)) kw_args--;
2963  else {
2964  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 19); __PYX_ERR(1, 14, __pyx_L3_error)
2965  }
2966  CYTHON_FALLTHROUGH;
2967  case 20:
2968  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasFluxBoundaryConditions)) != 0)) kw_args--;
2969  else {
2970  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 20); __PYX_ERR(1, 14, __pyx_L3_error)
2971  }
2972  CYTHON_FALLTHROUGH;
2973  case 21:
2974  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nExteriorElementBoundaries_globa)) != 0)) kw_args--;
2975  else {
2976  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 21); __PYX_ERR(1, 14, __pyx_L3_error)
2977  }
2978  CYTHON_FALLTHROUGH;
2979  case 22:
2980  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exteriorElementBoundariesArray)) != 0)) kw_args--;
2981  else {
2982  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 22); __PYX_ERR(1, 14, __pyx_L3_error)
2983  }
2984  CYTHON_FALLTHROUGH;
2985  case 23:
2986  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasOutflowBoundary)) != 0)) kw_args--;
2987  else {
2988  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 23); __PYX_ERR(1, 14, __pyx_L3_error)
2989  }
2990  CYTHON_FALLTHROUGH;
2991  case 24:
2992  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_needOutflowJacobian)) != 0)) kw_args--;
2993  else {
2994  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, 24); __PYX_ERR(1, 14, __pyx_L3_error)
2995  }
2996  }
2997  if (unlikely(kw_args > 0)) {
2998  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "findNonzeros") < 0)) __PYX_ERR(1, 14, __pyx_L3_error)
2999  }
3000  } else if (PyTuple_GET_SIZE(__pyx_args) != 25) {
3001  goto __pyx_L5_argtuple_error;
3002  } else {
3003  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3004  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3005  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3006  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3007  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3008  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3009  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3010  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3011  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3012  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3013  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3014  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3015  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3016  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3017  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
3018  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
3019  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
3020  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
3021  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
3022  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
3023  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
3024  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
3025  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
3026  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
3027  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
3028  }
3029  __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_nElements_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 15, __pyx_L3_error)
3030  __pyx_v_nDOF_test_element = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nDOF_test_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error)
3031  __pyx_v_nDOF_trial_element = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nDOF_trial_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 17, __pyx_L3_error)
3032  __pyx_v_nFreeDOF_test = ((PyArrayObject *)values[3]);
3033  __pyx_v_freeGlobal_test = ((PyArrayObject *)values[4]);
3034  __pyx_v_nFreeDOF_trial = ((PyArrayObject *)values[5]);
3035  __pyx_v_freeGlobal_trial = ((PyArrayObject *)values[6]);
3036  __pyx_v_offset_test = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_offset_test == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 22, __pyx_L3_error)
3037  __pyx_v_stride_test = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_stride_test == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 23, __pyx_L3_error)
3038  __pyx_v_offset_trial = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_offset_trial == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 24, __pyx_L3_error)
3039  __pyx_v_stride_trial = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_stride_trial == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 25, __pyx_L3_error)
3040  __pyx_v_hasNumericalFlux = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_hasNumericalFlux == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L3_error)
3041  __pyx_v_hasDiffusionInMixedForm = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_hasDiffusionInMixedForm == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 27, __pyx_L3_error)
3042  __pyx_v_needNumericalFluxJacobian = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_needNumericalFluxJacobian == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 28, __pyx_L3_error)
3043  __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_nElementBoundaries_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 29, __pyx_L3_error)
3044  __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[15]);
3045  __pyx_v_nInteriorElementBoundaries_global = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_nInteriorElementBoundaries_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L3_error)
3046  __pyx_v_interiorElementBoundariesArray = ((PyArrayObject *)values[17]);
3047  __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[18]);
3048  __pyx_v_elementBoundaryLocalElementBoundariesArray = ((PyArrayObject *)values[19]);
3049  __pyx_v_hasFluxBoundaryConditions = __Pyx_PyInt_As_int(values[20]); if (unlikely((__pyx_v_hasFluxBoundaryConditions == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 35, __pyx_L3_error)
3050  __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyInt_As_int(values[21]); if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 36, __pyx_L3_error)
3051  __pyx_v_exteriorElementBoundariesArray = ((PyArrayObject *)values[22]);
3052  __pyx_v_hasOutflowBoundary = __Pyx_PyInt_As_int(values[23]); if (unlikely((__pyx_v_hasOutflowBoundary == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 38, __pyx_L3_error)
3053  __pyx_v_needOutflowJacobian = __Pyx_PyInt_As_int(values[24]); if (unlikely((__pyx_v_needOutflowJacobian == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 39, __pyx_L3_error)
3054  }
3055  goto __pyx_L4_argument_unpacking_done;
3056  __pyx_L5_argtuple_error:;
3057  __Pyx_RaiseArgtupleInvalid("findNonzeros", 1, 25, 25, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 14, __pyx_L3_error)
3058  __pyx_L3_error:;
3059  __Pyx_AddTraceback("csparsity.PySparsityInfo.findNonzeros", __pyx_clineno, __pyx_lineno, __pyx_filename);
3060  __Pyx_RefNannyFinishContext();
3061  return NULL;
3062  __pyx_L4_argument_unpacking_done:;
3063  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nFreeDOF_test), __pyx_ptype_5numpy_ndarray, 1, "nFreeDOF_test", 0))) __PYX_ERR(1, 18, __pyx_L1_error)
3064  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_freeGlobal_test), __pyx_ptype_5numpy_ndarray, 1, "freeGlobal_test", 0))) __PYX_ERR(1, 19, __pyx_L1_error)
3065  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nFreeDOF_trial), __pyx_ptype_5numpy_ndarray, 1, "nFreeDOF_trial", 0))) __PYX_ERR(1, 20, __pyx_L1_error)
3066  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_freeGlobal_trial), __pyx_ptype_5numpy_ndarray, 1, "freeGlobal_trial", 0))) __PYX_ERR(1, 21, __pyx_L1_error)
3067  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1, "elementNeighborsArray", 0))) __PYX_ERR(1, 30, __pyx_L1_error)
3068  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interiorElementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1, "interiorElementBoundariesArray", 0))) __PYX_ERR(1, 32, __pyx_L1_error)
3069  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryElementsArray", 0))) __PYX_ERR(1, 33, __pyx_L1_error)
3070  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryLocalElementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryLocalElementBoundariesArray", 0))) __PYX_ERR(1, 34, __pyx_L1_error)
3071  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1, "exteriorElementBoundariesArray", 0))) __PYX_ERR(1, 37, __pyx_L1_error)
3072  __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo_4findNonzeros(((struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self), __pyx_v_nElements_global, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, __pyx_v_nFreeDOF_test, __pyx_v_freeGlobal_test, __pyx_v_nFreeDOF_trial, __pyx_v_freeGlobal_trial, __pyx_v_offset_test, __pyx_v_stride_test, __pyx_v_offset_trial, __pyx_v_stride_trial, __pyx_v_hasNumericalFlux, __pyx_v_hasDiffusionInMixedForm, __pyx_v_needNumericalFluxJacobian, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_nInteriorElementBoundaries_global, __pyx_v_interiorElementBoundariesArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementBoundaryLocalElementBoundariesArray, __pyx_v_hasFluxBoundaryConditions, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_exteriorElementBoundariesArray, __pyx_v_hasOutflowBoundary, __pyx_v_needOutflowJacobian);
3073 
3074  /* function exit code */
3075  goto __pyx_L0;
3076  __pyx_L1_error:;
3077  __pyx_r = NULL;
3078  __pyx_L0:;
3079  __Pyx_RefNannyFinishContext();
3080  return __pyx_r;
3081 }
3082 
3083 static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_4findNonzeros(struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self, int __pyx_v_nElements_global, int __pyx_v_nDOF_test_element, int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_nFreeDOF_test, PyArrayObject *__pyx_v_freeGlobal_test, PyArrayObject *__pyx_v_nFreeDOF_trial, PyArrayObject *__pyx_v_freeGlobal_trial, int __pyx_v_offset_test, int __pyx_v_stride_test, int __pyx_v_offset_trial, int __pyx_v_stride_trial, int __pyx_v_hasNumericalFlux, int __pyx_v_hasDiffusionInMixedForm, int __pyx_v_needNumericalFluxJacobian, int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, int __pyx_v_nInteriorElementBoundaries_global, PyArrayObject *__pyx_v_interiorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray, int __pyx_v_hasFluxBoundaryConditions, int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, int __pyx_v_hasOutflowBoundary, int __pyx_v_needOutflowJacobian) {
3084  PyObject *__pyx_r = NULL;
3085  __Pyx_RefNannyDeclarations
3086  __Pyx_RefNannySetupContext("findNonzeros", 0);
3087 
3088  /* "csparsity.pyx":40
3089  * int hasOutflowBoundary,
3090  * int needOutflowJacobian):
3091  * self.cpp.findNonzeros(nElements_global, # <<<<<<<<<<<<<<
3092  * nDOF_test_element,
3093  * nDOF_trial_element,
3094  */
3095  __pyx_v_self->cpp.findNonzeros(__pyx_v_nElements_global, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, ((int *)__pyx_v_nFreeDOF_test->data), ((int *)__pyx_v_freeGlobal_test->data), ((int *)__pyx_v_nFreeDOF_trial->data), ((int *)__pyx_v_freeGlobal_trial->data), __pyx_v_offset_test, __pyx_v_stride_test, __pyx_v_offset_trial, __pyx_v_stride_trial, __pyx_v_hasNumericalFlux, __pyx_v_hasDiffusionInMixedForm, __pyx_v_needNumericalFluxJacobian, __pyx_v_nElementBoundaries_element, ((int *)__pyx_v_elementNeighborsArray->data), __pyx_v_nInteriorElementBoundaries_global, ((int *)__pyx_v_interiorElementBoundariesArray->data), ((int *)__pyx_v_elementBoundaryElementsArray->data), ((int *)__pyx_v_elementBoundaryLocalElementBoundariesArray->data), __pyx_v_hasFluxBoundaryConditions, __pyx_v_nExteriorElementBoundaries_global, ((int *)__pyx_v_exteriorElementBoundariesArray->data), __pyx_v_hasOutflowBoundary, __pyx_v_needOutflowJacobian);
3096 
3097  /* "csparsity.pyx":14
3098  * #self.cpp.columnIndecesMap.clear()
3099  * #self.cpp.columnOffsetsMap.clear()
3100  * def findNonzeros(self, # <<<<<<<<<<<<<<
3101  * int nElements_global,
3102  * int nDOF_test_element,
3103  */
3104 
3105  /* function exit code */
3106  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3107  __Pyx_XGIVEREF(__pyx_r);
3108  __Pyx_RefNannyFinishContext();
3109  return __pyx_r;
3110 }
3111 
3112 /* "csparsity.pyx":65
3113  * hasOutflowBoundary,
3114  * needOutflowJacobian)
3115  * def getOffsets_CSR(self, # <<<<<<<<<<<<<<
3116  * int nElements_global,
3117  * int nDOF_test_element,
3118  */
3119 
3120 /* Python wrapper */
3121 static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_7getOffsets_CSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3122 static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_7getOffsets_CSR(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3123  int __pyx_v_nElements_global;
3124  int __pyx_v_nDOF_test_element;
3125  int __pyx_v_nDOF_trial_element;
3126  PyArrayObject *__pyx_v_nFreeDOF_test = 0;
3127  PyArrayObject *__pyx_v_freeGlobal_test = 0;
3128  PyArrayObject *__pyx_v_nFreeDOF_trial = 0;
3129  PyArrayObject *__pyx_v_freeGlobal_trial = 0;
3130  int __pyx_v_offset_test;
3131  int __pyx_v_stride_test;
3132  int __pyx_v_offset_trial;
3133  int __pyx_v_stride_trial;
3134  int __pyx_v_hasNumericalFlux;
3135  int __pyx_v_hasDiffusionInMixedForm;
3136  int __pyx_v_needNumericalFluxJacobian;
3137  int __pyx_v_nElementBoundaries_element;
3138  PyArrayObject *__pyx_v_elementNeighborsArray = 0;
3139  int __pyx_v_nInteriorElementBoundaries_global;
3140  PyArrayObject *__pyx_v_interiorElementBoundariesArray = 0;
3141  PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
3142  PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray = 0;
3143  int __pyx_v_hasFluxBoundaryConditions;
3144  int __pyx_v_nExteriorElementBoundaries_global;
3145  PyArrayObject *__pyx_v_exteriorElementBoundariesArray = 0;
3146  int __pyx_v_hasOutflowBoundary;
3147  int __pyx_v_needOutflowJacobian;
3148  PyArrayObject *__pyx_v_rowptr = 0;
3149  PyArrayObject *__pyx_v_csrRowIndeces = 0;
3150  PyArrayObject *__pyx_v_csrColumnOffsets = 0;
3151  PyArrayObject *__pyx_v_csrColumnOffsets_eNebN = 0;
3152  PyArrayObject *__pyx_v_csrColumnOffsets_eb = 0;
3153  PyArrayObject *__pyx_v_csrColumnOffsets_eb_eNebN = 0;
3154  int __pyx_lineno = 0;
3155  const char *__pyx_filename = NULL;
3156  int __pyx_clineno = 0;
3157  PyObject *__pyx_r = 0;
3158  __Pyx_RefNannyDeclarations
3159  __Pyx_RefNannySetupContext("getOffsets_CSR (wrapper)", 0);
3160  {
3161  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nElements_global,&__pyx_n_s_nDOF_test_element,&__pyx_n_s_nDOF_trial_element,&__pyx_n_s_nFreeDOF_test,&__pyx_n_s_freeGlobal_test,&__pyx_n_s_nFreeDOF_trial,&__pyx_n_s_freeGlobal_trial,&__pyx_n_s_offset_test,&__pyx_n_s_stride_test,&__pyx_n_s_offset_trial,&__pyx_n_s_stride_trial,&__pyx_n_s_hasNumericalFlux,&__pyx_n_s_hasDiffusionInMixedForm,&__pyx_n_s_needNumericalFluxJacobian,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_nInteriorElementBoundaries_globa,&__pyx_n_s_interiorElementBoundariesArray,&__pyx_n_s_elementBoundaryElementsArray,&__pyx_n_s_elementBoundaryLocalElementBound,&__pyx_n_s_hasFluxBoundaryConditions,&__pyx_n_s_nExteriorElementBoundaries_globa,&__pyx_n_s_exteriorElementBoundariesArray,&__pyx_n_s_hasOutflowBoundary,&__pyx_n_s_needOutflowJacobian,&__pyx_n_s_rowptr,&__pyx_n_s_csrRowIndeces,&__pyx_n_s_csrColumnOffsets,&__pyx_n_s_csrColumnOffsets_eNebN,&__pyx_n_s_csrColumnOffsets_eb,&__pyx_n_s_csrColumnOffsets_eb_eNebN,0};
3162  PyObject* values[31] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
3163  if (unlikely(__pyx_kwds)) {
3164  Py_ssize_t kw_args;
3165  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3166  switch (pos_args) {
3167  case 31: values[30] = PyTuple_GET_ITEM(__pyx_args, 30);
3168  CYTHON_FALLTHROUGH;
3169  case 30: values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
3170  CYTHON_FALLTHROUGH;
3171  case 29: values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
3172  CYTHON_FALLTHROUGH;
3173  case 28: values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
3174  CYTHON_FALLTHROUGH;
3175  case 27: values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
3176  CYTHON_FALLTHROUGH;
3177  case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
3178  CYTHON_FALLTHROUGH;
3179  case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
3180  CYTHON_FALLTHROUGH;
3181  case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
3182  CYTHON_FALLTHROUGH;
3183  case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
3184  CYTHON_FALLTHROUGH;
3185  case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
3186  CYTHON_FALLTHROUGH;
3187  case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
3188  CYTHON_FALLTHROUGH;
3189  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
3190  CYTHON_FALLTHROUGH;
3191  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
3192  CYTHON_FALLTHROUGH;
3193  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
3194  CYTHON_FALLTHROUGH;
3195  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
3196  CYTHON_FALLTHROUGH;
3197  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
3198  CYTHON_FALLTHROUGH;
3199  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
3200  CYTHON_FALLTHROUGH;
3201  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3202  CYTHON_FALLTHROUGH;
3203  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3204  CYTHON_FALLTHROUGH;
3205  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3206  CYTHON_FALLTHROUGH;
3207  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3208  CYTHON_FALLTHROUGH;
3209  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3210  CYTHON_FALLTHROUGH;
3211  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3212  CYTHON_FALLTHROUGH;
3213  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3214  CYTHON_FALLTHROUGH;
3215  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3216  CYTHON_FALLTHROUGH;
3217  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3218  CYTHON_FALLTHROUGH;
3219  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3220  CYTHON_FALLTHROUGH;
3221  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3222  CYTHON_FALLTHROUGH;
3223  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3224  CYTHON_FALLTHROUGH;
3225  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3226  CYTHON_FALLTHROUGH;
3227  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3228  CYTHON_FALLTHROUGH;
3229  case 0: break;
3230  default: goto __pyx_L5_argtuple_error;
3231  }
3232  kw_args = PyDict_Size(__pyx_kwds);
3233  switch (pos_args) {
3234  case 0:
3235  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
3236  else goto __pyx_L5_argtuple_error;
3237  CYTHON_FALLTHROUGH;
3238  case 1:
3239  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_test_element)) != 0)) kw_args--;
3240  else {
3241  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 1); __PYX_ERR(1, 65, __pyx_L3_error)
3242  }
3243  CYTHON_FALLTHROUGH;
3244  case 2:
3245  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_trial_element)) != 0)) kw_args--;
3246  else {
3247  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 2); __PYX_ERR(1, 65, __pyx_L3_error)
3248  }
3249  CYTHON_FALLTHROUGH;
3250  case 3:
3251  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nFreeDOF_test)) != 0)) kw_args--;
3252  else {
3253  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 3); __PYX_ERR(1, 65, __pyx_L3_error)
3254  }
3255  CYTHON_FALLTHROUGH;
3256  case 4:
3257  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_freeGlobal_test)) != 0)) kw_args--;
3258  else {
3259  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 4); __PYX_ERR(1, 65, __pyx_L3_error)
3260  }
3261  CYTHON_FALLTHROUGH;
3262  case 5:
3263  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nFreeDOF_trial)) != 0)) kw_args--;
3264  else {
3265  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 5); __PYX_ERR(1, 65, __pyx_L3_error)
3266  }
3267  CYTHON_FALLTHROUGH;
3268  case 6:
3269  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_freeGlobal_trial)) != 0)) kw_args--;
3270  else {
3271  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 6); __PYX_ERR(1, 65, __pyx_L3_error)
3272  }
3273  CYTHON_FALLTHROUGH;
3274  case 7:
3275  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset_test)) != 0)) kw_args--;
3276  else {
3277  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 7); __PYX_ERR(1, 65, __pyx_L3_error)
3278  }
3279  CYTHON_FALLTHROUGH;
3280  case 8:
3281  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stride_test)) != 0)) kw_args--;
3282  else {
3283  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 8); __PYX_ERR(1, 65, __pyx_L3_error)
3284  }
3285  CYTHON_FALLTHROUGH;
3286  case 9:
3287  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset_trial)) != 0)) kw_args--;
3288  else {
3289  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 9); __PYX_ERR(1, 65, __pyx_L3_error)
3290  }
3291  CYTHON_FALLTHROUGH;
3292  case 10:
3293  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stride_trial)) != 0)) kw_args--;
3294  else {
3295  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 10); __PYX_ERR(1, 65, __pyx_L3_error)
3296  }
3297  CYTHON_FALLTHROUGH;
3298  case 11:
3299  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasNumericalFlux)) != 0)) kw_args--;
3300  else {
3301  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 11); __PYX_ERR(1, 65, __pyx_L3_error)
3302  }
3303  CYTHON_FALLTHROUGH;
3304  case 12:
3305  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasDiffusionInMixedForm)) != 0)) kw_args--;
3306  else {
3307  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 12); __PYX_ERR(1, 65, __pyx_L3_error)
3308  }
3309  CYTHON_FALLTHROUGH;
3310  case 13:
3311  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_needNumericalFluxJacobian)) != 0)) kw_args--;
3312  else {
3313  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 13); __PYX_ERR(1, 65, __pyx_L3_error)
3314  }
3315  CYTHON_FALLTHROUGH;
3316  case 14:
3317  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
3318  else {
3319  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 14); __PYX_ERR(1, 65, __pyx_L3_error)
3320  }
3321  CYTHON_FALLTHROUGH;
3322  case 15:
3323  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
3324  else {
3325  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 15); __PYX_ERR(1, 65, __pyx_L3_error)
3326  }
3327  CYTHON_FALLTHROUGH;
3328  case 16:
3329  if (likely((values[16] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nInteriorElementBoundaries_globa)) != 0)) kw_args--;
3330  else {
3331  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 16); __PYX_ERR(1, 65, __pyx_L3_error)
3332  }
3333  CYTHON_FALLTHROUGH;
3334  case 17:
3335  if (likely((values[17] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interiorElementBoundariesArray)) != 0)) kw_args--;
3336  else {
3337  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 17); __PYX_ERR(1, 65, __pyx_L3_error)
3338  }
3339  CYTHON_FALLTHROUGH;
3340  case 18:
3341  if (likely((values[18] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryElementsArray)) != 0)) kw_args--;
3342  else {
3343  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 18); __PYX_ERR(1, 65, __pyx_L3_error)
3344  }
3345  CYTHON_FALLTHROUGH;
3346  case 19:
3347  if (likely((values[19] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryLocalElementBound)) != 0)) kw_args--;
3348  else {
3349  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 19); __PYX_ERR(1, 65, __pyx_L3_error)
3350  }
3351  CYTHON_FALLTHROUGH;
3352  case 20:
3353  if (likely((values[20] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasFluxBoundaryConditions)) != 0)) kw_args--;
3354  else {
3355  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 20); __PYX_ERR(1, 65, __pyx_L3_error)
3356  }
3357  CYTHON_FALLTHROUGH;
3358  case 21:
3359  if (likely((values[21] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nExteriorElementBoundaries_globa)) != 0)) kw_args--;
3360  else {
3361  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 21); __PYX_ERR(1, 65, __pyx_L3_error)
3362  }
3363  CYTHON_FALLTHROUGH;
3364  case 22:
3365  if (likely((values[22] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exteriorElementBoundariesArray)) != 0)) kw_args--;
3366  else {
3367  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 22); __PYX_ERR(1, 65, __pyx_L3_error)
3368  }
3369  CYTHON_FALLTHROUGH;
3370  case 23:
3371  if (likely((values[23] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hasOutflowBoundary)) != 0)) kw_args--;
3372  else {
3373  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 23); __PYX_ERR(1, 65, __pyx_L3_error)
3374  }
3375  CYTHON_FALLTHROUGH;
3376  case 24:
3377  if (likely((values[24] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_needOutflowJacobian)) != 0)) kw_args--;
3378  else {
3379  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 24); __PYX_ERR(1, 65, __pyx_L3_error)
3380  }
3381  CYTHON_FALLTHROUGH;
3382  case 25:
3383  if (likely((values[25] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
3384  else {
3385  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 25); __PYX_ERR(1, 65, __pyx_L3_error)
3386  }
3387  CYTHON_FALLTHROUGH;
3388  case 26:
3389  if (likely((values[26] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrRowIndeces)) != 0)) kw_args--;
3390  else {
3391  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 26); __PYX_ERR(1, 65, __pyx_L3_error)
3392  }
3393  CYTHON_FALLTHROUGH;
3394  case 27:
3395  if (likely((values[27] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColumnOffsets)) != 0)) kw_args--;
3396  else {
3397  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 27); __PYX_ERR(1, 65, __pyx_L3_error)
3398  }
3399  CYTHON_FALLTHROUGH;
3400  case 28:
3401  if (likely((values[28] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColumnOffsets_eNebN)) != 0)) kw_args--;
3402  else {
3403  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 28); __PYX_ERR(1, 65, __pyx_L3_error)
3404  }
3405  CYTHON_FALLTHROUGH;
3406  case 29:
3407  if (likely((values[29] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColumnOffsets_eb)) != 0)) kw_args--;
3408  else {
3409  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 29); __PYX_ERR(1, 65, __pyx_L3_error)
3410  }
3411  CYTHON_FALLTHROUGH;
3412  case 30:
3413  if (likely((values[30] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_csrColumnOffsets_eb_eNebN)) != 0)) kw_args--;
3414  else {
3415  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, 30); __PYX_ERR(1, 65, __pyx_L3_error)
3416  }
3417  }
3418  if (unlikely(kw_args > 0)) {
3419  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getOffsets_CSR") < 0)) __PYX_ERR(1, 65, __pyx_L3_error)
3420  }
3421  } else if (PyTuple_GET_SIZE(__pyx_args) != 31) {
3422  goto __pyx_L5_argtuple_error;
3423  } else {
3424  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3425  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3426  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3427  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3428  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3429  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3430  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3431  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3432  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3433  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3434  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3435  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3436  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3437  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3438  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
3439  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
3440  values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
3441  values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
3442  values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
3443  values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
3444  values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
3445  values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
3446  values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
3447  values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
3448  values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
3449  values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
3450  values[26] = PyTuple_GET_ITEM(__pyx_args, 26);
3451  values[27] = PyTuple_GET_ITEM(__pyx_args, 27);
3452  values[28] = PyTuple_GET_ITEM(__pyx_args, 28);
3453  values[29] = PyTuple_GET_ITEM(__pyx_args, 29);
3454  values[30] = PyTuple_GET_ITEM(__pyx_args, 30);
3455  }
3456  __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_nElements_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 66, __pyx_L3_error)
3457  __pyx_v_nDOF_test_element = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nDOF_test_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 67, __pyx_L3_error)
3458  __pyx_v_nDOF_trial_element = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_nDOF_trial_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 68, __pyx_L3_error)
3459  __pyx_v_nFreeDOF_test = ((PyArrayObject *)values[3]);
3460  __pyx_v_freeGlobal_test = ((PyArrayObject *)values[4]);
3461  __pyx_v_nFreeDOF_trial = ((PyArrayObject *)values[5]);
3462  __pyx_v_freeGlobal_trial = ((PyArrayObject *)values[6]);
3463  __pyx_v_offset_test = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_offset_test == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 73, __pyx_L3_error)
3464  __pyx_v_stride_test = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_stride_test == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 74, __pyx_L3_error)
3465  __pyx_v_offset_trial = __Pyx_PyInt_As_int(values[9]); if (unlikely((__pyx_v_offset_trial == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 75, __pyx_L3_error)
3466  __pyx_v_stride_trial = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_stride_trial == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 76, __pyx_L3_error)
3467  __pyx_v_hasNumericalFlux = __Pyx_PyInt_As_int(values[11]); if (unlikely((__pyx_v_hasNumericalFlux == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 77, __pyx_L3_error)
3468  __pyx_v_hasDiffusionInMixedForm = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_hasDiffusionInMixedForm == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 78, __pyx_L3_error)
3469  __pyx_v_needNumericalFluxJacobian = __Pyx_PyInt_As_int(values[13]); if (unlikely((__pyx_v_needNumericalFluxJacobian == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 79, __pyx_L3_error)
3470  __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[14]); if (unlikely((__pyx_v_nElementBoundaries_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 80, __pyx_L3_error)
3471  __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[15]);
3472  __pyx_v_nInteriorElementBoundaries_global = __Pyx_PyInt_As_int(values[16]); if (unlikely((__pyx_v_nInteriorElementBoundaries_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 82, __pyx_L3_error)
3473  __pyx_v_interiorElementBoundariesArray = ((PyArrayObject *)values[17]);
3474  __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[18]);
3475  __pyx_v_elementBoundaryLocalElementBoundariesArray = ((PyArrayObject *)values[19]);
3476  __pyx_v_hasFluxBoundaryConditions = __Pyx_PyInt_As_int(values[20]); if (unlikely((__pyx_v_hasFluxBoundaryConditions == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 86, __pyx_L3_error)
3477  __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyInt_As_int(values[21]); if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 87, __pyx_L3_error)
3478  __pyx_v_exteriorElementBoundariesArray = ((PyArrayObject *)values[22]);
3479  __pyx_v_hasOutflowBoundary = __Pyx_PyInt_As_int(values[23]); if (unlikely((__pyx_v_hasOutflowBoundary == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 89, __pyx_L3_error)
3480  __pyx_v_needOutflowJacobian = __Pyx_PyInt_As_int(values[24]); if (unlikely((__pyx_v_needOutflowJacobian == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 90, __pyx_L3_error)
3481  __pyx_v_rowptr = ((PyArrayObject *)values[25]);
3482  __pyx_v_csrRowIndeces = ((PyArrayObject *)values[26]);
3483  __pyx_v_csrColumnOffsets = ((PyArrayObject *)values[27]);
3484  __pyx_v_csrColumnOffsets_eNebN = ((PyArrayObject *)values[28]);
3485  __pyx_v_csrColumnOffsets_eb = ((PyArrayObject *)values[29]);
3486  __pyx_v_csrColumnOffsets_eb_eNebN = ((PyArrayObject *)values[30]);
3487  }
3488  goto __pyx_L4_argument_unpacking_done;
3489  __pyx_L5_argtuple_error:;
3490  __Pyx_RaiseArgtupleInvalid("getOffsets_CSR", 1, 31, 31, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 65, __pyx_L3_error)
3491  __pyx_L3_error:;
3492  __Pyx_AddTraceback("csparsity.PySparsityInfo.getOffsets_CSR", __pyx_clineno, __pyx_lineno, __pyx_filename);
3493  __Pyx_RefNannyFinishContext();
3494  return NULL;
3495  __pyx_L4_argument_unpacking_done:;
3496  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nFreeDOF_test), __pyx_ptype_5numpy_ndarray, 1, "nFreeDOF_test", 0))) __PYX_ERR(1, 69, __pyx_L1_error)
3497  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_freeGlobal_test), __pyx_ptype_5numpy_ndarray, 1, "freeGlobal_test", 0))) __PYX_ERR(1, 70, __pyx_L1_error)
3498  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nFreeDOF_trial), __pyx_ptype_5numpy_ndarray, 1, "nFreeDOF_trial", 0))) __PYX_ERR(1, 71, __pyx_L1_error)
3499  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_freeGlobal_trial), __pyx_ptype_5numpy_ndarray, 1, "freeGlobal_trial", 0))) __PYX_ERR(1, 72, __pyx_L1_error)
3500  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1, "elementNeighborsArray", 0))) __PYX_ERR(1, 81, __pyx_L1_error)
3501  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interiorElementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1, "interiorElementBoundariesArray", 0))) __PYX_ERR(1, 83, __pyx_L1_error)
3502  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryElementsArray", 0))) __PYX_ERR(1, 84, __pyx_L1_error)
3503  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryLocalElementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryLocalElementBoundariesArray", 0))) __PYX_ERR(1, 85, __pyx_L1_error)
3504  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1, "exteriorElementBoundariesArray", 0))) __PYX_ERR(1, 88, __pyx_L1_error)
3505  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1, "rowptr", 0))) __PYX_ERR(1, 91, __pyx_L1_error)
3506  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_csrRowIndeces), __pyx_ptype_5numpy_ndarray, 1, "csrRowIndeces", 0))) __PYX_ERR(1, 92, __pyx_L1_error)
3507  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_csrColumnOffsets), __pyx_ptype_5numpy_ndarray, 1, "csrColumnOffsets", 0))) __PYX_ERR(1, 93, __pyx_L1_error)
3508  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_csrColumnOffsets_eNebN), __pyx_ptype_5numpy_ndarray, 1, "csrColumnOffsets_eNebN", 0))) __PYX_ERR(1, 94, __pyx_L1_error)
3509  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_csrColumnOffsets_eb), __pyx_ptype_5numpy_ndarray, 1, "csrColumnOffsets_eb", 0))) __PYX_ERR(1, 95, __pyx_L1_error)
3510  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_csrColumnOffsets_eb_eNebN), __pyx_ptype_5numpy_ndarray, 1, "csrColumnOffsets_eb_eNebN", 0))) __PYX_ERR(1, 96, __pyx_L1_error)
3511  __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo_6getOffsets_CSR(((struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self), __pyx_v_nElements_global, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, __pyx_v_nFreeDOF_test, __pyx_v_freeGlobal_test, __pyx_v_nFreeDOF_trial, __pyx_v_freeGlobal_trial, __pyx_v_offset_test, __pyx_v_stride_test, __pyx_v_offset_trial, __pyx_v_stride_trial, __pyx_v_hasNumericalFlux, __pyx_v_hasDiffusionInMixedForm, __pyx_v_needNumericalFluxJacobian, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_nInteriorElementBoundaries_global, __pyx_v_interiorElementBoundariesArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementBoundaryLocalElementBoundariesArray, __pyx_v_hasFluxBoundaryConditions, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_exteriorElementBoundariesArray, __pyx_v_hasOutflowBoundary, __pyx_v_needOutflowJacobian, __pyx_v_rowptr, __pyx_v_csrRowIndeces, __pyx_v_csrColumnOffsets, __pyx_v_csrColumnOffsets_eNebN, __pyx_v_csrColumnOffsets_eb, __pyx_v_csrColumnOffsets_eb_eNebN);
3512 
3513  /* function exit code */
3514  goto __pyx_L0;
3515  __pyx_L1_error:;
3516  __pyx_r = NULL;
3517  __pyx_L0:;
3518  __Pyx_RefNannyFinishContext();
3519  return __pyx_r;
3520 }
3521 
3522 static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_6getOffsets_CSR(struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self, int __pyx_v_nElements_global, int __pyx_v_nDOF_test_element, int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_nFreeDOF_test, PyArrayObject *__pyx_v_freeGlobal_test, PyArrayObject *__pyx_v_nFreeDOF_trial, PyArrayObject *__pyx_v_freeGlobal_trial, int __pyx_v_offset_test, int __pyx_v_stride_test, int __pyx_v_offset_trial, int __pyx_v_stride_trial, int __pyx_v_hasNumericalFlux, int __pyx_v_hasDiffusionInMixedForm, int __pyx_v_needNumericalFluxJacobian, int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, int __pyx_v_nInteriorElementBoundaries_global, PyArrayObject *__pyx_v_interiorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementBoundaryLocalElementBoundariesArray, int __pyx_v_hasFluxBoundaryConditions, int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, int __pyx_v_hasOutflowBoundary, int __pyx_v_needOutflowJacobian, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_csrRowIndeces, PyArrayObject *__pyx_v_csrColumnOffsets, PyArrayObject *__pyx_v_csrColumnOffsets_eNebN, PyArrayObject *__pyx_v_csrColumnOffsets_eb, PyArrayObject *__pyx_v_csrColumnOffsets_eb_eNebN) {
3523  PyObject *__pyx_r = NULL;
3524  __Pyx_RefNannyDeclarations
3525  __Pyx_RefNannySetupContext("getOffsets_CSR", 0);
3526 
3527  /* "csparsity.pyx":97
3528  * np.ndarray csrColumnOffsets_eb,
3529  * np.ndarray csrColumnOffsets_eb_eNebN):
3530  * self.cpp.getOffsets_CSR(nElements_global, # <<<<<<<<<<<<<<
3531  * nDOF_test_element,
3532  * nDOF_trial_element,
3533  */
3534  __pyx_v_self->cpp.getOffsets_CSR(__pyx_v_nElements_global, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, ((int *)__pyx_v_nFreeDOF_test->data), ((int *)__pyx_v_freeGlobal_test->data), ((int *)__pyx_v_nFreeDOF_trial->data), ((int *)__pyx_v_freeGlobal_trial->data), __pyx_v_offset_test, __pyx_v_stride_test, __pyx_v_offset_trial, __pyx_v_stride_trial, __pyx_v_hasNumericalFlux, __pyx_v_hasDiffusionInMixedForm, __pyx_v_needNumericalFluxJacobian, __pyx_v_nElementBoundaries_element, ((int *)__pyx_v_elementNeighborsArray->data), __pyx_v_nInteriorElementBoundaries_global, ((int *)__pyx_v_interiorElementBoundariesArray->data), ((int *)__pyx_v_elementBoundaryElementsArray->data), ((int *)__pyx_v_elementBoundaryLocalElementBoundariesArray->data), __pyx_v_hasFluxBoundaryConditions, __pyx_v_nExteriorElementBoundaries_global, ((int *)__pyx_v_exteriorElementBoundariesArray->data), __pyx_v_hasOutflowBoundary, __pyx_v_needOutflowJacobian, ((int *)__pyx_v_rowptr->data), ((int *)__pyx_v_csrRowIndeces->data), ((int *)__pyx_v_csrColumnOffsets->data), ((int *)__pyx_v_csrColumnOffsets_eNebN->data), ((int *)__pyx_v_csrColumnOffsets_eb->data), ((int *)__pyx_v_csrColumnOffsets_eb_eNebN->data));
3535 
3536  /* "csparsity.pyx":65
3537  * hasOutflowBoundary,
3538  * needOutflowJacobian)
3539  * def getOffsets_CSR(self, # <<<<<<<<<<<<<<
3540  * int nElements_global,
3541  * int nDOF_test_element,
3542  */
3543 
3544  /* function exit code */
3545  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3546  __Pyx_XGIVEREF(__pyx_r);
3547  __Pyx_RefNannyFinishContext();
3548  return __pyx_r;
3549 }
3550 
3551 /* "csparsity.pyx":128
3552  * <int*> csrColumnOffsets_eb.data,
3553  * <int*> csrColumnOffsets_eb_eNebN.data)
3554  * def getCSR(self): # <<<<<<<<<<<<<<
3555  * self.cpp.getCSR()
3556  * return (np.asarray(<int[:self.cpp.nrows]>self.cpp.rowptr),
3557  */
3558 
3559 /* Python wrapper */
3560 static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_9getCSR(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3561 static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_9getCSR(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3562  PyObject *__pyx_r = 0;
3563  __Pyx_RefNannyDeclarations
3564  __Pyx_RefNannySetupContext("getCSR (wrapper)", 0);
3565  __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo_8getCSR(((struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self));
3566 
3567  /* function exit code */
3568  __Pyx_RefNannyFinishContext();
3569  return __pyx_r;
3570 }
3571 
3572 static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_8getCSR(struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self) {
3573  PyObject *__pyx_r = NULL;
3574  __Pyx_RefNannyDeclarations
3575  PyObject *__pyx_t_1 = NULL;
3576  PyObject *__pyx_t_2 = NULL;
3577  PyObject *__pyx_t_3 = NULL;
3578  int *__pyx_t_4;
3579  struct __pyx_array_obj *__pyx_t_5 = NULL;
3580  PyObject *__pyx_t_6 = NULL;
3581  PyObject *__pyx_t_7 = NULL;
3582  PyObject *__pyx_t_8 = NULL;
3583  double *__pyx_t_9;
3584  PyObject *__pyx_t_10 = NULL;
3585  int __pyx_lineno = 0;
3586  const char *__pyx_filename = NULL;
3587  int __pyx_clineno = 0;
3588  __Pyx_RefNannySetupContext("getCSR", 0);
3589 
3590  /* "csparsity.pyx":129
3591  * <int*> csrColumnOffsets_eb_eNebN.data)
3592  * def getCSR(self):
3593  * self.cpp.getCSR() # <<<<<<<<<<<<<<
3594  * return (np.asarray(<int[:self.cpp.nrows]>self.cpp.rowptr),
3595  * np.asarray(<int[:self.cpp.nnz]>self.cpp.colind),
3596  */
3597  __pyx_v_self->cpp.getCSR();
3598 
3599  /* "csparsity.pyx":130
3600  * def getCSR(self):
3601  * self.cpp.getCSR()
3602  * return (np.asarray(<int[:self.cpp.nrows]>self.cpp.rowptr), # <<<<<<<<<<<<<<
3603  * np.asarray(<int[:self.cpp.nnz]>self.cpp.colind),
3604  * self.cpp.nnz,
3605  */
3606  __Pyx_XDECREF(__pyx_r);
3607  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 130, __pyx_L1_error)
3608  __Pyx_GOTREF(__pyx_t_2);
3609  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 130, __pyx_L1_error)
3610  __Pyx_GOTREF(__pyx_t_3);
3611  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3612  __pyx_t_4 = __pyx_v_self->cpp.rowptr;
3613  if (!__pyx_t_4) {
3614  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3615  __PYX_ERR(1, 130, __pyx_L1_error)
3616  }
3617  __pyx_t_6 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 130, __pyx_L1_error)
3618  __Pyx_GOTREF(__pyx_t_6);
3619  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->cpp.nrows)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 130, __pyx_L1_error)
3620  __Pyx_GOTREF(__pyx_t_2);
3621  __pyx_t_5 = __pyx_array_new(__pyx_t_2, sizeof(int), PyBytes_AS_STRING(__pyx_t_6), (char *) "c", (char *) __pyx_t_4);
3622  if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 130, __pyx_L1_error)
3623  __Pyx_GOTREF(__pyx_t_5);
3624  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3625  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3626  __pyx_t_6 = NULL;
3627  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3628  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
3629  if (likely(__pyx_t_6)) {
3630  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3631  __Pyx_INCREF(__pyx_t_6);
3632  __Pyx_INCREF(function);
3633  __Pyx_DECREF_SET(__pyx_t_3, function);
3634  }
3635  }
3636  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, ((PyObject *)__pyx_t_5)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_5));
3637  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3638  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
3639  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 130, __pyx_L1_error)
3640  __Pyx_GOTREF(__pyx_t_1);
3641  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3642 
3643  /* "csparsity.pyx":131
3644  * self.cpp.getCSR()
3645  * return (np.asarray(<int[:self.cpp.nrows]>self.cpp.rowptr),
3646  * np.asarray(<int[:self.cpp.nnz]>self.cpp.colind), # <<<<<<<<<<<<<<
3647  * self.cpp.nnz,
3648  * np.asarray(<double[:self.cpp.nnz]>self.cpp.nzval))
3649  */
3650  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 131, __pyx_L1_error)
3651  __Pyx_GOTREF(__pyx_t_6);
3652  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 131, __pyx_L1_error)
3653  __Pyx_GOTREF(__pyx_t_2);
3654  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3655  __pyx_t_4 = __pyx_v_self->cpp.colind;
3656  if (!__pyx_t_4) {
3657  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3658  __PYX_ERR(1, 131, __pyx_L1_error)
3659  }
3660  __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 131, __pyx_L1_error)
3661  __Pyx_GOTREF(__pyx_t_7);
3662  __pyx_t_6 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->cpp.nnz)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 131, __pyx_L1_error)
3663  __Pyx_GOTREF(__pyx_t_6);
3664  __pyx_t_5 = __pyx_array_new(__pyx_t_6, sizeof(int), PyBytes_AS_STRING(__pyx_t_7), (char *) "c", (char *) __pyx_t_4);
3665  if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 131, __pyx_L1_error)
3666  __Pyx_GOTREF(__pyx_t_5);
3667  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3668  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3669  __pyx_t_7 = NULL;
3670  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3671  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
3672  if (likely(__pyx_t_7)) {
3673  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3674  __Pyx_INCREF(__pyx_t_7);
3675  __Pyx_INCREF(function);
3676  __Pyx_DECREF_SET(__pyx_t_2, function);
3677  }
3678  }
3679  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, ((PyObject *)__pyx_t_5)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_5));
3680  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3681  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
3682  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __pyx_L1_error)
3683  __Pyx_GOTREF(__pyx_t_3);
3684  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3685 
3686  /* "csparsity.pyx":132
3687  * return (np.asarray(<int[:self.cpp.nrows]>self.cpp.rowptr),
3688  * np.asarray(<int[:self.cpp.nnz]>self.cpp.colind),
3689  * self.cpp.nnz, # <<<<<<<<<<<<<<
3690  * np.asarray(<double[:self.cpp.nnz]>self.cpp.nzval))
3691  */
3692  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->cpp.nnz); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 132, __pyx_L1_error)
3693  __Pyx_GOTREF(__pyx_t_2);
3694 
3695  /* "csparsity.pyx":133
3696  * np.asarray(<int[:self.cpp.nnz]>self.cpp.colind),
3697  * self.cpp.nnz,
3698  * np.asarray(<double[:self.cpp.nnz]>self.cpp.nzval)) # <<<<<<<<<<<<<<
3699  */
3700  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 133, __pyx_L1_error)
3701  __Pyx_GOTREF(__pyx_t_6);
3702  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 133, __pyx_L1_error)
3703  __Pyx_GOTREF(__pyx_t_8);
3704  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3705  __pyx_t_9 = __pyx_v_self->cpp.nzval;
3706  if (!__pyx_t_9) {
3707  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3708  __PYX_ERR(1, 133, __pyx_L1_error)
3709  }
3710  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 133, __pyx_L1_error)
3711  __Pyx_GOTREF(__pyx_t_10);
3712  __pyx_t_6 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->cpp.nnz)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 133, __pyx_L1_error)
3713  __Pyx_GOTREF(__pyx_t_6);
3714  __pyx_t_5 = __pyx_array_new(__pyx_t_6, sizeof(double), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_9);
3715  if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 133, __pyx_L1_error)
3716  __Pyx_GOTREF(__pyx_t_5);
3717  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3718  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3719  __pyx_t_10 = NULL;
3720  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
3721  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
3722  if (likely(__pyx_t_10)) {
3723  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
3724  __Pyx_INCREF(__pyx_t_10);
3725  __Pyx_INCREF(function);
3726  __Pyx_DECREF_SET(__pyx_t_8, function);
3727  }
3728  }
3729  __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_5)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_5));
3730  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3731  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
3732  if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 133, __pyx_L1_error)
3733  __Pyx_GOTREF(__pyx_t_7);
3734  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3735 
3736  /* "csparsity.pyx":130
3737  * def getCSR(self):
3738  * self.cpp.getCSR()
3739  * return (np.asarray(<int[:self.cpp.nrows]>self.cpp.rowptr), # <<<<<<<<<<<<<<
3740  * np.asarray(<int[:self.cpp.nnz]>self.cpp.colind),
3741  * self.cpp.nnz,
3742  */
3743  __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 130, __pyx_L1_error)
3744  __Pyx_GOTREF(__pyx_t_8);
3745  __Pyx_GIVEREF(__pyx_t_1);
3746  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
3747  __Pyx_GIVEREF(__pyx_t_3);
3748  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3);
3749  __Pyx_GIVEREF(__pyx_t_2);
3750  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_2);
3751  __Pyx_GIVEREF(__pyx_t_7);
3752  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7);
3753  __pyx_t_1 = 0;
3754  __pyx_t_3 = 0;
3755  __pyx_t_2 = 0;
3756  __pyx_t_7 = 0;
3757  __pyx_r = __pyx_t_8;
3758  __pyx_t_8 = 0;
3759  goto __pyx_L0;
3760 
3761  /* "csparsity.pyx":128
3762  * <int*> csrColumnOffsets_eb.data,
3763  * <int*> csrColumnOffsets_eb_eNebN.data)
3764  * def getCSR(self): # <<<<<<<<<<<<<<
3765  * self.cpp.getCSR()
3766  * return (np.asarray(<int[:self.cpp.nrows]>self.cpp.rowptr),
3767  */
3768 
3769  /* function exit code */
3770  __pyx_L1_error:;
3771  __Pyx_XDECREF(__pyx_t_1);
3772  __Pyx_XDECREF(__pyx_t_2);
3773  __Pyx_XDECREF(__pyx_t_3);
3774  __Pyx_XDECREF(((PyObject *)__pyx_t_5));
3775  __Pyx_XDECREF(__pyx_t_6);
3776  __Pyx_XDECREF(__pyx_t_7);
3777  __Pyx_XDECREF(__pyx_t_8);
3778  __Pyx_XDECREF(__pyx_t_10);
3779  __Pyx_AddTraceback("csparsity.PySparsityInfo.getCSR", __pyx_clineno, __pyx_lineno, __pyx_filename);
3780  __pyx_r = NULL;
3781  __pyx_L0:;
3782  __Pyx_XGIVEREF(__pyx_r);
3783  __Pyx_RefNannyFinishContext();
3784  return __pyx_r;
3785 }
3786 
3787 /* "(tree fragment)":1
3788  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3789  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3790  * def __setstate_cython__(self, __pyx_state):
3791  */
3792 
3793 /* Python wrapper */
3794 static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3795 static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3796  PyObject *__pyx_r = 0;
3797  __Pyx_RefNannyDeclarations
3798  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3799  __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo_10__reduce_cython__(((struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self));
3800 
3801  /* function exit code */
3802  __Pyx_RefNannyFinishContext();
3803  return __pyx_r;
3804 }
3805 
3806 static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self) {
3807  PyObject *__pyx_r = NULL;
3808  __Pyx_RefNannyDeclarations
3809  PyObject *__pyx_t_1 = NULL;
3810  int __pyx_lineno = 0;
3811  const char *__pyx_filename = NULL;
3812  int __pyx_clineno = 0;
3813  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3814 
3815  /* "(tree fragment)":2
3816  * def __reduce_cython__(self):
3817  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3818  * def __setstate_cython__(self, __pyx_state):
3819  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3820  */
3821  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
3822  __Pyx_GOTREF(__pyx_t_1);
3823  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3824  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3825  __PYX_ERR(0, 2, __pyx_L1_error)
3826 
3827  /* "(tree fragment)":1
3828  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3829  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3830  * def __setstate_cython__(self, __pyx_state):
3831  */
3832 
3833  /* function exit code */
3834  __pyx_L1_error:;
3835  __Pyx_XDECREF(__pyx_t_1);
3836  __Pyx_AddTraceback("csparsity.PySparsityInfo.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3837  __pyx_r = NULL;
3838  __Pyx_XGIVEREF(__pyx_r);
3839  __Pyx_RefNannyFinishContext();
3840  return __pyx_r;
3841 }
3842 
3843 /* "(tree fragment)":3
3844  * def __reduce_cython__(self):
3845  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3846  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3847  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3848  */
3849 
3850 /* Python wrapper */
3851 static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3852 static PyObject *__pyx_pw_9csparsity_14PySparsityInfo_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3853  PyObject *__pyx_r = 0;
3854  __Pyx_RefNannyDeclarations
3855  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3856  __pyx_r = __pyx_pf_9csparsity_14PySparsityInfo_12__setstate_cython__(((struct __pyx_obj_9csparsity_PySparsityInfo *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3857 
3858  /* function exit code */
3859  __Pyx_RefNannyFinishContext();
3860  return __pyx_r;
3861 }
3862 
3863 static PyObject *__pyx_pf_9csparsity_14PySparsityInfo_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9csparsity_PySparsityInfo *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3864  PyObject *__pyx_r = NULL;
3865  __Pyx_RefNannyDeclarations
3866  PyObject *__pyx_t_1 = NULL;
3867  int __pyx_lineno = 0;
3868  const char *__pyx_filename = NULL;
3869  int __pyx_clineno = 0;
3870  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3871 
3872  /* "(tree fragment)":4
3873  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3874  * def __setstate_cython__(self, __pyx_state):
3875  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3876  */
3877  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
3878  __Pyx_GOTREF(__pyx_t_1);
3879  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3880  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3881  __PYX_ERR(0, 4, __pyx_L1_error)
3882 
3883  /* "(tree fragment)":3
3884  * def __reduce_cython__(self):
3885  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3886  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3887  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3888  */
3889 
3890  /* function exit code */
3891  __pyx_L1_error:;
3892  __Pyx_XDECREF(__pyx_t_1);
3893  __Pyx_AddTraceback("csparsity.PySparsityInfo.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3894  __pyx_r = NULL;
3895  __Pyx_XGIVEREF(__pyx_r);
3896  __Pyx_RefNannyFinishContext();
3897  return __pyx_r;
3898 }
3899 
3900 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
3901  * ctypedef npy_cdouble complex_t
3902  *
3903  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
3904  * return PyArray_MultiIterNew(1, <void*>a)
3905  *
3906  */
3907 
3908 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
3909  PyObject *__pyx_r = NULL;
3910  __Pyx_RefNannyDeclarations
3911  PyObject *__pyx_t_1 = NULL;
3912  int __pyx_lineno = 0;
3913  const char *__pyx_filename = NULL;
3914  int __pyx_clineno = 0;
3915  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
3916 
3917  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":736
3918  *
3919  * cdef inline object PyArray_MultiIterNew1(a):
3920  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
3921  *
3922  * cdef inline object PyArray_MultiIterNew2(a, b):
3923  */
3924  __Pyx_XDECREF(__pyx_r);
3925  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
3926  __Pyx_GOTREF(__pyx_t_1);
3927  __pyx_r = __pyx_t_1;
3928  __pyx_t_1 = 0;
3929  goto __pyx_L0;
3930 
3931  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
3932  * ctypedef npy_cdouble complex_t
3933  *
3934  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
3935  * return PyArray_MultiIterNew(1, <void*>a)
3936  *
3937  */
3938 
3939  /* function exit code */
3940  __pyx_L1_error:;
3941  __Pyx_XDECREF(__pyx_t_1);
3942  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
3943  __pyx_r = 0;
3944  __pyx_L0:;
3945  __Pyx_XGIVEREF(__pyx_r);
3946  __Pyx_RefNannyFinishContext();
3947  return __pyx_r;
3948 }
3949 
3950 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
3951  * return PyArray_MultiIterNew(1, <void*>a)
3952  *
3953  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
3954  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
3955  *
3956  */
3957 
3958 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
3959  PyObject *__pyx_r = NULL;
3960  __Pyx_RefNannyDeclarations
3961  PyObject *__pyx_t_1 = NULL;
3962  int __pyx_lineno = 0;
3963  const char *__pyx_filename = NULL;
3964  int __pyx_clineno = 0;
3965  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
3966 
3967  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":739
3968  *
3969  * cdef inline object PyArray_MultiIterNew2(a, b):
3970  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
3971  *
3972  * cdef inline object PyArray_MultiIterNew3(a, b, c):
3973  */
3974  __Pyx_XDECREF(__pyx_r);
3975  __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)
3976  __Pyx_GOTREF(__pyx_t_1);
3977  __pyx_r = __pyx_t_1;
3978  __pyx_t_1 = 0;
3979  goto __pyx_L0;
3980 
3981  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
3982  * return PyArray_MultiIterNew(1, <void*>a)
3983  *
3984  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
3985  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
3986  *
3987  */
3988 
3989  /* function exit code */
3990  __pyx_L1_error:;
3991  __Pyx_XDECREF(__pyx_t_1);
3992  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
3993  __pyx_r = 0;
3994  __pyx_L0:;
3995  __Pyx_XGIVEREF(__pyx_r);
3996  __Pyx_RefNannyFinishContext();
3997  return __pyx_r;
3998 }
3999 
4000 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
4001  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4002  *
4003  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
4004  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4005  *
4006  */
4007 
4008 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
4009  PyObject *__pyx_r = NULL;
4010  __Pyx_RefNannyDeclarations
4011  PyObject *__pyx_t_1 = NULL;
4012  int __pyx_lineno = 0;
4013  const char *__pyx_filename = NULL;
4014  int __pyx_clineno = 0;
4015  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
4016 
4017  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":742
4018  *
4019  * cdef inline object PyArray_MultiIterNew3(a, b, c):
4020  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
4021  *
4022  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4023  */
4024  __Pyx_XDECREF(__pyx_r);
4025  __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)
4026  __Pyx_GOTREF(__pyx_t_1);
4027  __pyx_r = __pyx_t_1;
4028  __pyx_t_1 = 0;
4029  goto __pyx_L0;
4030 
4031  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
4032  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
4033  *
4034  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
4035  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4036  *
4037  */
4038 
4039  /* function exit code */
4040  __pyx_L1_error:;
4041  __Pyx_XDECREF(__pyx_t_1);
4042  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4043  __pyx_r = 0;
4044  __pyx_L0:;
4045  __Pyx_XGIVEREF(__pyx_r);
4046  __Pyx_RefNannyFinishContext();
4047  return __pyx_r;
4048 }
4049 
4050 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
4051  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4052  *
4053  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
4054  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4055  *
4056  */
4057 
4058 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) {
4059  PyObject *__pyx_r = NULL;
4060  __Pyx_RefNannyDeclarations
4061  PyObject *__pyx_t_1 = NULL;
4062  int __pyx_lineno = 0;
4063  const char *__pyx_filename = NULL;
4064  int __pyx_clineno = 0;
4065  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
4066 
4067  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":745
4068  *
4069  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
4070  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
4071  *
4072  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
4073  */
4074  __Pyx_XDECREF(__pyx_r);
4075  __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)
4076  __Pyx_GOTREF(__pyx_t_1);
4077  __pyx_r = __pyx_t_1;
4078  __pyx_t_1 = 0;
4079  goto __pyx_L0;
4080 
4081  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
4082  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
4083  *
4084  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
4085  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4086  *
4087  */
4088 
4089  /* function exit code */
4090  __pyx_L1_error:;
4091  __Pyx_XDECREF(__pyx_t_1);
4092  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
4093  __pyx_r = 0;
4094  __pyx_L0:;
4095  __Pyx_XGIVEREF(__pyx_r);
4096  __Pyx_RefNannyFinishContext();
4097  return __pyx_r;
4098 }
4099 
4100 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
4101  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4102  *
4103  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
4104  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4105  *
4106  */
4107 
4108 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) {
4109  PyObject *__pyx_r = NULL;
4110  __Pyx_RefNannyDeclarations
4111  PyObject *__pyx_t_1 = NULL;
4112  int __pyx_lineno = 0;
4113  const char *__pyx_filename = NULL;
4114  int __pyx_clineno = 0;
4115  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
4116 
4117  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":748
4118  *
4119  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
4120  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
4121  *
4122  * cdef inline tuple PyDataType_SHAPE(dtype d):
4123  */
4124  __Pyx_XDECREF(__pyx_r);
4125  __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)
4126  __Pyx_GOTREF(__pyx_t_1);
4127  __pyx_r = __pyx_t_1;
4128  __pyx_t_1 = 0;
4129  goto __pyx_L0;
4130 
4131  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
4132  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
4133  *
4134  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
4135  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4136  *
4137  */
4138 
4139  /* function exit code */
4140  __pyx_L1_error:;
4141  __Pyx_XDECREF(__pyx_t_1);
4142  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4143  __pyx_r = 0;
4144  __pyx_L0:;
4145  __Pyx_XGIVEREF(__pyx_r);
4146  __Pyx_RefNannyFinishContext();
4147  return __pyx_r;
4148 }
4149 
4150 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
4151  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4152  *
4153  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
4154  * if PyDataType_HASSUBARRAY(d):
4155  * return <tuple>d.subarray.shape
4156  */
4157 
4158 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
4159  PyObject *__pyx_r = NULL;
4160  __Pyx_RefNannyDeclarations
4161  int __pyx_t_1;
4162  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
4163 
4164  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
4165  *
4166  * cdef inline tuple PyDataType_SHAPE(dtype d):
4167  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
4168  * return <tuple>d.subarray.shape
4169  * else:
4170  */
4171  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
4172  if (__pyx_t_1) {
4173 
4174  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":752
4175  * cdef inline tuple PyDataType_SHAPE(dtype d):
4176  * if PyDataType_HASSUBARRAY(d):
4177  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
4178  * else:
4179  * return ()
4180  */
4181  __Pyx_XDECREF(__pyx_r);
4182  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
4183  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
4184  goto __pyx_L0;
4185 
4186  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
4187  *
4188  * cdef inline tuple PyDataType_SHAPE(dtype d):
4189  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
4190  * return <tuple>d.subarray.shape
4191  * else:
4192  */
4193  }
4194 
4195  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":754
4196  * return <tuple>d.subarray.shape
4197  * else:
4198  * return () # <<<<<<<<<<<<<<
4199  *
4200  *
4201  */
4202  /*else*/ {
4203  __Pyx_XDECREF(__pyx_r);
4204  __Pyx_INCREF(__pyx_empty_tuple);
4205  __pyx_r = __pyx_empty_tuple;
4206  goto __pyx_L0;
4207  }
4208 
4209  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
4210  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
4211  *
4212  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
4213  * if PyDataType_HASSUBARRAY(d):
4214  * return <tuple>d.subarray.shape
4215  */
4216 
4217  /* function exit code */
4218  __pyx_L0:;
4219  __Pyx_XGIVEREF(__pyx_r);
4220  __Pyx_RefNannyFinishContext();
4221  return __pyx_r;
4222 }
4223 
4224 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
4225  * int _import_umath() except -1
4226  *
4227  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
4228  * Py_INCREF(base) # important to do this before stealing the reference below!
4229  * PyArray_SetBaseObject(arr, base)
4230  */
4231 
4232 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
4233  __Pyx_RefNannyDeclarations
4234  __Pyx_RefNannySetupContext("set_array_base", 0);
4235 
4236  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":930
4237  *
4238  * cdef inline void set_array_base(ndarray arr, object base):
4239  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
4240  * PyArray_SetBaseObject(arr, base)
4241  *
4242  */
4243  Py_INCREF(__pyx_v_base);
4244 
4245  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":931
4246  * cdef inline void set_array_base(ndarray arr, object base):
4247  * Py_INCREF(base) # important to do this before stealing the reference below!
4248  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
4249  *
4250  * cdef inline object get_array_base(ndarray arr):
4251  */
4252  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
4253 
4254  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
4255  * int _import_umath() except -1
4256  *
4257  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
4258  * Py_INCREF(base) # important to do this before stealing the reference below!
4259  * PyArray_SetBaseObject(arr, base)
4260  */
4261 
4262  /* function exit code */
4263  __Pyx_RefNannyFinishContext();
4264 }
4265 
4266 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
4267  * PyArray_SetBaseObject(arr, base)
4268  *
4269  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
4270  * base = PyArray_BASE(arr)
4271  * if base is NULL:
4272  */
4273 
4274 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
4275  PyObject *__pyx_v_base;
4276  PyObject *__pyx_r = NULL;
4277  __Pyx_RefNannyDeclarations
4278  int __pyx_t_1;
4279  __Pyx_RefNannySetupContext("get_array_base", 0);
4280 
4281  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":934
4282  *
4283  * cdef inline object get_array_base(ndarray arr):
4284  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
4285  * if base is NULL:
4286  * return None
4287  */
4288  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
4289 
4290  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
4291  * cdef inline object get_array_base(ndarray arr):
4292  * base = PyArray_BASE(arr)
4293  * if base is NULL: # <<<<<<<<<<<<<<
4294  * return None
4295  * return <object>base
4296  */
4297  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
4298  if (__pyx_t_1) {
4299 
4300  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":936
4301  * base = PyArray_BASE(arr)
4302  * if base is NULL:
4303  * return None # <<<<<<<<<<<<<<
4304  * return <object>base
4305  *
4306  */
4307  __Pyx_XDECREF(__pyx_r);
4308  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4309  goto __pyx_L0;
4310 
4311  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
4312  * cdef inline object get_array_base(ndarray arr):
4313  * base = PyArray_BASE(arr)
4314  * if base is NULL: # <<<<<<<<<<<<<<
4315  * return None
4316  * return <object>base
4317  */
4318  }
4319 
4320  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":937
4321  * if base is NULL:
4322  * return None
4323  * return <object>base # <<<<<<<<<<<<<<
4324  *
4325  * # Versions of the import_* functions which are more suitable for
4326  */
4327  __Pyx_XDECREF(__pyx_r);
4328  __Pyx_INCREF(((PyObject *)__pyx_v_base));
4329  __pyx_r = ((PyObject *)__pyx_v_base);
4330  goto __pyx_L0;
4331 
4332  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
4333  * PyArray_SetBaseObject(arr, base)
4334  *
4335  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
4336  * base = PyArray_BASE(arr)
4337  * if base is NULL:
4338  */
4339 
4340  /* function exit code */
4341  __pyx_L0:;
4342  __Pyx_XGIVEREF(__pyx_r);
4343  __Pyx_RefNannyFinishContext();
4344  return __pyx_r;
4345 }
4346 
4347 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
4348  * # Versions of the import_* functions which are more suitable for
4349  * # Cython code.
4350  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
4351  * try:
4352  * __pyx_import_array()
4353  */
4354 
4355 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
4356  int __pyx_r;
4357  __Pyx_RefNannyDeclarations
4358  PyObject *__pyx_t_1 = NULL;
4359  PyObject *__pyx_t_2 = NULL;
4360  PyObject *__pyx_t_3 = NULL;
4361  int __pyx_t_4;
4362  PyObject *__pyx_t_5 = NULL;
4363  PyObject *__pyx_t_6 = NULL;
4364  PyObject *__pyx_t_7 = NULL;
4365  PyObject *__pyx_t_8 = NULL;
4366  int __pyx_lineno = 0;
4367  const char *__pyx_filename = NULL;
4368  int __pyx_clineno = 0;
4369  __Pyx_RefNannySetupContext("import_array", 0);
4370 
4371  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
4372  * # Cython code.
4373  * cdef inline int import_array() except -1:
4374  * try: # <<<<<<<<<<<<<<
4375  * __pyx_import_array()
4376  * except Exception:
4377  */
4378  {
4379  __Pyx_PyThreadState_declare
4380  __Pyx_PyThreadState_assign
4381  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4382  __Pyx_XGOTREF(__pyx_t_1);
4383  __Pyx_XGOTREF(__pyx_t_2);
4384  __Pyx_XGOTREF(__pyx_t_3);
4385  /*try:*/ {
4386 
4387  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":943
4388  * cdef inline int import_array() except -1:
4389  * try:
4390  * __pyx_import_array() # <<<<<<<<<<<<<<
4391  * except Exception:
4392  * raise ImportError("numpy.core.multiarray failed to import")
4393  */
4394  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
4395 
4396  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
4397  * # Cython code.
4398  * cdef inline int import_array() except -1:
4399  * try: # <<<<<<<<<<<<<<
4400  * __pyx_import_array()
4401  * except Exception:
4402  */
4403  }
4404  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4405  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4406  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4407  goto __pyx_L8_try_end;
4408  __pyx_L3_error:;
4409 
4410  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":944
4411  * try:
4412  * __pyx_import_array()
4413  * except Exception: # <<<<<<<<<<<<<<
4414  * raise ImportError("numpy.core.multiarray failed to import")
4415  *
4416  */
4417  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
4418  if (__pyx_t_4) {
4419  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
4420  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
4421  __Pyx_GOTREF(__pyx_t_5);
4422  __Pyx_GOTREF(__pyx_t_6);
4423  __Pyx_GOTREF(__pyx_t_7);
4424 
4425  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
4426  * __pyx_import_array()
4427  * except Exception:
4428  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
4429  *
4430  * cdef inline int import_umath() except -1:
4431  */
4432  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
4433  __Pyx_GOTREF(__pyx_t_8);
4434  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
4435  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4436  __PYX_ERR(2, 945, __pyx_L5_except_error)
4437  }
4438  goto __pyx_L5_except_error;
4439  __pyx_L5_except_error:;
4440 
4441  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
4442  * # Cython code.
4443  * cdef inline int import_array() except -1:
4444  * try: # <<<<<<<<<<<<<<
4445  * __pyx_import_array()
4446  * except Exception:
4447  */
4448  __Pyx_XGIVEREF(__pyx_t_1);
4449  __Pyx_XGIVEREF(__pyx_t_2);
4450  __Pyx_XGIVEREF(__pyx_t_3);
4451  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4452  goto __pyx_L1_error;
4453  __pyx_L8_try_end:;
4454  }
4455 
4456  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
4457  * # Versions of the import_* functions which are more suitable for
4458  * # Cython code.
4459  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
4460  * try:
4461  * __pyx_import_array()
4462  */
4463 
4464  /* function exit code */
4465  __pyx_r = 0;
4466  goto __pyx_L0;
4467  __pyx_L1_error:;
4468  __Pyx_XDECREF(__pyx_t_5);
4469  __Pyx_XDECREF(__pyx_t_6);
4470  __Pyx_XDECREF(__pyx_t_7);
4471  __Pyx_XDECREF(__pyx_t_8);
4472  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
4473  __pyx_r = -1;
4474  __pyx_L0:;
4475  __Pyx_RefNannyFinishContext();
4476  return __pyx_r;
4477 }
4478 
4479 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
4480  * raise ImportError("numpy.core.multiarray failed to import")
4481  *
4482  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
4483  * try:
4484  * _import_umath()
4485  */
4486 
4487 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
4488  int __pyx_r;
4489  __Pyx_RefNannyDeclarations
4490  PyObject *__pyx_t_1 = NULL;
4491  PyObject *__pyx_t_2 = NULL;
4492  PyObject *__pyx_t_3 = NULL;
4493  int __pyx_t_4;
4494  PyObject *__pyx_t_5 = NULL;
4495  PyObject *__pyx_t_6 = NULL;
4496  PyObject *__pyx_t_7 = NULL;
4497  PyObject *__pyx_t_8 = NULL;
4498  int __pyx_lineno = 0;
4499  const char *__pyx_filename = NULL;
4500  int __pyx_clineno = 0;
4501  __Pyx_RefNannySetupContext("import_umath", 0);
4502 
4503  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
4504  *
4505  * cdef inline int import_umath() except -1:
4506  * try: # <<<<<<<<<<<<<<
4507  * _import_umath()
4508  * except Exception:
4509  */
4510  {
4511  __Pyx_PyThreadState_declare
4512  __Pyx_PyThreadState_assign
4513  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4514  __Pyx_XGOTREF(__pyx_t_1);
4515  __Pyx_XGOTREF(__pyx_t_2);
4516  __Pyx_XGOTREF(__pyx_t_3);
4517  /*try:*/ {
4518 
4519  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":949
4520  * cdef inline int import_umath() except -1:
4521  * try:
4522  * _import_umath() # <<<<<<<<<<<<<<
4523  * except Exception:
4524  * raise ImportError("numpy.core.umath failed to import")
4525  */
4526  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
4527 
4528  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
4529  *
4530  * cdef inline int import_umath() except -1:
4531  * try: # <<<<<<<<<<<<<<
4532  * _import_umath()
4533  * except Exception:
4534  */
4535  }
4536  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4537  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4538  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4539  goto __pyx_L8_try_end;
4540  __pyx_L3_error:;
4541 
4542  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":950
4543  * try:
4544  * _import_umath()
4545  * except Exception: # <<<<<<<<<<<<<<
4546  * raise ImportError("numpy.core.umath failed to import")
4547  *
4548  */
4549  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
4550  if (__pyx_t_4) {
4551  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
4552  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
4553  __Pyx_GOTREF(__pyx_t_5);
4554  __Pyx_GOTREF(__pyx_t_6);
4555  __Pyx_GOTREF(__pyx_t_7);
4556 
4557  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
4558  * _import_umath()
4559  * except Exception:
4560  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
4561  *
4562  * cdef inline int import_ufunc() except -1:
4563  */
4564  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
4565  __Pyx_GOTREF(__pyx_t_8);
4566  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
4567  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4568  __PYX_ERR(2, 951, __pyx_L5_except_error)
4569  }
4570  goto __pyx_L5_except_error;
4571  __pyx_L5_except_error:;
4572 
4573  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
4574  *
4575  * cdef inline int import_umath() except -1:
4576  * try: # <<<<<<<<<<<<<<
4577  * _import_umath()
4578  * except Exception:
4579  */
4580  __Pyx_XGIVEREF(__pyx_t_1);
4581  __Pyx_XGIVEREF(__pyx_t_2);
4582  __Pyx_XGIVEREF(__pyx_t_3);
4583  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4584  goto __pyx_L1_error;
4585  __pyx_L8_try_end:;
4586  }
4587 
4588  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
4589  * raise ImportError("numpy.core.multiarray failed to import")
4590  *
4591  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
4592  * try:
4593  * _import_umath()
4594  */
4595 
4596  /* function exit code */
4597  __pyx_r = 0;
4598  goto __pyx_L0;
4599  __pyx_L1_error:;
4600  __Pyx_XDECREF(__pyx_t_5);
4601  __Pyx_XDECREF(__pyx_t_6);
4602  __Pyx_XDECREF(__pyx_t_7);
4603  __Pyx_XDECREF(__pyx_t_8);
4604  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
4605  __pyx_r = -1;
4606  __pyx_L0:;
4607  __Pyx_RefNannyFinishContext();
4608  return __pyx_r;
4609 }
4610 
4611 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
4612  * raise ImportError("numpy.core.umath failed to import")
4613  *
4614  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
4615  * try:
4616  * _import_umath()
4617  */
4618 
4619 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
4620  int __pyx_r;
4621  __Pyx_RefNannyDeclarations
4622  PyObject *__pyx_t_1 = NULL;
4623  PyObject *__pyx_t_2 = NULL;
4624  PyObject *__pyx_t_3 = NULL;
4625  int __pyx_t_4;
4626  PyObject *__pyx_t_5 = NULL;
4627  PyObject *__pyx_t_6 = NULL;
4628  PyObject *__pyx_t_7 = NULL;
4629  PyObject *__pyx_t_8 = NULL;
4630  int __pyx_lineno = 0;
4631  const char *__pyx_filename = NULL;
4632  int __pyx_clineno = 0;
4633  __Pyx_RefNannySetupContext("import_ufunc", 0);
4634 
4635  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
4636  *
4637  * cdef inline int import_ufunc() except -1:
4638  * try: # <<<<<<<<<<<<<<
4639  * _import_umath()
4640  * except Exception:
4641  */
4642  {
4643  __Pyx_PyThreadState_declare
4644  __Pyx_PyThreadState_assign
4645  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4646  __Pyx_XGOTREF(__pyx_t_1);
4647  __Pyx_XGOTREF(__pyx_t_2);
4648  __Pyx_XGOTREF(__pyx_t_3);
4649  /*try:*/ {
4650 
4651  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":955
4652  * cdef inline int import_ufunc() except -1:
4653  * try:
4654  * _import_umath() # <<<<<<<<<<<<<<
4655  * except Exception:
4656  * raise ImportError("numpy.core.umath failed to import")
4657  */
4658  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
4659 
4660  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
4661  *
4662  * cdef inline int import_ufunc() except -1:
4663  * try: # <<<<<<<<<<<<<<
4664  * _import_umath()
4665  * except Exception:
4666  */
4667  }
4668  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4669  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4670  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4671  goto __pyx_L8_try_end;
4672  __pyx_L3_error:;
4673 
4674  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":956
4675  * try:
4676  * _import_umath()
4677  * except Exception: # <<<<<<<<<<<<<<
4678  * raise ImportError("numpy.core.umath failed to import")
4679  *
4680  */
4681  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
4682  if (__pyx_t_4) {
4683  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
4684  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
4685  __Pyx_GOTREF(__pyx_t_5);
4686  __Pyx_GOTREF(__pyx_t_6);
4687  __Pyx_GOTREF(__pyx_t_7);
4688 
4689  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":957
4690  * _import_umath()
4691  * except Exception:
4692  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
4693  *
4694  * cdef extern from *:
4695  */
4696  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
4697  __Pyx_GOTREF(__pyx_t_8);
4698  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
4699  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4700  __PYX_ERR(2, 957, __pyx_L5_except_error)
4701  }
4702  goto __pyx_L5_except_error;
4703  __pyx_L5_except_error:;
4704 
4705  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
4706  *
4707  * cdef inline int import_ufunc() except -1:
4708  * try: # <<<<<<<<<<<<<<
4709  * _import_umath()
4710  * except Exception:
4711  */
4712  __Pyx_XGIVEREF(__pyx_t_1);
4713  __Pyx_XGIVEREF(__pyx_t_2);
4714  __Pyx_XGIVEREF(__pyx_t_3);
4715  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4716  goto __pyx_L1_error;
4717  __pyx_L8_try_end:;
4718  }
4719 
4720  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
4721  * raise ImportError("numpy.core.umath failed to import")
4722  *
4723  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
4724  * try:
4725  * _import_umath()
4726  */
4727 
4728  /* function exit code */
4729  __pyx_r = 0;
4730  goto __pyx_L0;
4731  __pyx_L1_error:;
4732  __Pyx_XDECREF(__pyx_t_5);
4733  __Pyx_XDECREF(__pyx_t_6);
4734  __Pyx_XDECREF(__pyx_t_7);
4735  __Pyx_XDECREF(__pyx_t_8);
4736  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
4737  __pyx_r = -1;
4738  __pyx_L0:;
4739  __Pyx_RefNannyFinishContext();
4740  return __pyx_r;
4741 }
4742 
4743 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
4744  *
4745  *
4746  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
4747  * """
4748  * Cython equivalent of `isinstance(obj, np.timedelta64)`
4749  */
4750 
4751 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
4752  int __pyx_r;
4753  __Pyx_RefNannyDeclarations
4754  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
4755 
4756  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":979
4757  * bool
4758  * """
4759  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
4760  *
4761  *
4762  */
4763  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
4764  goto __pyx_L0;
4765 
4766  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
4767  *
4768  *
4769  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
4770  * """
4771  * Cython equivalent of `isinstance(obj, np.timedelta64)`
4772  */
4773 
4774  /* function exit code */
4775  __pyx_L0:;
4776  __Pyx_RefNannyFinishContext();
4777  return __pyx_r;
4778 }
4779 
4780 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
4781  *
4782  *
4783  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
4784  * """
4785  * Cython equivalent of `isinstance(obj, np.datetime64)`
4786  */
4787 
4788 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
4789  int __pyx_r;
4790  __Pyx_RefNannyDeclarations
4791  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
4792 
4793  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":994
4794  * bool
4795  * """
4796  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
4797  *
4798  *
4799  */
4800  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
4801  goto __pyx_L0;
4802 
4803  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
4804  *
4805  *
4806  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
4807  * """
4808  * Cython equivalent of `isinstance(obj, np.datetime64)`
4809  */
4810 
4811  /* function exit code */
4812  __pyx_L0:;
4813  __Pyx_RefNannyFinishContext();
4814  return __pyx_r;
4815 }
4816 
4817 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
4818  *
4819  *
4820  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
4821  * """
4822  * returns the int64 value underlying scalar numpy datetime64 object
4823  */
4824 
4825 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
4826  npy_datetime __pyx_r;
4827 
4828  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1004
4829  * also needed. That can be found using `get_datetime64_unit`.
4830  * """
4831  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
4832  *
4833  *
4834  */
4835  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
4836  goto __pyx_L0;
4837 
4838  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
4839  *
4840  *
4841  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
4842  * """
4843  * returns the int64 value underlying scalar numpy datetime64 object
4844  */
4845 
4846  /* function exit code */
4847  __pyx_L0:;
4848  return __pyx_r;
4849 }
4850 
4851 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
4852  *
4853  *
4854  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
4855  * """
4856  * returns the int64 value underlying scalar numpy timedelta64 object
4857  */
4858 
4859 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
4860  npy_timedelta __pyx_r;
4861 
4862  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1011
4863  * returns the int64 value underlying scalar numpy timedelta64 object
4864  * """
4865  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
4866  *
4867  *
4868  */
4869  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
4870  goto __pyx_L0;
4871 
4872  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
4873  *
4874  *
4875  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
4876  * """
4877  * returns the int64 value underlying scalar numpy timedelta64 object
4878  */
4879 
4880  /* function exit code */
4881  __pyx_L0:;
4882  return __pyx_r;
4883 }
4884 
4885 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
4886  *
4887  *
4888  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
4889  * """
4890  * returns the unit part of the dtype for a numpy datetime64 object.
4891  */
4892 
4893 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
4894  NPY_DATETIMEUNIT __pyx_r;
4895 
4896  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1018
4897  * returns the unit part of the dtype for a numpy datetime64 object.
4898  * """
4899  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
4900  */
4901  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
4902  goto __pyx_L0;
4903 
4904  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
4905  *
4906  *
4907  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
4908  * """
4909  * returns the unit part of the dtype for a numpy datetime64 object.
4910  */
4911 
4912  /* function exit code */
4913  __pyx_L0:;
4914  return __pyx_r;
4915 }
4916 
4917 /* "View.MemoryView":122
4918  * cdef bint dtype_is_object
4919  *
4920  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4921  * mode="c", bint allocate_buffer=True):
4922  *
4923  */
4924 
4925 /* Python wrapper */
4926 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4927 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4928  PyObject *__pyx_v_shape = 0;
4929  Py_ssize_t __pyx_v_itemsize;
4930  PyObject *__pyx_v_format = 0;
4931  PyObject *__pyx_v_mode = 0;
4932  int __pyx_v_allocate_buffer;
4933  int __pyx_lineno = 0;
4934  const char *__pyx_filename = NULL;
4935  int __pyx_clineno = 0;
4936  int __pyx_r;
4937  __Pyx_RefNannyDeclarations
4938  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4939  {
4940  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};
4941  PyObject* values[5] = {0,0,0,0,0};
4942  values[3] = ((PyObject *)__pyx_n_s_c);
4943  if (unlikely(__pyx_kwds)) {
4944  Py_ssize_t kw_args;
4945  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4946  switch (pos_args) {
4947  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4948  CYTHON_FALLTHROUGH;
4949  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4950  CYTHON_FALLTHROUGH;
4951  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4952  CYTHON_FALLTHROUGH;
4953  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4954  CYTHON_FALLTHROUGH;
4955  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4956  CYTHON_FALLTHROUGH;
4957  case 0: break;
4958  default: goto __pyx_L5_argtuple_error;
4959  }
4960  kw_args = PyDict_Size(__pyx_kwds);
4961  switch (pos_args) {
4962  case 0:
4963  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
4964  else goto __pyx_L5_argtuple_error;
4965  CYTHON_FALLTHROUGH;
4966  case 1:
4967  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
4968  else {
4969  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(0, 122, __pyx_L3_error)
4970  }
4971  CYTHON_FALLTHROUGH;
4972  case 2:
4973  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
4974  else {
4975  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(0, 122, __pyx_L3_error)
4976  }
4977  CYTHON_FALLTHROUGH;
4978  case 3:
4979  if (kw_args > 0) {
4980  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
4981  if (value) { values[3] = value; kw_args--; }
4982  }
4983  CYTHON_FALLTHROUGH;
4984  case 4:
4985  if (kw_args > 0) {
4986  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
4987  if (value) { values[4] = value; kw_args--; }
4988  }
4989  }
4990  if (unlikely(kw_args > 0)) {
4991  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 122, __pyx_L3_error)
4992  }
4993  } else {
4994  switch (PyTuple_GET_SIZE(__pyx_args)) {
4995  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4996  CYTHON_FALLTHROUGH;
4997  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4998  CYTHON_FALLTHROUGH;
4999  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5000  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5001  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5002  break;
5003  default: goto __pyx_L5_argtuple_error;
5004  }
5005  }
5006  __pyx_v_shape = ((PyObject*)values[0]);
5007  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error)
5008  __pyx_v_format = values[2];
5009  __pyx_v_mode = values[3];
5010  if (values[4]) {
5011  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L3_error)
5012  } else {
5013 
5014  /* "View.MemoryView":123
5015  *
5016  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
5017  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
5018  *
5019  * cdef int idx
5020  */
5021  __pyx_v_allocate_buffer = ((int)1);
5022  }
5023  }
5024  goto __pyx_L4_argument_unpacking_done;
5025  __pyx_L5_argtuple_error:;
5026  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 122, __pyx_L3_error)
5027  __pyx_L3_error:;
5028  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5029  __Pyx_RefNannyFinishContext();
5030  return -1;
5031  __pyx_L4_argument_unpacking_done:;
5032  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(0, 122, __pyx_L1_error)
5033  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
5034  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(0, 122, __pyx_L1_error)
5035  }
5036  __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);
5037 
5038  /* "View.MemoryView":122
5039  * cdef bint dtype_is_object
5040  *
5041  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5042  * mode="c", bint allocate_buffer=True):
5043  *
5044  */
5045 
5046  /* function exit code */
5047  goto __pyx_L0;
5048  __pyx_L1_error:;
5049  __pyx_r = -1;
5050  __pyx_L0:;
5051  __Pyx_RefNannyFinishContext();
5052  return __pyx_r;
5053 }
5054 
5055 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) {
5056  int __pyx_v_idx;
5057  Py_ssize_t __pyx_v_i;
5058  Py_ssize_t __pyx_v_dim;
5059  PyObject **__pyx_v_p;
5060  char __pyx_v_order;
5061  int __pyx_r;
5062  __Pyx_RefNannyDeclarations
5063  Py_ssize_t __pyx_t_1;
5064  int __pyx_t_2;
5065  PyObject *__pyx_t_3 = NULL;
5066  int __pyx_t_4;
5067  PyObject *__pyx_t_5 = NULL;
5068  PyObject *__pyx_t_6 = NULL;
5069  char *__pyx_t_7;
5070  int __pyx_t_8;
5071  Py_ssize_t __pyx_t_9;
5072  PyObject *__pyx_t_10 = NULL;
5073  Py_ssize_t __pyx_t_11;
5074  int __pyx_lineno = 0;
5075  const char *__pyx_filename = NULL;
5076  int __pyx_clineno = 0;
5077  __Pyx_RefNannySetupContext("__cinit__", 0);
5078  __Pyx_INCREF(__pyx_v_format);
5079 
5080  /* "View.MemoryView":129
5081  * cdef PyObject **p
5082  *
5083  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
5084  * self.itemsize = itemsize
5085  *
5086  */
5087  if (unlikely(__pyx_v_shape == Py_None)) {
5088  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
5089  __PYX_ERR(0, 129, __pyx_L1_error)
5090  }
5091  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 129, __pyx_L1_error)
5092  __pyx_v_self->ndim = ((int)__pyx_t_1);
5093 
5094  /* "View.MemoryView":130
5095  *
5096  * self.ndim = <int> len(shape)
5097  * self.itemsize = itemsize # <<<<<<<<<<<<<<
5098  *
5099  * if not self.ndim:
5100  */
5101  __pyx_v_self->itemsize = __pyx_v_itemsize;
5102 
5103  /* "View.MemoryView":132
5104  * self.itemsize = itemsize
5105  *
5106  * if not self.ndim: # <<<<<<<<<<<<<<
5107  * raise ValueError("Empty shape tuple for cython.array")
5108  *
5109  */
5110  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
5111  if (unlikely(__pyx_t_2)) {
5112 
5113  /* "View.MemoryView":133
5114  *
5115  * if not self.ndim:
5116  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
5117  *
5118  * if itemsize <= 0:
5119  */
5120  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
5121  __Pyx_GOTREF(__pyx_t_3);
5122  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5123  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5124  __PYX_ERR(0, 133, __pyx_L1_error)
5125 
5126  /* "View.MemoryView":132
5127  * self.itemsize = itemsize
5128  *
5129  * if not self.ndim: # <<<<<<<<<<<<<<
5130  * raise ValueError("Empty shape tuple for cython.array")
5131  *
5132  */
5133  }
5134 
5135  /* "View.MemoryView":135
5136  * raise ValueError("Empty shape tuple for cython.array")
5137  *
5138  * if itemsize <= 0: # <<<<<<<<<<<<<<
5139  * raise ValueError("itemsize <= 0 for cython.array")
5140  *
5141  */
5142  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
5143  if (unlikely(__pyx_t_2)) {
5144 
5145  /* "View.MemoryView":136
5146  *
5147  * if itemsize <= 0:
5148  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
5149  *
5150  * if not isinstance(format, bytes):
5151  */
5152  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
5153  __Pyx_GOTREF(__pyx_t_3);
5154  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5155  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5156  __PYX_ERR(0, 136, __pyx_L1_error)
5157 
5158  /* "View.MemoryView":135
5159  * raise ValueError("Empty shape tuple for cython.array")
5160  *
5161  * if itemsize <= 0: # <<<<<<<<<<<<<<
5162  * raise ValueError("itemsize <= 0 for cython.array")
5163  *
5164  */
5165  }
5166 
5167  /* "View.MemoryView":138
5168  * raise ValueError("itemsize <= 0 for cython.array")
5169  *
5170  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
5171  * format = format.encode('ASCII')
5172  * self._format = format # keep a reference to the byte string
5173  */
5174  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
5175  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
5176  if (__pyx_t_4) {
5177 
5178  /* "View.MemoryView":139
5179  *
5180  * if not isinstance(format, bytes):
5181  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
5182  * self._format = format # keep a reference to the byte string
5183  * self.format = self._format
5184  */
5185  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error)
5186  __Pyx_GOTREF(__pyx_t_5);
5187  __pyx_t_6 = NULL;
5188  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
5189  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
5190  if (likely(__pyx_t_6)) {
5191  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5192  __Pyx_INCREF(__pyx_t_6);
5193  __Pyx_INCREF(function);
5194  __Pyx_DECREF_SET(__pyx_t_5, function);
5195  }
5196  }
5197  __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);
5198  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5199  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
5200  __Pyx_GOTREF(__pyx_t_3);
5201  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5202  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
5203  __pyx_t_3 = 0;
5204 
5205  /* "View.MemoryView":138
5206  * raise ValueError("itemsize <= 0 for cython.array")
5207  *
5208  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
5209  * format = format.encode('ASCII')
5210  * self._format = format # keep a reference to the byte string
5211  */
5212  }
5213 
5214  /* "View.MemoryView":140
5215  * if not isinstance(format, bytes):
5216  * format = format.encode('ASCII')
5217  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
5218  * self.format = self._format
5219  *
5220  */
5221  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(0, 140, __pyx_L1_error)
5222  __pyx_t_3 = __pyx_v_format;
5223  __Pyx_INCREF(__pyx_t_3);
5224  __Pyx_GIVEREF(__pyx_t_3);
5225  __Pyx_GOTREF(__pyx_v_self->_format);
5226  __Pyx_DECREF(__pyx_v_self->_format);
5227  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
5228  __pyx_t_3 = 0;
5229 
5230  /* "View.MemoryView":141
5231  * format = format.encode('ASCII')
5232  * self._format = format # keep a reference to the byte string
5233  * self.format = self._format # <<<<<<<<<<<<<<
5234  *
5235  *
5236  */
5237  if (unlikely(__pyx_v_self->_format == Py_None)) {
5238  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
5239  __PYX_ERR(0, 141, __pyx_L1_error)
5240  }
5241  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error)
5242  __pyx_v_self->format = __pyx_t_7;
5243 
5244  /* "View.MemoryView":144
5245  *
5246  *
5247  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
5248  * self._strides = self._shape + self.ndim
5249  *
5250  */
5251  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
5252 
5253  /* "View.MemoryView":145
5254  *
5255  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
5256  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
5257  *
5258  * if not self._shape:
5259  */
5260  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
5261 
5262  /* "View.MemoryView":147
5263  * self._strides = self._shape + self.ndim
5264  *
5265  * if not self._shape: # <<<<<<<<<<<<<<
5266  * raise MemoryError("unable to allocate shape and strides.")
5267  *
5268  */
5269  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
5270  if (unlikely(__pyx_t_4)) {
5271 
5272  /* "View.MemoryView":148
5273  *
5274  * if not self._shape:
5275  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
5276  *
5277  *
5278  */
5279  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
5280  __Pyx_GOTREF(__pyx_t_3);
5281  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5282  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5283  __PYX_ERR(0, 148, __pyx_L1_error)
5284 
5285  /* "View.MemoryView":147
5286  * self._strides = self._shape + self.ndim
5287  *
5288  * if not self._shape: # <<<<<<<<<<<<<<
5289  * raise MemoryError("unable to allocate shape and strides.")
5290  *
5291  */
5292  }
5293 
5294  /* "View.MemoryView":151
5295  *
5296  *
5297  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5298  * if dim <= 0:
5299  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
5300  */
5301  __pyx_t_8 = 0;
5302  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
5303  for (;;) {
5304  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
5305  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5306  __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(0, 151, __pyx_L1_error)
5307  #else
5308  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error)
5309  __Pyx_GOTREF(__pyx_t_5);
5310  #endif
5311  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error)
5312  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5313  __pyx_v_dim = __pyx_t_9;
5314  __pyx_v_idx = __pyx_t_8;
5315  __pyx_t_8 = (__pyx_t_8 + 1);
5316 
5317  /* "View.MemoryView":152
5318  *
5319  * for idx, dim in enumerate(shape):
5320  * if dim <= 0: # <<<<<<<<<<<<<<
5321  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
5322  * self._shape[idx] = dim
5323  */
5324  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
5325  if (unlikely(__pyx_t_4)) {
5326 
5327  /* "View.MemoryView":153
5328  * for idx, dim in enumerate(shape):
5329  * if dim <= 0:
5330  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
5331  * self._shape[idx] = dim
5332  *
5333  */
5334  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
5335  __Pyx_GOTREF(__pyx_t_5);
5336  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error)
5337  __Pyx_GOTREF(__pyx_t_6);
5338  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 153, __pyx_L1_error)
5339  __Pyx_GOTREF(__pyx_t_10);
5340  __Pyx_GIVEREF(__pyx_t_5);
5341  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
5342  __Pyx_GIVEREF(__pyx_t_6);
5343  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
5344  __pyx_t_5 = 0;
5345  __pyx_t_6 = 0;
5346  __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(0, 153, __pyx_L1_error)
5347  __Pyx_GOTREF(__pyx_t_6);
5348  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5349  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 153, __pyx_L1_error)
5350  __Pyx_GOTREF(__pyx_t_10);
5351  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5352  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
5353  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5354  __PYX_ERR(0, 153, __pyx_L1_error)
5355 
5356  /* "View.MemoryView":152
5357  *
5358  * for idx, dim in enumerate(shape):
5359  * if dim <= 0: # <<<<<<<<<<<<<<
5360  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
5361  * self._shape[idx] = dim
5362  */
5363  }
5364 
5365  /* "View.MemoryView":154
5366  * if dim <= 0:
5367  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
5368  * self._shape[idx] = dim # <<<<<<<<<<<<<<
5369  *
5370  * cdef char order
5371  */
5372  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
5373 
5374  /* "View.MemoryView":151
5375  *
5376  *
5377  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5378  * if dim <= 0:
5379  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
5380  */
5381  }
5382  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5383 
5384  /* "View.MemoryView":157
5385  *
5386  * cdef char order
5387  * if mode == 'fortran': # <<<<<<<<<<<<<<
5388  * order = b'F'
5389  * self.mode = u'fortran'
5390  */
5391  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 157, __pyx_L1_error)
5392  if (__pyx_t_4) {
5393 
5394  /* "View.MemoryView":158
5395  * cdef char order
5396  * if mode == 'fortran':
5397  * order = b'F' # <<<<<<<<<<<<<<
5398  * self.mode = u'fortran'
5399  * elif mode == 'c':
5400  */
5401  __pyx_v_order = 'F';
5402 
5403  /* "View.MemoryView":159
5404  * if mode == 'fortran':
5405  * order = b'F'
5406  * self.mode = u'fortran' # <<<<<<<<<<<<<<
5407  * elif mode == 'c':
5408  * order = b'C'
5409  */
5410  __Pyx_INCREF(__pyx_n_u_fortran);
5411  __Pyx_GIVEREF(__pyx_n_u_fortran);
5412  __Pyx_GOTREF(__pyx_v_self->mode);
5413  __Pyx_DECREF(__pyx_v_self->mode);
5414  __pyx_v_self->mode = __pyx_n_u_fortran;
5415 
5416  /* "View.MemoryView":157
5417  *
5418  * cdef char order
5419  * if mode == 'fortran': # <<<<<<<<<<<<<<
5420  * order = b'F'
5421  * self.mode = u'fortran'
5422  */
5423  goto __pyx_L10;
5424  }
5425 
5426  /* "View.MemoryView":160
5427  * order = b'F'
5428  * self.mode = u'fortran'
5429  * elif mode == 'c': # <<<<<<<<<<<<<<
5430  * order = b'C'
5431  * self.mode = u'c'
5432  */
5433  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 160, __pyx_L1_error)
5434  if (likely(__pyx_t_4)) {
5435 
5436  /* "View.MemoryView":161
5437  * self.mode = u'fortran'
5438  * elif mode == 'c':
5439  * order = b'C' # <<<<<<<<<<<<<<
5440  * self.mode = u'c'
5441  * else:
5442  */
5443  __pyx_v_order = 'C';
5444 
5445  /* "View.MemoryView":162
5446  * elif mode == 'c':
5447  * order = b'C'
5448  * self.mode = u'c' # <<<<<<<<<<<<<<
5449  * else:
5450  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
5451  */
5452  __Pyx_INCREF(__pyx_n_u_c);
5453  __Pyx_GIVEREF(__pyx_n_u_c);
5454  __Pyx_GOTREF(__pyx_v_self->mode);
5455  __Pyx_DECREF(__pyx_v_self->mode);
5456  __pyx_v_self->mode = __pyx_n_u_c;
5457 
5458  /* "View.MemoryView":160
5459  * order = b'F'
5460  * self.mode = u'fortran'
5461  * elif mode == 'c': # <<<<<<<<<<<<<<
5462  * order = b'C'
5463  * self.mode = u'c'
5464  */
5465  goto __pyx_L10;
5466  }
5467 
5468  /* "View.MemoryView":164
5469  * self.mode = u'c'
5470  * else:
5471  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
5472  *
5473  * self.len = fill_contig_strides_array(self._shape, self._strides,
5474  */
5475  /*else*/ {
5476  __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(0, 164, __pyx_L1_error)
5477  __Pyx_GOTREF(__pyx_t_3);
5478  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 164, __pyx_L1_error)
5479  __Pyx_GOTREF(__pyx_t_10);
5480  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5481  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
5482  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5483  __PYX_ERR(0, 164, __pyx_L1_error)
5484  }
5485  __pyx_L10:;
5486 
5487  /* "View.MemoryView":166
5488  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
5489  *
5490  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
5491  * itemsize, self.ndim, order)
5492  *
5493  */
5494  __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);
5495 
5496  /* "View.MemoryView":169
5497  * itemsize, self.ndim, order)
5498  *
5499  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
5500  * self.dtype_is_object = format == b'O'
5501  * if allocate_buffer:
5502  */
5503  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
5504 
5505  /* "View.MemoryView":170
5506  *
5507  * self.free_data = allocate_buffer
5508  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
5509  * if allocate_buffer:
5510  *
5511  */
5512  __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(0, 170, __pyx_L1_error)
5513  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L1_error)
5514  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5515  __pyx_v_self->dtype_is_object = __pyx_t_4;
5516 
5517  /* "View.MemoryView":171
5518  * self.free_data = allocate_buffer
5519  * self.dtype_is_object = format == b'O'
5520  * if allocate_buffer: # <<<<<<<<<<<<<<
5521  *
5522  *
5523  */
5524  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
5525  if (__pyx_t_4) {
5526 
5527  /* "View.MemoryView":174
5528  *
5529  *
5530  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
5531  * if not self.data:
5532  * raise MemoryError("unable to allocate array data.")
5533  */
5534  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
5535 
5536  /* "View.MemoryView":175
5537  *
5538  * self.data = <char *>malloc(self.len)
5539  * if not self.data: # <<<<<<<<<<<<<<
5540  * raise MemoryError("unable to allocate array data.")
5541  *
5542  */
5543  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
5544  if (unlikely(__pyx_t_4)) {
5545 
5546  /* "View.MemoryView":176
5547  * self.data = <char *>malloc(self.len)
5548  * if not self.data:
5549  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
5550  *
5551  * if self.dtype_is_object:
5552  */
5553  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 176, __pyx_L1_error)
5554  __Pyx_GOTREF(__pyx_t_10);
5555  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
5556  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5557  __PYX_ERR(0, 176, __pyx_L1_error)
5558 
5559  /* "View.MemoryView":175
5560  *
5561  * self.data = <char *>malloc(self.len)
5562  * if not self.data: # <<<<<<<<<<<<<<
5563  * raise MemoryError("unable to allocate array data.")
5564  *
5565  */
5566  }
5567 
5568  /* "View.MemoryView":178
5569  * raise MemoryError("unable to allocate array data.")
5570  *
5571  * if self.dtype_is_object: # <<<<<<<<<<<<<<
5572  * p = <PyObject **> self.data
5573  * for i in range(self.len / itemsize):
5574  */
5575  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
5576  if (__pyx_t_4) {
5577 
5578  /* "View.MemoryView":179
5579  *
5580  * if self.dtype_is_object:
5581  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
5582  * for i in range(self.len / itemsize):
5583  * p[i] = Py_None
5584  */
5585  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
5586 
5587  /* "View.MemoryView":180
5588  * if self.dtype_is_object:
5589  * p = <PyObject **> self.data
5590  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
5591  * p[i] = Py_None
5592  * Py_INCREF(Py_None)
5593  */
5594  if (unlikely(__pyx_v_itemsize == 0)) {
5595  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
5596  __PYX_ERR(0, 180, __pyx_L1_error)
5597  }
5598  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))) {
5599  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
5600  __PYX_ERR(0, 180, __pyx_L1_error)
5601  }
5602  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
5603  __pyx_t_9 = __pyx_t_1;
5604  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
5605  __pyx_v_i = __pyx_t_11;
5606 
5607  /* "View.MemoryView":181
5608  * p = <PyObject **> self.data
5609  * for i in range(self.len / itemsize):
5610  * p[i] = Py_None # <<<<<<<<<<<<<<
5611  * Py_INCREF(Py_None)
5612  *
5613  */
5614  (__pyx_v_p[__pyx_v_i]) = Py_None;
5615 
5616  /* "View.MemoryView":182
5617  * for i in range(self.len / itemsize):
5618  * p[i] = Py_None
5619  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
5620  *
5621  * @cname('getbuffer')
5622  */
5623  Py_INCREF(Py_None);
5624  }
5625 
5626  /* "View.MemoryView":178
5627  * raise MemoryError("unable to allocate array data.")
5628  *
5629  * if self.dtype_is_object: # <<<<<<<<<<<<<<
5630  * p = <PyObject **> self.data
5631  * for i in range(self.len / itemsize):
5632  */
5633  }
5634 
5635  /* "View.MemoryView":171
5636  * self.free_data = allocate_buffer
5637  * self.dtype_is_object = format == b'O'
5638  * if allocate_buffer: # <<<<<<<<<<<<<<
5639  *
5640  *
5641  */
5642  }
5643 
5644  /* "View.MemoryView":122
5645  * cdef bint dtype_is_object
5646  *
5647  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5648  * mode="c", bint allocate_buffer=True):
5649  *
5650  */
5651 
5652  /* function exit code */
5653  __pyx_r = 0;
5654  goto __pyx_L0;
5655  __pyx_L1_error:;
5656  __Pyx_XDECREF(__pyx_t_3);
5657  __Pyx_XDECREF(__pyx_t_5);
5658  __Pyx_XDECREF(__pyx_t_6);
5659  __Pyx_XDECREF(__pyx_t_10);
5660  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5661  __pyx_r = -1;
5662  __pyx_L0:;
5663  __Pyx_XDECREF(__pyx_v_format);
5664  __Pyx_RefNannyFinishContext();
5665  return __pyx_r;
5666 }
5667 
5668 /* "View.MemoryView":185
5669  *
5670  * @cname('getbuffer')
5671  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
5672  * cdef int bufmode = -1
5673  * if self.mode == u"c":
5674  */
5675 
5676 /* Python wrapper */
5677 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
5678 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5679  int __pyx_r;
5680  __Pyx_RefNannyDeclarations
5681  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
5682  __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));
5683 
5684  /* function exit code */
5685  __Pyx_RefNannyFinishContext();
5686  return __pyx_r;
5687 }
5688 
5689 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) {
5690  int __pyx_v_bufmode;
5691  int __pyx_r;
5692  __Pyx_RefNannyDeclarations
5693  int __pyx_t_1;
5694  int __pyx_t_2;
5695  PyObject *__pyx_t_3 = NULL;
5696  char *__pyx_t_4;
5697  Py_ssize_t __pyx_t_5;
5698  int __pyx_t_6;
5699  Py_ssize_t *__pyx_t_7;
5700  int __pyx_lineno = 0;
5701  const char *__pyx_filename = NULL;
5702  int __pyx_clineno = 0;
5703  if (__pyx_v_info == NULL) {
5704  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
5705  return -1;
5706  }
5707  __Pyx_RefNannySetupContext("__getbuffer__", 0);
5708  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5709  __Pyx_GIVEREF(__pyx_v_info->obj);
5710 
5711  /* "View.MemoryView":186
5712  * @cname('getbuffer')
5713  * def __getbuffer__(self, Py_buffer *info, int flags):
5714  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
5715  * if self.mode == u"c":
5716  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5717  */
5718  __pyx_v_bufmode = -1;
5719 
5720  /* "View.MemoryView":187
5721  * def __getbuffer__(self, Py_buffer *info, int flags):
5722  * cdef int bufmode = -1
5723  * if self.mode == u"c": # <<<<<<<<<<<<<<
5724  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5725  * elif self.mode == u"fortran":
5726  */
5727  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
5728  __pyx_t_2 = (__pyx_t_1 != 0);
5729  if (__pyx_t_2) {
5730 
5731  /* "View.MemoryView":188
5732  * cdef int bufmode = -1
5733  * if self.mode == u"c":
5734  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5735  * elif self.mode == u"fortran":
5736  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5737  */
5738  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5739 
5740  /* "View.MemoryView":187
5741  * def __getbuffer__(self, Py_buffer *info, int flags):
5742  * cdef int bufmode = -1
5743  * if self.mode == u"c": # <<<<<<<<<<<<<<
5744  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5745  * elif self.mode == u"fortran":
5746  */
5747  goto __pyx_L3;
5748  }
5749 
5750  /* "View.MemoryView":189
5751  * if self.mode == u"c":
5752  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5753  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5754  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5755  * if not (flags & bufmode):
5756  */
5757  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 189, __pyx_L1_error)
5758  __pyx_t_1 = (__pyx_t_2 != 0);
5759  if (__pyx_t_1) {
5760 
5761  /* "View.MemoryView":190
5762  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5763  * elif self.mode == u"fortran":
5764  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5765  * if not (flags & bufmode):
5766  * raise ValueError("Can only create a buffer that is contiguous in memory.")
5767  */
5768  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5769 
5770  /* "View.MemoryView":189
5771  * if self.mode == u"c":
5772  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5773  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5774  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5775  * if not (flags & bufmode):
5776  */
5777  }
5778  __pyx_L3:;
5779 
5780  /* "View.MemoryView":191
5781  * elif self.mode == u"fortran":
5782  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5783  * if not (flags & bufmode): # <<<<<<<<<<<<<<
5784  * raise ValueError("Can only create a buffer that is contiguous in memory.")
5785  * info.buf = self.data
5786  */
5787  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
5788  if (unlikely(__pyx_t_1)) {
5789 
5790  /* "View.MemoryView":192
5791  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5792  * if not (flags & bufmode):
5793  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
5794  * info.buf = self.data
5795  * info.len = self.len
5796  */
5797  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
5798  __Pyx_GOTREF(__pyx_t_3);
5799  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5800  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5801  __PYX_ERR(0, 192, __pyx_L1_error)
5802 
5803  /* "View.MemoryView":191
5804  * elif self.mode == u"fortran":
5805  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5806  * if not (flags & bufmode): # <<<<<<<<<<<<<<
5807  * raise ValueError("Can only create a buffer that is contiguous in memory.")
5808  * info.buf = self.data
5809  */
5810  }
5811 
5812  /* "View.MemoryView":193
5813  * if not (flags & bufmode):
5814  * raise ValueError("Can only create a buffer that is contiguous in memory.")
5815  * info.buf = self.data # <<<<<<<<<<<<<<
5816  * info.len = self.len
5817  * info.ndim = self.ndim
5818  */
5819  __pyx_t_4 = __pyx_v_self->data;
5820  __pyx_v_info->buf = __pyx_t_4;
5821 
5822  /* "View.MemoryView":194
5823  * raise ValueError("Can only create a buffer that is contiguous in memory.")
5824  * info.buf = self.data
5825  * info.len = self.len # <<<<<<<<<<<<<<
5826  * info.ndim = self.ndim
5827  * info.shape = self._shape
5828  */
5829  __pyx_t_5 = __pyx_v_self->len;
5830  __pyx_v_info->len = __pyx_t_5;
5831 
5832  /* "View.MemoryView":195
5833  * info.buf = self.data
5834  * info.len = self.len
5835  * info.ndim = self.ndim # <<<<<<<<<<<<<<
5836  * info.shape = self._shape
5837  * info.strides = self._strides
5838  */
5839  __pyx_t_6 = __pyx_v_self->ndim;
5840  __pyx_v_info->ndim = __pyx_t_6;
5841 
5842  /* "View.MemoryView":196
5843  * info.len = self.len
5844  * info.ndim = self.ndim
5845  * info.shape = self._shape # <<<<<<<<<<<<<<
5846  * info.strides = self._strides
5847  * info.suboffsets = NULL
5848  */
5849  __pyx_t_7 = __pyx_v_self->_shape;
5850  __pyx_v_info->shape = __pyx_t_7;
5851 
5852  /* "View.MemoryView":197
5853  * info.ndim = self.ndim
5854  * info.shape = self._shape
5855  * info.strides = self._strides # <<<<<<<<<<<<<<
5856  * info.suboffsets = NULL
5857  * info.itemsize = self.itemsize
5858  */
5859  __pyx_t_7 = __pyx_v_self->_strides;
5860  __pyx_v_info->strides = __pyx_t_7;
5861 
5862  /* "View.MemoryView":198
5863  * info.shape = self._shape
5864  * info.strides = self._strides
5865  * info.suboffsets = NULL # <<<<<<<<<<<<<<
5866  * info.itemsize = self.itemsize
5867  * info.readonly = 0
5868  */
5869  __pyx_v_info->suboffsets = NULL;
5870 
5871  /* "View.MemoryView":199
5872  * info.strides = self._strides
5873  * info.suboffsets = NULL
5874  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
5875  * info.readonly = 0
5876  *
5877  */
5878  __pyx_t_5 = __pyx_v_self->itemsize;
5879  __pyx_v_info->itemsize = __pyx_t_5;
5880 
5881  /* "View.MemoryView":200
5882  * info.suboffsets = NULL
5883  * info.itemsize = self.itemsize
5884  * info.readonly = 0 # <<<<<<<<<<<<<<
5885  *
5886  * if flags & PyBUF_FORMAT:
5887  */
5888  __pyx_v_info->readonly = 0;
5889 
5890  /* "View.MemoryView":202
5891  * info.readonly = 0
5892  *
5893  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
5894  * info.format = self.format
5895  * else:
5896  */
5897  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
5898  if (__pyx_t_1) {
5899 
5900  /* "View.MemoryView":203
5901  *
5902  * if flags & PyBUF_FORMAT:
5903  * info.format = self.format # <<<<<<<<<<<<<<
5904  * else:
5905  * info.format = NULL
5906  */
5907  __pyx_t_4 = __pyx_v_self->format;
5908  __pyx_v_info->format = __pyx_t_4;
5909 
5910  /* "View.MemoryView":202
5911  * info.readonly = 0
5912  *
5913  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
5914  * info.format = self.format
5915  * else:
5916  */
5917  goto __pyx_L5;
5918  }
5919 
5920  /* "View.MemoryView":205
5921  * info.format = self.format
5922  * else:
5923  * info.format = NULL # <<<<<<<<<<<<<<
5924  *
5925  * info.obj = self
5926  */
5927  /*else*/ {
5928  __pyx_v_info->format = NULL;
5929  }
5930  __pyx_L5:;
5931 
5932  /* "View.MemoryView":207
5933  * info.format = NULL
5934  *
5935  * info.obj = self # <<<<<<<<<<<<<<
5936  *
5937  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
5938  */
5939  __Pyx_INCREF(((PyObject *)__pyx_v_self));
5940  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
5941  __Pyx_GOTREF(__pyx_v_info->obj);
5942  __Pyx_DECREF(__pyx_v_info->obj);
5943  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5944 
5945  /* "View.MemoryView":185
5946  *
5947  * @cname('getbuffer')
5948  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
5949  * cdef int bufmode = -1
5950  * if self.mode == u"c":
5951  */
5952 
5953  /* function exit code */
5954  __pyx_r = 0;
5955  goto __pyx_L0;
5956  __pyx_L1_error:;
5957  __Pyx_XDECREF(__pyx_t_3);
5958  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5959  __pyx_r = -1;
5960  if (__pyx_v_info->obj != NULL) {
5961  __Pyx_GOTREF(__pyx_v_info->obj);
5962  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5963  }
5964  goto __pyx_L2;
5965  __pyx_L0:;
5966  if (__pyx_v_info->obj == Py_None) {
5967  __Pyx_GOTREF(__pyx_v_info->obj);
5968  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5969  }
5970  __pyx_L2:;
5971  __Pyx_RefNannyFinishContext();
5972  return __pyx_r;
5973 }
5974 
5975 /* "View.MemoryView":211
5976  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
5977  *
5978  * def __dealloc__(array self): # <<<<<<<<<<<<<<
5979  * if self.callback_free_data != NULL:
5980  * self.callback_free_data(self.data)
5981  */
5982 
5983 /* Python wrapper */
5984 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
5985 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
5986  __Pyx_RefNannyDeclarations
5987  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
5988  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
5989 
5990  /* function exit code */
5991  __Pyx_RefNannyFinishContext();
5992 }
5993 
5994 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
5995  __Pyx_RefNannyDeclarations
5996  int __pyx_t_1;
5997  __Pyx_RefNannySetupContext("__dealloc__", 0);
5998 
5999  /* "View.MemoryView":212
6000  *
6001  * def __dealloc__(array self):
6002  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
6003  * self.callback_free_data(self.data)
6004  * elif self.free_data:
6005  */
6006  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
6007  if (__pyx_t_1) {
6008 
6009  /* "View.MemoryView":213
6010  * def __dealloc__(array self):
6011  * if self.callback_free_data != NULL:
6012  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
6013  * elif self.free_data:
6014  * if self.dtype_is_object:
6015  */
6016  __pyx_v_self->callback_free_data(__pyx_v_self->data);
6017 
6018  /* "View.MemoryView":212
6019  *
6020  * def __dealloc__(array self):
6021  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
6022  * self.callback_free_data(self.data)
6023  * elif self.free_data:
6024  */
6025  goto __pyx_L3;
6026  }
6027 
6028  /* "View.MemoryView":214
6029  * if self.callback_free_data != NULL:
6030  * self.callback_free_data(self.data)
6031  * elif self.free_data: # <<<<<<<<<<<<<<
6032  * if self.dtype_is_object:
6033  * refcount_objects_in_slice(self.data, self._shape,
6034  */
6035  __pyx_t_1 = (__pyx_v_self->free_data != 0);
6036  if (__pyx_t_1) {
6037 
6038  /* "View.MemoryView":215
6039  * self.callback_free_data(self.data)
6040  * elif self.free_data:
6041  * if self.dtype_is_object: # <<<<<<<<<<<<<<
6042  * refcount_objects_in_slice(self.data, self._shape,
6043  * self._strides, self.ndim, False)
6044  */
6045  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
6046  if (__pyx_t_1) {
6047 
6048  /* "View.MemoryView":216
6049  * elif self.free_data:
6050  * if self.dtype_is_object:
6051  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
6052  * self._strides, self.ndim, False)
6053  * free(self.data)
6054  */
6055  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
6056 
6057  /* "View.MemoryView":215
6058  * self.callback_free_data(self.data)
6059  * elif self.free_data:
6060  * if self.dtype_is_object: # <<<<<<<<<<<<<<
6061  * refcount_objects_in_slice(self.data, self._shape,
6062  * self._strides, self.ndim, False)
6063  */
6064  }
6065 
6066  /* "View.MemoryView":218
6067  * refcount_objects_in_slice(self.data, self._shape,
6068  * self._strides, self.ndim, False)
6069  * free(self.data) # <<<<<<<<<<<<<<
6070  * PyObject_Free(self._shape)
6071  *
6072  */
6073  free(__pyx_v_self->data);
6074 
6075  /* "View.MemoryView":214
6076  * if self.callback_free_data != NULL:
6077  * self.callback_free_data(self.data)
6078  * elif self.free_data: # <<<<<<<<<<<<<<
6079  * if self.dtype_is_object:
6080  * refcount_objects_in_slice(self.data, self._shape,
6081  */
6082  }
6083  __pyx_L3:;
6084 
6085  /* "View.MemoryView":219
6086  * self._strides, self.ndim, False)
6087  * free(self.data)
6088  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
6089  *
6090  * @property
6091  */
6092  PyObject_Free(__pyx_v_self->_shape);
6093 
6094  /* "View.MemoryView":211
6095  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
6096  *
6097  * def __dealloc__(array self): # <<<<<<<<<<<<<<
6098  * if self.callback_free_data != NULL:
6099  * self.callback_free_data(self.data)
6100  */
6101 
6102  /* function exit code */
6103  __Pyx_RefNannyFinishContext();
6104 }
6105 
6106 /* "View.MemoryView":222
6107  *
6108  * @property
6109  * def memview(self): # <<<<<<<<<<<<<<
6110  * return self.get_memview()
6111  *
6112  */
6113 
6114 /* Python wrapper */
6115 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
6116 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
6117  PyObject *__pyx_r = 0;
6118  __Pyx_RefNannyDeclarations
6119  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6120  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
6121 
6122  /* function exit code */
6123  __Pyx_RefNannyFinishContext();
6124  return __pyx_r;
6125 }
6126 
6127 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
6128  PyObject *__pyx_r = NULL;
6129  __Pyx_RefNannyDeclarations
6130  PyObject *__pyx_t_1 = NULL;
6131  int __pyx_lineno = 0;
6132  const char *__pyx_filename = NULL;
6133  int __pyx_clineno = 0;
6134  __Pyx_RefNannySetupContext("__get__", 0);
6135 
6136  /* "View.MemoryView":223
6137  * @property
6138  * def memview(self):
6139  * return self.get_memview() # <<<<<<<<<<<<<<
6140  *
6141  * @cname('get_memview')
6142  */
6143  __Pyx_XDECREF(__pyx_r);
6144  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
6145  __Pyx_GOTREF(__pyx_t_1);
6146  __pyx_r = __pyx_t_1;
6147  __pyx_t_1 = 0;
6148  goto __pyx_L0;
6149 
6150  /* "View.MemoryView":222
6151  *
6152  * @property
6153  * def memview(self): # <<<<<<<<<<<<<<
6154  * return self.get_memview()
6155  *
6156  */
6157 
6158  /* function exit code */
6159  __pyx_L1_error:;
6160  __Pyx_XDECREF(__pyx_t_1);
6161  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6162  __pyx_r = NULL;
6163  __pyx_L0:;
6164  __Pyx_XGIVEREF(__pyx_r);
6165  __Pyx_RefNannyFinishContext();
6166  return __pyx_r;
6167 }
6168 
6169 /* "View.MemoryView":226
6170  *
6171  * @cname('get_memview')
6172  * cdef get_memview(self): # <<<<<<<<<<<<<<
6173  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6174  * return memoryview(self, flags, self.dtype_is_object)
6175  */
6176 
6177 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
6178  int __pyx_v_flags;
6179  PyObject *__pyx_r = NULL;
6180  __Pyx_RefNannyDeclarations
6181  PyObject *__pyx_t_1 = NULL;
6182  PyObject *__pyx_t_2 = NULL;
6183  PyObject *__pyx_t_3 = NULL;
6184  int __pyx_lineno = 0;
6185  const char *__pyx_filename = NULL;
6186  int __pyx_clineno = 0;
6187  __Pyx_RefNannySetupContext("get_memview", 0);
6188 
6189  /* "View.MemoryView":227
6190  * @cname('get_memview')
6191  * cdef get_memview(self):
6192  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
6193  * return memoryview(self, flags, self.dtype_is_object)
6194  *
6195  */
6196  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
6197 
6198  /* "View.MemoryView":228
6199  * cdef get_memview(self):
6200  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6201  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
6202  *
6203  * def __len__(self):
6204  */
6205  __Pyx_XDECREF(__pyx_r);
6206  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
6207  __Pyx_GOTREF(__pyx_t_1);
6208  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
6209  __Pyx_GOTREF(__pyx_t_2);
6210  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
6211  __Pyx_GOTREF(__pyx_t_3);
6212  __Pyx_INCREF(((PyObject *)__pyx_v_self));
6213  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6214  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
6215  __Pyx_GIVEREF(__pyx_t_1);
6216  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
6217  __Pyx_GIVEREF(__pyx_t_2);
6218  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
6219  __pyx_t_1 = 0;
6220  __pyx_t_2 = 0;
6221  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
6222  __Pyx_GOTREF(__pyx_t_2);
6223  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6224  __pyx_r = __pyx_t_2;
6225  __pyx_t_2 = 0;
6226  goto __pyx_L0;
6227 
6228  /* "View.MemoryView":226
6229  *
6230  * @cname('get_memview')
6231  * cdef get_memview(self): # <<<<<<<<<<<<<<
6232  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6233  * return memoryview(self, flags, self.dtype_is_object)
6234  */
6235 
6236  /* function exit code */
6237  __pyx_L1_error:;
6238  __Pyx_XDECREF(__pyx_t_1);
6239  __Pyx_XDECREF(__pyx_t_2);
6240  __Pyx_XDECREF(__pyx_t_3);
6241  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
6242  __pyx_r = 0;
6243  __pyx_L0:;
6244  __Pyx_XGIVEREF(__pyx_r);
6245  __Pyx_RefNannyFinishContext();
6246  return __pyx_r;
6247 }
6248 
6249 /* "View.MemoryView":230
6250  * return memoryview(self, flags, self.dtype_is_object)
6251  *
6252  * def __len__(self): # <<<<<<<<<<<<<<
6253  * return self._shape[0]
6254  *
6255  */
6256 
6257 /* Python wrapper */
6258 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
6259 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
6260  Py_ssize_t __pyx_r;
6261  __Pyx_RefNannyDeclarations
6262  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
6263  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
6264 
6265  /* function exit code */
6266  __Pyx_RefNannyFinishContext();
6267  return __pyx_r;
6268 }
6269 
6270 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
6271  Py_ssize_t __pyx_r;
6272  __Pyx_RefNannyDeclarations
6273  __Pyx_RefNannySetupContext("__len__", 0);
6274 
6275  /* "View.MemoryView":231
6276  *
6277  * def __len__(self):
6278  * return self._shape[0] # <<<<<<<<<<<<<<
6279  *
6280  * def __getattr__(self, attr):
6281  */
6282  __pyx_r = (__pyx_v_self->_shape[0]);
6283  goto __pyx_L0;
6284 
6285  /* "View.MemoryView":230
6286  * return memoryview(self, flags, self.dtype_is_object)
6287  *
6288  * def __len__(self): # <<<<<<<<<<<<<<
6289  * return self._shape[0]
6290  *
6291  */
6292 
6293  /* function exit code */
6294  __pyx_L0:;
6295  __Pyx_RefNannyFinishContext();
6296  return __pyx_r;
6297 }
6298 
6299 /* "View.MemoryView":233
6300  * return self._shape[0]
6301  *
6302  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6303  * return getattr(self.memview, attr)
6304  *
6305  */
6306 
6307 /* Python wrapper */
6308 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
6309 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
6310  PyObject *__pyx_r = 0;
6311  __Pyx_RefNannyDeclarations
6312  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
6313  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
6314 
6315  /* function exit code */
6316  __Pyx_RefNannyFinishContext();
6317  return __pyx_r;
6318 }
6319 
6320 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
6321  PyObject *__pyx_r = NULL;
6322  __Pyx_RefNannyDeclarations
6323  PyObject *__pyx_t_1 = NULL;
6324  PyObject *__pyx_t_2 = NULL;
6325  int __pyx_lineno = 0;
6326  const char *__pyx_filename = NULL;
6327  int __pyx_clineno = 0;
6328  __Pyx_RefNannySetupContext("__getattr__", 0);
6329 
6330  /* "View.MemoryView":234
6331  *
6332  * def __getattr__(self, attr):
6333  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
6334  *
6335  * def __getitem__(self, item):
6336  */
6337  __Pyx_XDECREF(__pyx_r);
6338  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
6339  __Pyx_GOTREF(__pyx_t_1);
6340  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
6341  __Pyx_GOTREF(__pyx_t_2);
6342  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6343  __pyx_r = __pyx_t_2;
6344  __pyx_t_2 = 0;
6345  goto __pyx_L0;
6346 
6347  /* "View.MemoryView":233
6348  * return self._shape[0]
6349  *
6350  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6351  * return getattr(self.memview, attr)
6352  *
6353  */
6354 
6355  /* function exit code */
6356  __pyx_L1_error:;
6357  __Pyx_XDECREF(__pyx_t_1);
6358  __Pyx_XDECREF(__pyx_t_2);
6359  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6360  __pyx_r = NULL;
6361  __pyx_L0:;
6362  __Pyx_XGIVEREF(__pyx_r);
6363  __Pyx_RefNannyFinishContext();
6364  return __pyx_r;
6365 }
6366 
6367 /* "View.MemoryView":236
6368  * return getattr(self.memview, attr)
6369  *
6370  * def __getitem__(self, item): # <<<<<<<<<<<<<<
6371  * return self.memview[item]
6372  *
6373  */
6374 
6375 /* Python wrapper */
6376 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
6377 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
6378  PyObject *__pyx_r = 0;
6379  __Pyx_RefNannyDeclarations
6380  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
6381  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
6382 
6383  /* function exit code */
6384  __Pyx_RefNannyFinishContext();
6385  return __pyx_r;
6386 }
6387 
6388 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
6389  PyObject *__pyx_r = NULL;
6390  __Pyx_RefNannyDeclarations
6391  PyObject *__pyx_t_1 = NULL;
6392  PyObject *__pyx_t_2 = NULL;
6393  int __pyx_lineno = 0;
6394  const char *__pyx_filename = NULL;
6395  int __pyx_clineno = 0;
6396  __Pyx_RefNannySetupContext("__getitem__", 0);
6397 
6398  /* "View.MemoryView":237
6399  *
6400  * def __getitem__(self, item):
6401  * return self.memview[item] # <<<<<<<<<<<<<<
6402  *
6403  * def __setitem__(self, item, value):
6404  */
6405  __Pyx_XDECREF(__pyx_r);
6406  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
6407  __Pyx_GOTREF(__pyx_t_1);
6408  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
6409  __Pyx_GOTREF(__pyx_t_2);
6410  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6411  __pyx_r = __pyx_t_2;
6412  __pyx_t_2 = 0;
6413  goto __pyx_L0;
6414 
6415  /* "View.MemoryView":236
6416  * return getattr(self.memview, attr)
6417  *
6418  * def __getitem__(self, item): # <<<<<<<<<<<<<<
6419  * return self.memview[item]
6420  *
6421  */
6422 
6423  /* function exit code */
6424  __pyx_L1_error:;
6425  __Pyx_XDECREF(__pyx_t_1);
6426  __Pyx_XDECREF(__pyx_t_2);
6427  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6428  __pyx_r = NULL;
6429  __pyx_L0:;
6430  __Pyx_XGIVEREF(__pyx_r);
6431  __Pyx_RefNannyFinishContext();
6432  return __pyx_r;
6433 }
6434 
6435 /* "View.MemoryView":239
6436  * return self.memview[item]
6437  *
6438  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6439  * self.memview[item] = value
6440  *
6441  */
6442 
6443 /* Python wrapper */
6444 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
6445 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6446  int __pyx_r;
6447  __Pyx_RefNannyDeclarations
6448  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
6449  __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));
6450 
6451  /* function exit code */
6452  __Pyx_RefNannyFinishContext();
6453  return __pyx_r;
6454 }
6455 
6456 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) {
6457  int __pyx_r;
6458  __Pyx_RefNannyDeclarations
6459  PyObject *__pyx_t_1 = NULL;
6460  int __pyx_lineno = 0;
6461  const char *__pyx_filename = NULL;
6462  int __pyx_clineno = 0;
6463  __Pyx_RefNannySetupContext("__setitem__", 0);
6464 
6465  /* "View.MemoryView":240
6466  *
6467  * def __setitem__(self, item, value):
6468  * self.memview[item] = value # <<<<<<<<<<<<<<
6469  *
6470  *
6471  */
6472  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
6473  __Pyx_GOTREF(__pyx_t_1);
6474  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
6475  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6476 
6477  /* "View.MemoryView":239
6478  * return self.memview[item]
6479  *
6480  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6481  * self.memview[item] = value
6482  *
6483  */
6484 
6485  /* function exit code */
6486  __pyx_r = 0;
6487  goto __pyx_L0;
6488  __pyx_L1_error:;
6489  __Pyx_XDECREF(__pyx_t_1);
6490  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6491  __pyx_r = -1;
6492  __pyx_L0:;
6493  __Pyx_RefNannyFinishContext();
6494  return __pyx_r;
6495 }
6496 
6497 /* "(tree fragment)":1
6498  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6499  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6500  * def __setstate_cython__(self, __pyx_state):
6501  */
6502 
6503 /* Python wrapper */
6504 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6505 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6506  PyObject *__pyx_r = 0;
6507  __Pyx_RefNannyDeclarations
6508  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6509  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
6510 
6511  /* function exit code */
6512  __Pyx_RefNannyFinishContext();
6513  return __pyx_r;
6514 }
6515 
6516 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
6517  PyObject *__pyx_r = NULL;
6518  __Pyx_RefNannyDeclarations
6519  PyObject *__pyx_t_1 = NULL;
6520  int __pyx_lineno = 0;
6521  const char *__pyx_filename = NULL;
6522  int __pyx_clineno = 0;
6523  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6524 
6525  /* "(tree fragment)":2
6526  * def __reduce_cython__(self):
6527  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
6528  * def __setstate_cython__(self, __pyx_state):
6529  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6530  */
6531  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
6532  __Pyx_GOTREF(__pyx_t_1);
6533  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6534  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6535  __PYX_ERR(0, 2, __pyx_L1_error)
6536 
6537  /* "(tree fragment)":1
6538  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6539  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6540  * def __setstate_cython__(self, __pyx_state):
6541  */
6542 
6543  /* function exit code */
6544  __pyx_L1_error:;
6545  __Pyx_XDECREF(__pyx_t_1);
6546  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6547  __pyx_r = NULL;
6548  __Pyx_XGIVEREF(__pyx_r);
6549  __Pyx_RefNannyFinishContext();
6550  return __pyx_r;
6551 }
6552 
6553 /* "(tree fragment)":3
6554  * def __reduce_cython__(self):
6555  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6556  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6557  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6558  */
6559 
6560 /* Python wrapper */
6561 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
6562 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6563  PyObject *__pyx_r = 0;
6564  __Pyx_RefNannyDeclarations
6565  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6566  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6567 
6568  /* function exit code */
6569  __Pyx_RefNannyFinishContext();
6570  return __pyx_r;
6571 }
6572 
6573 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) {
6574  PyObject *__pyx_r = NULL;
6575  __Pyx_RefNannyDeclarations
6576  PyObject *__pyx_t_1 = NULL;
6577  int __pyx_lineno = 0;
6578  const char *__pyx_filename = NULL;
6579  int __pyx_clineno = 0;
6580  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6581 
6582  /* "(tree fragment)":4
6583  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6584  * def __setstate_cython__(self, __pyx_state):
6585  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
6586  */
6587  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
6588  __Pyx_GOTREF(__pyx_t_1);
6589  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6590  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6591  __PYX_ERR(0, 4, __pyx_L1_error)
6592 
6593  /* "(tree fragment)":3
6594  * def __reduce_cython__(self):
6595  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6596  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6597  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6598  */
6599 
6600  /* function exit code */
6601  __pyx_L1_error:;
6602  __Pyx_XDECREF(__pyx_t_1);
6603  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6604  __pyx_r = NULL;
6605  __Pyx_XGIVEREF(__pyx_r);
6606  __Pyx_RefNannyFinishContext();
6607  return __pyx_r;
6608 }
6609 
6610 /* "View.MemoryView":244
6611  *
6612  * @cname("__pyx_array_new")
6613  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
6614  * char *mode, char *buf):
6615  * cdef array result
6616  */
6617 
6618 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) {
6619  struct __pyx_array_obj *__pyx_v_result = 0;
6620  struct __pyx_array_obj *__pyx_r = NULL;
6621  __Pyx_RefNannyDeclarations
6622  int __pyx_t_1;
6623  PyObject *__pyx_t_2 = NULL;
6624  PyObject *__pyx_t_3 = NULL;
6625  PyObject *__pyx_t_4 = NULL;
6626  PyObject *__pyx_t_5 = NULL;
6627  int __pyx_lineno = 0;
6628  const char *__pyx_filename = NULL;
6629  int __pyx_clineno = 0;
6630  __Pyx_RefNannySetupContext("array_cwrapper", 0);
6631 
6632  /* "View.MemoryView":248
6633  * cdef array result
6634  *
6635  * if buf == NULL: # <<<<<<<<<<<<<<
6636  * result = array(shape, itemsize, format, mode.decode('ASCII'))
6637  * else:
6638  */
6639  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
6640  if (__pyx_t_1) {
6641 
6642  /* "View.MemoryView":249
6643  *
6644  * if buf == NULL:
6645  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
6646  * else:
6647  * result = array(shape, itemsize, format, mode.decode('ASCII'),
6648  */
6649  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
6650  __Pyx_GOTREF(__pyx_t_2);
6651  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
6652  __Pyx_GOTREF(__pyx_t_3);
6653  __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(0, 249, __pyx_L1_error)
6654  __Pyx_GOTREF(__pyx_t_4);
6655  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error)
6656  __Pyx_GOTREF(__pyx_t_5);
6657  __Pyx_INCREF(__pyx_v_shape);
6658  __Pyx_GIVEREF(__pyx_v_shape);
6659  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
6660  __Pyx_GIVEREF(__pyx_t_2);
6661  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
6662  __Pyx_GIVEREF(__pyx_t_3);
6663  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
6664  __Pyx_GIVEREF(__pyx_t_4);
6665  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
6666  __pyx_t_2 = 0;
6667  __pyx_t_3 = 0;
6668  __pyx_t_4 = 0;
6669  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
6670  __Pyx_GOTREF(__pyx_t_4);
6671  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6672  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
6673  __pyx_t_4 = 0;
6674 
6675  /* "View.MemoryView":248
6676  * cdef array result
6677  *
6678  * if buf == NULL: # <<<<<<<<<<<<<<
6679  * result = array(shape, itemsize, format, mode.decode('ASCII'))
6680  * else:
6681  */
6682  goto __pyx_L3;
6683  }
6684 
6685  /* "View.MemoryView":251
6686  * result = array(shape, itemsize, format, mode.decode('ASCII'))
6687  * else:
6688  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
6689  * allocate_buffer=False)
6690  * result.data = buf
6691  */
6692  /*else*/ {
6693  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
6694  __Pyx_GOTREF(__pyx_t_4);
6695  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error)
6696  __Pyx_GOTREF(__pyx_t_5);
6697  __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(0, 251, __pyx_L1_error)
6698  __Pyx_GOTREF(__pyx_t_3);
6699  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
6700  __Pyx_GOTREF(__pyx_t_2);
6701  __Pyx_INCREF(__pyx_v_shape);
6702  __Pyx_GIVEREF(__pyx_v_shape);
6703  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
6704  __Pyx_GIVEREF(__pyx_t_4);
6705  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
6706  __Pyx_GIVEREF(__pyx_t_5);
6707  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
6708  __Pyx_GIVEREF(__pyx_t_3);
6709  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
6710  __pyx_t_4 = 0;
6711  __pyx_t_5 = 0;
6712  __pyx_t_3 = 0;
6713 
6714  /* "View.MemoryView":252
6715  * else:
6716  * result = array(shape, itemsize, format, mode.decode('ASCII'),
6717  * allocate_buffer=False) # <<<<<<<<<<<<<<
6718  * result.data = buf
6719  *
6720  */
6721  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
6722  __Pyx_GOTREF(__pyx_t_3);
6723  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
6724 
6725  /* "View.MemoryView":251
6726  * result = array(shape, itemsize, format, mode.decode('ASCII'))
6727  * else:
6728  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
6729  * allocate_buffer=False)
6730  * result.data = buf
6731  */
6732  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error)
6733  __Pyx_GOTREF(__pyx_t_5);
6734  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6735  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6736  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
6737  __pyx_t_5 = 0;
6738 
6739  /* "View.MemoryView":253
6740  * result = array(shape, itemsize, format, mode.decode('ASCII'),
6741  * allocate_buffer=False)
6742  * result.data = buf # <<<<<<<<<<<<<<
6743  *
6744  * return result
6745  */
6746  __pyx_v_result->data = __pyx_v_buf;
6747  }
6748  __pyx_L3:;
6749 
6750  /* "View.MemoryView":255
6751  * result.data = buf
6752  *
6753  * return result # <<<<<<<<<<<<<<
6754  *
6755  *
6756  */
6757  __Pyx_XDECREF(((PyObject *)__pyx_r));
6758  __Pyx_INCREF(((PyObject *)__pyx_v_result));
6759  __pyx_r = __pyx_v_result;
6760  goto __pyx_L0;
6761 
6762  /* "View.MemoryView":244
6763  *
6764  * @cname("__pyx_array_new")
6765  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
6766  * char *mode, char *buf):
6767  * cdef array result
6768  */
6769 
6770  /* function exit code */
6771  __pyx_L1_error:;
6772  __Pyx_XDECREF(__pyx_t_2);
6773  __Pyx_XDECREF(__pyx_t_3);
6774  __Pyx_XDECREF(__pyx_t_4);
6775  __Pyx_XDECREF(__pyx_t_5);
6776  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
6777  __pyx_r = 0;
6778  __pyx_L0:;
6779  __Pyx_XDECREF((PyObject *)__pyx_v_result);
6780  __Pyx_XGIVEREF((PyObject *)__pyx_r);
6781  __Pyx_RefNannyFinishContext();
6782  return __pyx_r;
6783 }
6784 
6785 /* "View.MemoryView":281
6786  * cdef class Enum(object):
6787  * cdef object name
6788  * def __init__(self, name): # <<<<<<<<<<<<<<
6789  * self.name = name
6790  * def __repr__(self):
6791  */
6792 
6793 /* Python wrapper */
6794 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6795 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6796  PyObject *__pyx_v_name = 0;
6797  int __pyx_lineno = 0;
6798  const char *__pyx_filename = NULL;
6799  int __pyx_clineno = 0;
6800  int __pyx_r;
6801  __Pyx_RefNannyDeclarations
6802  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
6803  {
6804  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
6805  PyObject* values[1] = {0};
6806  if (unlikely(__pyx_kwds)) {
6807  Py_ssize_t kw_args;
6808  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6809  switch (pos_args) {
6810  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6811  CYTHON_FALLTHROUGH;
6812  case 0: break;
6813  default: goto __pyx_L5_argtuple_error;
6814  }
6815  kw_args = PyDict_Size(__pyx_kwds);
6816  switch (pos_args) {
6817  case 0:
6818  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
6819  else goto __pyx_L5_argtuple_error;
6820  }
6821  if (unlikely(kw_args > 0)) {
6822  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 281, __pyx_L3_error)
6823  }
6824  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
6825  goto __pyx_L5_argtuple_error;
6826  } else {
6827  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6828  }
6829  __pyx_v_name = values[0];
6830  }
6831  goto __pyx_L4_argument_unpacking_done;
6832  __pyx_L5_argtuple_error:;
6833  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 281, __pyx_L3_error)
6834  __pyx_L3_error:;
6835  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6836  __Pyx_RefNannyFinishContext();
6837  return -1;
6838  __pyx_L4_argument_unpacking_done:;
6839  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
6840 
6841  /* function exit code */
6842  __Pyx_RefNannyFinishContext();
6843  return __pyx_r;
6844 }
6845 
6846 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
6847  int __pyx_r;
6848  __Pyx_RefNannyDeclarations
6849  __Pyx_RefNannySetupContext("__init__", 0);
6850 
6851  /* "View.MemoryView":282
6852  * cdef object name
6853  * def __init__(self, name):
6854  * self.name = name # <<<<<<<<<<<<<<
6855  * def __repr__(self):
6856  * return self.name
6857  */
6858  __Pyx_INCREF(__pyx_v_name);
6859  __Pyx_GIVEREF(__pyx_v_name);
6860  __Pyx_GOTREF(__pyx_v_self->name);
6861  __Pyx_DECREF(__pyx_v_self->name);
6862  __pyx_v_self->name = __pyx_v_name;
6863 
6864  /* "View.MemoryView":281
6865  * cdef class Enum(object):
6866  * cdef object name
6867  * def __init__(self, name): # <<<<<<<<<<<<<<
6868  * self.name = name
6869  * def __repr__(self):
6870  */
6871 
6872  /* function exit code */
6873  __pyx_r = 0;
6874  __Pyx_RefNannyFinishContext();
6875  return __pyx_r;
6876 }
6877 
6878 /* "View.MemoryView":283
6879  * def __init__(self, name):
6880  * self.name = name
6881  * def __repr__(self): # <<<<<<<<<<<<<<
6882  * return self.name
6883  *
6884  */
6885 
6886 /* Python wrapper */
6887 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
6888 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
6889  PyObject *__pyx_r = 0;
6890  __Pyx_RefNannyDeclarations
6891  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
6892  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
6893 
6894  /* function exit code */
6895  __Pyx_RefNannyFinishContext();
6896  return __pyx_r;
6897 }
6898 
6899 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
6900  PyObject *__pyx_r = NULL;
6901  __Pyx_RefNannyDeclarations
6902  __Pyx_RefNannySetupContext("__repr__", 0);
6903 
6904  /* "View.MemoryView":284
6905  * self.name = name
6906  * def __repr__(self):
6907  * return self.name # <<<<<<<<<<<<<<
6908  *
6909  * cdef generic = Enum("<strided and direct or indirect>")
6910  */
6911  __Pyx_XDECREF(__pyx_r);
6912  __Pyx_INCREF(__pyx_v_self->name);
6913  __pyx_r = __pyx_v_self->name;
6914  goto __pyx_L0;
6915 
6916  /* "View.MemoryView":283
6917  * def __init__(self, name):
6918  * self.name = name
6919  * def __repr__(self): # <<<<<<<<<<<<<<
6920  * return self.name
6921  *
6922  */
6923 
6924  /* function exit code */
6925  __pyx_L0:;
6926  __Pyx_XGIVEREF(__pyx_r);
6927  __Pyx_RefNannyFinishContext();
6928  return __pyx_r;
6929 }
6930 
6931 /* "(tree fragment)":1
6932  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6933  * cdef tuple state
6934  * cdef object _dict
6935  */
6936 
6937 /* Python wrapper */
6938 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6939 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6940  PyObject *__pyx_r = 0;
6941  __Pyx_RefNannyDeclarations
6942  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6943  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
6944 
6945  /* function exit code */
6946  __Pyx_RefNannyFinishContext();
6947  return __pyx_r;
6948 }
6949 
6950 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
6951  PyObject *__pyx_v_state = 0;
6952  PyObject *__pyx_v__dict = 0;
6953  int __pyx_v_use_setstate;
6954  PyObject *__pyx_r = NULL;
6955  __Pyx_RefNannyDeclarations
6956  PyObject *__pyx_t_1 = NULL;
6957  int __pyx_t_2;
6958  int __pyx_t_3;
6959  PyObject *__pyx_t_4 = NULL;
6960  PyObject *__pyx_t_5 = NULL;
6961  int __pyx_lineno = 0;
6962  const char *__pyx_filename = NULL;
6963  int __pyx_clineno = 0;
6964  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6965 
6966  /* "(tree fragment)":5
6967  * cdef object _dict
6968  * cdef bint use_setstate
6969  * state = (self.name,) # <<<<<<<<<<<<<<
6970  * _dict = getattr(self, '__dict__', None)
6971  * if _dict is not None:
6972  */
6973  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
6974  __Pyx_GOTREF(__pyx_t_1);
6975  __Pyx_INCREF(__pyx_v_self->name);
6976  __Pyx_GIVEREF(__pyx_v_self->name);
6977  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
6978  __pyx_v_state = ((PyObject*)__pyx_t_1);
6979  __pyx_t_1 = 0;
6980 
6981  /* "(tree fragment)":6
6982  * cdef bint use_setstate
6983  * state = (self.name,)
6984  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
6985  * if _dict is not None:
6986  * state += (_dict,)
6987  */
6988  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
6989  __Pyx_GOTREF(__pyx_t_1);
6990  __pyx_v__dict = __pyx_t_1;
6991  __pyx_t_1 = 0;
6992 
6993  /* "(tree fragment)":7
6994  * state = (self.name,)
6995  * _dict = getattr(self, '__dict__', None)
6996  * if _dict is not None: # <<<<<<<<<<<<<<
6997  * state += (_dict,)
6998  * use_setstate = True
6999  */
7000  __pyx_t_2 = (__pyx_v__dict != Py_None);
7001  __pyx_t_3 = (__pyx_t_2 != 0);
7002  if (__pyx_t_3) {
7003 
7004  /* "(tree fragment)":8
7005  * _dict = getattr(self, '__dict__', None)
7006  * if _dict is not None:
7007  * state += (_dict,) # <<<<<<<<<<<<<<
7008  * use_setstate = True
7009  * else:
7010  */
7011  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
7012  __Pyx_GOTREF(__pyx_t_1);
7013  __Pyx_INCREF(__pyx_v__dict);
7014  __Pyx_GIVEREF(__pyx_v__dict);
7015  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
7016  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error)
7017  __Pyx_GOTREF(__pyx_t_4);
7018  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7019  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
7020  __pyx_t_4 = 0;
7021 
7022  /* "(tree fragment)":9
7023  * if _dict is not None:
7024  * state += (_dict,)
7025  * use_setstate = True # <<<<<<<<<<<<<<
7026  * else:
7027  * use_setstate = self.name is not None
7028  */
7029  __pyx_v_use_setstate = 1;
7030 
7031  /* "(tree fragment)":7
7032  * state = (self.name,)
7033  * _dict = getattr(self, '__dict__', None)
7034  * if _dict is not None: # <<<<<<<<<<<<<<
7035  * state += (_dict,)
7036  * use_setstate = True
7037  */
7038  goto __pyx_L3;
7039  }
7040 
7041  /* "(tree fragment)":11
7042  * use_setstate = True
7043  * else:
7044  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
7045  * if use_setstate:
7046  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
7047  */
7048  /*else*/ {
7049  __pyx_t_3 = (__pyx_v_self->name != Py_None);
7050  __pyx_v_use_setstate = __pyx_t_3;
7051  }
7052  __pyx_L3:;
7053 
7054  /* "(tree fragment)":12
7055  * else:
7056  * use_setstate = self.name is not None
7057  * if use_setstate: # <<<<<<<<<<<<<<
7058  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
7059  * else:
7060  */
7061  __pyx_t_3 = (__pyx_v_use_setstate != 0);
7062  if (__pyx_t_3) {
7063 
7064  /* "(tree fragment)":13
7065  * use_setstate = self.name is not None
7066  * if use_setstate:
7067  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
7068  * else:
7069  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
7070  */
7071  __Pyx_XDECREF(__pyx_r);
7072  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error)
7073  __Pyx_GOTREF(__pyx_t_4);
7074  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
7075  __Pyx_GOTREF(__pyx_t_1);
7076  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7077  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7078  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7079  __Pyx_INCREF(__pyx_int_184977713);
7080  __Pyx_GIVEREF(__pyx_int_184977713);
7081  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
7082  __Pyx_INCREF(Py_None);
7083  __Pyx_GIVEREF(Py_None);
7084  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
7085  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error)
7086  __Pyx_GOTREF(__pyx_t_5);
7087  __Pyx_GIVEREF(__pyx_t_4);
7088  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
7089  __Pyx_GIVEREF(__pyx_t_1);
7090  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
7091  __Pyx_INCREF(__pyx_v_state);
7092  __Pyx_GIVEREF(__pyx_v_state);
7093  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
7094  __pyx_t_4 = 0;
7095  __pyx_t_1 = 0;
7096  __pyx_r = __pyx_t_5;
7097  __pyx_t_5 = 0;
7098  goto __pyx_L0;
7099 
7100  /* "(tree fragment)":12
7101  * else:
7102  * use_setstate = self.name is not None
7103  * if use_setstate: # <<<<<<<<<<<<<<
7104  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
7105  * else:
7106  */
7107  }
7108 
7109  /* "(tree fragment)":15
7110  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
7111  * else:
7112  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
7113  * def __setstate_cython__(self, __pyx_state):
7114  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7115  */
7116  /*else*/ {
7117  __Pyx_XDECREF(__pyx_r);
7118  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 15, __pyx_L1_error)
7119  __Pyx_GOTREF(__pyx_t_5);
7120  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
7121  __Pyx_GOTREF(__pyx_t_1);
7122  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7123  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7124  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7125  __Pyx_INCREF(__pyx_int_184977713);
7126  __Pyx_GIVEREF(__pyx_int_184977713);
7127  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
7128  __Pyx_INCREF(__pyx_v_state);
7129  __Pyx_GIVEREF(__pyx_v_state);
7130  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
7131  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 15, __pyx_L1_error)
7132  __Pyx_GOTREF(__pyx_t_4);
7133  __Pyx_GIVEREF(__pyx_t_5);
7134  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
7135  __Pyx_GIVEREF(__pyx_t_1);
7136  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
7137  __pyx_t_5 = 0;
7138  __pyx_t_1 = 0;
7139  __pyx_r = __pyx_t_4;
7140  __pyx_t_4 = 0;
7141  goto __pyx_L0;
7142  }
7143 
7144  /* "(tree fragment)":1
7145  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7146  * cdef tuple state
7147  * cdef object _dict
7148  */
7149 
7150  /* function exit code */
7151  __pyx_L1_error:;
7152  __Pyx_XDECREF(__pyx_t_1);
7153  __Pyx_XDECREF(__pyx_t_4);
7154  __Pyx_XDECREF(__pyx_t_5);
7155  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7156  __pyx_r = NULL;
7157  __pyx_L0:;
7158  __Pyx_XDECREF(__pyx_v_state);
7159  __Pyx_XDECREF(__pyx_v__dict);
7160  __Pyx_XGIVEREF(__pyx_r);
7161  __Pyx_RefNannyFinishContext();
7162  return __pyx_r;
7163 }
7164 
7165 /* "(tree fragment)":16
7166  * else:
7167  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
7168  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7169  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7170  */
7171 
7172 /* Python wrapper */
7173 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
7174 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7175  PyObject *__pyx_r = 0;
7176  __Pyx_RefNannyDeclarations
7177  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7178  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7179 
7180  /* function exit code */
7181  __Pyx_RefNannyFinishContext();
7182  return __pyx_r;
7183 }
7184 
7185 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7186  PyObject *__pyx_r = NULL;
7187  __Pyx_RefNannyDeclarations
7188  PyObject *__pyx_t_1 = NULL;
7189  int __pyx_lineno = 0;
7190  const char *__pyx_filename = NULL;
7191  int __pyx_clineno = 0;
7192  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
7193 
7194  /* "(tree fragment)":17
7195  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
7196  * def __setstate_cython__(self, __pyx_state):
7197  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
7198  */
7199  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(0, 17, __pyx_L1_error)
7200  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
7201  __Pyx_GOTREF(__pyx_t_1);
7202  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7203 
7204  /* "(tree fragment)":16
7205  * else:
7206  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
7207  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7208  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7209  */
7210 
7211  /* function exit code */
7212  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7213  goto __pyx_L0;
7214  __pyx_L1_error:;
7215  __Pyx_XDECREF(__pyx_t_1);
7216  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7217  __pyx_r = NULL;
7218  __pyx_L0:;
7219  __Pyx_XGIVEREF(__pyx_r);
7220  __Pyx_RefNannyFinishContext();
7221  return __pyx_r;
7222 }
7223 
7224 /* "View.MemoryView":298
7225  *
7226  * @cname('__pyx_align_pointer')
7227  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
7228  * "Align pointer memory on a given boundary"
7229  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
7230  */
7231 
7232 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
7233  Py_intptr_t __pyx_v_aligned_p;
7234  size_t __pyx_v_offset;
7235  void *__pyx_r;
7236  int __pyx_t_1;
7237 
7238  /* "View.MemoryView":300
7239  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
7240  * "Align pointer memory on a given boundary"
7241  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
7242  * cdef size_t offset
7243  *
7244  */
7245  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
7246 
7247  /* "View.MemoryView":304
7248  *
7249  * with cython.cdivision(True):
7250  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
7251  *
7252  * if offset > 0:
7253  */
7254  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
7255 
7256  /* "View.MemoryView":306
7257  * offset = aligned_p % alignment
7258  *
7259  * if offset > 0: # <<<<<<<<<<<<<<
7260  * aligned_p += alignment - offset
7261  *
7262  */
7263  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
7264  if (__pyx_t_1) {
7265 
7266  /* "View.MemoryView":307
7267  *
7268  * if offset > 0:
7269  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
7270  *
7271  * return <void *> aligned_p
7272  */
7273  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
7274 
7275  /* "View.MemoryView":306
7276  * offset = aligned_p % alignment
7277  *
7278  * if offset > 0: # <<<<<<<<<<<<<<
7279  * aligned_p += alignment - offset
7280  *
7281  */
7282  }
7283 
7284  /* "View.MemoryView":309
7285  * aligned_p += alignment - offset
7286  *
7287  * return <void *> aligned_p # <<<<<<<<<<<<<<
7288  *
7289  *
7290  */
7291  __pyx_r = ((void *)__pyx_v_aligned_p);
7292  goto __pyx_L0;
7293 
7294  /* "View.MemoryView":298
7295  *
7296  * @cname('__pyx_align_pointer')
7297  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
7298  * "Align pointer memory on a given boundary"
7299  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
7300  */
7301 
7302  /* function exit code */
7303  __pyx_L0:;
7304  return __pyx_r;
7305 }
7306 
7307 /* "View.MemoryView":345
7308  * cdef __Pyx_TypeInfo *typeinfo
7309  *
7310  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7311  * self.obj = obj
7312  * self.flags = flags
7313  */
7314 
7315 /* Python wrapper */
7316 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7317 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7318  PyObject *__pyx_v_obj = 0;
7319  int __pyx_v_flags;
7320  int __pyx_v_dtype_is_object;
7321  int __pyx_lineno = 0;
7322  const char *__pyx_filename = NULL;
7323  int __pyx_clineno = 0;
7324  int __pyx_r;
7325  __Pyx_RefNannyDeclarations
7326  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7327  {
7328  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
7329  PyObject* values[3] = {0,0,0};
7330  if (unlikely(__pyx_kwds)) {
7331  Py_ssize_t kw_args;
7332  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7333  switch (pos_args) {
7334  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7335  CYTHON_FALLTHROUGH;
7336  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7337  CYTHON_FALLTHROUGH;
7338  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7339  CYTHON_FALLTHROUGH;
7340  case 0: break;
7341  default: goto __pyx_L5_argtuple_error;
7342  }
7343  kw_args = PyDict_Size(__pyx_kwds);
7344  switch (pos_args) {
7345  case 0:
7346  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
7347  else goto __pyx_L5_argtuple_error;
7348  CYTHON_FALLTHROUGH;
7349  case 1:
7350  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
7351  else {
7352  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(0, 345, __pyx_L3_error)
7353  }
7354  CYTHON_FALLTHROUGH;
7355  case 2:
7356  if (kw_args > 0) {
7357  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
7358  if (value) { values[2] = value; kw_args--; }
7359  }
7360  }
7361  if (unlikely(kw_args > 0)) {
7362  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 345, __pyx_L3_error)
7363  }
7364  } else {
7365  switch (PyTuple_GET_SIZE(__pyx_args)) {
7366  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7367  CYTHON_FALLTHROUGH;
7368  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7369  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7370  break;
7371  default: goto __pyx_L5_argtuple_error;
7372  }
7373  }
7374  __pyx_v_obj = values[0];
7375  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error)
7376  if (values[2]) {
7377  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error)
7378  } else {
7379  __pyx_v_dtype_is_object = ((int)0);
7380  }
7381  }
7382  goto __pyx_L4_argument_unpacking_done;
7383  __pyx_L5_argtuple_error:;
7384  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 345, __pyx_L3_error)
7385  __pyx_L3_error:;
7386  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7387  __Pyx_RefNannyFinishContext();
7388  return -1;
7389  __pyx_L4_argument_unpacking_done:;
7390  __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);
7391 
7392  /* function exit code */
7393  __Pyx_RefNannyFinishContext();
7394  return __pyx_r;
7395 }
7396 
7397 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) {
7398  int __pyx_r;
7399  __Pyx_RefNannyDeclarations
7400  int __pyx_t_1;
7401  int __pyx_t_2;
7402  int __pyx_t_3;
7403  int __pyx_t_4;
7404  int __pyx_lineno = 0;
7405  const char *__pyx_filename = NULL;
7406  int __pyx_clineno = 0;
7407  __Pyx_RefNannySetupContext("__cinit__", 0);
7408 
7409  /* "View.MemoryView":346
7410  *
7411  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7412  * self.obj = obj # <<<<<<<<<<<<<<
7413  * self.flags = flags
7414  * if type(self) is memoryview or obj is not None:
7415  */
7416  __Pyx_INCREF(__pyx_v_obj);
7417  __Pyx_GIVEREF(__pyx_v_obj);
7418  __Pyx_GOTREF(__pyx_v_self->obj);
7419  __Pyx_DECREF(__pyx_v_self->obj);
7420  __pyx_v_self->obj = __pyx_v_obj;
7421 
7422  /* "View.MemoryView":347
7423  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7424  * self.obj = obj
7425  * self.flags = flags # <<<<<<<<<<<<<<
7426  * if type(self) is memoryview or obj is not None:
7427  * __Pyx_GetBuffer(obj, &self.view, flags)
7428  */
7429  __pyx_v_self->flags = __pyx_v_flags;
7430 
7431  /* "View.MemoryView":348
7432  * self.obj = obj
7433  * self.flags = flags
7434  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7435  * __Pyx_GetBuffer(obj, &self.view, flags)
7436  * if <PyObject *> self.view.obj == NULL:
7437  */
7438  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
7439  __pyx_t_3 = (__pyx_t_2 != 0);
7440  if (!__pyx_t_3) {
7441  } else {
7442  __pyx_t_1 = __pyx_t_3;
7443  goto __pyx_L4_bool_binop_done;
7444  }
7445  __pyx_t_3 = (__pyx_v_obj != Py_None);
7446  __pyx_t_2 = (__pyx_t_3 != 0);
7447  __pyx_t_1 = __pyx_t_2;
7448  __pyx_L4_bool_binop_done:;
7449  if (__pyx_t_1) {
7450 
7451  /* "View.MemoryView":349
7452  * self.flags = flags
7453  * if type(self) is memoryview or obj is not None:
7454  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
7455  * if <PyObject *> self.view.obj == NULL:
7456  * (<__pyx_buffer *> &self.view).obj = Py_None
7457  */
7458  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 349, __pyx_L1_error)
7459 
7460  /* "View.MemoryView":350
7461  * if type(self) is memoryview or obj is not None:
7462  * __Pyx_GetBuffer(obj, &self.view, flags)
7463  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7464  * (<__pyx_buffer *> &self.view).obj = Py_None
7465  * Py_INCREF(Py_None)
7466  */
7467  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
7468  if (__pyx_t_1) {
7469 
7470  /* "View.MemoryView":351
7471  * __Pyx_GetBuffer(obj, &self.view, flags)
7472  * if <PyObject *> self.view.obj == NULL:
7473  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
7474  * Py_INCREF(Py_None)
7475  *
7476  */
7477  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
7478 
7479  /* "View.MemoryView":352
7480  * if <PyObject *> self.view.obj == NULL:
7481  * (<__pyx_buffer *> &self.view).obj = Py_None
7482  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7483  *
7484  * global __pyx_memoryview_thread_locks_used
7485  */
7486  Py_INCREF(Py_None);
7487 
7488  /* "View.MemoryView":350
7489  * if type(self) is memoryview or obj is not None:
7490  * __Pyx_GetBuffer(obj, &self.view, flags)
7491  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7492  * (<__pyx_buffer *> &self.view).obj = Py_None
7493  * Py_INCREF(Py_None)
7494  */
7495  }
7496 
7497  /* "View.MemoryView":348
7498  * self.obj = obj
7499  * self.flags = flags
7500  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7501  * __Pyx_GetBuffer(obj, &self.view, flags)
7502  * if <PyObject *> self.view.obj == NULL:
7503  */
7504  }
7505 
7506  /* "View.MemoryView":355
7507  *
7508  * global __pyx_memoryview_thread_locks_used
7509  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
7510  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7511  * __pyx_memoryview_thread_locks_used += 1
7512  */
7513  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
7514  if (__pyx_t_1) {
7515 
7516  /* "View.MemoryView":356
7517  * global __pyx_memoryview_thread_locks_used
7518  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
7519  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
7520  * __pyx_memoryview_thread_locks_used += 1
7521  * if self.lock is NULL:
7522  */
7523  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7524 
7525  /* "View.MemoryView":357
7526  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
7527  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7528  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
7529  * if self.lock is NULL:
7530  * self.lock = PyThread_allocate_lock()
7531  */
7532  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
7533 
7534  /* "View.MemoryView":355
7535  *
7536  * global __pyx_memoryview_thread_locks_used
7537  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
7538  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7539  * __pyx_memoryview_thread_locks_used += 1
7540  */
7541  }
7542 
7543  /* "View.MemoryView":358
7544  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7545  * __pyx_memoryview_thread_locks_used += 1
7546  * if self.lock is NULL: # <<<<<<<<<<<<<<
7547  * self.lock = PyThread_allocate_lock()
7548  * if self.lock is NULL:
7549  */
7550  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
7551  if (__pyx_t_1) {
7552 
7553  /* "View.MemoryView":359
7554  * __pyx_memoryview_thread_locks_used += 1
7555  * if self.lock is NULL:
7556  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
7557  * if self.lock is NULL:
7558  * raise MemoryError
7559  */
7560  __pyx_v_self->lock = PyThread_allocate_lock();
7561 
7562  /* "View.MemoryView":360
7563  * if self.lock is NULL:
7564  * self.lock = PyThread_allocate_lock()
7565  * if self.lock is NULL: # <<<<<<<<<<<<<<
7566  * raise MemoryError
7567  *
7568  */
7569  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
7570  if (unlikely(__pyx_t_1)) {
7571 
7572  /* "View.MemoryView":361
7573  * self.lock = PyThread_allocate_lock()
7574  * if self.lock is NULL:
7575  * raise MemoryError # <<<<<<<<<<<<<<
7576  *
7577  * if flags & PyBUF_FORMAT:
7578  */
7579  PyErr_NoMemory(); __PYX_ERR(0, 361, __pyx_L1_error)
7580 
7581  /* "View.MemoryView":360
7582  * if self.lock is NULL:
7583  * self.lock = PyThread_allocate_lock()
7584  * if self.lock is NULL: # <<<<<<<<<<<<<<
7585  * raise MemoryError
7586  *
7587  */
7588  }
7589 
7590  /* "View.MemoryView":358
7591  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7592  * __pyx_memoryview_thread_locks_used += 1
7593  * if self.lock is NULL: # <<<<<<<<<<<<<<
7594  * self.lock = PyThread_allocate_lock()
7595  * if self.lock is NULL:
7596  */
7597  }
7598 
7599  /* "View.MemoryView":363
7600  * raise MemoryError
7601  *
7602  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7603  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7604  * else:
7605  */
7606  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7607  if (__pyx_t_1) {
7608 
7609  /* "View.MemoryView":364
7610  *
7611  * if flags & PyBUF_FORMAT:
7612  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
7613  * else:
7614  * self.dtype_is_object = dtype_is_object
7615  */
7616  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
7617  if (__pyx_t_2) {
7618  } else {
7619  __pyx_t_1 = __pyx_t_2;
7620  goto __pyx_L11_bool_binop_done;
7621  }
7622  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
7623  __pyx_t_1 = __pyx_t_2;
7624  __pyx_L11_bool_binop_done:;
7625  __pyx_v_self->dtype_is_object = __pyx_t_1;
7626 
7627  /* "View.MemoryView":363
7628  * raise MemoryError
7629  *
7630  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7631  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7632  * else:
7633  */
7634  goto __pyx_L10;
7635  }
7636 
7637  /* "View.MemoryView":366
7638  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7639  * else:
7640  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
7641  *
7642  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
7643  */
7644  /*else*/ {
7645  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
7646  }
7647  __pyx_L10:;
7648 
7649  /* "View.MemoryView":368
7650  * self.dtype_is_object = dtype_is_object
7651  *
7652  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
7653  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
7654  * self.typeinfo = NULL
7655  */
7656  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
7657 
7658  /* "View.MemoryView":370
7659  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
7660  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
7661  * self.typeinfo = NULL # <<<<<<<<<<<<<<
7662  *
7663  * def __dealloc__(memoryview self):
7664  */
7665  __pyx_v_self->typeinfo = NULL;
7666 
7667  /* "View.MemoryView":345
7668  * cdef __Pyx_TypeInfo *typeinfo
7669  *
7670  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7671  * self.obj = obj
7672  * self.flags = flags
7673  */
7674 
7675  /* function exit code */
7676  __pyx_r = 0;
7677  goto __pyx_L0;
7678  __pyx_L1_error:;
7679  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7680  __pyx_r = -1;
7681  __pyx_L0:;
7682  __Pyx_RefNannyFinishContext();
7683  return __pyx_r;
7684 }
7685 
7686 /* "View.MemoryView":372
7687  * self.typeinfo = NULL
7688  *
7689  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
7690  * if self.obj is not None:
7691  * __Pyx_ReleaseBuffer(&self.view)
7692  */
7693 
7694 /* Python wrapper */
7695 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
7696 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
7697  __Pyx_RefNannyDeclarations
7698  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
7699  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
7700 
7701  /* function exit code */
7702  __Pyx_RefNannyFinishContext();
7703 }
7704 
7705 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
7706  int __pyx_v_i;
7707  __Pyx_RefNannyDeclarations
7708  int __pyx_t_1;
7709  int __pyx_t_2;
7710  int __pyx_t_3;
7711  int __pyx_t_4;
7712  int __pyx_t_5;
7713  PyThread_type_lock __pyx_t_6;
7714  PyThread_type_lock __pyx_t_7;
7715  __Pyx_RefNannySetupContext("__dealloc__", 0);
7716 
7717  /* "View.MemoryView":373
7718  *
7719  * def __dealloc__(memoryview self):
7720  * if self.obj is not None: # <<<<<<<<<<<<<<
7721  * __Pyx_ReleaseBuffer(&self.view)
7722  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7723  */
7724  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
7725  __pyx_t_2 = (__pyx_t_1 != 0);
7726  if (__pyx_t_2) {
7727 
7728  /* "View.MemoryView":374
7729  * def __dealloc__(memoryview self):
7730  * if self.obj is not None:
7731  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
7732  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7733  *
7734  */
7735  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
7736 
7737  /* "View.MemoryView":373
7738  *
7739  * def __dealloc__(memoryview self):
7740  * if self.obj is not None: # <<<<<<<<<<<<<<
7741  * __Pyx_ReleaseBuffer(&self.view)
7742  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7743  */
7744  goto __pyx_L3;
7745  }
7746 
7747  /* "View.MemoryView":375
7748  * if self.obj is not None:
7749  * __Pyx_ReleaseBuffer(&self.view)
7750  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
7751  *
7752  * (<__pyx_buffer *> &self.view).obj = NULL
7753  */
7754  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
7755  if (__pyx_t_2) {
7756 
7757  /* "View.MemoryView":377
7758  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7759  *
7760  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
7761  * Py_DECREF(Py_None)
7762  *
7763  */
7764  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
7765 
7766  /* "View.MemoryView":378
7767  *
7768  * (<__pyx_buffer *> &self.view).obj = NULL
7769  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
7770  *
7771  * cdef int i
7772  */
7773  Py_DECREF(Py_None);
7774 
7775  /* "View.MemoryView":375
7776  * if self.obj is not None:
7777  * __Pyx_ReleaseBuffer(&self.view)
7778  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
7779  *
7780  * (<__pyx_buffer *> &self.view).obj = NULL
7781  */
7782  }
7783  __pyx_L3:;
7784 
7785  /* "View.MemoryView":382
7786  * cdef int i
7787  * global __pyx_memoryview_thread_locks_used
7788  * if self.lock != NULL: # <<<<<<<<<<<<<<
7789  * for i in range(__pyx_memoryview_thread_locks_used):
7790  * if __pyx_memoryview_thread_locks[i] is self.lock:
7791  */
7792  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
7793  if (__pyx_t_2) {
7794 
7795  /* "View.MemoryView":383
7796  * global __pyx_memoryview_thread_locks_used
7797  * if self.lock != NULL:
7798  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
7799  * if __pyx_memoryview_thread_locks[i] is self.lock:
7800  * __pyx_memoryview_thread_locks_used -= 1
7801  */
7802  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
7803  __pyx_t_4 = __pyx_t_3;
7804  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
7805  __pyx_v_i = __pyx_t_5;
7806 
7807  /* "View.MemoryView":384
7808  * if self.lock != NULL:
7809  * for i in range(__pyx_memoryview_thread_locks_used):
7810  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
7811  * __pyx_memoryview_thread_locks_used -= 1
7812  * if i != __pyx_memoryview_thread_locks_used:
7813  */
7814  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
7815  if (__pyx_t_2) {
7816 
7817  /* "View.MemoryView":385
7818  * for i in range(__pyx_memoryview_thread_locks_used):
7819  * if __pyx_memoryview_thread_locks[i] is self.lock:
7820  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
7821  * if i != __pyx_memoryview_thread_locks_used:
7822  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7823  */
7824  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
7825 
7826  /* "View.MemoryView":386
7827  * if __pyx_memoryview_thread_locks[i] is self.lock:
7828  * __pyx_memoryview_thread_locks_used -= 1
7829  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
7830  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7831  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
7832  */
7833  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
7834  if (__pyx_t_2) {
7835 
7836  /* "View.MemoryView":388
7837  * if i != __pyx_memoryview_thread_locks_used:
7838  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7839  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
7840  * break
7841  * else:
7842  */
7843  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7844  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
7845 
7846  /* "View.MemoryView":387
7847  * __pyx_memoryview_thread_locks_used -= 1
7848  * if i != __pyx_memoryview_thread_locks_used:
7849  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
7850  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
7851  * break
7852  */
7853  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
7854  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
7855 
7856  /* "View.MemoryView":386
7857  * if __pyx_memoryview_thread_locks[i] is self.lock:
7858  * __pyx_memoryview_thread_locks_used -= 1
7859  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
7860  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7861  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
7862  */
7863  }
7864 
7865  /* "View.MemoryView":389
7866  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
7867  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
7868  * break # <<<<<<<<<<<<<<
7869  * else:
7870  * PyThread_free_lock(self.lock)
7871  */
7872  goto __pyx_L6_break;
7873 
7874  /* "View.MemoryView":384
7875  * if self.lock != NULL:
7876  * for i in range(__pyx_memoryview_thread_locks_used):
7877  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
7878  * __pyx_memoryview_thread_locks_used -= 1
7879  * if i != __pyx_memoryview_thread_locks_used:
7880  */
7881  }
7882  }
7883  /*else*/ {
7884 
7885  /* "View.MemoryView":391
7886  * break
7887  * else:
7888  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
7889  *
7890  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
7891  */
7892  PyThread_free_lock(__pyx_v_self->lock);
7893  }
7894  __pyx_L6_break:;
7895 
7896  /* "View.MemoryView":382
7897  * cdef int i
7898  * global __pyx_memoryview_thread_locks_used
7899  * if self.lock != NULL: # <<<<<<<<<<<<<<
7900  * for i in range(__pyx_memoryview_thread_locks_used):
7901  * if __pyx_memoryview_thread_locks[i] is self.lock:
7902  */
7903  }
7904 
7905  /* "View.MemoryView":372
7906  * self.typeinfo = NULL
7907  *
7908  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
7909  * if self.obj is not None:
7910  * __Pyx_ReleaseBuffer(&self.view)
7911  */
7912 
7913  /* function exit code */
7914  __Pyx_RefNannyFinishContext();
7915 }
7916 
7917 /* "View.MemoryView":393
7918  * PyThread_free_lock(self.lock)
7919  *
7920  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
7921  * cdef Py_ssize_t dim
7922  * cdef char *itemp = <char *> self.view.buf
7923  */
7924 
7925 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
7926  Py_ssize_t __pyx_v_dim;
7927  char *__pyx_v_itemp;
7928  PyObject *__pyx_v_idx = NULL;
7929  char *__pyx_r;
7930  __Pyx_RefNannyDeclarations
7931  Py_ssize_t __pyx_t_1;
7932  PyObject *__pyx_t_2 = NULL;
7933  Py_ssize_t __pyx_t_3;
7934  PyObject *(*__pyx_t_4)(PyObject *);
7935  PyObject *__pyx_t_5 = NULL;
7936  Py_ssize_t __pyx_t_6;
7937  char *__pyx_t_7;
7938  int __pyx_lineno = 0;
7939  const char *__pyx_filename = NULL;
7940  int __pyx_clineno = 0;
7941  __Pyx_RefNannySetupContext("get_item_pointer", 0);
7942 
7943  /* "View.MemoryView":395
7944  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
7945  * cdef Py_ssize_t dim
7946  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
7947  *
7948  * for dim, idx in enumerate(index):
7949  */
7950  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
7951 
7952  /* "View.MemoryView":397
7953  * cdef char *itemp = <char *> self.view.buf
7954  *
7955  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
7956  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
7957  *
7958  */
7959  __pyx_t_1 = 0;
7960  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
7961  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
7962  __pyx_t_4 = NULL;
7963  } else {
7964  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error)
7965  __Pyx_GOTREF(__pyx_t_2);
7966  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error)
7967  }
7968  for (;;) {
7969  if (likely(!__pyx_t_4)) {
7970  if (likely(PyList_CheckExact(__pyx_t_2))) {
7971  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
7972  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7973  __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(0, 397, __pyx_L1_error)
7974  #else
7975  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error)
7976  __Pyx_GOTREF(__pyx_t_5);
7977  #endif
7978  } else {
7979  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
7980  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7981  __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(0, 397, __pyx_L1_error)
7982  #else
7983  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error)
7984  __Pyx_GOTREF(__pyx_t_5);
7985  #endif
7986  }
7987  } else {
7988  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
7989  if (unlikely(!__pyx_t_5)) {
7990  PyObject* exc_type = PyErr_Occurred();
7991  if (exc_type) {
7992  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7993  else __PYX_ERR(0, 397, __pyx_L1_error)
7994  }
7995  break;
7996  }
7997  __Pyx_GOTREF(__pyx_t_5);
7998  }
7999  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
8000  __pyx_t_5 = 0;
8001  __pyx_v_dim = __pyx_t_1;
8002  __pyx_t_1 = (__pyx_t_1 + 1);
8003 
8004  /* "View.MemoryView":398
8005  *
8006  * for dim, idx in enumerate(index):
8007  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
8008  *
8009  * return itemp
8010  */
8011  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error)
8012  __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(0, 398, __pyx_L1_error)
8013  __pyx_v_itemp = __pyx_t_7;
8014 
8015  /* "View.MemoryView":397
8016  * cdef char *itemp = <char *> self.view.buf
8017  *
8018  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8019  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8020  *
8021  */
8022  }
8023  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8024 
8025  /* "View.MemoryView":400
8026  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8027  *
8028  * return itemp # <<<<<<<<<<<<<<
8029  *
8030  *
8031  */
8032  __pyx_r = __pyx_v_itemp;
8033  goto __pyx_L0;
8034 
8035  /* "View.MemoryView":393
8036  * PyThread_free_lock(self.lock)
8037  *
8038  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
8039  * cdef Py_ssize_t dim
8040  * cdef char *itemp = <char *> self.view.buf
8041  */
8042 
8043  /* function exit code */
8044  __pyx_L1_error:;
8045  __Pyx_XDECREF(__pyx_t_2);
8046  __Pyx_XDECREF(__pyx_t_5);
8047  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8048  __pyx_r = NULL;
8049  __pyx_L0:;
8050  __Pyx_XDECREF(__pyx_v_idx);
8051  __Pyx_RefNannyFinishContext();
8052  return __pyx_r;
8053 }
8054 
8055 /* "View.MemoryView":403
8056  *
8057  *
8058  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8059  * if index is Ellipsis:
8060  * return self
8061  */
8062 
8063 /* Python wrapper */
8064 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
8065 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
8066  PyObject *__pyx_r = 0;
8067  __Pyx_RefNannyDeclarations
8068  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
8069  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
8070 
8071  /* function exit code */
8072  __Pyx_RefNannyFinishContext();
8073  return __pyx_r;
8074 }
8075 
8076 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8077  PyObject *__pyx_v_have_slices = NULL;
8078  PyObject *__pyx_v_indices = NULL;
8079  char *__pyx_v_itemp;
8080  PyObject *__pyx_r = NULL;
8081  __Pyx_RefNannyDeclarations
8082  int __pyx_t_1;
8083  int __pyx_t_2;
8084  PyObject *__pyx_t_3 = NULL;
8085  PyObject *__pyx_t_4 = NULL;
8086  PyObject *__pyx_t_5 = NULL;
8087  char *__pyx_t_6;
8088  int __pyx_lineno = 0;
8089  const char *__pyx_filename = NULL;
8090  int __pyx_clineno = 0;
8091  __Pyx_RefNannySetupContext("__getitem__", 0);
8092 
8093  /* "View.MemoryView":404
8094  *
8095  * def __getitem__(memoryview self, object index):
8096  * if index is Ellipsis: # <<<<<<<<<<<<<<
8097  * return self
8098  *
8099  */
8100  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
8101  __pyx_t_2 = (__pyx_t_1 != 0);
8102  if (__pyx_t_2) {
8103 
8104  /* "View.MemoryView":405
8105  * def __getitem__(memoryview self, object index):
8106  * if index is Ellipsis:
8107  * return self # <<<<<<<<<<<<<<
8108  *
8109  * have_slices, indices = _unellipsify(index, self.view.ndim)
8110  */
8111  __Pyx_XDECREF(__pyx_r);
8112  __Pyx_INCREF(((PyObject *)__pyx_v_self));
8113  __pyx_r = ((PyObject *)__pyx_v_self);
8114  goto __pyx_L0;
8115 
8116  /* "View.MemoryView":404
8117  *
8118  * def __getitem__(memoryview self, object index):
8119  * if index is Ellipsis: # <<<<<<<<<<<<<<
8120  * return self
8121  *
8122  */
8123  }
8124 
8125  /* "View.MemoryView":407
8126  * return self
8127  *
8128  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8129  *
8130  * cdef char *itemp
8131  */
8132  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error)
8133  __Pyx_GOTREF(__pyx_t_3);
8134  if (likely(__pyx_t_3 != Py_None)) {
8135  PyObject* sequence = __pyx_t_3;
8136  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8137  if (unlikely(size != 2)) {
8138  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8139  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8140  __PYX_ERR(0, 407, __pyx_L1_error)
8141  }
8142  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8143  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
8144  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
8145  __Pyx_INCREF(__pyx_t_4);
8146  __Pyx_INCREF(__pyx_t_5);
8147  #else
8148  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error)
8149  __Pyx_GOTREF(__pyx_t_4);
8150  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error)
8151  __Pyx_GOTREF(__pyx_t_5);
8152  #endif
8153  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8154  } else {
8155  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 407, __pyx_L1_error)
8156  }
8157  __pyx_v_have_slices = __pyx_t_4;
8158  __pyx_t_4 = 0;
8159  __pyx_v_indices = __pyx_t_5;
8160  __pyx_t_5 = 0;
8161 
8162  /* "View.MemoryView":410
8163  *
8164  * cdef char *itemp
8165  * if have_slices: # <<<<<<<<<<<<<<
8166  * return memview_slice(self, indices)
8167  * else:
8168  */
8169  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 410, __pyx_L1_error)
8170  if (__pyx_t_2) {
8171 
8172  /* "View.MemoryView":411
8173  * cdef char *itemp
8174  * if have_slices:
8175  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
8176  * else:
8177  * itemp = self.get_item_pointer(indices)
8178  */
8179  __Pyx_XDECREF(__pyx_r);
8180  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error)
8181  __Pyx_GOTREF(__pyx_t_3);
8182  __pyx_r = __pyx_t_3;
8183  __pyx_t_3 = 0;
8184  goto __pyx_L0;
8185 
8186  /* "View.MemoryView":410
8187  *
8188  * cdef char *itemp
8189  * if have_slices: # <<<<<<<<<<<<<<
8190  * return memview_slice(self, indices)
8191  * else:
8192  */
8193  }
8194 
8195  /* "View.MemoryView":413
8196  * return memview_slice(self, indices)
8197  * else:
8198  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
8199  * return self.convert_item_to_object(itemp)
8200  *
8201  */
8202  /*else*/ {
8203  __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(0, 413, __pyx_L1_error)
8204  __pyx_v_itemp = __pyx_t_6;
8205 
8206  /* "View.MemoryView":414
8207  * else:
8208  * itemp = self.get_item_pointer(indices)
8209  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
8210  *
8211  * def __setitem__(memoryview self, object index, object value):
8212  */
8213  __Pyx_XDECREF(__pyx_r);
8214  __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(0, 414, __pyx_L1_error)
8215  __Pyx_GOTREF(__pyx_t_3);
8216  __pyx_r = __pyx_t_3;
8217  __pyx_t_3 = 0;
8218  goto __pyx_L0;
8219  }
8220 
8221  /* "View.MemoryView":403
8222  *
8223  *
8224  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8225  * if index is Ellipsis:
8226  * return self
8227  */
8228 
8229  /* function exit code */
8230  __pyx_L1_error:;
8231  __Pyx_XDECREF(__pyx_t_3);
8232  __Pyx_XDECREF(__pyx_t_4);
8233  __Pyx_XDECREF(__pyx_t_5);
8234  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8235  __pyx_r = NULL;
8236  __pyx_L0:;
8237  __Pyx_XDECREF(__pyx_v_have_slices);
8238  __Pyx_XDECREF(__pyx_v_indices);
8239  __Pyx_XGIVEREF(__pyx_r);
8240  __Pyx_RefNannyFinishContext();
8241  return __pyx_r;
8242 }
8243 
8244 /* "View.MemoryView":416
8245  * return self.convert_item_to_object(itemp)
8246  *
8247  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8248  * if self.view.readonly:
8249  * raise TypeError("Cannot assign to read-only memoryview")
8250  */
8251 
8252 /* Python wrapper */
8253 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
8254 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8255  int __pyx_r;
8256  __Pyx_RefNannyDeclarations
8257  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
8258  __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));
8259 
8260  /* function exit code */
8261  __Pyx_RefNannyFinishContext();
8262  return __pyx_r;
8263 }
8264 
8265 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) {
8266  PyObject *__pyx_v_have_slices = NULL;
8267  PyObject *__pyx_v_obj = NULL;
8268  int __pyx_r;
8269  __Pyx_RefNannyDeclarations
8270  int __pyx_t_1;
8271  PyObject *__pyx_t_2 = NULL;
8272  PyObject *__pyx_t_3 = NULL;
8273  PyObject *__pyx_t_4 = NULL;
8274  int __pyx_lineno = 0;
8275  const char *__pyx_filename = NULL;
8276  int __pyx_clineno = 0;
8277  __Pyx_RefNannySetupContext("__setitem__", 0);
8278  __Pyx_INCREF(__pyx_v_index);
8279 
8280  /* "View.MemoryView":417
8281  *
8282  * def __setitem__(memoryview self, object index, object value):
8283  * if self.view.readonly: # <<<<<<<<<<<<<<
8284  * raise TypeError("Cannot assign to read-only memoryview")
8285  *
8286  */
8287  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
8288  if (unlikely(__pyx_t_1)) {
8289 
8290  /* "View.MemoryView":418
8291  * def __setitem__(memoryview self, object index, object value):
8292  * if self.view.readonly:
8293  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
8294  *
8295  * have_slices, index = _unellipsify(index, self.view.ndim)
8296  */
8297  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
8298  __Pyx_GOTREF(__pyx_t_2);
8299  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
8300  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8301  __PYX_ERR(0, 418, __pyx_L1_error)
8302 
8303  /* "View.MemoryView":417
8304  *
8305  * def __setitem__(memoryview self, object index, object value):
8306  * if self.view.readonly: # <<<<<<<<<<<<<<
8307  * raise TypeError("Cannot assign to read-only memoryview")
8308  *
8309  */
8310  }
8311 
8312  /* "View.MemoryView":420
8313  * raise TypeError("Cannot assign to read-only memoryview")
8314  *
8315  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8316  *
8317  * if have_slices:
8318  */
8319  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
8320  __Pyx_GOTREF(__pyx_t_2);
8321  if (likely(__pyx_t_2 != Py_None)) {
8322  PyObject* sequence = __pyx_t_2;
8323  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8324  if (unlikely(size != 2)) {
8325  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8326  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8327  __PYX_ERR(0, 420, __pyx_L1_error)
8328  }
8329  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8330  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
8331  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
8332  __Pyx_INCREF(__pyx_t_3);
8333  __Pyx_INCREF(__pyx_t_4);
8334  #else
8335  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
8336  __Pyx_GOTREF(__pyx_t_3);
8337  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
8338  __Pyx_GOTREF(__pyx_t_4);
8339  #endif
8340  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8341  } else {
8342  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 420, __pyx_L1_error)
8343  }
8344  __pyx_v_have_slices = __pyx_t_3;
8345  __pyx_t_3 = 0;
8346  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
8347  __pyx_t_4 = 0;
8348 
8349  /* "View.MemoryView":422
8350  * have_slices, index = _unellipsify(index, self.view.ndim)
8351  *
8352  * if have_slices: # <<<<<<<<<<<<<<
8353  * obj = self.is_slice(value)
8354  * if obj:
8355  */
8356  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 422, __pyx_L1_error)
8357  if (__pyx_t_1) {
8358 
8359  /* "View.MemoryView":423
8360  *
8361  * if have_slices:
8362  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
8363  * if obj:
8364  * self.setitem_slice_assignment(self[index], obj)
8365  */
8366  __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(0, 423, __pyx_L1_error)
8367  __Pyx_GOTREF(__pyx_t_2);
8368  __pyx_v_obj = __pyx_t_2;
8369  __pyx_t_2 = 0;
8370 
8371  /* "View.MemoryView":424
8372  * if have_slices:
8373  * obj = self.is_slice(value)
8374  * if obj: # <<<<<<<<<<<<<<
8375  * self.setitem_slice_assignment(self[index], obj)
8376  * else:
8377  */
8378  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 424, __pyx_L1_error)
8379  if (__pyx_t_1) {
8380 
8381  /* "View.MemoryView":425
8382  * obj = self.is_slice(value)
8383  * if obj:
8384  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
8385  * else:
8386  * self.setitem_slice_assign_scalar(self[index], value)
8387  */
8388  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error)
8389  __Pyx_GOTREF(__pyx_t_2);
8390  __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(0, 425, __pyx_L1_error)
8391  __Pyx_GOTREF(__pyx_t_4);
8392  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8393  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8394 
8395  /* "View.MemoryView":424
8396  * if have_slices:
8397  * obj = self.is_slice(value)
8398  * if obj: # <<<<<<<<<<<<<<
8399  * self.setitem_slice_assignment(self[index], obj)
8400  * else:
8401  */
8402  goto __pyx_L5;
8403  }
8404 
8405  /* "View.MemoryView":427
8406  * self.setitem_slice_assignment(self[index], obj)
8407  * else:
8408  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
8409  * else:
8410  * self.setitem_indexed(index, value)
8411  */
8412  /*else*/ {
8413  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
8414  __Pyx_GOTREF(__pyx_t_4);
8415  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(0, 427, __pyx_L1_error)
8416  __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(0, 427, __pyx_L1_error)
8417  __Pyx_GOTREF(__pyx_t_2);
8418  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8419  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8420  }
8421  __pyx_L5:;
8422 
8423  /* "View.MemoryView":422
8424  * have_slices, index = _unellipsify(index, self.view.ndim)
8425  *
8426  * if have_slices: # <<<<<<<<<<<<<<
8427  * obj = self.is_slice(value)
8428  * if obj:
8429  */
8430  goto __pyx_L4;
8431  }
8432 
8433  /* "View.MemoryView":429
8434  * self.setitem_slice_assign_scalar(self[index], value)
8435  * else:
8436  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
8437  *
8438  * cdef is_slice(self, obj):
8439  */
8440  /*else*/ {
8441  __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(0, 429, __pyx_L1_error)
8442  __Pyx_GOTREF(__pyx_t_2);
8443  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8444  }
8445  __pyx_L4:;
8446 
8447  /* "View.MemoryView":416
8448  * return self.convert_item_to_object(itemp)
8449  *
8450  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8451  * if self.view.readonly:
8452  * raise TypeError("Cannot assign to read-only memoryview")
8453  */
8454 
8455  /* function exit code */
8456  __pyx_r = 0;
8457  goto __pyx_L0;
8458  __pyx_L1_error:;
8459  __Pyx_XDECREF(__pyx_t_2);
8460  __Pyx_XDECREF(__pyx_t_3);
8461  __Pyx_XDECREF(__pyx_t_4);
8462  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8463  __pyx_r = -1;
8464  __pyx_L0:;
8465  __Pyx_XDECREF(__pyx_v_have_slices);
8466  __Pyx_XDECREF(__pyx_v_obj);
8467  __Pyx_XDECREF(__pyx_v_index);
8468  __Pyx_RefNannyFinishContext();
8469  return __pyx_r;
8470 }
8471 
8472 /* "View.MemoryView":431
8473  * self.setitem_indexed(index, value)
8474  *
8475  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
8476  * if not isinstance(obj, memoryview):
8477  * try:
8478  */
8479 
8480 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
8481  PyObject *__pyx_r = NULL;
8482  __Pyx_RefNannyDeclarations
8483  int __pyx_t_1;
8484  int __pyx_t_2;
8485  PyObject *__pyx_t_3 = NULL;
8486  PyObject *__pyx_t_4 = NULL;
8487  PyObject *__pyx_t_5 = NULL;
8488  PyObject *__pyx_t_6 = NULL;
8489  PyObject *__pyx_t_7 = NULL;
8490  PyObject *__pyx_t_8 = NULL;
8491  int __pyx_t_9;
8492  int __pyx_lineno = 0;
8493  const char *__pyx_filename = NULL;
8494  int __pyx_clineno = 0;
8495  __Pyx_RefNannySetupContext("is_slice", 0);
8496  __Pyx_INCREF(__pyx_v_obj);
8497 
8498  /* "View.MemoryView":432
8499  *
8500  * cdef is_slice(self, obj):
8501  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
8502  * try:
8503  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8504  */
8505  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
8506  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
8507  if (__pyx_t_2) {
8508 
8509  /* "View.MemoryView":433
8510  * cdef is_slice(self, obj):
8511  * if not isinstance(obj, memoryview):
8512  * try: # <<<<<<<<<<<<<<
8513  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8514  * self.dtype_is_object)
8515  */
8516  {
8517  __Pyx_PyThreadState_declare
8518  __Pyx_PyThreadState_assign
8519  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
8520  __Pyx_XGOTREF(__pyx_t_3);
8521  __Pyx_XGOTREF(__pyx_t_4);
8522  __Pyx_XGOTREF(__pyx_t_5);
8523  /*try:*/ {
8524 
8525  /* "View.MemoryView":434
8526  * if not isinstance(obj, memoryview):
8527  * try:
8528  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
8529  * self.dtype_is_object)
8530  * except TypeError:
8531  */
8532  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 434, __pyx_L4_error)
8533  __Pyx_GOTREF(__pyx_t_6);
8534 
8535  /* "View.MemoryView":435
8536  * try:
8537  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8538  * self.dtype_is_object) # <<<<<<<<<<<<<<
8539  * except TypeError:
8540  * return None
8541  */
8542  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L4_error)
8543  __Pyx_GOTREF(__pyx_t_7);
8544 
8545  /* "View.MemoryView":434
8546  * if not isinstance(obj, memoryview):
8547  * try:
8548  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
8549  * self.dtype_is_object)
8550  * except TypeError:
8551  */
8552  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 434, __pyx_L4_error)
8553  __Pyx_GOTREF(__pyx_t_8);
8554  __Pyx_INCREF(__pyx_v_obj);
8555  __Pyx_GIVEREF(__pyx_v_obj);
8556  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
8557  __Pyx_GIVEREF(__pyx_t_6);
8558  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
8559  __Pyx_GIVEREF(__pyx_t_7);
8560  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
8561  __pyx_t_6 = 0;
8562  __pyx_t_7 = 0;
8563  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L4_error)
8564  __Pyx_GOTREF(__pyx_t_7);
8565  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8566  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
8567  __pyx_t_7 = 0;
8568 
8569  /* "View.MemoryView":433
8570  * cdef is_slice(self, obj):
8571  * if not isinstance(obj, memoryview):
8572  * try: # <<<<<<<<<<<<<<
8573  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8574  * self.dtype_is_object)
8575  */
8576  }
8577  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8578  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8579  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8580  goto __pyx_L9_try_end;
8581  __pyx_L4_error:;
8582  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8583  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8584  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8585 
8586  /* "View.MemoryView":436
8587  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8588  * self.dtype_is_object)
8589  * except TypeError: # <<<<<<<<<<<<<<
8590  * return None
8591  *
8592  */
8593  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
8594  if (__pyx_t_9) {
8595  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
8596  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 436, __pyx_L6_except_error)
8597  __Pyx_GOTREF(__pyx_t_7);
8598  __Pyx_GOTREF(__pyx_t_8);
8599  __Pyx_GOTREF(__pyx_t_6);
8600 
8601  /* "View.MemoryView":437
8602  * self.dtype_is_object)
8603  * except TypeError:
8604  * return None # <<<<<<<<<<<<<<
8605  *
8606  * return obj
8607  */
8608  __Pyx_XDECREF(__pyx_r);
8609  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8610  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8611  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8612  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8613  goto __pyx_L7_except_return;
8614  }
8615  goto __pyx_L6_except_error;
8616  __pyx_L6_except_error:;
8617 
8618  /* "View.MemoryView":433
8619  * cdef is_slice(self, obj):
8620  * if not isinstance(obj, memoryview):
8621  * try: # <<<<<<<<<<<<<<
8622  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8623  * self.dtype_is_object)
8624  */
8625  __Pyx_XGIVEREF(__pyx_t_3);
8626  __Pyx_XGIVEREF(__pyx_t_4);
8627  __Pyx_XGIVEREF(__pyx_t_5);
8628  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
8629  goto __pyx_L1_error;
8630  __pyx_L7_except_return:;
8631  __Pyx_XGIVEREF(__pyx_t_3);
8632  __Pyx_XGIVEREF(__pyx_t_4);
8633  __Pyx_XGIVEREF(__pyx_t_5);
8634  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
8635  goto __pyx_L0;
8636  __pyx_L9_try_end:;
8637  }
8638 
8639  /* "View.MemoryView":432
8640  *
8641  * cdef is_slice(self, obj):
8642  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
8643  * try:
8644  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8645  */
8646  }
8647 
8648  /* "View.MemoryView":439
8649  * return None
8650  *
8651  * return obj # <<<<<<<<<<<<<<
8652  *
8653  * cdef setitem_slice_assignment(self, dst, src):
8654  */
8655  __Pyx_XDECREF(__pyx_r);
8656  __Pyx_INCREF(__pyx_v_obj);
8657  __pyx_r = __pyx_v_obj;
8658  goto __pyx_L0;
8659 
8660  /* "View.MemoryView":431
8661  * self.setitem_indexed(index, value)
8662  *
8663  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
8664  * if not isinstance(obj, memoryview):
8665  * try:
8666  */
8667 
8668  /* function exit code */
8669  __pyx_L1_error:;
8670  __Pyx_XDECREF(__pyx_t_6);
8671  __Pyx_XDECREF(__pyx_t_7);
8672  __Pyx_XDECREF(__pyx_t_8);
8673  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
8674  __pyx_r = 0;
8675  __pyx_L0:;
8676  __Pyx_XDECREF(__pyx_v_obj);
8677  __Pyx_XGIVEREF(__pyx_r);
8678  __Pyx_RefNannyFinishContext();
8679  return __pyx_r;
8680 }
8681 
8682 /* "View.MemoryView":441
8683  * return obj
8684  *
8685  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
8686  * cdef __Pyx_memviewslice dst_slice
8687  * cdef __Pyx_memviewslice src_slice
8688  */
8689 
8690 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
8691  __Pyx_memviewslice __pyx_v_dst_slice;
8692  __Pyx_memviewslice __pyx_v_src_slice;
8693  PyObject *__pyx_r = NULL;
8694  __Pyx_RefNannyDeclarations
8695  __Pyx_memviewslice *__pyx_t_1;
8696  __Pyx_memviewslice *__pyx_t_2;
8697  PyObject *__pyx_t_3 = NULL;
8698  int __pyx_t_4;
8699  int __pyx_t_5;
8700  int __pyx_t_6;
8701  int __pyx_lineno = 0;
8702  const char *__pyx_filename = NULL;
8703  int __pyx_clineno = 0;
8704  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
8705 
8706  /* "View.MemoryView":445
8707  * cdef __Pyx_memviewslice src_slice
8708  *
8709  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
8710  * get_slice_from_memview(dst, &dst_slice)[0],
8711  * src.ndim, dst.ndim, self.dtype_is_object)
8712  */
8713  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(0, 445, __pyx_L1_error)
8714  __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(0, 445, __pyx_L1_error)
8715 
8716  /* "View.MemoryView":446
8717  *
8718  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
8719  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
8720  * src.ndim, dst.ndim, self.dtype_is_object)
8721  *
8722  */
8723  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(0, 446, __pyx_L1_error)
8724  __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(0, 446, __pyx_L1_error)
8725 
8726  /* "View.MemoryView":447
8727  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
8728  * get_slice_from_memview(dst, &dst_slice)[0],
8729  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
8730  *
8731  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
8732  */
8733  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error)
8734  __Pyx_GOTREF(__pyx_t_3);
8735  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error)
8736  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8737  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error)
8738  __Pyx_GOTREF(__pyx_t_3);
8739  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error)
8740  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8741 
8742  /* "View.MemoryView":445
8743  * cdef __Pyx_memviewslice src_slice
8744  *
8745  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
8746  * get_slice_from_memview(dst, &dst_slice)[0],
8747  * src.ndim, dst.ndim, self.dtype_is_object)
8748  */
8749  __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(0, 445, __pyx_L1_error)
8750 
8751  /* "View.MemoryView":441
8752  * return obj
8753  *
8754  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
8755  * cdef __Pyx_memviewslice dst_slice
8756  * cdef __Pyx_memviewslice src_slice
8757  */
8758 
8759  /* function exit code */
8760  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8761  goto __pyx_L0;
8762  __pyx_L1_error:;
8763  __Pyx_XDECREF(__pyx_t_3);
8764  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
8765  __pyx_r = 0;
8766  __pyx_L0:;
8767  __Pyx_XGIVEREF(__pyx_r);
8768  __Pyx_RefNannyFinishContext();
8769  return __pyx_r;
8770 }
8771 
8772 /* "View.MemoryView":449
8773  * src.ndim, dst.ndim, self.dtype_is_object)
8774  *
8775  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
8776  * cdef int array[128]
8777  * cdef void *tmp = NULL
8778  */
8779 
8780 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) {
8781  int __pyx_v_array[0x80];
8782  void *__pyx_v_tmp;
8783  void *__pyx_v_item;
8784  __Pyx_memviewslice *__pyx_v_dst_slice;
8785  __Pyx_memviewslice __pyx_v_tmp_slice;
8786  PyObject *__pyx_r = NULL;
8787  __Pyx_RefNannyDeclarations
8788  __Pyx_memviewslice *__pyx_t_1;
8789  int __pyx_t_2;
8790  PyObject *__pyx_t_3 = NULL;
8791  int __pyx_t_4;
8792  int __pyx_t_5;
8793  char const *__pyx_t_6;
8794  PyObject *__pyx_t_7 = NULL;
8795  PyObject *__pyx_t_8 = NULL;
8796  PyObject *__pyx_t_9 = NULL;
8797  PyObject *__pyx_t_10 = NULL;
8798  PyObject *__pyx_t_11 = NULL;
8799  PyObject *__pyx_t_12 = NULL;
8800  int __pyx_lineno = 0;
8801  const char *__pyx_filename = NULL;
8802  int __pyx_clineno = 0;
8803  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
8804 
8805  /* "View.MemoryView":451
8806  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
8807  * cdef int array[128]
8808  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
8809  * cdef void *item
8810  *
8811  */
8812  __pyx_v_tmp = NULL;
8813 
8814  /* "View.MemoryView":456
8815  * cdef __Pyx_memviewslice *dst_slice
8816  * cdef __Pyx_memviewslice tmp_slice
8817  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
8818  *
8819  * if <size_t>self.view.itemsize > sizeof(array):
8820  */
8821  __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(0, 456, __pyx_L1_error)
8822  __pyx_v_dst_slice = __pyx_t_1;
8823 
8824  /* "View.MemoryView":458
8825  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
8826  *
8827  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
8828  * tmp = PyMem_Malloc(self.view.itemsize)
8829  * if tmp == NULL:
8830  */
8831  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
8832  if (__pyx_t_2) {
8833 
8834  /* "View.MemoryView":459
8835  *
8836  * if <size_t>self.view.itemsize > sizeof(array):
8837  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
8838  * if tmp == NULL:
8839  * raise MemoryError
8840  */
8841  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
8842 
8843  /* "View.MemoryView":460
8844  * if <size_t>self.view.itemsize > sizeof(array):
8845  * tmp = PyMem_Malloc(self.view.itemsize)
8846  * if tmp == NULL: # <<<<<<<<<<<<<<
8847  * raise MemoryError
8848  * item = tmp
8849  */
8850  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
8851  if (unlikely(__pyx_t_2)) {
8852 
8853  /* "View.MemoryView":461
8854  * tmp = PyMem_Malloc(self.view.itemsize)
8855  * if tmp == NULL:
8856  * raise MemoryError # <<<<<<<<<<<<<<
8857  * item = tmp
8858  * else:
8859  */
8860  PyErr_NoMemory(); __PYX_ERR(0, 461, __pyx_L1_error)
8861 
8862  /* "View.MemoryView":460
8863  * if <size_t>self.view.itemsize > sizeof(array):
8864  * tmp = PyMem_Malloc(self.view.itemsize)
8865  * if tmp == NULL: # <<<<<<<<<<<<<<
8866  * raise MemoryError
8867  * item = tmp
8868  */
8869  }
8870 
8871  /* "View.MemoryView":462
8872  * if tmp == NULL:
8873  * raise MemoryError
8874  * item = tmp # <<<<<<<<<<<<<<
8875  * else:
8876  * item = <void *> array
8877  */
8878  __pyx_v_item = __pyx_v_tmp;
8879 
8880  /* "View.MemoryView":458
8881  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
8882  *
8883  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
8884  * tmp = PyMem_Malloc(self.view.itemsize)
8885  * if tmp == NULL:
8886  */
8887  goto __pyx_L3;
8888  }
8889 
8890  /* "View.MemoryView":464
8891  * item = tmp
8892  * else:
8893  * item = <void *> array # <<<<<<<<<<<<<<
8894  *
8895  * try:
8896  */
8897  /*else*/ {
8898  __pyx_v_item = ((void *)__pyx_v_array);
8899  }
8900  __pyx_L3:;
8901 
8902  /* "View.MemoryView":466
8903  * item = <void *> array
8904  *
8905  * try: # <<<<<<<<<<<<<<
8906  * if self.dtype_is_object:
8907  * (<PyObject **> item)[0] = <PyObject *> value
8908  */
8909  /*try:*/ {
8910 
8911  /* "View.MemoryView":467
8912  *
8913  * try:
8914  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8915  * (<PyObject **> item)[0] = <PyObject *> value
8916  * else:
8917  */
8918  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
8919  if (__pyx_t_2) {
8920 
8921  /* "View.MemoryView":468
8922  * try:
8923  * if self.dtype_is_object:
8924  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
8925  * else:
8926  * self.assign_item_from_object(<char *> item, value)
8927  */
8928  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
8929 
8930  /* "View.MemoryView":467
8931  *
8932  * try:
8933  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8934  * (<PyObject **> item)[0] = <PyObject *> value
8935  * else:
8936  */
8937  goto __pyx_L8;
8938  }
8939 
8940  /* "View.MemoryView":470
8941  * (<PyObject **> item)[0] = <PyObject *> value
8942  * else:
8943  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
8944  *
8945  *
8946  */
8947  /*else*/ {
8948  __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(0, 470, __pyx_L6_error)
8949  __Pyx_GOTREF(__pyx_t_3);
8950  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8951  }
8952  __pyx_L8:;
8953 
8954  /* "View.MemoryView":474
8955  *
8956  *
8957  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
8958  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
8959  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
8960  */
8961  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
8962  if (__pyx_t_2) {
8963 
8964  /* "View.MemoryView":475
8965  *
8966  * if self.view.suboffsets != NULL:
8967  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
8968  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
8969  * item, self.dtype_is_object)
8970  */
8971  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L6_error)
8972  __Pyx_GOTREF(__pyx_t_3);
8973  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8974 
8975  /* "View.MemoryView":474
8976  *
8977  *
8978  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
8979  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
8980  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
8981  */
8982  }
8983 
8984  /* "View.MemoryView":476
8985  * if self.view.suboffsets != NULL:
8986  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
8987  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
8988  * item, self.dtype_is_object)
8989  * finally:
8990  */
8991  __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);
8992  }
8993 
8994  /* "View.MemoryView":479
8995  * item, self.dtype_is_object)
8996  * finally:
8997  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
8998  *
8999  * cdef setitem_indexed(self, index, value):
9000  */
9001  /*finally:*/ {
9002  /*normal exit:*/{
9003  PyMem_Free(__pyx_v_tmp);
9004  goto __pyx_L7;
9005  }
9006  __pyx_L6_error:;
9007  /*exception exit:*/{
9008  __Pyx_PyThreadState_declare
9009  __Pyx_PyThreadState_assign
9010  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9011  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9012  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9013  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);
9014  __Pyx_XGOTREF(__pyx_t_7);
9015  __Pyx_XGOTREF(__pyx_t_8);
9016  __Pyx_XGOTREF(__pyx_t_9);
9017  __Pyx_XGOTREF(__pyx_t_10);
9018  __Pyx_XGOTREF(__pyx_t_11);
9019  __Pyx_XGOTREF(__pyx_t_12);
9020  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
9021  {
9022  PyMem_Free(__pyx_v_tmp);
9023  }
9024  if (PY_MAJOR_VERSION >= 3) {
9025  __Pyx_XGIVEREF(__pyx_t_10);
9026  __Pyx_XGIVEREF(__pyx_t_11);
9027  __Pyx_XGIVEREF(__pyx_t_12);
9028  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9029  }
9030  __Pyx_XGIVEREF(__pyx_t_7);
9031  __Pyx_XGIVEREF(__pyx_t_8);
9032  __Pyx_XGIVEREF(__pyx_t_9);
9033  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9034  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9035  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
9036  goto __pyx_L1_error;
9037  }
9038  __pyx_L7:;
9039  }
9040 
9041  /* "View.MemoryView":449
9042  * src.ndim, dst.ndim, self.dtype_is_object)
9043  *
9044  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9045  * cdef int array[128]
9046  * cdef void *tmp = NULL
9047  */
9048 
9049  /* function exit code */
9050  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9051  goto __pyx_L0;
9052  __pyx_L1_error:;
9053  __Pyx_XDECREF(__pyx_t_3);
9054  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9055  __pyx_r = 0;
9056  __pyx_L0:;
9057  __Pyx_XGIVEREF(__pyx_r);
9058  __Pyx_RefNannyFinishContext();
9059  return __pyx_r;
9060 }
9061 
9062 /* "View.MemoryView":481
9063  * PyMem_Free(tmp)
9064  *
9065  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
9066  * cdef char *itemp = self.get_item_pointer(index)
9067  * self.assign_item_from_object(itemp, value)
9068  */
9069 
9070 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9071  char *__pyx_v_itemp;
9072  PyObject *__pyx_r = NULL;
9073  __Pyx_RefNannyDeclarations
9074  char *__pyx_t_1;
9075  PyObject *__pyx_t_2 = NULL;
9076  int __pyx_lineno = 0;
9077  const char *__pyx_filename = NULL;
9078  int __pyx_clineno = 0;
9079  __Pyx_RefNannySetupContext("setitem_indexed", 0);
9080 
9081  /* "View.MemoryView":482
9082  *
9083  * cdef setitem_indexed(self, index, value):
9084  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
9085  * self.assign_item_from_object(itemp, value)
9086  *
9087  */
9088  __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(0, 482, __pyx_L1_error)
9089  __pyx_v_itemp = __pyx_t_1;
9090 
9091  /* "View.MemoryView":483
9092  * cdef setitem_indexed(self, index, value):
9093  * cdef char *itemp = self.get_item_pointer(index)
9094  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
9095  *
9096  * cdef convert_item_to_object(self, char *itemp):
9097  */
9098  __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(0, 483, __pyx_L1_error)
9099  __Pyx_GOTREF(__pyx_t_2);
9100  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9101 
9102  /* "View.MemoryView":481
9103  * PyMem_Free(tmp)
9104  *
9105  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
9106  * cdef char *itemp = self.get_item_pointer(index)
9107  * self.assign_item_from_object(itemp, value)
9108  */
9109 
9110  /* function exit code */
9111  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9112  goto __pyx_L0;
9113  __pyx_L1_error:;
9114  __Pyx_XDECREF(__pyx_t_2);
9115  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
9116  __pyx_r = 0;
9117  __pyx_L0:;
9118  __Pyx_XGIVEREF(__pyx_r);
9119  __Pyx_RefNannyFinishContext();
9120  return __pyx_r;
9121 }
9122 
9123 /* "View.MemoryView":485
9124  * self.assign_item_from_object(itemp, value)
9125  *
9126  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9127  * """Only used if instantiated manually by the user, or if Cython doesn't
9128  * know how to convert the type"""
9129  */
9130 
9131 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
9132  PyObject *__pyx_v_struct = NULL;
9133  PyObject *__pyx_v_bytesitem = 0;
9134  PyObject *__pyx_v_result = NULL;
9135  PyObject *__pyx_r = NULL;
9136  __Pyx_RefNannyDeclarations
9137  PyObject *__pyx_t_1 = NULL;
9138  PyObject *__pyx_t_2 = NULL;
9139  PyObject *__pyx_t_3 = NULL;
9140  PyObject *__pyx_t_4 = NULL;
9141  PyObject *__pyx_t_5 = NULL;
9142  PyObject *__pyx_t_6 = NULL;
9143  PyObject *__pyx_t_7 = NULL;
9144  int __pyx_t_8;
9145  PyObject *__pyx_t_9 = NULL;
9146  size_t __pyx_t_10;
9147  int __pyx_t_11;
9148  int __pyx_lineno = 0;
9149  const char *__pyx_filename = NULL;
9150  int __pyx_clineno = 0;
9151  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
9152 
9153  /* "View.MemoryView":488
9154  * """Only used if instantiated manually by the user, or if Cython doesn't
9155  * know how to convert the type"""
9156  * import struct # <<<<<<<<<<<<<<
9157  * cdef bytes bytesitem
9158  *
9159  */
9160  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error)
9161  __Pyx_GOTREF(__pyx_t_1);
9162  __pyx_v_struct = __pyx_t_1;
9163  __pyx_t_1 = 0;
9164 
9165  /* "View.MemoryView":491
9166  * cdef bytes bytesitem
9167  *
9168  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
9169  * try:
9170  * result = struct.unpack(self.view.format, bytesitem)
9171  */
9172  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
9173  __Pyx_GOTREF(__pyx_t_1);
9174  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
9175  __pyx_t_1 = 0;
9176 
9177  /* "View.MemoryView":492
9178  *
9179  * bytesitem = itemp[:self.view.itemsize]
9180  * try: # <<<<<<<<<<<<<<
9181  * result = struct.unpack(self.view.format, bytesitem)
9182  * except struct.error:
9183  */
9184  {
9185  __Pyx_PyThreadState_declare
9186  __Pyx_PyThreadState_assign
9187  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
9188  __Pyx_XGOTREF(__pyx_t_2);
9189  __Pyx_XGOTREF(__pyx_t_3);
9190  __Pyx_XGOTREF(__pyx_t_4);
9191  /*try:*/ {
9192 
9193  /* "View.MemoryView":493
9194  * bytesitem = itemp[:self.view.itemsize]
9195  * try:
9196  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
9197  * except struct.error:
9198  * raise ValueError("Unable to convert item to object")
9199  */
9200  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L3_error)
9201  __Pyx_GOTREF(__pyx_t_5);
9202  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 493, __pyx_L3_error)
9203  __Pyx_GOTREF(__pyx_t_6);
9204  __pyx_t_7 = NULL;
9205  __pyx_t_8 = 0;
9206  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
9207  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
9208  if (likely(__pyx_t_7)) {
9209  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9210  __Pyx_INCREF(__pyx_t_7);
9211  __Pyx_INCREF(function);
9212  __Pyx_DECREF_SET(__pyx_t_5, function);
9213  __pyx_t_8 = 1;
9214  }
9215  }
9216  #if CYTHON_FAST_PYCALL
9217  if (PyFunction_Check(__pyx_t_5)) {
9218  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
9219  __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(0, 493, __pyx_L3_error)
9220  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9221  __Pyx_GOTREF(__pyx_t_1);
9222  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9223  } else
9224  #endif
9225  #if CYTHON_FAST_PYCCALL
9226  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
9227  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
9228  __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(0, 493, __pyx_L3_error)
9229  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9230  __Pyx_GOTREF(__pyx_t_1);
9231  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9232  } else
9233  #endif
9234  {
9235  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 493, __pyx_L3_error)
9236  __Pyx_GOTREF(__pyx_t_9);
9237  if (__pyx_t_7) {
9238  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
9239  }
9240  __Pyx_GIVEREF(__pyx_t_6);
9241  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
9242  __Pyx_INCREF(__pyx_v_bytesitem);
9243  __Pyx_GIVEREF(__pyx_v_bytesitem);
9244  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
9245  __pyx_t_6 = 0;
9246  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L3_error)
9247  __Pyx_GOTREF(__pyx_t_1);
9248  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9249  }
9250  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9251  __pyx_v_result = __pyx_t_1;
9252  __pyx_t_1 = 0;
9253 
9254  /* "View.MemoryView":492
9255  *
9256  * bytesitem = itemp[:self.view.itemsize]
9257  * try: # <<<<<<<<<<<<<<
9258  * result = struct.unpack(self.view.format, bytesitem)
9259  * except struct.error:
9260  */
9261  }
9262 
9263  /* "View.MemoryView":497
9264  * raise ValueError("Unable to convert item to object")
9265  * else:
9266  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9267  * return result[0]
9268  * return result
9269  */
9270  /*else:*/ {
9271  __pyx_t_10 = strlen(__pyx_v_self->view.format);
9272  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
9273  if (__pyx_t_11) {
9274 
9275  /* "View.MemoryView":498
9276  * else:
9277  * if len(self.view.format) == 1:
9278  * return result[0] # <<<<<<<<<<<<<<
9279  * return result
9280  *
9281  */
9282  __Pyx_XDECREF(__pyx_r);
9283  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L5_except_error)
9284  __Pyx_GOTREF(__pyx_t_1);
9285  __pyx_r = __pyx_t_1;
9286  __pyx_t_1 = 0;
9287  goto __pyx_L6_except_return;
9288 
9289  /* "View.MemoryView":497
9290  * raise ValueError("Unable to convert item to object")
9291  * else:
9292  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9293  * return result[0]
9294  * return result
9295  */
9296  }
9297 
9298  /* "View.MemoryView":499
9299  * if len(self.view.format) == 1:
9300  * return result[0]
9301  * return result # <<<<<<<<<<<<<<
9302  *
9303  * cdef assign_item_from_object(self, char *itemp, object value):
9304  */
9305  __Pyx_XDECREF(__pyx_r);
9306  __Pyx_INCREF(__pyx_v_result);
9307  __pyx_r = __pyx_v_result;
9308  goto __pyx_L6_except_return;
9309  }
9310  __pyx_L3_error:;
9311  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9312  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9313  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9314  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9315  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9316 
9317  /* "View.MemoryView":494
9318  * try:
9319  * result = struct.unpack(self.view.format, bytesitem)
9320  * except struct.error: # <<<<<<<<<<<<<<
9321  * raise ValueError("Unable to convert item to object")
9322  * else:
9323  */
9324  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
9325  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L5_except_error)
9326  __Pyx_GOTREF(__pyx_t_6);
9327  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
9328  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9329  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
9330  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
9331  if (__pyx_t_8) {
9332  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9333  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 494, __pyx_L5_except_error)
9334  __Pyx_GOTREF(__pyx_t_9);
9335  __Pyx_GOTREF(__pyx_t_5);
9336  __Pyx_GOTREF(__pyx_t_1);
9337 
9338  /* "View.MemoryView":495
9339  * result = struct.unpack(self.view.format, bytesitem)
9340  * except struct.error:
9341  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
9342  * else:
9343  * if len(self.view.format) == 1:
9344  */
9345  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 495, __pyx_L5_except_error)
9346  __Pyx_GOTREF(__pyx_t_6);
9347  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
9348  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9349  __PYX_ERR(0, 495, __pyx_L5_except_error)
9350  }
9351  goto __pyx_L5_except_error;
9352  __pyx_L5_except_error:;
9353 
9354  /* "View.MemoryView":492
9355  *
9356  * bytesitem = itemp[:self.view.itemsize]
9357  * try: # <<<<<<<<<<<<<<
9358  * result = struct.unpack(self.view.format, bytesitem)
9359  * except struct.error:
9360  */
9361  __Pyx_XGIVEREF(__pyx_t_2);
9362  __Pyx_XGIVEREF(__pyx_t_3);
9363  __Pyx_XGIVEREF(__pyx_t_4);
9364  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9365  goto __pyx_L1_error;
9366  __pyx_L6_except_return:;
9367  __Pyx_XGIVEREF(__pyx_t_2);
9368  __Pyx_XGIVEREF(__pyx_t_3);
9369  __Pyx_XGIVEREF(__pyx_t_4);
9370  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9371  goto __pyx_L0;
9372  }
9373 
9374  /* "View.MemoryView":485
9375  * self.assign_item_from_object(itemp, value)
9376  *
9377  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9378  * """Only used if instantiated manually by the user, or if Cython doesn't
9379  * know how to convert the type"""
9380  */
9381 
9382  /* function exit code */
9383  __pyx_L1_error:;
9384  __Pyx_XDECREF(__pyx_t_1);
9385  __Pyx_XDECREF(__pyx_t_5);
9386  __Pyx_XDECREF(__pyx_t_6);
9387  __Pyx_XDECREF(__pyx_t_7);
9388  __Pyx_XDECREF(__pyx_t_9);
9389  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9390  __pyx_r = 0;
9391  __pyx_L0:;
9392  __Pyx_XDECREF(__pyx_v_struct);
9393  __Pyx_XDECREF(__pyx_v_bytesitem);
9394  __Pyx_XDECREF(__pyx_v_result);
9395  __Pyx_XGIVEREF(__pyx_r);
9396  __Pyx_RefNannyFinishContext();
9397  return __pyx_r;
9398 }
9399 
9400 /* "View.MemoryView":501
9401  * return result
9402  *
9403  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
9404  * """Only used if instantiated manually by the user, or if Cython doesn't
9405  * know how to convert the type"""
9406  */
9407 
9408 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
9409  PyObject *__pyx_v_struct = NULL;
9410  char __pyx_v_c;
9411  PyObject *__pyx_v_bytesvalue = 0;
9412  Py_ssize_t __pyx_v_i;
9413  PyObject *__pyx_r = NULL;
9414  __Pyx_RefNannyDeclarations
9415  PyObject *__pyx_t_1 = NULL;
9416  int __pyx_t_2;
9417  int __pyx_t_3;
9418  PyObject *__pyx_t_4 = NULL;
9419  PyObject *__pyx_t_5 = NULL;
9420  PyObject *__pyx_t_6 = NULL;
9421  int __pyx_t_7;
9422  PyObject *__pyx_t_8 = NULL;
9423  Py_ssize_t __pyx_t_9;
9424  PyObject *__pyx_t_10 = NULL;
9425  char *__pyx_t_11;
9426  char *__pyx_t_12;
9427  char *__pyx_t_13;
9428  char *__pyx_t_14;
9429  int __pyx_lineno = 0;
9430  const char *__pyx_filename = NULL;
9431  int __pyx_clineno = 0;
9432  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
9433 
9434  /* "View.MemoryView":504
9435  * """Only used if instantiated manually by the user, or if Cython doesn't
9436  * know how to convert the type"""
9437  * import struct # <<<<<<<<<<<<<<
9438  * cdef char c
9439  * cdef bytes bytesvalue
9440  */
9441  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
9442  __Pyx_GOTREF(__pyx_t_1);
9443  __pyx_v_struct = __pyx_t_1;
9444  __pyx_t_1 = 0;
9445 
9446  /* "View.MemoryView":509
9447  * cdef Py_ssize_t i
9448  *
9449  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9450  * bytesvalue = struct.pack(self.view.format, *value)
9451  * else:
9452  */
9453  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
9454  __pyx_t_3 = (__pyx_t_2 != 0);
9455  if (__pyx_t_3) {
9456 
9457  /* "View.MemoryView":510
9458  *
9459  * if isinstance(value, tuple):
9460  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
9461  * else:
9462  * bytesvalue = struct.pack(self.view.format, value)
9463  */
9464  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
9465  __Pyx_GOTREF(__pyx_t_1);
9466  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error)
9467  __Pyx_GOTREF(__pyx_t_4);
9468  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error)
9469  __Pyx_GOTREF(__pyx_t_5);
9470  __Pyx_GIVEREF(__pyx_t_4);
9471  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
9472  __pyx_t_4 = 0;
9473  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error)
9474  __Pyx_GOTREF(__pyx_t_4);
9475  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error)
9476  __Pyx_GOTREF(__pyx_t_6);
9477  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9478  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9479  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error)
9480  __Pyx_GOTREF(__pyx_t_4);
9481  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9482  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9483  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(0, 510, __pyx_L1_error)
9484  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
9485  __pyx_t_4 = 0;
9486 
9487  /* "View.MemoryView":509
9488  * cdef Py_ssize_t i
9489  *
9490  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9491  * bytesvalue = struct.pack(self.view.format, *value)
9492  * else:
9493  */
9494  goto __pyx_L3;
9495  }
9496 
9497  /* "View.MemoryView":512
9498  * bytesvalue = struct.pack(self.view.format, *value)
9499  * else:
9500  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
9501  *
9502  * for i, c in enumerate(bytesvalue):
9503  */
9504  /*else*/ {
9505  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error)
9506  __Pyx_GOTREF(__pyx_t_6);
9507  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
9508  __Pyx_GOTREF(__pyx_t_1);
9509  __pyx_t_5 = NULL;
9510  __pyx_t_7 = 0;
9511  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
9512  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
9513  if (likely(__pyx_t_5)) {
9514  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
9515  __Pyx_INCREF(__pyx_t_5);
9516  __Pyx_INCREF(function);
9517  __Pyx_DECREF_SET(__pyx_t_6, function);
9518  __pyx_t_7 = 1;
9519  }
9520  }
9521  #if CYTHON_FAST_PYCALL
9522  if (PyFunction_Check(__pyx_t_6)) {
9523  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
9524  __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(0, 512, __pyx_L1_error)
9525  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9526  __Pyx_GOTREF(__pyx_t_4);
9527  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9528  } else
9529  #endif
9530  #if CYTHON_FAST_PYCCALL
9531  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
9532  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
9533  __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(0, 512, __pyx_L1_error)
9534  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9535  __Pyx_GOTREF(__pyx_t_4);
9536  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9537  } else
9538  #endif
9539  {
9540  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 512, __pyx_L1_error)
9541  __Pyx_GOTREF(__pyx_t_8);
9542  if (__pyx_t_5) {
9543  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
9544  }
9545  __Pyx_GIVEREF(__pyx_t_1);
9546  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
9547  __Pyx_INCREF(__pyx_v_value);
9548  __Pyx_GIVEREF(__pyx_v_value);
9549  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
9550  __pyx_t_1 = 0;
9551  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
9552  __Pyx_GOTREF(__pyx_t_4);
9553  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9554  }
9555  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9556  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(0, 512, __pyx_L1_error)
9557  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
9558  __pyx_t_4 = 0;
9559  }
9560  __pyx_L3:;
9561 
9562  /* "View.MemoryView":514
9563  * bytesvalue = struct.pack(self.view.format, value)
9564  *
9565  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
9566  * itemp[i] = c
9567  *
9568  */
9569  __pyx_t_9 = 0;
9570  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
9571  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
9572  __PYX_ERR(0, 514, __pyx_L1_error)
9573  }
9574  __Pyx_INCREF(__pyx_v_bytesvalue);
9575  __pyx_t_10 = __pyx_v_bytesvalue;
9576  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
9577  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
9578  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
9579  __pyx_t_11 = __pyx_t_14;
9580  __pyx_v_c = (__pyx_t_11[0]);
9581 
9582  /* "View.MemoryView":515
9583  *
9584  * for i, c in enumerate(bytesvalue):
9585  * itemp[i] = c # <<<<<<<<<<<<<<
9586  *
9587  * @cname('getbuffer')
9588  */
9589  __pyx_v_i = __pyx_t_9;
9590 
9591  /* "View.MemoryView":514
9592  * bytesvalue = struct.pack(self.view.format, value)
9593  *
9594  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
9595  * itemp[i] = c
9596  *
9597  */
9598  __pyx_t_9 = (__pyx_t_9 + 1);
9599 
9600  /* "View.MemoryView":515
9601  *
9602  * for i, c in enumerate(bytesvalue):
9603  * itemp[i] = c # <<<<<<<<<<<<<<
9604  *
9605  * @cname('getbuffer')
9606  */
9607  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
9608  }
9609  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9610 
9611  /* "View.MemoryView":501
9612  * return result
9613  *
9614  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
9615  * """Only used if instantiated manually by the user, or if Cython doesn't
9616  * know how to convert the type"""
9617  */
9618 
9619  /* function exit code */
9620  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9621  goto __pyx_L0;
9622  __pyx_L1_error:;
9623  __Pyx_XDECREF(__pyx_t_1);
9624  __Pyx_XDECREF(__pyx_t_4);
9625  __Pyx_XDECREF(__pyx_t_5);
9626  __Pyx_XDECREF(__pyx_t_6);
9627  __Pyx_XDECREF(__pyx_t_8);
9628  __Pyx_XDECREF(__pyx_t_10);
9629  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9630  __pyx_r = 0;
9631  __pyx_L0:;
9632  __Pyx_XDECREF(__pyx_v_struct);
9633  __Pyx_XDECREF(__pyx_v_bytesvalue);
9634  __Pyx_XGIVEREF(__pyx_r);
9635  __Pyx_RefNannyFinishContext();
9636  return __pyx_r;
9637 }
9638 
9639 /* "View.MemoryView":518
9640  *
9641  * @cname('getbuffer')
9642  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9643  * if flags & PyBUF_WRITABLE and self.view.readonly:
9644  * raise ValueError("Cannot create writable memory view from read-only memoryview")
9645  */
9646 
9647 /* Python wrapper */
9648 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
9649 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9650  int __pyx_r;
9651  __Pyx_RefNannyDeclarations
9652  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9653  __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));
9654 
9655  /* function exit code */
9656  __Pyx_RefNannyFinishContext();
9657  return __pyx_r;
9658 }
9659 
9660 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) {
9661  int __pyx_r;
9662  __Pyx_RefNannyDeclarations
9663  int __pyx_t_1;
9664  int __pyx_t_2;
9665  PyObject *__pyx_t_3 = NULL;
9666  Py_ssize_t *__pyx_t_4;
9667  char *__pyx_t_5;
9668  void *__pyx_t_6;
9669  int __pyx_t_7;
9670  Py_ssize_t __pyx_t_8;
9671  int __pyx_lineno = 0;
9672  const char *__pyx_filename = NULL;
9673  int __pyx_clineno = 0;
9674  if (__pyx_v_info == NULL) {
9675  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
9676  return -1;
9677  }
9678  __Pyx_RefNannySetupContext("__getbuffer__", 0);
9679  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9680  __Pyx_GIVEREF(__pyx_v_info->obj);
9681 
9682  /* "View.MemoryView":519
9683  * @cname('getbuffer')
9684  * def __getbuffer__(self, Py_buffer *info, int flags):
9685  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
9686  * raise ValueError("Cannot create writable memory view from read-only memoryview")
9687  *
9688  */
9689  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
9690  if (__pyx_t_2) {
9691  } else {
9692  __pyx_t_1 = __pyx_t_2;
9693  goto __pyx_L4_bool_binop_done;
9694  }
9695  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
9696  __pyx_t_1 = __pyx_t_2;
9697  __pyx_L4_bool_binop_done:;
9698  if (unlikely(__pyx_t_1)) {
9699 
9700  /* "View.MemoryView":520
9701  * def __getbuffer__(self, Py_buffer *info, int flags):
9702  * if flags & PyBUF_WRITABLE and self.view.readonly:
9703  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
9704  *
9705  * if flags & PyBUF_ND:
9706  */
9707  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error)
9708  __Pyx_GOTREF(__pyx_t_3);
9709  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9710  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9711  __PYX_ERR(0, 520, __pyx_L1_error)
9712 
9713  /* "View.MemoryView":519
9714  * @cname('getbuffer')
9715  * def __getbuffer__(self, Py_buffer *info, int flags):
9716  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
9717  * raise ValueError("Cannot create writable memory view from read-only memoryview")
9718  *
9719  */
9720  }
9721 
9722  /* "View.MemoryView":522
9723  * raise ValueError("Cannot create writable memory view from read-only memoryview")
9724  *
9725  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
9726  * info.shape = self.view.shape
9727  * else:
9728  */
9729  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
9730  if (__pyx_t_1) {
9731 
9732  /* "View.MemoryView":523
9733  *
9734  * if flags & PyBUF_ND:
9735  * info.shape = self.view.shape # <<<<<<<<<<<<<<
9736  * else:
9737  * info.shape = NULL
9738  */
9739  __pyx_t_4 = __pyx_v_self->view.shape;
9740  __pyx_v_info->shape = __pyx_t_4;
9741 
9742  /* "View.MemoryView":522
9743  * raise ValueError("Cannot create writable memory view from read-only memoryview")
9744  *
9745  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
9746  * info.shape = self.view.shape
9747  * else:
9748  */
9749  goto __pyx_L6;
9750  }
9751 
9752  /* "View.MemoryView":525
9753  * info.shape = self.view.shape
9754  * else:
9755  * info.shape = NULL # <<<<<<<<<<<<<<
9756  *
9757  * if flags & PyBUF_STRIDES:
9758  */
9759  /*else*/ {
9760  __pyx_v_info->shape = NULL;
9761  }
9762  __pyx_L6:;
9763 
9764  /* "View.MemoryView":527
9765  * info.shape = NULL
9766  *
9767  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
9768  * info.strides = self.view.strides
9769  * else:
9770  */
9771  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
9772  if (__pyx_t_1) {
9773 
9774  /* "View.MemoryView":528
9775  *
9776  * if flags & PyBUF_STRIDES:
9777  * info.strides = self.view.strides # <<<<<<<<<<<<<<
9778  * else:
9779  * info.strides = NULL
9780  */
9781  __pyx_t_4 = __pyx_v_self->view.strides;
9782  __pyx_v_info->strides = __pyx_t_4;
9783 
9784  /* "View.MemoryView":527
9785  * info.shape = NULL
9786  *
9787  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
9788  * info.strides = self.view.strides
9789  * else:
9790  */
9791  goto __pyx_L7;
9792  }
9793 
9794  /* "View.MemoryView":530
9795  * info.strides = self.view.strides
9796  * else:
9797  * info.strides = NULL # <<<<<<<<<<<<<<
9798  *
9799  * if flags & PyBUF_INDIRECT:
9800  */
9801  /*else*/ {
9802  __pyx_v_info->strides = NULL;
9803  }
9804  __pyx_L7:;
9805 
9806  /* "View.MemoryView":532
9807  * info.strides = NULL
9808  *
9809  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
9810  * info.suboffsets = self.view.suboffsets
9811  * else:
9812  */
9813  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
9814  if (__pyx_t_1) {
9815 
9816  /* "View.MemoryView":533
9817  *
9818  * if flags & PyBUF_INDIRECT:
9819  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
9820  * else:
9821  * info.suboffsets = NULL
9822  */
9823  __pyx_t_4 = __pyx_v_self->view.suboffsets;
9824  __pyx_v_info->suboffsets = __pyx_t_4;
9825 
9826  /* "View.MemoryView":532
9827  * info.strides = NULL
9828  *
9829  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
9830  * info.suboffsets = self.view.suboffsets
9831  * else:
9832  */
9833  goto __pyx_L8;
9834  }
9835 
9836  /* "View.MemoryView":535
9837  * info.suboffsets = self.view.suboffsets
9838  * else:
9839  * info.suboffsets = NULL # <<<<<<<<<<<<<<
9840  *
9841  * if flags & PyBUF_FORMAT:
9842  */
9843  /*else*/ {
9844  __pyx_v_info->suboffsets = NULL;
9845  }
9846  __pyx_L8:;
9847 
9848  /* "View.MemoryView":537
9849  * info.suboffsets = NULL
9850  *
9851  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9852  * info.format = self.view.format
9853  * else:
9854  */
9855  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9856  if (__pyx_t_1) {
9857 
9858  /* "View.MemoryView":538
9859  *
9860  * if flags & PyBUF_FORMAT:
9861  * info.format = self.view.format # <<<<<<<<<<<<<<
9862  * else:
9863  * info.format = NULL
9864  */
9865  __pyx_t_5 = __pyx_v_self->view.format;
9866  __pyx_v_info->format = __pyx_t_5;
9867 
9868  /* "View.MemoryView":537
9869  * info.suboffsets = NULL
9870  *
9871  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9872  * info.format = self.view.format
9873  * else:
9874  */
9875  goto __pyx_L9;
9876  }
9877 
9878  /* "View.MemoryView":540
9879  * info.format = self.view.format
9880  * else:
9881  * info.format = NULL # <<<<<<<<<<<<<<
9882  *
9883  * info.buf = self.view.buf
9884  */
9885  /*else*/ {
9886  __pyx_v_info->format = NULL;
9887  }
9888  __pyx_L9:;
9889 
9890  /* "View.MemoryView":542
9891  * info.format = NULL
9892  *
9893  * info.buf = self.view.buf # <<<<<<<<<<<<<<
9894  * info.ndim = self.view.ndim
9895  * info.itemsize = self.view.itemsize
9896  */
9897  __pyx_t_6 = __pyx_v_self->view.buf;
9898  __pyx_v_info->buf = __pyx_t_6;
9899 
9900  /* "View.MemoryView":543
9901  *
9902  * info.buf = self.view.buf
9903  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
9904  * info.itemsize = self.view.itemsize
9905  * info.len = self.view.len
9906  */
9907  __pyx_t_7 = __pyx_v_self->view.ndim;
9908  __pyx_v_info->ndim = __pyx_t_7;
9909 
9910  /* "View.MemoryView":544
9911  * info.buf = self.view.buf
9912  * info.ndim = self.view.ndim
9913  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
9914  * info.len = self.view.len
9915  * info.readonly = self.view.readonly
9916  */
9917  __pyx_t_8 = __pyx_v_self->view.itemsize;
9918  __pyx_v_info->itemsize = __pyx_t_8;
9919 
9920  /* "View.MemoryView":545
9921  * info.ndim = self.view.ndim
9922  * info.itemsize = self.view.itemsize
9923  * info.len = self.view.len # <<<<<<<<<<<<<<
9924  * info.readonly = self.view.readonly
9925  * info.obj = self
9926  */
9927  __pyx_t_8 = __pyx_v_self->view.len;
9928  __pyx_v_info->len = __pyx_t_8;
9929 
9930  /* "View.MemoryView":546
9931  * info.itemsize = self.view.itemsize
9932  * info.len = self.view.len
9933  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
9934  * info.obj = self
9935  *
9936  */
9937  __pyx_t_1 = __pyx_v_self->view.readonly;
9938  __pyx_v_info->readonly = __pyx_t_1;
9939 
9940  /* "View.MemoryView":547
9941  * info.len = self.view.len
9942  * info.readonly = self.view.readonly
9943  * info.obj = self # <<<<<<<<<<<<<<
9944  *
9945  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
9946  */
9947  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9948  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9949  __Pyx_GOTREF(__pyx_v_info->obj);
9950  __Pyx_DECREF(__pyx_v_info->obj);
9951  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9952 
9953  /* "View.MemoryView":518
9954  *
9955  * @cname('getbuffer')
9956  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9957  * if flags & PyBUF_WRITABLE and self.view.readonly:
9958  * raise ValueError("Cannot create writable memory view from read-only memoryview")
9959  */
9960 
9961  /* function exit code */
9962  __pyx_r = 0;
9963  goto __pyx_L0;
9964  __pyx_L1_error:;
9965  __Pyx_XDECREF(__pyx_t_3);
9966  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9967  __pyx_r = -1;
9968  if (__pyx_v_info->obj != NULL) {
9969  __Pyx_GOTREF(__pyx_v_info->obj);
9970  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9971  }
9972  goto __pyx_L2;
9973  __pyx_L0:;
9974  if (__pyx_v_info->obj == Py_None) {
9975  __Pyx_GOTREF(__pyx_v_info->obj);
9976  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9977  }
9978  __pyx_L2:;
9979  __Pyx_RefNannyFinishContext();
9980  return __pyx_r;
9981 }
9982 
9983 /* "View.MemoryView":553
9984  *
9985  * @property
9986  * def T(self): # <<<<<<<<<<<<<<
9987  * cdef _memoryviewslice result = memoryview_copy(self)
9988  * transpose_memslice(&result.from_slice)
9989  */
9990 
9991 /* Python wrapper */
9992 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
9993 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
9994  PyObject *__pyx_r = 0;
9995  __Pyx_RefNannyDeclarations
9996  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9997  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
9998 
9999  /* function exit code */
10000  __Pyx_RefNannyFinishContext();
10001  return __pyx_r;
10002 }
10003 
10004 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10005  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
10006  PyObject *__pyx_r = NULL;
10007  __Pyx_RefNannyDeclarations
10008  PyObject *__pyx_t_1 = NULL;
10009  int __pyx_t_2;
10010  int __pyx_lineno = 0;
10011  const char *__pyx_filename = NULL;
10012  int __pyx_clineno = 0;
10013  __Pyx_RefNannySetupContext("__get__", 0);
10014 
10015  /* "View.MemoryView":554
10016  * @property
10017  * def T(self):
10018  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
10019  * transpose_memslice(&result.from_slice)
10020  * return result
10021  */
10022  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
10023  __Pyx_GOTREF(__pyx_t_1);
10024  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(0, 554, __pyx_L1_error)
10025  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
10026  __pyx_t_1 = 0;
10027 
10028  /* "View.MemoryView":555
10029  * def T(self):
10030  * cdef _memoryviewslice result = memoryview_copy(self)
10031  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
10032  * return result
10033  *
10034  */
10035  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(0, 555, __pyx_L1_error)
10036 
10037  /* "View.MemoryView":556
10038  * cdef _memoryviewslice result = memoryview_copy(self)
10039  * transpose_memslice(&result.from_slice)
10040  * return result # <<<<<<<<<<<<<<
10041  *
10042  * @property
10043  */
10044  __Pyx_XDECREF(__pyx_r);
10045  __Pyx_INCREF(((PyObject *)__pyx_v_result));
10046  __pyx_r = ((PyObject *)__pyx_v_result);
10047  goto __pyx_L0;
10048 
10049  /* "View.MemoryView":553
10050  *
10051  * @property
10052  * def T(self): # <<<<<<<<<<<<<<
10053  * cdef _memoryviewslice result = memoryview_copy(self)
10054  * transpose_memslice(&result.from_slice)
10055  */
10056 
10057  /* function exit code */
10058  __pyx_L1_error:;
10059  __Pyx_XDECREF(__pyx_t_1);
10060  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10061  __pyx_r = NULL;
10062  __pyx_L0:;
10063  __Pyx_XDECREF((PyObject *)__pyx_v_result);
10064  __Pyx_XGIVEREF(__pyx_r);
10065  __Pyx_RefNannyFinishContext();
10066  return __pyx_r;
10067 }
10068 
10069 /* "View.MemoryView":559
10070  *
10071  * @property
10072  * def base(self): # <<<<<<<<<<<<<<
10073  * return self.obj
10074  *
10075  */
10076 
10077 /* Python wrapper */
10078 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
10079 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
10080  PyObject *__pyx_r = 0;
10081  __Pyx_RefNannyDeclarations
10082  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10083  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10084 
10085  /* function exit code */
10086  __Pyx_RefNannyFinishContext();
10087  return __pyx_r;
10088 }
10089 
10090 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10091  PyObject *__pyx_r = NULL;
10092  __Pyx_RefNannyDeclarations
10093  __Pyx_RefNannySetupContext("__get__", 0);
10094 
10095  /* "View.MemoryView":560
10096  * @property
10097  * def base(self):
10098  * return self.obj # <<<<<<<<<<<<<<
10099  *
10100  * @property
10101  */
10102  __Pyx_XDECREF(__pyx_r);
10103  __Pyx_INCREF(__pyx_v_self->obj);
10104  __pyx_r = __pyx_v_self->obj;
10105  goto __pyx_L0;
10106 
10107  /* "View.MemoryView":559
10108  *
10109  * @property
10110  * def base(self): # <<<<<<<<<<<<<<
10111  * return self.obj
10112  *
10113  */
10114 
10115  /* function exit code */
10116  __pyx_L0:;
10117  __Pyx_XGIVEREF(__pyx_r);
10118  __Pyx_RefNannyFinishContext();
10119  return __pyx_r;
10120 }
10121 
10122 /* "View.MemoryView":563
10123  *
10124  * @property
10125  * def shape(self): # <<<<<<<<<<<<<<
10126  * return tuple([length for length in self.view.shape[:self.view.ndim]])
10127  *
10128  */
10129 
10130 /* Python wrapper */
10131 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
10132 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
10133  PyObject *__pyx_r = 0;
10134  __Pyx_RefNannyDeclarations
10135  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10136  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10137 
10138  /* function exit code */
10139  __Pyx_RefNannyFinishContext();
10140  return __pyx_r;
10141 }
10142 
10143 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10144  Py_ssize_t __pyx_v_length;
10145  PyObject *__pyx_r = NULL;
10146  __Pyx_RefNannyDeclarations
10147  PyObject *__pyx_t_1 = NULL;
10148  Py_ssize_t *__pyx_t_2;
10149  Py_ssize_t *__pyx_t_3;
10150  Py_ssize_t *__pyx_t_4;
10151  PyObject *__pyx_t_5 = NULL;
10152  int __pyx_lineno = 0;
10153  const char *__pyx_filename = NULL;
10154  int __pyx_clineno = 0;
10155  __Pyx_RefNannySetupContext("__get__", 0);
10156 
10157  /* "View.MemoryView":564
10158  * @property
10159  * def shape(self):
10160  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
10161  *
10162  * @property
10163  */
10164  __Pyx_XDECREF(__pyx_r);
10165  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
10166  __Pyx_GOTREF(__pyx_t_1);
10167  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10168  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
10169  __pyx_t_2 = __pyx_t_4;
10170  __pyx_v_length = (__pyx_t_2[0]);
10171  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error)
10172  __Pyx_GOTREF(__pyx_t_5);
10173  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 564, __pyx_L1_error)
10174  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10175  }
10176  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error)
10177  __Pyx_GOTREF(__pyx_t_5);
10178  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10179  __pyx_r = __pyx_t_5;
10180  __pyx_t_5 = 0;
10181  goto __pyx_L0;
10182 
10183  /* "View.MemoryView":563
10184  *
10185  * @property
10186  * def shape(self): # <<<<<<<<<<<<<<
10187  * return tuple([length for length in self.view.shape[:self.view.ndim]])
10188  *
10189  */
10190 
10191  /* function exit code */
10192  __pyx_L1_error:;
10193  __Pyx_XDECREF(__pyx_t_1);
10194  __Pyx_XDECREF(__pyx_t_5);
10195  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10196  __pyx_r = NULL;
10197  __pyx_L0:;
10198  __Pyx_XGIVEREF(__pyx_r);
10199  __Pyx_RefNannyFinishContext();
10200  return __pyx_r;
10201 }
10202 
10203 /* "View.MemoryView":567
10204  *
10205  * @property
10206  * def strides(self): # <<<<<<<<<<<<<<
10207  * if self.view.strides == NULL:
10208  *
10209  */
10210 
10211 /* Python wrapper */
10212 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
10213 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
10214  PyObject *__pyx_r = 0;
10215  __Pyx_RefNannyDeclarations
10216  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10217  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10218 
10219  /* function exit code */
10220  __Pyx_RefNannyFinishContext();
10221  return __pyx_r;
10222 }
10223 
10224 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10225  Py_ssize_t __pyx_v_stride;
10226  PyObject *__pyx_r = NULL;
10227  __Pyx_RefNannyDeclarations
10228  int __pyx_t_1;
10229  PyObject *__pyx_t_2 = NULL;
10230  Py_ssize_t *__pyx_t_3;
10231  Py_ssize_t *__pyx_t_4;
10232  Py_ssize_t *__pyx_t_5;
10233  PyObject *__pyx_t_6 = NULL;
10234  int __pyx_lineno = 0;
10235  const char *__pyx_filename = NULL;
10236  int __pyx_clineno = 0;
10237  __Pyx_RefNannySetupContext("__get__", 0);
10238 
10239  /* "View.MemoryView":568
10240  * @property
10241  * def strides(self):
10242  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
10243  *
10244  * raise ValueError("Buffer view does not expose strides")
10245  */
10246  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
10247  if (unlikely(__pyx_t_1)) {
10248 
10249  /* "View.MemoryView":570
10250  * if self.view.strides == NULL:
10251  *
10252  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
10253  *
10254  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10255  */
10256  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
10257  __Pyx_GOTREF(__pyx_t_2);
10258  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
10259  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10260  __PYX_ERR(0, 570, __pyx_L1_error)
10261 
10262  /* "View.MemoryView":568
10263  * @property
10264  * def strides(self):
10265  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
10266  *
10267  * raise ValueError("Buffer view does not expose strides")
10268  */
10269  }
10270 
10271  /* "View.MemoryView":572
10272  * raise ValueError("Buffer view does not expose strides")
10273  *
10274  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
10275  *
10276  * @property
10277  */
10278  __Pyx_XDECREF(__pyx_r);
10279  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
10280  __Pyx_GOTREF(__pyx_t_2);
10281  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
10282  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
10283  __pyx_t_3 = __pyx_t_5;
10284  __pyx_v_stride = (__pyx_t_3[0]);
10285  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error)
10286  __Pyx_GOTREF(__pyx_t_6);
10287  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 572, __pyx_L1_error)
10288  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10289  }
10290  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error)
10291  __Pyx_GOTREF(__pyx_t_6);
10292  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10293  __pyx_r = __pyx_t_6;
10294  __pyx_t_6 = 0;
10295  goto __pyx_L0;
10296 
10297  /* "View.MemoryView":567
10298  *
10299  * @property
10300  * def strides(self): # <<<<<<<<<<<<<<
10301  * if self.view.strides == NULL:
10302  *
10303  */
10304 
10305  /* function exit code */
10306  __pyx_L1_error:;
10307  __Pyx_XDECREF(__pyx_t_2);
10308  __Pyx_XDECREF(__pyx_t_6);
10309  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10310  __pyx_r = NULL;
10311  __pyx_L0:;
10312  __Pyx_XGIVEREF(__pyx_r);
10313  __Pyx_RefNannyFinishContext();
10314  return __pyx_r;
10315 }
10316 
10317 /* "View.MemoryView":575
10318  *
10319  * @property
10320  * def suboffsets(self): # <<<<<<<<<<<<<<
10321  * if self.view.suboffsets == NULL:
10322  * return (-1,) * self.view.ndim
10323  */
10324 
10325 /* Python wrapper */
10326 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
10327 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
10328  PyObject *__pyx_r = 0;
10329  __Pyx_RefNannyDeclarations
10330  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10331  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10332 
10333  /* function exit code */
10334  __Pyx_RefNannyFinishContext();
10335  return __pyx_r;
10336 }
10337 
10338 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10339  Py_ssize_t __pyx_v_suboffset;
10340  PyObject *__pyx_r = NULL;
10341  __Pyx_RefNannyDeclarations
10342  int __pyx_t_1;
10343  PyObject *__pyx_t_2 = NULL;
10344  PyObject *__pyx_t_3 = NULL;
10345  Py_ssize_t *__pyx_t_4;
10346  Py_ssize_t *__pyx_t_5;
10347  Py_ssize_t *__pyx_t_6;
10348  int __pyx_lineno = 0;
10349  const char *__pyx_filename = NULL;
10350  int __pyx_clineno = 0;
10351  __Pyx_RefNannySetupContext("__get__", 0);
10352 
10353  /* "View.MemoryView":576
10354  * @property
10355  * def suboffsets(self):
10356  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10357  * return (-1,) * self.view.ndim
10358  *
10359  */
10360  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
10361  if (__pyx_t_1) {
10362 
10363  /* "View.MemoryView":577
10364  * def suboffsets(self):
10365  * if self.view.suboffsets == NULL:
10366  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
10367  *
10368  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10369  */
10370  __Pyx_XDECREF(__pyx_r);
10371  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
10372  __Pyx_GOTREF(__pyx_t_2);
10373  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__16, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error)
10374  __Pyx_GOTREF(__pyx_t_3);
10375  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10376  __pyx_r = __pyx_t_3;
10377  __pyx_t_3 = 0;
10378  goto __pyx_L0;
10379 
10380  /* "View.MemoryView":576
10381  * @property
10382  * def suboffsets(self):
10383  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10384  * return (-1,) * self.view.ndim
10385  *
10386  */
10387  }
10388 
10389  /* "View.MemoryView":579
10390  * return (-1,) * self.view.ndim
10391  *
10392  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
10393  *
10394  * @property
10395  */
10396  __Pyx_XDECREF(__pyx_r);
10397  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error)
10398  __Pyx_GOTREF(__pyx_t_3);
10399  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
10400  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
10401  __pyx_t_4 = __pyx_t_6;
10402  __pyx_v_suboffset = (__pyx_t_4[0]);
10403  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error)
10404  __Pyx_GOTREF(__pyx_t_2);
10405  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 579, __pyx_L1_error)
10406  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10407  }
10408  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error)
10409  __Pyx_GOTREF(__pyx_t_2);
10410  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10411  __pyx_r = __pyx_t_2;
10412  __pyx_t_2 = 0;
10413  goto __pyx_L0;
10414 
10415  /* "View.MemoryView":575
10416  *
10417  * @property
10418  * def suboffsets(self): # <<<<<<<<<<<<<<
10419  * if self.view.suboffsets == NULL:
10420  * return (-1,) * self.view.ndim
10421  */
10422 
10423  /* function exit code */
10424  __pyx_L1_error:;
10425  __Pyx_XDECREF(__pyx_t_2);
10426  __Pyx_XDECREF(__pyx_t_3);
10427  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10428  __pyx_r = NULL;
10429  __pyx_L0:;
10430  __Pyx_XGIVEREF(__pyx_r);
10431  __Pyx_RefNannyFinishContext();
10432  return __pyx_r;
10433 }
10434 
10435 /* "View.MemoryView":582
10436  *
10437  * @property
10438  * def ndim(self): # <<<<<<<<<<<<<<
10439  * return self.view.ndim
10440  *
10441  */
10442 
10443 /* Python wrapper */
10444 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
10445 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
10446  PyObject *__pyx_r = 0;
10447  __Pyx_RefNannyDeclarations
10448  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10449  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10450 
10451  /* function exit code */
10452  __Pyx_RefNannyFinishContext();
10453  return __pyx_r;
10454 }
10455 
10456 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10457  PyObject *__pyx_r = NULL;
10458  __Pyx_RefNannyDeclarations
10459  PyObject *__pyx_t_1 = NULL;
10460  int __pyx_lineno = 0;
10461  const char *__pyx_filename = NULL;
10462  int __pyx_clineno = 0;
10463  __Pyx_RefNannySetupContext("__get__", 0);
10464 
10465  /* "View.MemoryView":583
10466  * @property
10467  * def ndim(self):
10468  * return self.view.ndim # <<<<<<<<<<<<<<
10469  *
10470  * @property
10471  */
10472  __Pyx_XDECREF(__pyx_r);
10473  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
10474  __Pyx_GOTREF(__pyx_t_1);
10475  __pyx_r = __pyx_t_1;
10476  __pyx_t_1 = 0;
10477  goto __pyx_L0;
10478 
10479  /* "View.MemoryView":582
10480  *
10481  * @property
10482  * def ndim(self): # <<<<<<<<<<<<<<
10483  * return self.view.ndim
10484  *
10485  */
10486 
10487  /* function exit code */
10488  __pyx_L1_error:;
10489  __Pyx_XDECREF(__pyx_t_1);
10490  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10491  __pyx_r = NULL;
10492  __pyx_L0:;
10493  __Pyx_XGIVEREF(__pyx_r);
10494  __Pyx_RefNannyFinishContext();
10495  return __pyx_r;
10496 }
10497 
10498 /* "View.MemoryView":586
10499  *
10500  * @property
10501  * def itemsize(self): # <<<<<<<<<<<<<<
10502  * return self.view.itemsize
10503  *
10504  */
10505 
10506 /* Python wrapper */
10507 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
10508 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
10509  PyObject *__pyx_r = 0;
10510  __Pyx_RefNannyDeclarations
10511  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10512  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10513 
10514  /* function exit code */
10515  __Pyx_RefNannyFinishContext();
10516  return __pyx_r;
10517 }
10518 
10519 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10520  PyObject *__pyx_r = NULL;
10521  __Pyx_RefNannyDeclarations
10522  PyObject *__pyx_t_1 = NULL;
10523  int __pyx_lineno = 0;
10524  const char *__pyx_filename = NULL;
10525  int __pyx_clineno = 0;
10526  __Pyx_RefNannySetupContext("__get__", 0);
10527 
10528  /* "View.MemoryView":587
10529  * @property
10530  * def itemsize(self):
10531  * return self.view.itemsize # <<<<<<<<<<<<<<
10532  *
10533  * @property
10534  */
10535  __Pyx_XDECREF(__pyx_r);
10536  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error)
10537  __Pyx_GOTREF(__pyx_t_1);
10538  __pyx_r = __pyx_t_1;
10539  __pyx_t_1 = 0;
10540  goto __pyx_L0;
10541 
10542  /* "View.MemoryView":586
10543  *
10544  * @property
10545  * def itemsize(self): # <<<<<<<<<<<<<<
10546  * return self.view.itemsize
10547  *
10548  */
10549 
10550  /* function exit code */
10551  __pyx_L1_error:;
10552  __Pyx_XDECREF(__pyx_t_1);
10553  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10554  __pyx_r = NULL;
10555  __pyx_L0:;
10556  __Pyx_XGIVEREF(__pyx_r);
10557  __Pyx_RefNannyFinishContext();
10558  return __pyx_r;
10559 }
10560 
10561 /* "View.MemoryView":590
10562  *
10563  * @property
10564  * def nbytes(self): # <<<<<<<<<<<<<<
10565  * return self.size * self.view.itemsize
10566  *
10567  */
10568 
10569 /* Python wrapper */
10570 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
10571 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
10572  PyObject *__pyx_r = 0;
10573  __Pyx_RefNannyDeclarations
10574  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10575  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10576 
10577  /* function exit code */
10578  __Pyx_RefNannyFinishContext();
10579  return __pyx_r;
10580 }
10581 
10582 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10583  PyObject *__pyx_r = NULL;
10584  __Pyx_RefNannyDeclarations
10585  PyObject *__pyx_t_1 = NULL;
10586  PyObject *__pyx_t_2 = NULL;
10587  PyObject *__pyx_t_3 = NULL;
10588  int __pyx_lineno = 0;
10589  const char *__pyx_filename = NULL;
10590  int __pyx_clineno = 0;
10591  __Pyx_RefNannySetupContext("__get__", 0);
10592 
10593  /* "View.MemoryView":591
10594  * @property
10595  * def nbytes(self):
10596  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
10597  *
10598  * @property
10599  */
10600  __Pyx_XDECREF(__pyx_r);
10601  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error)
10602  __Pyx_GOTREF(__pyx_t_1);
10603  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error)
10604  __Pyx_GOTREF(__pyx_t_2);
10605  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error)
10606  __Pyx_GOTREF(__pyx_t_3);
10607  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10608  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10609  __pyx_r = __pyx_t_3;
10610  __pyx_t_3 = 0;
10611  goto __pyx_L0;
10612 
10613  /* "View.MemoryView":590
10614  *
10615  * @property
10616  * def nbytes(self): # <<<<<<<<<<<<<<
10617  * return self.size * self.view.itemsize
10618  *
10619  */
10620 
10621  /* function exit code */
10622  __pyx_L1_error:;
10623  __Pyx_XDECREF(__pyx_t_1);
10624  __Pyx_XDECREF(__pyx_t_2);
10625  __Pyx_XDECREF(__pyx_t_3);
10626  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10627  __pyx_r = NULL;
10628  __pyx_L0:;
10629  __Pyx_XGIVEREF(__pyx_r);
10630  __Pyx_RefNannyFinishContext();
10631  return __pyx_r;
10632 }
10633 
10634 /* "View.MemoryView":594
10635  *
10636  * @property
10637  * def size(self): # <<<<<<<<<<<<<<
10638  * if self._size is None:
10639  * result = 1
10640  */
10641 
10642 /* Python wrapper */
10643 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
10644 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
10645  PyObject *__pyx_r = 0;
10646  __Pyx_RefNannyDeclarations
10647  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10648  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10649 
10650  /* function exit code */
10651  __Pyx_RefNannyFinishContext();
10652  return __pyx_r;
10653 }
10654 
10655 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10656  PyObject *__pyx_v_result = NULL;
10657  PyObject *__pyx_v_length = NULL;
10658  PyObject *__pyx_r = NULL;
10659  __Pyx_RefNannyDeclarations
10660  int __pyx_t_1;
10661  int __pyx_t_2;
10662  Py_ssize_t *__pyx_t_3;
10663  Py_ssize_t *__pyx_t_4;
10664  Py_ssize_t *__pyx_t_5;
10665  PyObject *__pyx_t_6 = NULL;
10666  int __pyx_lineno = 0;
10667  const char *__pyx_filename = NULL;
10668  int __pyx_clineno = 0;
10669  __Pyx_RefNannySetupContext("__get__", 0);
10670 
10671  /* "View.MemoryView":595
10672  * @property
10673  * def size(self):
10674  * if self._size is None: # <<<<<<<<<<<<<<
10675  * result = 1
10676  *
10677  */
10678  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
10679  __pyx_t_2 = (__pyx_t_1 != 0);
10680  if (__pyx_t_2) {
10681 
10682  /* "View.MemoryView":596
10683  * def size(self):
10684  * if self._size is None:
10685  * result = 1 # <<<<<<<<<<<<<<
10686  *
10687  * for length in self.view.shape[:self.view.ndim]:
10688  */
10689  __Pyx_INCREF(__pyx_int_1);
10690  __pyx_v_result = __pyx_int_1;
10691 
10692  /* "View.MemoryView":598
10693  * result = 1
10694  *
10695  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
10696  * result *= length
10697  *
10698  */
10699  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10700  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
10701  __pyx_t_3 = __pyx_t_5;
10702  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 598, __pyx_L1_error)
10703  __Pyx_GOTREF(__pyx_t_6);
10704  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
10705  __pyx_t_6 = 0;
10706 
10707  /* "View.MemoryView":599
10708  *
10709  * for length in self.view.shape[:self.view.ndim]:
10710  * result *= length # <<<<<<<<<<<<<<
10711  *
10712  * self._size = result
10713  */
10714  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error)
10715  __Pyx_GOTREF(__pyx_t_6);
10716  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
10717  __pyx_t_6 = 0;
10718  }
10719 
10720  /* "View.MemoryView":601
10721  * result *= length
10722  *
10723  * self._size = result # <<<<<<<<<<<<<<
10724  *
10725  * return self._size
10726  */
10727  __Pyx_INCREF(__pyx_v_result);
10728  __Pyx_GIVEREF(__pyx_v_result);
10729  __Pyx_GOTREF(__pyx_v_self->_size);
10730  __Pyx_DECREF(__pyx_v_self->_size);
10731  __pyx_v_self->_size = __pyx_v_result;
10732 
10733  /* "View.MemoryView":595
10734  * @property
10735  * def size(self):
10736  * if self._size is None: # <<<<<<<<<<<<<<
10737  * result = 1
10738  *
10739  */
10740  }
10741 
10742  /* "View.MemoryView":603
10743  * self._size = result
10744  *
10745  * return self._size # <<<<<<<<<<<<<<
10746  *
10747  * def __len__(self):
10748  */
10749  __Pyx_XDECREF(__pyx_r);
10750  __Pyx_INCREF(__pyx_v_self->_size);
10751  __pyx_r = __pyx_v_self->_size;
10752  goto __pyx_L0;
10753 
10754  /* "View.MemoryView":594
10755  *
10756  * @property
10757  * def size(self): # <<<<<<<<<<<<<<
10758  * if self._size is None:
10759  * result = 1
10760  */
10761 
10762  /* function exit code */
10763  __pyx_L1_error:;
10764  __Pyx_XDECREF(__pyx_t_6);
10765  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10766  __pyx_r = NULL;
10767  __pyx_L0:;
10768  __Pyx_XDECREF(__pyx_v_result);
10769  __Pyx_XDECREF(__pyx_v_length);
10770  __Pyx_XGIVEREF(__pyx_r);
10771  __Pyx_RefNannyFinishContext();
10772  return __pyx_r;
10773 }
10774 
10775 /* "View.MemoryView":605
10776  * return self._size
10777  *
10778  * def __len__(self): # <<<<<<<<<<<<<<
10779  * if self.view.ndim >= 1:
10780  * return self.view.shape[0]
10781  */
10782 
10783 /* Python wrapper */
10784 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
10785 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
10786  Py_ssize_t __pyx_r;
10787  __Pyx_RefNannyDeclarations
10788  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
10789  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10790 
10791  /* function exit code */
10792  __Pyx_RefNannyFinishContext();
10793  return __pyx_r;
10794 }
10795 
10796 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
10797  Py_ssize_t __pyx_r;
10798  __Pyx_RefNannyDeclarations
10799  int __pyx_t_1;
10800  __Pyx_RefNannySetupContext("__len__", 0);
10801 
10802  /* "View.MemoryView":606
10803  *
10804  * def __len__(self):
10805  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
10806  * return self.view.shape[0]
10807  *
10808  */
10809  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
10810  if (__pyx_t_1) {
10811 
10812  /* "View.MemoryView":607
10813  * def __len__(self):
10814  * if self.view.ndim >= 1:
10815  * return self.view.shape[0] # <<<<<<<<<<<<<<
10816  *
10817  * return 0
10818  */
10819  __pyx_r = (__pyx_v_self->view.shape[0]);
10820  goto __pyx_L0;
10821 
10822  /* "View.MemoryView":606
10823  *
10824  * def __len__(self):
10825  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
10826  * return self.view.shape[0]
10827  *
10828  */
10829  }
10830 
10831  /* "View.MemoryView":609
10832  * return self.view.shape[0]
10833  *
10834  * return 0 # <<<<<<<<<<<<<<
10835  *
10836  * def __repr__(self):
10837  */
10838  __pyx_r = 0;
10839  goto __pyx_L0;
10840 
10841  /* "View.MemoryView":605
10842  * return self._size
10843  *
10844  * def __len__(self): # <<<<<<<<<<<<<<
10845  * if self.view.ndim >= 1:
10846  * return self.view.shape[0]
10847  */
10848 
10849  /* function exit code */
10850  __pyx_L0:;
10851  __Pyx_RefNannyFinishContext();
10852  return __pyx_r;
10853 }
10854 
10855 /* "View.MemoryView":611
10856  * return 0
10857  *
10858  * def __repr__(self): # <<<<<<<<<<<<<<
10859  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
10860  * id(self))
10861  */
10862 
10863 /* Python wrapper */
10864 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
10865 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
10866  PyObject *__pyx_r = 0;
10867  __Pyx_RefNannyDeclarations
10868  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
10869  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10870 
10871  /* function exit code */
10872  __Pyx_RefNannyFinishContext();
10873  return __pyx_r;
10874 }
10875 
10876 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
10877  PyObject *__pyx_r = NULL;
10878  __Pyx_RefNannyDeclarations
10879  PyObject *__pyx_t_1 = NULL;
10880  PyObject *__pyx_t_2 = NULL;
10881  PyObject *__pyx_t_3 = NULL;
10882  int __pyx_lineno = 0;
10883  const char *__pyx_filename = NULL;
10884  int __pyx_clineno = 0;
10885  __Pyx_RefNannySetupContext("__repr__", 0);
10886 
10887  /* "View.MemoryView":612
10888  *
10889  * def __repr__(self):
10890  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
10891  * id(self))
10892  *
10893  */
10894  __Pyx_XDECREF(__pyx_r);
10895  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
10896  __Pyx_GOTREF(__pyx_t_1);
10897  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error)
10898  __Pyx_GOTREF(__pyx_t_2);
10899  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10900  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
10901  __Pyx_GOTREF(__pyx_t_1);
10902  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10903 
10904  /* "View.MemoryView":613
10905  * def __repr__(self):
10906  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
10907  * id(self)) # <<<<<<<<<<<<<<
10908  *
10909  * def __str__(self):
10910  */
10911  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error)
10912  __Pyx_GOTREF(__pyx_t_2);
10913 
10914  /* "View.MemoryView":612
10915  *
10916  * def __repr__(self):
10917  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
10918  * id(self))
10919  *
10920  */
10921  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error)
10922  __Pyx_GOTREF(__pyx_t_3);
10923  __Pyx_GIVEREF(__pyx_t_1);
10924  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
10925  __Pyx_GIVEREF(__pyx_t_2);
10926  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
10927  __pyx_t_1 = 0;
10928  __pyx_t_2 = 0;
10929  __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(0, 612, __pyx_L1_error)
10930  __Pyx_GOTREF(__pyx_t_2);
10931  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10932  __pyx_r = __pyx_t_2;
10933  __pyx_t_2 = 0;
10934  goto __pyx_L0;
10935 
10936  /* "View.MemoryView":611
10937  * return 0
10938  *
10939  * def __repr__(self): # <<<<<<<<<<<<<<
10940  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
10941  * id(self))
10942  */
10943 
10944  /* function exit code */
10945  __pyx_L1_error:;
10946  __Pyx_XDECREF(__pyx_t_1);
10947  __Pyx_XDECREF(__pyx_t_2);
10948  __Pyx_XDECREF(__pyx_t_3);
10949  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10950  __pyx_r = NULL;
10951  __pyx_L0:;
10952  __Pyx_XGIVEREF(__pyx_r);
10953  __Pyx_RefNannyFinishContext();
10954  return __pyx_r;
10955 }
10956 
10957 /* "View.MemoryView":615
10958  * id(self))
10959  *
10960  * def __str__(self): # <<<<<<<<<<<<<<
10961  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
10962  *
10963  */
10964 
10965 /* Python wrapper */
10966 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
10967 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
10968  PyObject *__pyx_r = 0;
10969  __Pyx_RefNannyDeclarations
10970  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
10971  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10972 
10973  /* function exit code */
10974  __Pyx_RefNannyFinishContext();
10975  return __pyx_r;
10976 }
10977 
10978 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
10979  PyObject *__pyx_r = NULL;
10980  __Pyx_RefNannyDeclarations
10981  PyObject *__pyx_t_1 = NULL;
10982  PyObject *__pyx_t_2 = NULL;
10983  int __pyx_lineno = 0;
10984  const char *__pyx_filename = NULL;
10985  int __pyx_clineno = 0;
10986  __Pyx_RefNannySetupContext("__str__", 0);
10987 
10988  /* "View.MemoryView":616
10989  *
10990  * def __str__(self):
10991  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
10992  *
10993  *
10994  */
10995  __Pyx_XDECREF(__pyx_r);
10996  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
10997  __Pyx_GOTREF(__pyx_t_1);
10998  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error)
10999  __Pyx_GOTREF(__pyx_t_2);
11000  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11001  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
11002  __Pyx_GOTREF(__pyx_t_1);
11003  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11004  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error)
11005  __Pyx_GOTREF(__pyx_t_2);
11006  __Pyx_GIVEREF(__pyx_t_1);
11007  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
11008  __pyx_t_1 = 0;
11009  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
11010  __Pyx_GOTREF(__pyx_t_1);
11011  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11012  __pyx_r = __pyx_t_1;
11013  __pyx_t_1 = 0;
11014  goto __pyx_L0;
11015 
11016  /* "View.MemoryView":615
11017  * id(self))
11018  *
11019  * def __str__(self): # <<<<<<<<<<<<<<
11020  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11021  *
11022  */
11023 
11024  /* function exit code */
11025  __pyx_L1_error:;
11026  __Pyx_XDECREF(__pyx_t_1);
11027  __Pyx_XDECREF(__pyx_t_2);
11028  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11029  __pyx_r = NULL;
11030  __pyx_L0:;
11031  __Pyx_XGIVEREF(__pyx_r);
11032  __Pyx_RefNannyFinishContext();
11033  return __pyx_r;
11034 }
11035 
11036 /* "View.MemoryView":619
11037  *
11038  *
11039  * def is_c_contig(self): # <<<<<<<<<<<<<<
11040  * cdef __Pyx_memviewslice *mslice
11041  * cdef __Pyx_memviewslice tmp
11042  */
11043 
11044 /* Python wrapper */
11045 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11046 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11047  PyObject *__pyx_r = 0;
11048  __Pyx_RefNannyDeclarations
11049  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
11050  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11051 
11052  /* function exit code */
11053  __Pyx_RefNannyFinishContext();
11054  return __pyx_r;
11055 }
11056 
11057 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11058  __Pyx_memviewslice *__pyx_v_mslice;
11059  __Pyx_memviewslice __pyx_v_tmp;
11060  PyObject *__pyx_r = NULL;
11061  __Pyx_RefNannyDeclarations
11062  __Pyx_memviewslice *__pyx_t_1;
11063  PyObject *__pyx_t_2 = NULL;
11064  int __pyx_lineno = 0;
11065  const char *__pyx_filename = NULL;
11066  int __pyx_clineno = 0;
11067  __Pyx_RefNannySetupContext("is_c_contig", 0);
11068 
11069  /* "View.MemoryView":622
11070  * cdef __Pyx_memviewslice *mslice
11071  * cdef __Pyx_memviewslice tmp
11072  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11073  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11074  *
11075  */
11076  __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(0, 622, __pyx_L1_error)
11077  __pyx_v_mslice = __pyx_t_1;
11078 
11079  /* "View.MemoryView":623
11080  * cdef __Pyx_memviewslice tmp
11081  * mslice = get_slice_from_memview(self, &tmp)
11082  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
11083  *
11084  * def is_f_contig(self):
11085  */
11086  __Pyx_XDECREF(__pyx_r);
11087  __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(0, 623, __pyx_L1_error)
11088  __Pyx_GOTREF(__pyx_t_2);
11089  __pyx_r = __pyx_t_2;
11090  __pyx_t_2 = 0;
11091  goto __pyx_L0;
11092 
11093  /* "View.MemoryView":619
11094  *
11095  *
11096  * def is_c_contig(self): # <<<<<<<<<<<<<<
11097  * cdef __Pyx_memviewslice *mslice
11098  * cdef __Pyx_memviewslice tmp
11099  */
11100 
11101  /* function exit code */
11102  __pyx_L1_error:;
11103  __Pyx_XDECREF(__pyx_t_2);
11104  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11105  __pyx_r = NULL;
11106  __pyx_L0:;
11107  __Pyx_XGIVEREF(__pyx_r);
11108  __Pyx_RefNannyFinishContext();
11109  return __pyx_r;
11110 }
11111 
11112 /* "View.MemoryView":625
11113  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11114  *
11115  * def is_f_contig(self): # <<<<<<<<<<<<<<
11116  * cdef __Pyx_memviewslice *mslice
11117  * cdef __Pyx_memviewslice tmp
11118  */
11119 
11120 /* Python wrapper */
11121 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11122 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11123  PyObject *__pyx_r = 0;
11124  __Pyx_RefNannyDeclarations
11125  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
11126  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11127 
11128  /* function exit code */
11129  __Pyx_RefNannyFinishContext();
11130  return __pyx_r;
11131 }
11132 
11133 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11134  __Pyx_memviewslice *__pyx_v_mslice;
11135  __Pyx_memviewslice __pyx_v_tmp;
11136  PyObject *__pyx_r = NULL;
11137  __Pyx_RefNannyDeclarations
11138  __Pyx_memviewslice *__pyx_t_1;
11139  PyObject *__pyx_t_2 = NULL;
11140  int __pyx_lineno = 0;
11141  const char *__pyx_filename = NULL;
11142  int __pyx_clineno = 0;
11143  __Pyx_RefNannySetupContext("is_f_contig", 0);
11144 
11145  /* "View.MemoryView":628
11146  * cdef __Pyx_memviewslice *mslice
11147  * cdef __Pyx_memviewslice tmp
11148  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11149  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11150  *
11151  */
11152  __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(0, 628, __pyx_L1_error)
11153  __pyx_v_mslice = __pyx_t_1;
11154 
11155  /* "View.MemoryView":629
11156  * cdef __Pyx_memviewslice tmp
11157  * mslice = get_slice_from_memview(self, &tmp)
11158  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
11159  *
11160  * def copy(self):
11161  */
11162  __Pyx_XDECREF(__pyx_r);
11163  __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(0, 629, __pyx_L1_error)
11164  __Pyx_GOTREF(__pyx_t_2);
11165  __pyx_r = __pyx_t_2;
11166  __pyx_t_2 = 0;
11167  goto __pyx_L0;
11168 
11169  /* "View.MemoryView":625
11170  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11171  *
11172  * def is_f_contig(self): # <<<<<<<<<<<<<<
11173  * cdef __Pyx_memviewslice *mslice
11174  * cdef __Pyx_memviewslice tmp
11175  */
11176 
11177  /* function exit code */
11178  __pyx_L1_error:;
11179  __Pyx_XDECREF(__pyx_t_2);
11180  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11181  __pyx_r = NULL;
11182  __pyx_L0:;
11183  __Pyx_XGIVEREF(__pyx_r);
11184  __Pyx_RefNannyFinishContext();
11185  return __pyx_r;
11186 }
11187 
11188 /* "View.MemoryView":631
11189  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11190  *
11191  * def copy(self): # <<<<<<<<<<<<<<
11192  * cdef __Pyx_memviewslice mslice
11193  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11194  */
11195 
11196 /* Python wrapper */
11197 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11198 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11199  PyObject *__pyx_r = 0;
11200  __Pyx_RefNannyDeclarations
11201  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
11202  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
11203 
11204  /* function exit code */
11205  __Pyx_RefNannyFinishContext();
11206  return __pyx_r;
11207 }
11208 
11209 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
11210  __Pyx_memviewslice __pyx_v_mslice;
11211  int __pyx_v_flags;
11212  PyObject *__pyx_r = NULL;
11213  __Pyx_RefNannyDeclarations
11214  __Pyx_memviewslice __pyx_t_1;
11215  PyObject *__pyx_t_2 = NULL;
11216  int __pyx_lineno = 0;
11217  const char *__pyx_filename = NULL;
11218  int __pyx_clineno = 0;
11219  __Pyx_RefNannySetupContext("copy", 0);
11220 
11221  /* "View.MemoryView":633
11222  * def copy(self):
11223  * cdef __Pyx_memviewslice mslice
11224  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
11225  *
11226  * slice_copy(self, &mslice)
11227  */
11228  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
11229 
11230  /* "View.MemoryView":635
11231  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11232  *
11233  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
11234  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
11235  * self.view.itemsize,
11236  */
11237  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
11238 
11239  /* "View.MemoryView":636
11240  *
11241  * slice_copy(self, &mslice)
11242  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
11243  * self.view.itemsize,
11244  * flags|PyBUF_C_CONTIGUOUS,
11245  */
11246  __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(0, 636, __pyx_L1_error)
11247  __pyx_v_mslice = __pyx_t_1;
11248 
11249  /* "View.MemoryView":641
11250  * self.dtype_is_object)
11251  *
11252  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
11253  *
11254  * def copy_fortran(self):
11255  */
11256  __Pyx_XDECREF(__pyx_r);
11257  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error)
11258  __Pyx_GOTREF(__pyx_t_2);
11259  __pyx_r = __pyx_t_2;
11260  __pyx_t_2 = 0;
11261  goto __pyx_L0;
11262 
11263  /* "View.MemoryView":631
11264  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11265  *
11266  * def copy(self): # <<<<<<<<<<<<<<
11267  * cdef __Pyx_memviewslice mslice
11268  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11269  */
11270 
11271  /* function exit code */
11272  __pyx_L1_error:;
11273  __Pyx_XDECREF(__pyx_t_2);
11274  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
11275  __pyx_r = NULL;
11276  __pyx_L0:;
11277  __Pyx_XGIVEREF(__pyx_r);
11278  __Pyx_RefNannyFinishContext();
11279  return __pyx_r;
11280 }
11281 
11282 /* "View.MemoryView":643
11283  * return memoryview_copy_from_slice(self, &mslice)
11284  *
11285  * def copy_fortran(self): # <<<<<<<<<<<<<<
11286  * cdef __Pyx_memviewslice src, dst
11287  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11288  */
11289 
11290 /* Python wrapper */
11291 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11292 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11293  PyObject *__pyx_r = 0;
11294  __Pyx_RefNannyDeclarations
11295  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
11296  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
11297 
11298  /* function exit code */
11299  __Pyx_RefNannyFinishContext();
11300  return __pyx_r;
11301 }
11302 
11303 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
11304  __Pyx_memviewslice __pyx_v_src;
11305  __Pyx_memviewslice __pyx_v_dst;
11306  int __pyx_v_flags;
11307  PyObject *__pyx_r = NULL;
11308  __Pyx_RefNannyDeclarations
11309  __Pyx_memviewslice __pyx_t_1;
11310  PyObject *__pyx_t_2 = NULL;
11311  int __pyx_lineno = 0;
11312  const char *__pyx_filename = NULL;
11313  int __pyx_clineno = 0;
11314  __Pyx_RefNannySetupContext("copy_fortran", 0);
11315 
11316  /* "View.MemoryView":645
11317  * def copy_fortran(self):
11318  * cdef __Pyx_memviewslice src, dst
11319  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
11320  *
11321  * slice_copy(self, &src)
11322  */
11323  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
11324 
11325  /* "View.MemoryView":647
11326  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11327  *
11328  * slice_copy(self, &src) # <<<<<<<<<<<<<<
11329  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
11330  * self.view.itemsize,
11331  */
11332  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
11333 
11334  /* "View.MemoryView":648
11335  *
11336  * slice_copy(self, &src)
11337  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
11338  * self.view.itemsize,
11339  * flags|PyBUF_F_CONTIGUOUS,
11340  */
11341  __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(0, 648, __pyx_L1_error)
11342  __pyx_v_dst = __pyx_t_1;
11343 
11344  /* "View.MemoryView":653
11345  * self.dtype_is_object)
11346  *
11347  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
11348  *
11349  *
11350  */
11351  __Pyx_XDECREF(__pyx_r);
11352  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error)
11353  __Pyx_GOTREF(__pyx_t_2);
11354  __pyx_r = __pyx_t_2;
11355  __pyx_t_2 = 0;
11356  goto __pyx_L0;
11357 
11358  /* "View.MemoryView":643
11359  * return memoryview_copy_from_slice(self, &mslice)
11360  *
11361  * def copy_fortran(self): # <<<<<<<<<<<<<<
11362  * cdef __Pyx_memviewslice src, dst
11363  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11364  */
11365 
11366  /* function exit code */
11367  __pyx_L1_error:;
11368  __Pyx_XDECREF(__pyx_t_2);
11369  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
11370  __pyx_r = NULL;
11371  __pyx_L0:;
11372  __Pyx_XGIVEREF(__pyx_r);
11373  __Pyx_RefNannyFinishContext();
11374  return __pyx_r;
11375 }
11376 
11377 /* "(tree fragment)":1
11378  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11379  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11380  * def __setstate_cython__(self, __pyx_state):
11381  */
11382 
11383 /* Python wrapper */
11384 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11385 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11386  PyObject *__pyx_r = 0;
11387  __Pyx_RefNannyDeclarations
11388  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11389  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11390 
11391  /* function exit code */
11392  __Pyx_RefNannyFinishContext();
11393  return __pyx_r;
11394 }
11395 
11396 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
11397  PyObject *__pyx_r = NULL;
11398  __Pyx_RefNannyDeclarations
11399  PyObject *__pyx_t_1 = NULL;
11400  int __pyx_lineno = 0;
11401  const char *__pyx_filename = NULL;
11402  int __pyx_clineno = 0;
11403  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
11404 
11405  /* "(tree fragment)":2
11406  * def __reduce_cython__(self):
11407  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
11408  * def __setstate_cython__(self, __pyx_state):
11409  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11410  */
11411  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
11412  __Pyx_GOTREF(__pyx_t_1);
11413  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11414  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11415  __PYX_ERR(0, 2, __pyx_L1_error)
11416 
11417  /* "(tree fragment)":1
11418  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11419  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11420  * def __setstate_cython__(self, __pyx_state):
11421  */
11422 
11423  /* function exit code */
11424  __pyx_L1_error:;
11425  __Pyx_XDECREF(__pyx_t_1);
11426  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11427  __pyx_r = NULL;
11428  __Pyx_XGIVEREF(__pyx_r);
11429  __Pyx_RefNannyFinishContext();
11430  return __pyx_r;
11431 }
11432 
11433 /* "(tree fragment)":3
11434  * def __reduce_cython__(self):
11435  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11436  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11437  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11438  */
11439 
11440 /* Python wrapper */
11441 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
11442 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11443  PyObject *__pyx_r = 0;
11444  __Pyx_RefNannyDeclarations
11445  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11446  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11447 
11448  /* function exit code */
11449  __Pyx_RefNannyFinishContext();
11450  return __pyx_r;
11451 }
11452 
11453 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) {
11454  PyObject *__pyx_r = NULL;
11455  __Pyx_RefNannyDeclarations
11456  PyObject *__pyx_t_1 = NULL;
11457  int __pyx_lineno = 0;
11458  const char *__pyx_filename = NULL;
11459  int __pyx_clineno = 0;
11460  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
11461 
11462  /* "(tree fragment)":4
11463  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11464  * def __setstate_cython__(self, __pyx_state):
11465  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
11466  */
11467  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
11468  __Pyx_GOTREF(__pyx_t_1);
11469  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11470  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11471  __PYX_ERR(0, 4, __pyx_L1_error)
11472 
11473  /* "(tree fragment)":3
11474  * def __reduce_cython__(self):
11475  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11476  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11477  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11478  */
11479 
11480  /* function exit code */
11481  __pyx_L1_error:;
11482  __Pyx_XDECREF(__pyx_t_1);
11483  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11484  __pyx_r = NULL;
11485  __Pyx_XGIVEREF(__pyx_r);
11486  __Pyx_RefNannyFinishContext();
11487  return __pyx_r;
11488 }
11489 
11490 /* "View.MemoryView":657
11491  *
11492  * @cname('__pyx_memoryview_new')
11493  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
11494  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
11495  * result.typeinfo = typeinfo
11496  */
11497 
11498 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
11499  struct __pyx_memoryview_obj *__pyx_v_result = 0;
11500  PyObject *__pyx_r = NULL;
11501  __Pyx_RefNannyDeclarations
11502  PyObject *__pyx_t_1 = NULL;
11503  PyObject *__pyx_t_2 = NULL;
11504  PyObject *__pyx_t_3 = NULL;
11505  int __pyx_lineno = 0;
11506  const char *__pyx_filename = NULL;
11507  int __pyx_clineno = 0;
11508  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
11509 
11510  /* "View.MemoryView":658
11511  * @cname('__pyx_memoryview_new')
11512  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
11513  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
11514  * result.typeinfo = typeinfo
11515  * return result
11516  */
11517  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
11518  __Pyx_GOTREF(__pyx_t_1);
11519  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error)
11520  __Pyx_GOTREF(__pyx_t_2);
11521  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error)
11522  __Pyx_GOTREF(__pyx_t_3);
11523  __Pyx_INCREF(__pyx_v_o);
11524  __Pyx_GIVEREF(__pyx_v_o);
11525  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
11526  __Pyx_GIVEREF(__pyx_t_1);
11527  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
11528  __Pyx_GIVEREF(__pyx_t_2);
11529  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
11530  __pyx_t_1 = 0;
11531  __pyx_t_2 = 0;
11532  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error)
11533  __Pyx_GOTREF(__pyx_t_2);
11534  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11535  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
11536  __pyx_t_2 = 0;
11537 
11538  /* "View.MemoryView":659
11539  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
11540  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
11541  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
11542  * return result
11543  *
11544  */
11545  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
11546 
11547  /* "View.MemoryView":660
11548  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
11549  * result.typeinfo = typeinfo
11550  * return result # <<<<<<<<<<<<<<
11551  *
11552  * @cname('__pyx_memoryview_check')
11553  */
11554  __Pyx_XDECREF(__pyx_r);
11555  __Pyx_INCREF(((PyObject *)__pyx_v_result));
11556  __pyx_r = ((PyObject *)__pyx_v_result);
11557  goto __pyx_L0;
11558 
11559  /* "View.MemoryView":657
11560  *
11561  * @cname('__pyx_memoryview_new')
11562  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
11563  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
11564  * result.typeinfo = typeinfo
11565  */
11566 
11567  /* function exit code */
11568  __pyx_L1_error:;
11569  __Pyx_XDECREF(__pyx_t_1);
11570  __Pyx_XDECREF(__pyx_t_2);
11571  __Pyx_XDECREF(__pyx_t_3);
11572  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
11573  __pyx_r = 0;
11574  __pyx_L0:;
11575  __Pyx_XDECREF((PyObject *)__pyx_v_result);
11576  __Pyx_XGIVEREF(__pyx_r);
11577  __Pyx_RefNannyFinishContext();
11578  return __pyx_r;
11579 }
11580 
11581 /* "View.MemoryView":663
11582  *
11583  * @cname('__pyx_memoryview_check')
11584  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
11585  * return isinstance(o, memoryview)
11586  *
11587  */
11588 
11589 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
11590  int __pyx_r;
11591  __Pyx_RefNannyDeclarations
11592  int __pyx_t_1;
11593  __Pyx_RefNannySetupContext("memoryview_check", 0);
11594 
11595  /* "View.MemoryView":664
11596  * @cname('__pyx_memoryview_check')
11597  * cdef inline bint memoryview_check(object o):
11598  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
11599  *
11600  * cdef tuple _unellipsify(object index, int ndim):
11601  */
11602  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
11603  __pyx_r = __pyx_t_1;
11604  goto __pyx_L0;
11605 
11606  /* "View.MemoryView":663
11607  *
11608  * @cname('__pyx_memoryview_check')
11609  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
11610  * return isinstance(o, memoryview)
11611  *
11612  */
11613 
11614  /* function exit code */
11615  __pyx_L0:;
11616  __Pyx_RefNannyFinishContext();
11617  return __pyx_r;
11618 }
11619 
11620 /* "View.MemoryView":666
11621  * return isinstance(o, memoryview)
11622  *
11623  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
11624  * """
11625  * Replace all ellipses with full slices and fill incomplete indices with
11626  */
11627 
11628 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
11629  PyObject *__pyx_v_tup = NULL;
11630  PyObject *__pyx_v_result = NULL;
11631  int __pyx_v_have_slices;
11632  int __pyx_v_seen_ellipsis;
11633  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
11634  PyObject *__pyx_v_item = NULL;
11635  Py_ssize_t __pyx_v_nslices;
11636  PyObject *__pyx_r = NULL;
11637  __Pyx_RefNannyDeclarations
11638  int __pyx_t_1;
11639  int __pyx_t_2;
11640  PyObject *__pyx_t_3 = NULL;
11641  PyObject *__pyx_t_4 = NULL;
11642  Py_ssize_t __pyx_t_5;
11643  PyObject *(*__pyx_t_6)(PyObject *);
11644  PyObject *__pyx_t_7 = NULL;
11645  Py_ssize_t __pyx_t_8;
11646  int __pyx_t_9;
11647  int __pyx_t_10;
11648  PyObject *__pyx_t_11 = NULL;
11649  int __pyx_lineno = 0;
11650  const char *__pyx_filename = NULL;
11651  int __pyx_clineno = 0;
11652  __Pyx_RefNannySetupContext("_unellipsify", 0);
11653 
11654  /* "View.MemoryView":671
11655  * full slices.
11656  * """
11657  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
11658  * tup = (index,)
11659  * else:
11660  */
11661  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
11662  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11663  if (__pyx_t_2) {
11664 
11665  /* "View.MemoryView":672
11666  * """
11667  * if not isinstance(index, tuple):
11668  * tup = (index,) # <<<<<<<<<<<<<<
11669  * else:
11670  * tup = index
11671  */
11672  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error)
11673  __Pyx_GOTREF(__pyx_t_3);
11674  __Pyx_INCREF(__pyx_v_index);
11675  __Pyx_GIVEREF(__pyx_v_index);
11676  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
11677  __pyx_v_tup = __pyx_t_3;
11678  __pyx_t_3 = 0;
11679 
11680  /* "View.MemoryView":671
11681  * full slices.
11682  * """
11683  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
11684  * tup = (index,)
11685  * else:
11686  */
11687  goto __pyx_L3;
11688  }
11689 
11690  /* "View.MemoryView":674
11691  * tup = (index,)
11692  * else:
11693  * tup = index # <<<<<<<<<<<<<<
11694  *
11695  * result = []
11696  */
11697  /*else*/ {
11698  __Pyx_INCREF(__pyx_v_index);
11699  __pyx_v_tup = __pyx_v_index;
11700  }
11701  __pyx_L3:;
11702 
11703  /* "View.MemoryView":676
11704  * tup = index
11705  *
11706  * result = [] # <<<<<<<<<<<<<<
11707  * have_slices = False
11708  * seen_ellipsis = False
11709  */
11710  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 676, __pyx_L1_error)
11711  __Pyx_GOTREF(__pyx_t_3);
11712  __pyx_v_result = ((PyObject*)__pyx_t_3);
11713  __pyx_t_3 = 0;
11714 
11715  /* "View.MemoryView":677
11716  *
11717  * result = []
11718  * have_slices = False # <<<<<<<<<<<<<<
11719  * seen_ellipsis = False
11720  * for idx, item in enumerate(tup):
11721  */
11722  __pyx_v_have_slices = 0;
11723 
11724  /* "View.MemoryView":678
11725  * result = []
11726  * have_slices = False
11727  * seen_ellipsis = False # <<<<<<<<<<<<<<
11728  * for idx, item in enumerate(tup):
11729  * if item is Ellipsis:
11730  */
11731  __pyx_v_seen_ellipsis = 0;
11732 
11733  /* "View.MemoryView":679
11734  * have_slices = False
11735  * seen_ellipsis = False
11736  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
11737  * if item is Ellipsis:
11738  * if not seen_ellipsis:
11739  */
11740  __Pyx_INCREF(__pyx_int_0);
11741  __pyx_t_3 = __pyx_int_0;
11742  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
11743  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
11744  __pyx_t_6 = NULL;
11745  } else {
11746  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error)
11747  __Pyx_GOTREF(__pyx_t_4);
11748  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 679, __pyx_L1_error)
11749  }
11750  for (;;) {
11751  if (likely(!__pyx_t_6)) {
11752  if (likely(PyList_CheckExact(__pyx_t_4))) {
11753  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
11754  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11755  __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(0, 679, __pyx_L1_error)
11756  #else
11757  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error)
11758  __Pyx_GOTREF(__pyx_t_7);
11759  #endif
11760  } else {
11761  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
11762  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11763  __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(0, 679, __pyx_L1_error)
11764  #else
11765  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error)
11766  __Pyx_GOTREF(__pyx_t_7);
11767  #endif
11768  }
11769  } else {
11770  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
11771  if (unlikely(!__pyx_t_7)) {
11772  PyObject* exc_type = PyErr_Occurred();
11773  if (exc_type) {
11774  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11775  else __PYX_ERR(0, 679, __pyx_L1_error)
11776  }
11777  break;
11778  }
11779  __Pyx_GOTREF(__pyx_t_7);
11780  }
11781  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
11782  __pyx_t_7 = 0;
11783  __Pyx_INCREF(__pyx_t_3);
11784  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
11785  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error)
11786  __Pyx_GOTREF(__pyx_t_7);
11787  __Pyx_DECREF(__pyx_t_3);
11788  __pyx_t_3 = __pyx_t_7;
11789  __pyx_t_7 = 0;
11790 
11791  /* "View.MemoryView":680
11792  * seen_ellipsis = False
11793  * for idx, item in enumerate(tup):
11794  * if item is Ellipsis: # <<<<<<<<<<<<<<
11795  * if not seen_ellipsis:
11796  * result.extend([slice(None)] * (ndim - len(tup) + 1))
11797  */
11798  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
11799  __pyx_t_1 = (__pyx_t_2 != 0);
11800  if (__pyx_t_1) {
11801 
11802  /* "View.MemoryView":681
11803  * for idx, item in enumerate(tup):
11804  * if item is Ellipsis:
11805  * if not seen_ellipsis: # <<<<<<<<<<<<<<
11806  * result.extend([slice(None)] * (ndim - len(tup) + 1))
11807  * seen_ellipsis = True
11808  */
11809  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
11810  if (__pyx_t_1) {
11811 
11812  /* "View.MemoryView":682
11813  * if item is Ellipsis:
11814  * if not seen_ellipsis:
11815  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
11816  * seen_ellipsis = True
11817  * else:
11818  */
11819  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 682, __pyx_L1_error)
11820  __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(0, 682, __pyx_L1_error)
11821  __Pyx_GOTREF(__pyx_t_7);
11822  { Py_ssize_t __pyx_temp;
11823  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
11824  __Pyx_INCREF(__pyx_slice__19);
11825  __Pyx_GIVEREF(__pyx_slice__19);
11826  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__19);
11827  }
11828  }
11829  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 682, __pyx_L1_error)
11830  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11831 
11832  /* "View.MemoryView":683
11833  * if not seen_ellipsis:
11834  * result.extend([slice(None)] * (ndim - len(tup) + 1))
11835  * seen_ellipsis = True # <<<<<<<<<<<<<<
11836  * else:
11837  * result.append(slice(None))
11838  */
11839  __pyx_v_seen_ellipsis = 1;
11840 
11841  /* "View.MemoryView":681
11842  * for idx, item in enumerate(tup):
11843  * if item is Ellipsis:
11844  * if not seen_ellipsis: # <<<<<<<<<<<<<<
11845  * result.extend([slice(None)] * (ndim - len(tup) + 1))
11846  * seen_ellipsis = True
11847  */
11848  goto __pyx_L7;
11849  }
11850 
11851  /* "View.MemoryView":685
11852  * seen_ellipsis = True
11853  * else:
11854  * result.append(slice(None)) # <<<<<<<<<<<<<<
11855  * have_slices = True
11856  * else:
11857  */
11858  /*else*/ {
11859  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__19); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 685, __pyx_L1_error)
11860  }
11861  __pyx_L7:;
11862 
11863  /* "View.MemoryView":686
11864  * else:
11865  * result.append(slice(None))
11866  * have_slices = True # <<<<<<<<<<<<<<
11867  * else:
11868  * if not isinstance(item, slice) and not PyIndex_Check(item):
11869  */
11870  __pyx_v_have_slices = 1;
11871 
11872  /* "View.MemoryView":680
11873  * seen_ellipsis = False
11874  * for idx, item in enumerate(tup):
11875  * if item is Ellipsis: # <<<<<<<<<<<<<<
11876  * if not seen_ellipsis:
11877  * result.extend([slice(None)] * (ndim - len(tup) + 1))
11878  */
11879  goto __pyx_L6;
11880  }
11881 
11882  /* "View.MemoryView":688
11883  * have_slices = True
11884  * else:
11885  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
11886  * raise TypeError("Cannot index with type '%s'" % type(item))
11887  *
11888  */
11889  /*else*/ {
11890  __pyx_t_2 = PySlice_Check(__pyx_v_item);
11891  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
11892  if (__pyx_t_10) {
11893  } else {
11894  __pyx_t_1 = __pyx_t_10;
11895  goto __pyx_L9_bool_binop_done;
11896  }
11897  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
11898  __pyx_t_1 = __pyx_t_10;
11899  __pyx_L9_bool_binop_done:;
11900  if (unlikely(__pyx_t_1)) {
11901 
11902  /* "View.MemoryView":689
11903  * else:
11904  * if not isinstance(item, slice) and not PyIndex_Check(item):
11905  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
11906  *
11907  * have_slices = have_slices or isinstance(item, slice)
11908  */
11909  __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(0, 689, __pyx_L1_error)
11910  __Pyx_GOTREF(__pyx_t_7);
11911  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 689, __pyx_L1_error)
11912  __Pyx_GOTREF(__pyx_t_11);
11913  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11914  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
11915  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
11916  __PYX_ERR(0, 689, __pyx_L1_error)
11917 
11918  /* "View.MemoryView":688
11919  * have_slices = True
11920  * else:
11921  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
11922  * raise TypeError("Cannot index with type '%s'" % type(item))
11923  *
11924  */
11925  }
11926 
11927  /* "View.MemoryView":691
11928  * raise TypeError("Cannot index with type '%s'" % type(item))
11929  *
11930  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
11931  * result.append(item)
11932  *
11933  */
11934  __pyx_t_10 = (__pyx_v_have_slices != 0);
11935  if (!__pyx_t_10) {
11936  } else {
11937  __pyx_t_1 = __pyx_t_10;
11938  goto __pyx_L11_bool_binop_done;
11939  }
11940  __pyx_t_10 = PySlice_Check(__pyx_v_item);
11941  __pyx_t_2 = (__pyx_t_10 != 0);
11942  __pyx_t_1 = __pyx_t_2;
11943  __pyx_L11_bool_binop_done:;
11944  __pyx_v_have_slices = __pyx_t_1;
11945 
11946  /* "View.MemoryView":692
11947  *
11948  * have_slices = have_slices or isinstance(item, slice)
11949  * result.append(item) # <<<<<<<<<<<<<<
11950  *
11951  * nslices = ndim - len(result)
11952  */
11953  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 692, __pyx_L1_error)
11954  }
11955  __pyx_L6:;
11956 
11957  /* "View.MemoryView":679
11958  * have_slices = False
11959  * seen_ellipsis = False
11960  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
11961  * if item is Ellipsis:
11962  * if not seen_ellipsis:
11963  */
11964  }
11965  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11966  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11967 
11968  /* "View.MemoryView":694
11969  * result.append(item)
11970  *
11971  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
11972  * if nslices:
11973  * result.extend([slice(None)] * nslices)
11974  */
11975  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 694, __pyx_L1_error)
11976  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
11977 
11978  /* "View.MemoryView":695
11979  *
11980  * nslices = ndim - len(result)
11981  * if nslices: # <<<<<<<<<<<<<<
11982  * result.extend([slice(None)] * nslices)
11983  *
11984  */
11985  __pyx_t_1 = (__pyx_v_nslices != 0);
11986  if (__pyx_t_1) {
11987 
11988  /* "View.MemoryView":696
11989  * nslices = ndim - len(result)
11990  * if nslices:
11991  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
11992  *
11993  * return have_slices or nslices, tuple(result)
11994  */
11995  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error)
11996  __Pyx_GOTREF(__pyx_t_3);
11997  { Py_ssize_t __pyx_temp;
11998  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
11999  __Pyx_INCREF(__pyx_slice__19);
12000  __Pyx_GIVEREF(__pyx_slice__19);
12001  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__19);
12002  }
12003  }
12004  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 696, __pyx_L1_error)
12005  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12006 
12007  /* "View.MemoryView":695
12008  *
12009  * nslices = ndim - len(result)
12010  * if nslices: # <<<<<<<<<<<<<<
12011  * result.extend([slice(None)] * nslices)
12012  *
12013  */
12014  }
12015 
12016  /* "View.MemoryView":698
12017  * result.extend([slice(None)] * nslices)
12018  *
12019  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
12020  *
12021  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
12022  */
12023  __Pyx_XDECREF(__pyx_r);
12024  if (!__pyx_v_have_slices) {
12025  } else {
12026  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
12027  __Pyx_GOTREF(__pyx_t_4);
12028  __pyx_t_3 = __pyx_t_4;
12029  __pyx_t_4 = 0;
12030  goto __pyx_L14_bool_binop_done;
12031  }
12032  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
12033  __Pyx_GOTREF(__pyx_t_4);
12034  __pyx_t_3 = __pyx_t_4;
12035  __pyx_t_4 = 0;
12036  __pyx_L14_bool_binop_done:;
12037  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
12038  __Pyx_GOTREF(__pyx_t_4);
12039  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 698, __pyx_L1_error)
12040  __Pyx_GOTREF(__pyx_t_11);
12041  __Pyx_GIVEREF(__pyx_t_3);
12042  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
12043  __Pyx_GIVEREF(__pyx_t_4);
12044  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
12045  __pyx_t_3 = 0;
12046  __pyx_t_4 = 0;
12047  __pyx_r = ((PyObject*)__pyx_t_11);
12048  __pyx_t_11 = 0;
12049  goto __pyx_L0;
12050 
12051  /* "View.MemoryView":666
12052  * return isinstance(o, memoryview)
12053  *
12054  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
12055  * """
12056  * Replace all ellipses with full slices and fill incomplete indices with
12057  */
12058 
12059  /* function exit code */
12060  __pyx_L1_error:;
12061  __Pyx_XDECREF(__pyx_t_3);
12062  __Pyx_XDECREF(__pyx_t_4);
12063  __Pyx_XDECREF(__pyx_t_7);
12064  __Pyx_XDECREF(__pyx_t_11);
12065  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
12066  __pyx_r = 0;
12067  __pyx_L0:;
12068  __Pyx_XDECREF(__pyx_v_tup);
12069  __Pyx_XDECREF(__pyx_v_result);
12070  __Pyx_XDECREF(__pyx_v_idx);
12071  __Pyx_XDECREF(__pyx_v_item);
12072  __Pyx_XGIVEREF(__pyx_r);
12073  __Pyx_RefNannyFinishContext();
12074  return __pyx_r;
12075 }
12076 
12077 /* "View.MemoryView":700
12078  * return have_slices or nslices, tuple(result)
12079  *
12080  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
12081  * for suboffset in suboffsets[:ndim]:
12082  * if suboffset >= 0:
12083  */
12084 
12085 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
12086  Py_ssize_t __pyx_v_suboffset;
12087  PyObject *__pyx_r = NULL;
12088  __Pyx_RefNannyDeclarations
12089  Py_ssize_t *__pyx_t_1;
12090  Py_ssize_t *__pyx_t_2;
12091  Py_ssize_t *__pyx_t_3;
12092  int __pyx_t_4;
12093  PyObject *__pyx_t_5 = NULL;
12094  int __pyx_lineno = 0;
12095  const char *__pyx_filename = NULL;
12096  int __pyx_clineno = 0;
12097  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
12098 
12099  /* "View.MemoryView":701
12100  *
12101  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
12102  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
12103  * if suboffset >= 0:
12104  * raise ValueError("Indirect dimensions not supported")
12105  */
12106  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
12107  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
12108  __pyx_t_1 = __pyx_t_3;
12109  __pyx_v_suboffset = (__pyx_t_1[0]);
12110 
12111  /* "View.MemoryView":702
12112  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
12113  * for suboffset in suboffsets[:ndim]:
12114  * if suboffset >= 0: # <<<<<<<<<<<<<<
12115  * raise ValueError("Indirect dimensions not supported")
12116  *
12117  */
12118  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
12119  if (unlikely(__pyx_t_4)) {
12120 
12121  /* "View.MemoryView":703
12122  * for suboffset in suboffsets[:ndim]:
12123  * if suboffset >= 0:
12124  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
12125  *
12126  *
12127  */
12128  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
12129  __Pyx_GOTREF(__pyx_t_5);
12130  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
12131  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12132  __PYX_ERR(0, 703, __pyx_L1_error)
12133 
12134  /* "View.MemoryView":702
12135  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
12136  * for suboffset in suboffsets[:ndim]:
12137  * if suboffset >= 0: # <<<<<<<<<<<<<<
12138  * raise ValueError("Indirect dimensions not supported")
12139  *
12140  */
12141  }
12142  }
12143 
12144  /* "View.MemoryView":700
12145  * return have_slices or nslices, tuple(result)
12146  *
12147  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
12148  * for suboffset in suboffsets[:ndim]:
12149  * if suboffset >= 0:
12150  */
12151 
12152  /* function exit code */
12153  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12154  goto __pyx_L0;
12155  __pyx_L1_error:;
12156  __Pyx_XDECREF(__pyx_t_5);
12157  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
12158  __pyx_r = 0;
12159  __pyx_L0:;
12160  __Pyx_XGIVEREF(__pyx_r);
12161  __Pyx_RefNannyFinishContext();
12162  return __pyx_r;
12163 }
12164 
12165 /* "View.MemoryView":710
12166  *
12167  * @cname('__pyx_memview_slice')
12168  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
12169  * cdef int new_ndim = 0, suboffset_dim = -1, dim
12170  * cdef bint negative_step
12171  */
12172 
12173 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
12174  int __pyx_v_new_ndim;
12175  int __pyx_v_suboffset_dim;
12176  int __pyx_v_dim;
12177  __Pyx_memviewslice __pyx_v_src;
12178  __Pyx_memviewslice __pyx_v_dst;
12179  __Pyx_memviewslice *__pyx_v_p_src;
12180  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
12181  __Pyx_memviewslice *__pyx_v_p_dst;
12182  int *__pyx_v_p_suboffset_dim;
12183  Py_ssize_t __pyx_v_start;
12184  Py_ssize_t __pyx_v_stop;
12185  Py_ssize_t __pyx_v_step;
12186  int __pyx_v_have_start;
12187  int __pyx_v_have_stop;
12188  int __pyx_v_have_step;
12189  PyObject *__pyx_v_index = NULL;
12190  struct __pyx_memoryview_obj *__pyx_r = NULL;
12191  __Pyx_RefNannyDeclarations
12192  int __pyx_t_1;
12193  int __pyx_t_2;
12194  PyObject *__pyx_t_3 = NULL;
12195  struct __pyx_memoryview_obj *__pyx_t_4;
12196  char *__pyx_t_5;
12197  int __pyx_t_6;
12198  Py_ssize_t __pyx_t_7;
12199  PyObject *(*__pyx_t_8)(PyObject *);
12200  PyObject *__pyx_t_9 = NULL;
12201  Py_ssize_t __pyx_t_10;
12202  int __pyx_t_11;
12203  Py_ssize_t __pyx_t_12;
12204  int __pyx_lineno = 0;
12205  const char *__pyx_filename = NULL;
12206  int __pyx_clineno = 0;
12207  __Pyx_RefNannySetupContext("memview_slice", 0);
12208 
12209  /* "View.MemoryView":711
12210  * @cname('__pyx_memview_slice')
12211  * cdef memoryview memview_slice(memoryview memview, object indices):
12212  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
12213  * cdef bint negative_step
12214  * cdef __Pyx_memviewslice src, dst
12215  */
12216  __pyx_v_new_ndim = 0;
12217  __pyx_v_suboffset_dim = -1;
12218 
12219  /* "View.MemoryView":718
12220  *
12221  *
12222  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
12223  *
12224  * cdef _memoryviewslice memviewsliceobj
12225  */
12226  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
12227 
12228  /* "View.MemoryView":722
12229  * cdef _memoryviewslice memviewsliceobj
12230  *
12231  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
12232  *
12233  * if isinstance(memview, _memoryviewslice):
12234  */
12235  #ifndef CYTHON_WITHOUT_ASSERTIONS
12236  if (unlikely(!Py_OptimizeFlag)) {
12237  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
12238  PyErr_SetNone(PyExc_AssertionError);
12239  __PYX_ERR(0, 722, __pyx_L1_error)
12240  }
12241  }
12242  #endif
12243 
12244  /* "View.MemoryView":724
12245  * assert memview.view.ndim > 0
12246  *
12247  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
12248  * memviewsliceobj = memview
12249  * p_src = &memviewsliceobj.from_slice
12250  */
12251  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
12252  __pyx_t_2 = (__pyx_t_1 != 0);
12253  if (__pyx_t_2) {
12254 
12255  /* "View.MemoryView":725
12256  *
12257  * if isinstance(memview, _memoryviewslice):
12258  * memviewsliceobj = memview # <<<<<<<<<<<<<<
12259  * p_src = &memviewsliceobj.from_slice
12260  * else:
12261  */
12262  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(0, 725, __pyx_L1_error)
12263  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
12264  __Pyx_INCREF(__pyx_t_3);
12265  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
12266  __pyx_t_3 = 0;
12267 
12268  /* "View.MemoryView":726
12269  * if isinstance(memview, _memoryviewslice):
12270  * memviewsliceobj = memview
12271  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
12272  * else:
12273  * slice_copy(memview, &src)
12274  */
12275  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
12276 
12277  /* "View.MemoryView":724
12278  * assert memview.view.ndim > 0
12279  *
12280  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
12281  * memviewsliceobj = memview
12282  * p_src = &memviewsliceobj.from_slice
12283  */
12284  goto __pyx_L3;
12285  }
12286 
12287  /* "View.MemoryView":728
12288  * p_src = &memviewsliceobj.from_slice
12289  * else:
12290  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
12291  * p_src = &src
12292  *
12293  */
12294  /*else*/ {
12295  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
12296 
12297  /* "View.MemoryView":729
12298  * else:
12299  * slice_copy(memview, &src)
12300  * p_src = &src # <<<<<<<<<<<<<<
12301  *
12302  *
12303  */
12304  __pyx_v_p_src = (&__pyx_v_src);
12305  }
12306  __pyx_L3:;
12307 
12308  /* "View.MemoryView":735
12309  *
12310  *
12311  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
12312  * dst.data = p_src.data
12313  *
12314  */
12315  __pyx_t_4 = __pyx_v_p_src->memview;
12316  __pyx_v_dst.memview = __pyx_t_4;
12317 
12318  /* "View.MemoryView":736
12319  *
12320  * dst.memview = p_src.memview
12321  * dst.data = p_src.data # <<<<<<<<<<<<<<
12322  *
12323  *
12324  */
12325  __pyx_t_5 = __pyx_v_p_src->data;
12326  __pyx_v_dst.data = __pyx_t_5;
12327 
12328  /* "View.MemoryView":741
12329  *
12330  *
12331  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
12332  * cdef int *p_suboffset_dim = &suboffset_dim
12333  * cdef Py_ssize_t start, stop, step
12334  */
12335  __pyx_v_p_dst = (&__pyx_v_dst);
12336 
12337  /* "View.MemoryView":742
12338  *
12339  * cdef __Pyx_memviewslice *p_dst = &dst
12340  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
12341  * cdef Py_ssize_t start, stop, step
12342  * cdef bint have_start, have_stop, have_step
12343  */
12344  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
12345 
12346  /* "View.MemoryView":746
12347  * cdef bint have_start, have_stop, have_step
12348  *
12349  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
12350  * if PyIndex_Check(index):
12351  * slice_memviewslice(
12352  */
12353  __pyx_t_6 = 0;
12354  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
12355  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
12356  __pyx_t_8 = NULL;
12357  } else {
12358  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error)
12359  __Pyx_GOTREF(__pyx_t_3);
12360  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 746, __pyx_L1_error)
12361  }
12362  for (;;) {
12363  if (likely(!__pyx_t_8)) {
12364  if (likely(PyList_CheckExact(__pyx_t_3))) {
12365  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
12366  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12367  __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(0, 746, __pyx_L1_error)
12368  #else
12369  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 746, __pyx_L1_error)
12370  __Pyx_GOTREF(__pyx_t_9);
12371  #endif
12372  } else {
12373  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
12374  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12375  __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(0, 746, __pyx_L1_error)
12376  #else
12377  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 746, __pyx_L1_error)
12378  __Pyx_GOTREF(__pyx_t_9);
12379  #endif
12380  }
12381  } else {
12382  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
12383  if (unlikely(!__pyx_t_9)) {
12384  PyObject* exc_type = PyErr_Occurred();
12385  if (exc_type) {
12386  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12387  else __PYX_ERR(0, 746, __pyx_L1_error)
12388  }
12389  break;
12390  }
12391  __Pyx_GOTREF(__pyx_t_9);
12392  }
12393  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
12394  __pyx_t_9 = 0;
12395  __pyx_v_dim = __pyx_t_6;
12396  __pyx_t_6 = (__pyx_t_6 + 1);
12397 
12398  /* "View.MemoryView":747
12399  *
12400  * for dim, index in enumerate(indices):
12401  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
12402  * slice_memviewslice(
12403  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
12404  */
12405  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
12406  if (__pyx_t_2) {
12407 
12408  /* "View.MemoryView":751
12409  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
12410  * dim, new_ndim, p_suboffset_dim,
12411  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
12412  * 0, 0, 0, # have_{start,stop,step}
12413  * False)
12414  */
12415  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 751, __pyx_L1_error)
12416 
12417  /* "View.MemoryView":748
12418  * for dim, index in enumerate(indices):
12419  * if PyIndex_Check(index):
12420  * slice_memviewslice( # <<<<<<<<<<<<<<
12421  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
12422  * dim, new_ndim, p_suboffset_dim,
12423  */
12424  __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(0, 748, __pyx_L1_error)
12425 
12426  /* "View.MemoryView":747
12427  *
12428  * for dim, index in enumerate(indices):
12429  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
12430  * slice_memviewslice(
12431  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
12432  */
12433  goto __pyx_L6;
12434  }
12435 
12436  /* "View.MemoryView":754
12437  * 0, 0, 0, # have_{start,stop,step}
12438  * False)
12439  * elif index is None: # <<<<<<<<<<<<<<
12440  * p_dst.shape[new_ndim] = 1
12441  * p_dst.strides[new_ndim] = 0
12442  */
12443  __pyx_t_2 = (__pyx_v_index == Py_None);
12444  __pyx_t_1 = (__pyx_t_2 != 0);
12445  if (__pyx_t_1) {
12446 
12447  /* "View.MemoryView":755
12448  * False)
12449  * elif index is None:
12450  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
12451  * p_dst.strides[new_ndim] = 0
12452  * p_dst.suboffsets[new_ndim] = -1
12453  */
12454  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
12455 
12456  /* "View.MemoryView":756
12457  * elif index is None:
12458  * p_dst.shape[new_ndim] = 1
12459  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
12460  * p_dst.suboffsets[new_ndim] = -1
12461  * new_ndim += 1
12462  */
12463  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
12464 
12465  /* "View.MemoryView":757
12466  * p_dst.shape[new_ndim] = 1
12467  * p_dst.strides[new_ndim] = 0
12468  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
12469  * new_ndim += 1
12470  * else:
12471  */
12472  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
12473 
12474  /* "View.MemoryView":758
12475  * p_dst.strides[new_ndim] = 0
12476  * p_dst.suboffsets[new_ndim] = -1
12477  * new_ndim += 1 # <<<<<<<<<<<<<<
12478  * else:
12479  * start = index.start or 0
12480  */
12481  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
12482 
12483  /* "View.MemoryView":754
12484  * 0, 0, 0, # have_{start,stop,step}
12485  * False)
12486  * elif index is None: # <<<<<<<<<<<<<<
12487  * p_dst.shape[new_ndim] = 1
12488  * p_dst.strides[new_ndim] = 0
12489  */
12490  goto __pyx_L6;
12491  }
12492 
12493  /* "View.MemoryView":760
12494  * new_ndim += 1
12495  * else:
12496  * start = index.start or 0 # <<<<<<<<<<<<<<
12497  * stop = index.stop or 0
12498  * step = index.step or 0
12499  */
12500  /*else*/ {
12501  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 760, __pyx_L1_error)
12502  __Pyx_GOTREF(__pyx_t_9);
12503  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 760, __pyx_L1_error)
12504  if (!__pyx_t_1) {
12505  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12506  } else {
12507  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 760, __pyx_L1_error)
12508  __pyx_t_10 = __pyx_t_12;
12509  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12510  goto __pyx_L7_bool_binop_done;
12511  }
12512  __pyx_t_10 = 0;
12513  __pyx_L7_bool_binop_done:;
12514  __pyx_v_start = __pyx_t_10;
12515 
12516  /* "View.MemoryView":761
12517  * else:
12518  * start = index.start or 0
12519  * stop = index.stop or 0 # <<<<<<<<<<<<<<
12520  * step = index.step or 0
12521  *
12522  */
12523  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 761, __pyx_L1_error)
12524  __Pyx_GOTREF(__pyx_t_9);
12525  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 761, __pyx_L1_error)
12526  if (!__pyx_t_1) {
12527  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12528  } else {
12529  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 761, __pyx_L1_error)
12530  __pyx_t_10 = __pyx_t_12;
12531  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12532  goto __pyx_L9_bool_binop_done;
12533  }
12534  __pyx_t_10 = 0;
12535  __pyx_L9_bool_binop_done:;
12536  __pyx_v_stop = __pyx_t_10;
12537 
12538  /* "View.MemoryView":762
12539  * start = index.start or 0
12540  * stop = index.stop or 0
12541  * step = index.step or 0 # <<<<<<<<<<<<<<
12542  *
12543  * have_start = index.start is not None
12544  */
12545  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 762, __pyx_L1_error)
12546  __Pyx_GOTREF(__pyx_t_9);
12547  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 762, __pyx_L1_error)
12548  if (!__pyx_t_1) {
12549  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12550  } else {
12551  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 762, __pyx_L1_error)
12552  __pyx_t_10 = __pyx_t_12;
12553  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12554  goto __pyx_L11_bool_binop_done;
12555  }
12556  __pyx_t_10 = 0;
12557  __pyx_L11_bool_binop_done:;
12558  __pyx_v_step = __pyx_t_10;
12559 
12560  /* "View.MemoryView":764
12561  * step = index.step or 0
12562  *
12563  * have_start = index.start is not None # <<<<<<<<<<<<<<
12564  * have_stop = index.stop is not None
12565  * have_step = index.step is not None
12566  */
12567  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 764, __pyx_L1_error)
12568  __Pyx_GOTREF(__pyx_t_9);
12569  __pyx_t_1 = (__pyx_t_9 != Py_None);
12570  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12571  __pyx_v_have_start = __pyx_t_1;
12572 
12573  /* "View.MemoryView":765
12574  *
12575  * have_start = index.start is not None
12576  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
12577  * have_step = index.step is not None
12578  *
12579  */
12580  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 765, __pyx_L1_error)
12581  __Pyx_GOTREF(__pyx_t_9);
12582  __pyx_t_1 = (__pyx_t_9 != Py_None);
12583  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12584  __pyx_v_have_stop = __pyx_t_1;
12585 
12586  /* "View.MemoryView":766
12587  * have_start = index.start is not None
12588  * have_stop = index.stop is not None
12589  * have_step = index.step is not None # <<<<<<<<<<<<<<
12590  *
12591  * slice_memviewslice(
12592  */
12593  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 766, __pyx_L1_error)
12594  __Pyx_GOTREF(__pyx_t_9);
12595  __pyx_t_1 = (__pyx_t_9 != Py_None);
12596  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12597  __pyx_v_have_step = __pyx_t_1;
12598 
12599  /* "View.MemoryView":768
12600  * have_step = index.step is not None
12601  *
12602  * slice_memviewslice( # <<<<<<<<<<<<<<
12603  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
12604  * dim, new_ndim, p_suboffset_dim,
12605  */
12606  __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(0, 768, __pyx_L1_error)
12607 
12608  /* "View.MemoryView":774
12609  * have_start, have_stop, have_step,
12610  * True)
12611  * new_ndim += 1 # <<<<<<<<<<<<<<
12612  *
12613  * if isinstance(memview, _memoryviewslice):
12614  */
12615  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
12616  }
12617  __pyx_L6:;
12618 
12619  /* "View.MemoryView":746
12620  * cdef bint have_start, have_stop, have_step
12621  *
12622  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
12623  * if PyIndex_Check(index):
12624  * slice_memviewslice(
12625  */
12626  }
12627  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12628 
12629  /* "View.MemoryView":776
12630  * new_ndim += 1
12631  *
12632  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
12633  * return memoryview_fromslice(dst, new_ndim,
12634  * memviewsliceobj.to_object_func,
12635  */
12636  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
12637  __pyx_t_2 = (__pyx_t_1 != 0);
12638  if (__pyx_t_2) {
12639 
12640  /* "View.MemoryView":777
12641  *
12642  * if isinstance(memview, _memoryviewslice):
12643  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
12644  * memviewsliceobj.to_object_func,
12645  * memviewsliceobj.to_dtype_func,
12646  */
12647  __Pyx_XDECREF(((PyObject *)__pyx_r));
12648 
12649  /* "View.MemoryView":778
12650  * if isinstance(memview, _memoryviewslice):
12651  * return memoryview_fromslice(dst, new_ndim,
12652  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
12653  * memviewsliceobj.to_dtype_func,
12654  * memview.dtype_is_object)
12655  */
12656  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(0, 778, __pyx_L1_error) }
12657 
12658  /* "View.MemoryView":779
12659  * return memoryview_fromslice(dst, new_ndim,
12660  * memviewsliceobj.to_object_func,
12661  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
12662  * memview.dtype_is_object)
12663  * else:
12664  */
12665  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(0, 779, __pyx_L1_error) }
12666 
12667  /* "View.MemoryView":777
12668  *
12669  * if isinstance(memview, _memoryviewslice):
12670  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
12671  * memviewsliceobj.to_object_func,
12672  * memviewsliceobj.to_dtype_func,
12673  */
12674  __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(0, 777, __pyx_L1_error)
12675  __Pyx_GOTREF(__pyx_t_3);
12676  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 777, __pyx_L1_error)
12677  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
12678  __pyx_t_3 = 0;
12679  goto __pyx_L0;
12680 
12681  /* "View.MemoryView":776
12682  * new_ndim += 1
12683  *
12684  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
12685  * return memoryview_fromslice(dst, new_ndim,
12686  * memviewsliceobj.to_object_func,
12687  */
12688  }
12689 
12690  /* "View.MemoryView":782
12691  * memview.dtype_is_object)
12692  * else:
12693  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
12694  * memview.dtype_is_object)
12695  *
12696  */
12697  /*else*/ {
12698  __Pyx_XDECREF(((PyObject *)__pyx_r));
12699 
12700  /* "View.MemoryView":783
12701  * else:
12702  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
12703  * memview.dtype_is_object) # <<<<<<<<<<<<<<
12704  *
12705  *
12706  */
12707  __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(0, 782, __pyx_L1_error)
12708  __Pyx_GOTREF(__pyx_t_3);
12709 
12710  /* "View.MemoryView":782
12711  * memview.dtype_is_object)
12712  * else:
12713  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
12714  * memview.dtype_is_object)
12715  *
12716  */
12717  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 782, __pyx_L1_error)
12718  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
12719  __pyx_t_3 = 0;
12720  goto __pyx_L0;
12721  }
12722 
12723  /* "View.MemoryView":710
12724  *
12725  * @cname('__pyx_memview_slice')
12726  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
12727  * cdef int new_ndim = 0, suboffset_dim = -1, dim
12728  * cdef bint negative_step
12729  */
12730 
12731  /* function exit code */
12732  __pyx_L1_error:;
12733  __Pyx_XDECREF(__pyx_t_3);
12734  __Pyx_XDECREF(__pyx_t_9);
12735  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12736  __pyx_r = 0;
12737  __pyx_L0:;
12738  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
12739  __Pyx_XDECREF(__pyx_v_index);
12740  __Pyx_XGIVEREF((PyObject *)__pyx_r);
12741  __Pyx_RefNannyFinishContext();
12742  return __pyx_r;
12743 }
12744 
12745 /* "View.MemoryView":807
12746  *
12747  * @cname('__pyx_memoryview_slice_memviewslice')
12748  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
12749  * __Pyx_memviewslice *dst,
12750  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
12751  */
12752 
12753 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) {
12754  Py_ssize_t __pyx_v_new_shape;
12755  int __pyx_v_negative_step;
12756  int __pyx_r;
12757  int __pyx_t_1;
12758  int __pyx_t_2;
12759  int __pyx_t_3;
12760  int __pyx_lineno = 0;
12761  const char *__pyx_filename = NULL;
12762  int __pyx_clineno = 0;
12763 
12764  /* "View.MemoryView":827
12765  * cdef bint negative_step
12766  *
12767  * if not is_slice: # <<<<<<<<<<<<<<
12768  *
12769  * if start < 0:
12770  */
12771  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
12772  if (__pyx_t_1) {
12773 
12774  /* "View.MemoryView":829
12775  * if not is_slice:
12776  *
12777  * if start < 0: # <<<<<<<<<<<<<<
12778  * start += shape
12779  * if not 0 <= start < shape:
12780  */
12781  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
12782  if (__pyx_t_1) {
12783 
12784  /* "View.MemoryView":830
12785  *
12786  * if start < 0:
12787  * start += shape # <<<<<<<<<<<<<<
12788  * if not 0 <= start < shape:
12789  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
12790  */
12791  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
12792 
12793  /* "View.MemoryView":829
12794  * if not is_slice:
12795  *
12796  * if start < 0: # <<<<<<<<<<<<<<
12797  * start += shape
12798  * if not 0 <= start < shape:
12799  */
12800  }
12801 
12802  /* "View.MemoryView":831
12803  * if start < 0:
12804  * start += shape
12805  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
12806  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
12807  * else:
12808  */
12809  __pyx_t_1 = (0 <= __pyx_v_start);
12810  if (__pyx_t_1) {
12811  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
12812  }
12813  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
12814  if (__pyx_t_2) {
12815 
12816  /* "View.MemoryView":832
12817  * start += shape
12818  * if not 0 <= start < shape:
12819  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
12820  * else:
12821  *
12822  */
12823  __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(0, 832, __pyx_L1_error)
12824 
12825  /* "View.MemoryView":831
12826  * if start < 0:
12827  * start += shape
12828  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
12829  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
12830  * else:
12831  */
12832  }
12833 
12834  /* "View.MemoryView":827
12835  * cdef bint negative_step
12836  *
12837  * if not is_slice: # <<<<<<<<<<<<<<
12838  *
12839  * if start < 0:
12840  */
12841  goto __pyx_L3;
12842  }
12843 
12844  /* "View.MemoryView":835
12845  * else:
12846  *
12847  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
12848  *
12849  * if have_step and step == 0:
12850  */
12851  /*else*/ {
12852  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
12853  if (__pyx_t_1) {
12854  } else {
12855  __pyx_t_2 = __pyx_t_1;
12856  goto __pyx_L6_bool_binop_done;
12857  }
12858  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
12859  __pyx_t_2 = __pyx_t_1;
12860  __pyx_L6_bool_binop_done:;
12861  __pyx_v_negative_step = __pyx_t_2;
12862 
12863  /* "View.MemoryView":837
12864  * negative_step = have_step != 0 and step < 0
12865  *
12866  * if have_step and step == 0: # <<<<<<<<<<<<<<
12867  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
12868  *
12869  */
12870  __pyx_t_1 = (__pyx_v_have_step != 0);
12871  if (__pyx_t_1) {
12872  } else {
12873  __pyx_t_2 = __pyx_t_1;
12874  goto __pyx_L9_bool_binop_done;
12875  }
12876  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
12877  __pyx_t_2 = __pyx_t_1;
12878  __pyx_L9_bool_binop_done:;
12879  if (__pyx_t_2) {
12880 
12881  /* "View.MemoryView":838
12882  *
12883  * if have_step and step == 0:
12884  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
12885  *
12886  *
12887  */
12888  __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(0, 838, __pyx_L1_error)
12889 
12890  /* "View.MemoryView":837
12891  * negative_step = have_step != 0 and step < 0
12892  *
12893  * if have_step and step == 0: # <<<<<<<<<<<<<<
12894  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
12895  *
12896  */
12897  }
12898 
12899  /* "View.MemoryView":841
12900  *
12901  *
12902  * if have_start: # <<<<<<<<<<<<<<
12903  * if start < 0:
12904  * start += shape
12905  */
12906  __pyx_t_2 = (__pyx_v_have_start != 0);
12907  if (__pyx_t_2) {
12908 
12909  /* "View.MemoryView":842
12910  *
12911  * if have_start:
12912  * if start < 0: # <<<<<<<<<<<<<<
12913  * start += shape
12914  * if start < 0:
12915  */
12916  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
12917  if (__pyx_t_2) {
12918 
12919  /* "View.MemoryView":843
12920  * if have_start:
12921  * if start < 0:
12922  * start += shape # <<<<<<<<<<<<<<
12923  * if start < 0:
12924  * start = 0
12925  */
12926  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
12927 
12928  /* "View.MemoryView":844
12929  * if start < 0:
12930  * start += shape
12931  * if start < 0: # <<<<<<<<<<<<<<
12932  * start = 0
12933  * elif start >= shape:
12934  */
12935  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
12936  if (__pyx_t_2) {
12937 
12938  /* "View.MemoryView":845
12939  * start += shape
12940  * if start < 0:
12941  * start = 0 # <<<<<<<<<<<<<<
12942  * elif start >= shape:
12943  * if negative_step:
12944  */
12945  __pyx_v_start = 0;
12946 
12947  /* "View.MemoryView":844
12948  * if start < 0:
12949  * start += shape
12950  * if start < 0: # <<<<<<<<<<<<<<
12951  * start = 0
12952  * elif start >= shape:
12953  */
12954  }
12955 
12956  /* "View.MemoryView":842
12957  *
12958  * if have_start:
12959  * if start < 0: # <<<<<<<<<<<<<<
12960  * start += shape
12961  * if start < 0:
12962  */
12963  goto __pyx_L12;
12964  }
12965 
12966  /* "View.MemoryView":846
12967  * if start < 0:
12968  * start = 0
12969  * elif start >= shape: # <<<<<<<<<<<<<<
12970  * if negative_step:
12971  * start = shape - 1
12972  */
12973  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
12974  if (__pyx_t_2) {
12975 
12976  /* "View.MemoryView":847
12977  * start = 0
12978  * elif start >= shape:
12979  * if negative_step: # <<<<<<<<<<<<<<
12980  * start = shape - 1
12981  * else:
12982  */
12983  __pyx_t_2 = (__pyx_v_negative_step != 0);
12984  if (__pyx_t_2) {
12985 
12986  /* "View.MemoryView":848
12987  * elif start >= shape:
12988  * if negative_step:
12989  * start = shape - 1 # <<<<<<<<<<<<<<
12990  * else:
12991  * start = shape
12992  */
12993  __pyx_v_start = (__pyx_v_shape - 1);
12994 
12995  /* "View.MemoryView":847
12996  * start = 0
12997  * elif start >= shape:
12998  * if negative_step: # <<<<<<<<<<<<<<
12999  * start = shape - 1
13000  * else:
13001  */
13002  goto __pyx_L14;
13003  }
13004 
13005  /* "View.MemoryView":850
13006  * start = shape - 1
13007  * else:
13008  * start = shape # <<<<<<<<<<<<<<
13009  * else:
13010  * if negative_step:
13011  */
13012  /*else*/ {
13013  __pyx_v_start = __pyx_v_shape;
13014  }
13015  __pyx_L14:;
13016 
13017  /* "View.MemoryView":846
13018  * if start < 0:
13019  * start = 0
13020  * elif start >= shape: # <<<<<<<<<<<<<<
13021  * if negative_step:
13022  * start = shape - 1
13023  */
13024  }
13025  __pyx_L12:;
13026 
13027  /* "View.MemoryView":841
13028  *
13029  *
13030  * if have_start: # <<<<<<<<<<<<<<
13031  * if start < 0:
13032  * start += shape
13033  */
13034  goto __pyx_L11;
13035  }
13036 
13037  /* "View.MemoryView":852
13038  * start = shape
13039  * else:
13040  * if negative_step: # <<<<<<<<<<<<<<
13041  * start = shape - 1
13042  * else:
13043  */
13044  /*else*/ {
13045  __pyx_t_2 = (__pyx_v_negative_step != 0);
13046  if (__pyx_t_2) {
13047 
13048  /* "View.MemoryView":853
13049  * else:
13050  * if negative_step:
13051  * start = shape - 1 # <<<<<<<<<<<<<<
13052  * else:
13053  * start = 0
13054  */
13055  __pyx_v_start = (__pyx_v_shape - 1);
13056 
13057  /* "View.MemoryView":852
13058  * start = shape
13059  * else:
13060  * if negative_step: # <<<<<<<<<<<<<<
13061  * start = shape - 1
13062  * else:
13063  */
13064  goto __pyx_L15;
13065  }
13066 
13067  /* "View.MemoryView":855
13068  * start = shape - 1
13069  * else:
13070  * start = 0 # <<<<<<<<<<<<<<
13071  *
13072  * if have_stop:
13073  */
13074  /*else*/ {
13075  __pyx_v_start = 0;
13076  }
13077  __pyx_L15:;
13078  }
13079  __pyx_L11:;
13080 
13081  /* "View.MemoryView":857
13082  * start = 0
13083  *
13084  * if have_stop: # <<<<<<<<<<<<<<
13085  * if stop < 0:
13086  * stop += shape
13087  */
13088  __pyx_t_2 = (__pyx_v_have_stop != 0);
13089  if (__pyx_t_2) {
13090 
13091  /* "View.MemoryView":858
13092  *
13093  * if have_stop:
13094  * if stop < 0: # <<<<<<<<<<<<<<
13095  * stop += shape
13096  * if stop < 0:
13097  */
13098  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
13099  if (__pyx_t_2) {
13100 
13101  /* "View.MemoryView":859
13102  * if have_stop:
13103  * if stop < 0:
13104  * stop += shape # <<<<<<<<<<<<<<
13105  * if stop < 0:
13106  * stop = 0
13107  */
13108  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
13109 
13110  /* "View.MemoryView":860
13111  * if stop < 0:
13112  * stop += shape
13113  * if stop < 0: # <<<<<<<<<<<<<<
13114  * stop = 0
13115  * elif stop > shape:
13116  */
13117  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
13118  if (__pyx_t_2) {
13119 
13120  /* "View.MemoryView":861
13121  * stop += shape
13122  * if stop < 0:
13123  * stop = 0 # <<<<<<<<<<<<<<
13124  * elif stop > shape:
13125  * stop = shape
13126  */
13127  __pyx_v_stop = 0;
13128 
13129  /* "View.MemoryView":860
13130  * if stop < 0:
13131  * stop += shape
13132  * if stop < 0: # <<<<<<<<<<<<<<
13133  * stop = 0
13134  * elif stop > shape:
13135  */
13136  }
13137 
13138  /* "View.MemoryView":858
13139  *
13140  * if have_stop:
13141  * if stop < 0: # <<<<<<<<<<<<<<
13142  * stop += shape
13143  * if stop < 0:
13144  */
13145  goto __pyx_L17;
13146  }
13147 
13148  /* "View.MemoryView":862
13149  * if stop < 0:
13150  * stop = 0
13151  * elif stop > shape: # <<<<<<<<<<<<<<
13152  * stop = shape
13153  * else:
13154  */
13155  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
13156  if (__pyx_t_2) {
13157 
13158  /* "View.MemoryView":863
13159  * stop = 0
13160  * elif stop > shape:
13161  * stop = shape # <<<<<<<<<<<<<<
13162  * else:
13163  * if negative_step:
13164  */
13165  __pyx_v_stop = __pyx_v_shape;
13166 
13167  /* "View.MemoryView":862
13168  * if stop < 0:
13169  * stop = 0
13170  * elif stop > shape: # <<<<<<<<<<<<<<
13171  * stop = shape
13172  * else:
13173  */
13174  }
13175  __pyx_L17:;
13176 
13177  /* "View.MemoryView":857
13178  * start = 0
13179  *
13180  * if have_stop: # <<<<<<<<<<<<<<
13181  * if stop < 0:
13182  * stop += shape
13183  */
13184  goto __pyx_L16;
13185  }
13186 
13187  /* "View.MemoryView":865
13188  * stop = shape
13189  * else:
13190  * if negative_step: # <<<<<<<<<<<<<<
13191  * stop = -1
13192  * else:
13193  */
13194  /*else*/ {
13195  __pyx_t_2 = (__pyx_v_negative_step != 0);
13196  if (__pyx_t_2) {
13197 
13198  /* "View.MemoryView":866
13199  * else:
13200  * if negative_step:
13201  * stop = -1 # <<<<<<<<<<<<<<
13202  * else:
13203  * stop = shape
13204  */
13205  __pyx_v_stop = -1L;
13206 
13207  /* "View.MemoryView":865
13208  * stop = shape
13209  * else:
13210  * if negative_step: # <<<<<<<<<<<<<<
13211  * stop = -1
13212  * else:
13213  */
13214  goto __pyx_L19;
13215  }
13216 
13217  /* "View.MemoryView":868
13218  * stop = -1
13219  * else:
13220  * stop = shape # <<<<<<<<<<<<<<
13221  *
13222  * if not have_step:
13223  */
13224  /*else*/ {
13225  __pyx_v_stop = __pyx_v_shape;
13226  }
13227  __pyx_L19:;
13228  }
13229  __pyx_L16:;
13230 
13231  /* "View.MemoryView":870
13232  * stop = shape
13233  *
13234  * if not have_step: # <<<<<<<<<<<<<<
13235  * step = 1
13236  *
13237  */
13238  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
13239  if (__pyx_t_2) {
13240 
13241  /* "View.MemoryView":871
13242  *
13243  * if not have_step:
13244  * step = 1 # <<<<<<<<<<<<<<
13245  *
13246  *
13247  */
13248  __pyx_v_step = 1;
13249 
13250  /* "View.MemoryView":870
13251  * stop = shape
13252  *
13253  * if not have_step: # <<<<<<<<<<<<<<
13254  * step = 1
13255  *
13256  */
13257  }
13258 
13259  /* "View.MemoryView":875
13260  *
13261  * with cython.cdivision(True):
13262  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
13263  *
13264  * if (stop - start) - step * new_shape:
13265  */
13266  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
13267 
13268  /* "View.MemoryView":877
13269  * new_shape = (stop - start) // step
13270  *
13271  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
13272  * new_shape += 1
13273  *
13274  */
13275  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
13276  if (__pyx_t_2) {
13277 
13278  /* "View.MemoryView":878
13279  *
13280  * if (stop - start) - step * new_shape:
13281  * new_shape += 1 # <<<<<<<<<<<<<<
13282  *
13283  * if new_shape < 0:
13284  */
13285  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
13286 
13287  /* "View.MemoryView":877
13288  * new_shape = (stop - start) // step
13289  *
13290  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
13291  * new_shape += 1
13292  *
13293  */
13294  }
13295 
13296  /* "View.MemoryView":880
13297  * new_shape += 1
13298  *
13299  * if new_shape < 0: # <<<<<<<<<<<<<<
13300  * new_shape = 0
13301  *
13302  */
13303  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
13304  if (__pyx_t_2) {
13305 
13306  /* "View.MemoryView":881
13307  *
13308  * if new_shape < 0:
13309  * new_shape = 0 # <<<<<<<<<<<<<<
13310  *
13311  *
13312  */
13313  __pyx_v_new_shape = 0;
13314 
13315  /* "View.MemoryView":880
13316  * new_shape += 1
13317  *
13318  * if new_shape < 0: # <<<<<<<<<<<<<<
13319  * new_shape = 0
13320  *
13321  */
13322  }
13323 
13324  /* "View.MemoryView":884
13325  *
13326  *
13327  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
13328  * dst.shape[new_ndim] = new_shape
13329  * dst.suboffsets[new_ndim] = suboffset
13330  */
13331  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
13332 
13333  /* "View.MemoryView":885
13334  *
13335  * dst.strides[new_ndim] = stride * step
13336  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
13337  * dst.suboffsets[new_ndim] = suboffset
13338  *
13339  */
13340  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
13341 
13342  /* "View.MemoryView":886
13343  * dst.strides[new_ndim] = stride * step
13344  * dst.shape[new_ndim] = new_shape
13345  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
13346  *
13347  *
13348  */
13349  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
13350  }
13351  __pyx_L3:;
13352 
13353  /* "View.MemoryView":889
13354  *
13355  *
13356  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
13357  * dst.data += start * stride
13358  * else:
13359  */
13360  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
13361  if (__pyx_t_2) {
13362 
13363  /* "View.MemoryView":890
13364  *
13365  * if suboffset_dim[0] < 0:
13366  * dst.data += start * stride # <<<<<<<<<<<<<<
13367  * else:
13368  * dst.suboffsets[suboffset_dim[0]] += start * stride
13369  */
13370  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
13371 
13372  /* "View.MemoryView":889
13373  *
13374  *
13375  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
13376  * dst.data += start * stride
13377  * else:
13378  */
13379  goto __pyx_L23;
13380  }
13381 
13382  /* "View.MemoryView":892
13383  * dst.data += start * stride
13384  * else:
13385  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
13386  *
13387  * if suboffset >= 0:
13388  */
13389  /*else*/ {
13390  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
13391  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
13392  }
13393  __pyx_L23:;
13394 
13395  /* "View.MemoryView":894
13396  * dst.suboffsets[suboffset_dim[0]] += start * stride
13397  *
13398  * if suboffset >= 0: # <<<<<<<<<<<<<<
13399  * if not is_slice:
13400  * if new_ndim == 0:
13401  */
13402  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
13403  if (__pyx_t_2) {
13404 
13405  /* "View.MemoryView":895
13406  *
13407  * if suboffset >= 0:
13408  * if not is_slice: # <<<<<<<<<<<<<<
13409  * if new_ndim == 0:
13410  * dst.data = (<char **> dst.data)[0] + suboffset
13411  */
13412  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
13413  if (__pyx_t_2) {
13414 
13415  /* "View.MemoryView":896
13416  * if suboffset >= 0:
13417  * if not is_slice:
13418  * if new_ndim == 0: # <<<<<<<<<<<<<<
13419  * dst.data = (<char **> dst.data)[0] + suboffset
13420  * else:
13421  */
13422  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
13423  if (__pyx_t_2) {
13424 
13425  /* "View.MemoryView":897
13426  * if not is_slice:
13427  * if new_ndim == 0:
13428  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
13429  * else:
13430  * _err_dim(IndexError, "All dimensions preceding dimension %d "
13431  */
13432  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
13433 
13434  /* "View.MemoryView":896
13435  * if suboffset >= 0:
13436  * if not is_slice:
13437  * if new_ndim == 0: # <<<<<<<<<<<<<<
13438  * dst.data = (<char **> dst.data)[0] + suboffset
13439  * else:
13440  */
13441  goto __pyx_L26;
13442  }
13443 
13444  /* "View.MemoryView":899
13445  * dst.data = (<char **> dst.data)[0] + suboffset
13446  * else:
13447  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
13448  * "must be indexed and not sliced", dim)
13449  * else:
13450  */
13451  /*else*/ {
13452 
13453  /* "View.MemoryView":900
13454  * else:
13455  * _err_dim(IndexError, "All dimensions preceding dimension %d "
13456  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
13457  * else:
13458  * suboffset_dim[0] = new_ndim
13459  */
13460  __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(0, 899, __pyx_L1_error)
13461  }
13462  __pyx_L26:;
13463 
13464  /* "View.MemoryView":895
13465  *
13466  * if suboffset >= 0:
13467  * if not is_slice: # <<<<<<<<<<<<<<
13468  * if new_ndim == 0:
13469  * dst.data = (<char **> dst.data)[0] + suboffset
13470  */
13471  goto __pyx_L25;
13472  }
13473 
13474  /* "View.MemoryView":902
13475  * "must be indexed and not sliced", dim)
13476  * else:
13477  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
13478  *
13479  * return 0
13480  */
13481  /*else*/ {
13482  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
13483  }
13484  __pyx_L25:;
13485 
13486  /* "View.MemoryView":894
13487  * dst.suboffsets[suboffset_dim[0]] += start * stride
13488  *
13489  * if suboffset >= 0: # <<<<<<<<<<<<<<
13490  * if not is_slice:
13491  * if new_ndim == 0:
13492  */
13493  }
13494 
13495  /* "View.MemoryView":904
13496  * suboffset_dim[0] = new_ndim
13497  *
13498  * return 0 # <<<<<<<<<<<<<<
13499  *
13500  *
13501  */
13502  __pyx_r = 0;
13503  goto __pyx_L0;
13504 
13505  /* "View.MemoryView":807
13506  *
13507  * @cname('__pyx_memoryview_slice_memviewslice')
13508  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
13509  * __Pyx_memviewslice *dst,
13510  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
13511  */
13512 
13513  /* function exit code */
13514  __pyx_L1_error:;
13515  {
13516  #ifdef WITH_THREAD
13517  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
13518  #endif
13519  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13520  #ifdef WITH_THREAD
13521  __Pyx_PyGILState_Release(__pyx_gilstate_save);
13522  #endif
13523  }
13524  __pyx_r = -1;
13525  __pyx_L0:;
13526  return __pyx_r;
13527 }
13528 
13529 /* "View.MemoryView":910
13530  *
13531  * @cname('__pyx_pybuffer_index')
13532  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
13533  * Py_ssize_t dim) except NULL:
13534  * cdef Py_ssize_t shape, stride, suboffset = -1
13535  */
13536 
13537 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) {
13538  Py_ssize_t __pyx_v_shape;
13539  Py_ssize_t __pyx_v_stride;
13540  Py_ssize_t __pyx_v_suboffset;
13541  Py_ssize_t __pyx_v_itemsize;
13542  char *__pyx_v_resultp;
13543  char *__pyx_r;
13544  __Pyx_RefNannyDeclarations
13545  Py_ssize_t __pyx_t_1;
13546  int __pyx_t_2;
13547  PyObject *__pyx_t_3 = NULL;
13548  PyObject *__pyx_t_4 = NULL;
13549  int __pyx_lineno = 0;
13550  const char *__pyx_filename = NULL;
13551  int __pyx_clineno = 0;
13552  __Pyx_RefNannySetupContext("pybuffer_index", 0);
13553 
13554  /* "View.MemoryView":912
13555  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
13556  * Py_ssize_t dim) except NULL:
13557  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
13558  * cdef Py_ssize_t itemsize = view.itemsize
13559  * cdef char *resultp
13560  */
13561  __pyx_v_suboffset = -1L;
13562 
13563  /* "View.MemoryView":913
13564  * Py_ssize_t dim) except NULL:
13565  * cdef Py_ssize_t shape, stride, suboffset = -1
13566  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
13567  * cdef char *resultp
13568  *
13569  */
13570  __pyx_t_1 = __pyx_v_view->itemsize;
13571  __pyx_v_itemsize = __pyx_t_1;
13572 
13573  /* "View.MemoryView":916
13574  * cdef char *resultp
13575  *
13576  * if view.ndim == 0: # <<<<<<<<<<<<<<
13577  * shape = view.len / itemsize
13578  * stride = itemsize
13579  */
13580  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
13581  if (__pyx_t_2) {
13582 
13583  /* "View.MemoryView":917
13584  *
13585  * if view.ndim == 0:
13586  * shape = view.len / itemsize # <<<<<<<<<<<<<<
13587  * stride = itemsize
13588  * else:
13589  */
13590  if (unlikely(__pyx_v_itemsize == 0)) {
13591  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
13592  __PYX_ERR(0, 917, __pyx_L1_error)
13593  }
13594  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))) {
13595  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
13596  __PYX_ERR(0, 917, __pyx_L1_error)
13597  }
13598  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
13599 
13600  /* "View.MemoryView":918
13601  * if view.ndim == 0:
13602  * shape = view.len / itemsize
13603  * stride = itemsize # <<<<<<<<<<<<<<
13604  * else:
13605  * shape = view.shape[dim]
13606  */
13607  __pyx_v_stride = __pyx_v_itemsize;
13608 
13609  /* "View.MemoryView":916
13610  * cdef char *resultp
13611  *
13612  * if view.ndim == 0: # <<<<<<<<<<<<<<
13613  * shape = view.len / itemsize
13614  * stride = itemsize
13615  */
13616  goto __pyx_L3;
13617  }
13618 
13619  /* "View.MemoryView":920
13620  * stride = itemsize
13621  * else:
13622  * shape = view.shape[dim] # <<<<<<<<<<<<<<
13623  * stride = view.strides[dim]
13624  * if view.suboffsets != NULL:
13625  */
13626  /*else*/ {
13627  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
13628 
13629  /* "View.MemoryView":921
13630  * else:
13631  * shape = view.shape[dim]
13632  * stride = view.strides[dim] # <<<<<<<<<<<<<<
13633  * if view.suboffsets != NULL:
13634  * suboffset = view.suboffsets[dim]
13635  */
13636  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
13637 
13638  /* "View.MemoryView":922
13639  * shape = view.shape[dim]
13640  * stride = view.strides[dim]
13641  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
13642  * suboffset = view.suboffsets[dim]
13643  *
13644  */
13645  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
13646  if (__pyx_t_2) {
13647 
13648  /* "View.MemoryView":923
13649  * stride = view.strides[dim]
13650  * if view.suboffsets != NULL:
13651  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
13652  *
13653  * if index < 0:
13654  */
13655  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
13656 
13657  /* "View.MemoryView":922
13658  * shape = view.shape[dim]
13659  * stride = view.strides[dim]
13660  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
13661  * suboffset = view.suboffsets[dim]
13662  *
13663  */
13664  }
13665  }
13666  __pyx_L3:;
13667 
13668  /* "View.MemoryView":925
13669  * suboffset = view.suboffsets[dim]
13670  *
13671  * if index < 0: # <<<<<<<<<<<<<<
13672  * index += view.shape[dim]
13673  * if index < 0:
13674  */
13675  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
13676  if (__pyx_t_2) {
13677 
13678  /* "View.MemoryView":926
13679  *
13680  * if index < 0:
13681  * index += view.shape[dim] # <<<<<<<<<<<<<<
13682  * if index < 0:
13683  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
13684  */
13685  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
13686 
13687  /* "View.MemoryView":927
13688  * if index < 0:
13689  * index += view.shape[dim]
13690  * if index < 0: # <<<<<<<<<<<<<<
13691  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
13692  *
13693  */
13694  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
13695  if (unlikely(__pyx_t_2)) {
13696 
13697  /* "View.MemoryView":928
13698  * index += view.shape[dim]
13699  * if index < 0:
13700  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
13701  *
13702  * if index >= shape:
13703  */
13704  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error)
13705  __Pyx_GOTREF(__pyx_t_3);
13706  __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(0, 928, __pyx_L1_error)
13707  __Pyx_GOTREF(__pyx_t_4);
13708  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13709  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error)
13710  __Pyx_GOTREF(__pyx_t_3);
13711  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13712  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13713  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13714  __PYX_ERR(0, 928, __pyx_L1_error)
13715 
13716  /* "View.MemoryView":927
13717  * if index < 0:
13718  * index += view.shape[dim]
13719  * if index < 0: # <<<<<<<<<<<<<<
13720  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
13721  *
13722  */
13723  }
13724 
13725  /* "View.MemoryView":925
13726  * suboffset = view.suboffsets[dim]
13727  *
13728  * if index < 0: # <<<<<<<<<<<<<<
13729  * index += view.shape[dim]
13730  * if index < 0:
13731  */
13732  }
13733 
13734  /* "View.MemoryView":930
13735  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
13736  *
13737  * if index >= shape: # <<<<<<<<<<<<<<
13738  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
13739  *
13740  */
13741  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
13742  if (unlikely(__pyx_t_2)) {
13743 
13744  /* "View.MemoryView":931
13745  *
13746  * if index >= shape:
13747  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
13748  *
13749  * resultp = bufp + index * stride
13750  */
13751  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error)
13752  __Pyx_GOTREF(__pyx_t_3);
13753  __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(0, 931, __pyx_L1_error)
13754  __Pyx_GOTREF(__pyx_t_4);
13755  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13756  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error)
13757  __Pyx_GOTREF(__pyx_t_3);
13758  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13759  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13760  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13761  __PYX_ERR(0, 931, __pyx_L1_error)
13762 
13763  /* "View.MemoryView":930
13764  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
13765  *
13766  * if index >= shape: # <<<<<<<<<<<<<<
13767  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
13768  *
13769  */
13770  }
13771 
13772  /* "View.MemoryView":933
13773  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
13774  *
13775  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
13776  * if suboffset >= 0:
13777  * resultp = (<char **> resultp)[0] + suboffset
13778  */
13779  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
13780 
13781  /* "View.MemoryView":934
13782  *
13783  * resultp = bufp + index * stride
13784  * if suboffset >= 0: # <<<<<<<<<<<<<<
13785  * resultp = (<char **> resultp)[0] + suboffset
13786  *
13787  */
13788  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
13789  if (__pyx_t_2) {
13790 
13791  /* "View.MemoryView":935
13792  * resultp = bufp + index * stride
13793  * if suboffset >= 0:
13794  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
13795  *
13796  * return resultp
13797  */
13798  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
13799 
13800  /* "View.MemoryView":934
13801  *
13802  * resultp = bufp + index * stride
13803  * if suboffset >= 0: # <<<<<<<<<<<<<<
13804  * resultp = (<char **> resultp)[0] + suboffset
13805  *
13806  */
13807  }
13808 
13809  /* "View.MemoryView":937
13810  * resultp = (<char **> resultp)[0] + suboffset
13811  *
13812  * return resultp # <<<<<<<<<<<<<<
13813  *
13814  *
13815  */
13816  __pyx_r = __pyx_v_resultp;
13817  goto __pyx_L0;
13818 
13819  /* "View.MemoryView":910
13820  *
13821  * @cname('__pyx_pybuffer_index')
13822  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
13823  * Py_ssize_t dim) except NULL:
13824  * cdef Py_ssize_t shape, stride, suboffset = -1
13825  */
13826 
13827  /* function exit code */
13828  __pyx_L1_error:;
13829  __Pyx_XDECREF(__pyx_t_3);
13830  __Pyx_XDECREF(__pyx_t_4);
13831  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
13832  __pyx_r = NULL;
13833  __pyx_L0:;
13834  __Pyx_RefNannyFinishContext();
13835  return __pyx_r;
13836 }
13837 
13838 /* "View.MemoryView":943
13839  *
13840  * @cname('__pyx_memslice_transpose')
13841  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
13842  * cdef int ndim = memslice.memview.view.ndim
13843  *
13844  */
13845 
13846 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
13847  int __pyx_v_ndim;
13848  Py_ssize_t *__pyx_v_shape;
13849  Py_ssize_t *__pyx_v_strides;
13850  int __pyx_v_i;
13851  int __pyx_v_j;
13852  int __pyx_r;
13853  int __pyx_t_1;
13854  Py_ssize_t *__pyx_t_2;
13855  long __pyx_t_3;
13856  long __pyx_t_4;
13857  Py_ssize_t __pyx_t_5;
13858  Py_ssize_t __pyx_t_6;
13859  int __pyx_t_7;
13860  int __pyx_t_8;
13861  int __pyx_t_9;
13862  int __pyx_lineno = 0;
13863  const char *__pyx_filename = NULL;
13864  int __pyx_clineno = 0;
13865 
13866  /* "View.MemoryView":944
13867  * @cname('__pyx_memslice_transpose')
13868  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
13869  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
13870  *
13871  * cdef Py_ssize_t *shape = memslice.shape
13872  */
13873  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
13874  __pyx_v_ndim = __pyx_t_1;
13875 
13876  /* "View.MemoryView":946
13877  * cdef int ndim = memslice.memview.view.ndim
13878  *
13879  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
13880  * cdef Py_ssize_t *strides = memslice.strides
13881  *
13882  */
13883  __pyx_t_2 = __pyx_v_memslice->shape;
13884  __pyx_v_shape = __pyx_t_2;
13885 
13886  /* "View.MemoryView":947
13887  *
13888  * cdef Py_ssize_t *shape = memslice.shape
13889  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
13890  *
13891  *
13892  */
13893  __pyx_t_2 = __pyx_v_memslice->strides;
13894  __pyx_v_strides = __pyx_t_2;
13895 
13896  /* "View.MemoryView":951
13897  *
13898  * cdef int i, j
13899  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
13900  * j = ndim - 1 - i
13901  * strides[i], strides[j] = strides[j], strides[i]
13902  */
13903  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
13904  __pyx_t_4 = __pyx_t_3;
13905  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
13906  __pyx_v_i = __pyx_t_1;
13907 
13908  /* "View.MemoryView":952
13909  * cdef int i, j
13910  * for i in range(ndim / 2):
13911  * j = ndim - 1 - i # <<<<<<<<<<<<<<
13912  * strides[i], strides[j] = strides[j], strides[i]
13913  * shape[i], shape[j] = shape[j], shape[i]
13914  */
13915  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
13916 
13917  /* "View.MemoryView":953
13918  * for i in range(ndim / 2):
13919  * j = ndim - 1 - i
13920  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
13921  * shape[i], shape[j] = shape[j], shape[i]
13922  *
13923  */
13924  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
13925  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
13926  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
13927  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
13928 
13929  /* "View.MemoryView":954
13930  * j = ndim - 1 - i
13931  * strides[i], strides[j] = strides[j], strides[i]
13932  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
13933  *
13934  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
13935  */
13936  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
13937  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
13938  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
13939  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
13940 
13941  /* "View.MemoryView":956
13942  * shape[i], shape[j] = shape[j], shape[i]
13943  *
13944  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
13945  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
13946  *
13947  */
13948  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
13949  if (!__pyx_t_8) {
13950  } else {
13951  __pyx_t_7 = __pyx_t_8;
13952  goto __pyx_L6_bool_binop_done;
13953  }
13954  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
13955  __pyx_t_7 = __pyx_t_8;
13956  __pyx_L6_bool_binop_done:;
13957  if (__pyx_t_7) {
13958 
13959  /* "View.MemoryView":957
13960  *
13961  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
13962  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
13963  *
13964  * return 1
13965  */
13966  __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(0, 957, __pyx_L1_error)
13967 
13968  /* "View.MemoryView":956
13969  * shape[i], shape[j] = shape[j], shape[i]
13970  *
13971  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
13972  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
13973  *
13974  */
13975  }
13976  }
13977 
13978  /* "View.MemoryView":959
13979  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
13980  *
13981  * return 1 # <<<<<<<<<<<<<<
13982  *
13983  *
13984  */
13985  __pyx_r = 1;
13986  goto __pyx_L0;
13987 
13988  /* "View.MemoryView":943
13989  *
13990  * @cname('__pyx_memslice_transpose')
13991  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
13992  * cdef int ndim = memslice.memview.view.ndim
13993  *
13994  */
13995 
13996  /* function exit code */
13997  __pyx_L1_error:;
13998  {
13999  #ifdef WITH_THREAD
14000  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14001  #endif
14002  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14003  #ifdef WITH_THREAD
14004  __Pyx_PyGILState_Release(__pyx_gilstate_save);
14005  #endif
14006  }
14007  __pyx_r = 0;
14008  __pyx_L0:;
14009  return __pyx_r;
14010 }
14011 
14012 /* "View.MemoryView":976
14013  * cdef int (*to_dtype_func)(char *, object) except 0
14014  *
14015  * def __dealloc__(self): # <<<<<<<<<<<<<<
14016  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
14017  *
14018  */
14019 
14020 /* Python wrapper */
14021 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
14022 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
14023  __Pyx_RefNannyDeclarations
14024  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
14025  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14026 
14027  /* function exit code */
14028  __Pyx_RefNannyFinishContext();
14029 }
14030 
14031 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14032  __Pyx_RefNannyDeclarations
14033  __Pyx_RefNannySetupContext("__dealloc__", 0);
14034 
14035  /* "View.MemoryView":977
14036  *
14037  * def __dealloc__(self):
14038  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
14039  *
14040  * cdef convert_item_to_object(self, char *itemp):
14041  */
14042  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
14043 
14044  /* "View.MemoryView":976
14045  * cdef int (*to_dtype_func)(char *, object) except 0
14046  *
14047  * def __dealloc__(self): # <<<<<<<<<<<<<<
14048  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
14049  *
14050  */
14051 
14052  /* function exit code */
14053  __Pyx_RefNannyFinishContext();
14054 }
14055 
14056 /* "View.MemoryView":979
14057  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
14058  *
14059  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14060  * if self.to_object_func != NULL:
14061  * return self.to_object_func(itemp)
14062  */
14063 
14064 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
14065  PyObject *__pyx_r = NULL;
14066  __Pyx_RefNannyDeclarations
14067  int __pyx_t_1;
14068  PyObject *__pyx_t_2 = NULL;
14069  int __pyx_lineno = 0;
14070  const char *__pyx_filename = NULL;
14071  int __pyx_clineno = 0;
14072  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
14073 
14074  /* "View.MemoryView":980
14075  *
14076  * cdef convert_item_to_object(self, char *itemp):
14077  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14078  * return self.to_object_func(itemp)
14079  * else:
14080  */
14081  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
14082  if (__pyx_t_1) {
14083 
14084  /* "View.MemoryView":981
14085  * cdef convert_item_to_object(self, char *itemp):
14086  * if self.to_object_func != NULL:
14087  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
14088  * else:
14089  * return memoryview.convert_item_to_object(self, itemp)
14090  */
14091  __Pyx_XDECREF(__pyx_r);
14092  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error)
14093  __Pyx_GOTREF(__pyx_t_2);
14094  __pyx_r = __pyx_t_2;
14095  __pyx_t_2 = 0;
14096  goto __pyx_L0;
14097 
14098  /* "View.MemoryView":980
14099  *
14100  * cdef convert_item_to_object(self, char *itemp):
14101  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14102  * return self.to_object_func(itemp)
14103  * else:
14104  */
14105  }
14106 
14107  /* "View.MemoryView":983
14108  * return self.to_object_func(itemp)
14109  * else:
14110  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
14111  *
14112  * cdef assign_item_from_object(self, char *itemp, object value):
14113  */
14114  /*else*/ {
14115  __Pyx_XDECREF(__pyx_r);
14116  __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(0, 983, __pyx_L1_error)
14117  __Pyx_GOTREF(__pyx_t_2);
14118  __pyx_r = __pyx_t_2;
14119  __pyx_t_2 = 0;
14120  goto __pyx_L0;
14121  }
14122 
14123  /* "View.MemoryView":979
14124  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
14125  *
14126  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14127  * if self.to_object_func != NULL:
14128  * return self.to_object_func(itemp)
14129  */
14130 
14131  /* function exit code */
14132  __pyx_L1_error:;
14133  __Pyx_XDECREF(__pyx_t_2);
14134  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14135  __pyx_r = 0;
14136  __pyx_L0:;
14137  __Pyx_XGIVEREF(__pyx_r);
14138  __Pyx_RefNannyFinishContext();
14139  return __pyx_r;
14140 }
14141 
14142 /* "View.MemoryView":985
14143  * return memoryview.convert_item_to_object(self, itemp)
14144  *
14145  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14146  * if self.to_dtype_func != NULL:
14147  * self.to_dtype_func(itemp, value)
14148  */
14149 
14150 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
14151  PyObject *__pyx_r = NULL;
14152  __Pyx_RefNannyDeclarations
14153  int __pyx_t_1;
14154  int __pyx_t_2;
14155  PyObject *__pyx_t_3 = NULL;
14156  int __pyx_lineno = 0;
14157  const char *__pyx_filename = NULL;
14158  int __pyx_clineno = 0;
14159  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
14160 
14161  /* "View.MemoryView":986
14162  *
14163  * cdef assign_item_from_object(self, char *itemp, object value):
14164  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14165  * self.to_dtype_func(itemp, value)
14166  * else:
14167  */
14168  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
14169  if (__pyx_t_1) {
14170 
14171  /* "View.MemoryView":987
14172  * cdef assign_item_from_object(self, char *itemp, object value):
14173  * if self.to_dtype_func != NULL:
14174  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
14175  * else:
14176  * memoryview.assign_item_from_object(self, itemp, value)
14177  */
14178  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(0, 987, __pyx_L1_error)
14179 
14180  /* "View.MemoryView":986
14181  *
14182  * cdef assign_item_from_object(self, char *itemp, object value):
14183  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14184  * self.to_dtype_func(itemp, value)
14185  * else:
14186  */
14187  goto __pyx_L3;
14188  }
14189 
14190  /* "View.MemoryView":989
14191  * self.to_dtype_func(itemp, value)
14192  * else:
14193  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
14194  *
14195  * @property
14196  */
14197  /*else*/ {
14198  __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(0, 989, __pyx_L1_error)
14199  __Pyx_GOTREF(__pyx_t_3);
14200  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14201  }
14202  __pyx_L3:;
14203 
14204  /* "View.MemoryView":985
14205  * return memoryview.convert_item_to_object(self, itemp)
14206  *
14207  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14208  * if self.to_dtype_func != NULL:
14209  * self.to_dtype_func(itemp, value)
14210  */
14211 
14212  /* function exit code */
14213  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14214  goto __pyx_L0;
14215  __pyx_L1_error:;
14216  __Pyx_XDECREF(__pyx_t_3);
14217  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14218  __pyx_r = 0;
14219  __pyx_L0:;
14220  __Pyx_XGIVEREF(__pyx_r);
14221  __Pyx_RefNannyFinishContext();
14222  return __pyx_r;
14223 }
14224 
14225 /* "View.MemoryView":992
14226  *
14227  * @property
14228  * def base(self): # <<<<<<<<<<<<<<
14229  * return self.from_object
14230  *
14231  */
14232 
14233 /* Python wrapper */
14234 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
14235 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
14236  PyObject *__pyx_r = 0;
14237  __Pyx_RefNannyDeclarations
14238  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14239  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14240 
14241  /* function exit code */
14242  __Pyx_RefNannyFinishContext();
14243  return __pyx_r;
14244 }
14245 
14246 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14247  PyObject *__pyx_r = NULL;
14248  __Pyx_RefNannyDeclarations
14249  __Pyx_RefNannySetupContext("__get__", 0);
14250 
14251  /* "View.MemoryView":993
14252  * @property
14253  * def base(self):
14254  * return self.from_object # <<<<<<<<<<<<<<
14255  *
14256  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
14257  */
14258  __Pyx_XDECREF(__pyx_r);
14259  __Pyx_INCREF(__pyx_v_self->from_object);
14260  __pyx_r = __pyx_v_self->from_object;
14261  goto __pyx_L0;
14262 
14263  /* "View.MemoryView":992
14264  *
14265  * @property
14266  * def base(self): # <<<<<<<<<<<<<<
14267  * return self.from_object
14268  *
14269  */
14270 
14271  /* function exit code */
14272  __pyx_L0:;
14273  __Pyx_XGIVEREF(__pyx_r);
14274  __Pyx_RefNannyFinishContext();
14275  return __pyx_r;
14276 }
14277 
14278 /* "(tree fragment)":1
14279  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14280  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14281  * def __setstate_cython__(self, __pyx_state):
14282  */
14283 
14284 /* Python wrapper */
14285 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14286 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14287  PyObject *__pyx_r = 0;
14288  __Pyx_RefNannyDeclarations
14289  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14290  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14291 
14292  /* function exit code */
14293  __Pyx_RefNannyFinishContext();
14294  return __pyx_r;
14295 }
14296 
14297 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14298  PyObject *__pyx_r = NULL;
14299  __Pyx_RefNannyDeclarations
14300  PyObject *__pyx_t_1 = NULL;
14301  int __pyx_lineno = 0;
14302  const char *__pyx_filename = NULL;
14303  int __pyx_clineno = 0;
14304  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14305 
14306  /* "(tree fragment)":2
14307  * def __reduce_cython__(self):
14308  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14309  * def __setstate_cython__(self, __pyx_state):
14310  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14311  */
14312  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
14313  __Pyx_GOTREF(__pyx_t_1);
14314  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14315  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14316  __PYX_ERR(0, 2, __pyx_L1_error)
14317 
14318  /* "(tree fragment)":1
14319  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14320  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14321  * def __setstate_cython__(self, __pyx_state):
14322  */
14323 
14324  /* function exit code */
14325  __pyx_L1_error:;
14326  __Pyx_XDECREF(__pyx_t_1);
14327  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14328  __pyx_r = NULL;
14329  __Pyx_XGIVEREF(__pyx_r);
14330  __Pyx_RefNannyFinishContext();
14331  return __pyx_r;
14332 }
14333 
14334 /* "(tree fragment)":3
14335  * def __reduce_cython__(self):
14336  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14337  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14338  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14339  */
14340 
14341 /* Python wrapper */
14342 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
14343 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14344  PyObject *__pyx_r = 0;
14345  __Pyx_RefNannyDeclarations
14346  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14347  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14348 
14349  /* function exit code */
14350  __Pyx_RefNannyFinishContext();
14351  return __pyx_r;
14352 }
14353 
14354 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) {
14355  PyObject *__pyx_r = NULL;
14356  __Pyx_RefNannyDeclarations
14357  PyObject *__pyx_t_1 = NULL;
14358  int __pyx_lineno = 0;
14359  const char *__pyx_filename = NULL;
14360  int __pyx_clineno = 0;
14361  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14362 
14363  /* "(tree fragment)":4
14364  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14365  * def __setstate_cython__(self, __pyx_state):
14366  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14367  */
14368  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
14369  __Pyx_GOTREF(__pyx_t_1);
14370  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14371  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14372  __PYX_ERR(0, 4, __pyx_L1_error)
14373 
14374  /* "(tree fragment)":3
14375  * def __reduce_cython__(self):
14376  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14377  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14378  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14379  */
14380 
14381  /* function exit code */
14382  __pyx_L1_error:;
14383  __Pyx_XDECREF(__pyx_t_1);
14384  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14385  __pyx_r = NULL;
14386  __Pyx_XGIVEREF(__pyx_r);
14387  __Pyx_RefNannyFinishContext();
14388  return __pyx_r;
14389 }
14390 
14391 /* "View.MemoryView":999
14392  *
14393  * @cname('__pyx_memoryview_fromslice')
14394  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
14395  * int ndim,
14396  * object (*to_object_func)(char *),
14397  */
14398 
14399 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) {
14400  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
14401  Py_ssize_t __pyx_v_suboffset;
14402  PyObject *__pyx_v_length = NULL;
14403  PyObject *__pyx_r = NULL;
14404  __Pyx_RefNannyDeclarations
14405  int __pyx_t_1;
14406  PyObject *__pyx_t_2 = NULL;
14407  PyObject *__pyx_t_3 = NULL;
14408  __Pyx_TypeInfo *__pyx_t_4;
14409  Py_buffer __pyx_t_5;
14410  Py_ssize_t *__pyx_t_6;
14411  Py_ssize_t *__pyx_t_7;
14412  Py_ssize_t *__pyx_t_8;
14413  Py_ssize_t __pyx_t_9;
14414  int __pyx_lineno = 0;
14415  const char *__pyx_filename = NULL;
14416  int __pyx_clineno = 0;
14417  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
14418 
14419  /* "View.MemoryView":1007
14420  * cdef _memoryviewslice result
14421  *
14422  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
14423  * return None
14424  *
14425  */
14426  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
14427  if (__pyx_t_1) {
14428 
14429  /* "View.MemoryView":1008
14430  *
14431  * if <PyObject *> memviewslice.memview == Py_None:
14432  * return None # <<<<<<<<<<<<<<
14433  *
14434  *
14435  */
14436  __Pyx_XDECREF(__pyx_r);
14437  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14438  goto __pyx_L0;
14439 
14440  /* "View.MemoryView":1007
14441  * cdef _memoryviewslice result
14442  *
14443  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
14444  * return None
14445  *
14446  */
14447  }
14448 
14449  /* "View.MemoryView":1013
14450  *
14451  *
14452  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
14453  *
14454  * result.from_slice = memviewslice
14455  */
14456  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error)
14457  __Pyx_GOTREF(__pyx_t_2);
14458  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1013, __pyx_L1_error)
14459  __Pyx_GOTREF(__pyx_t_3);
14460  __Pyx_INCREF(Py_None);
14461  __Pyx_GIVEREF(Py_None);
14462  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
14463  __Pyx_INCREF(__pyx_int_0);
14464  __Pyx_GIVEREF(__pyx_int_0);
14465  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
14466  __Pyx_GIVEREF(__pyx_t_2);
14467  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14468  __pyx_t_2 = 0;
14469  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error)
14470  __Pyx_GOTREF(__pyx_t_2);
14471  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14472  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
14473  __pyx_t_2 = 0;
14474 
14475  /* "View.MemoryView":1015
14476  * result = _memoryviewslice(None, 0, dtype_is_object)
14477  *
14478  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
14479  * __PYX_INC_MEMVIEW(&memviewslice, 1)
14480  *
14481  */
14482  __pyx_v_result->from_slice = __pyx_v_memviewslice;
14483 
14484  /* "View.MemoryView":1016
14485  *
14486  * result.from_slice = memviewslice
14487  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
14488  *
14489  * result.from_object = (<memoryview> memviewslice.memview).base
14490  */
14491  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
14492 
14493  /* "View.MemoryView":1018
14494  * __PYX_INC_MEMVIEW(&memviewslice, 1)
14495  *
14496  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
14497  * result.typeinfo = memviewslice.memview.typeinfo
14498  *
14499  */
14500  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
14501  __Pyx_GOTREF(__pyx_t_2);
14502  __Pyx_GIVEREF(__pyx_t_2);
14503  __Pyx_GOTREF(__pyx_v_result->from_object);
14504  __Pyx_DECREF(__pyx_v_result->from_object);
14505  __pyx_v_result->from_object = __pyx_t_2;
14506  __pyx_t_2 = 0;
14507 
14508  /* "View.MemoryView":1019
14509  *
14510  * result.from_object = (<memoryview> memviewslice.memview).base
14511  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
14512  *
14513  * result.view = memviewslice.memview.view
14514  */
14515  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
14516  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
14517 
14518  /* "View.MemoryView":1021
14519  * result.typeinfo = memviewslice.memview.typeinfo
14520  *
14521  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
14522  * result.view.buf = <void *> memviewslice.data
14523  * result.view.ndim = ndim
14524  */
14525  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
14526  __pyx_v_result->__pyx_base.view = __pyx_t_5;
14527 
14528  /* "View.MemoryView":1022
14529  *
14530  * result.view = memviewslice.memview.view
14531  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
14532  * result.view.ndim = ndim
14533  * (<__pyx_buffer *> &result.view).obj = Py_None
14534  */
14535  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
14536 
14537  /* "View.MemoryView":1023
14538  * result.view = memviewslice.memview.view
14539  * result.view.buf = <void *> memviewslice.data
14540  * result.view.ndim = ndim # <<<<<<<<<<<<<<
14541  * (<__pyx_buffer *> &result.view).obj = Py_None
14542  * Py_INCREF(Py_None)
14543  */
14544  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
14545 
14546  /* "View.MemoryView":1024
14547  * result.view.buf = <void *> memviewslice.data
14548  * result.view.ndim = ndim
14549  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
14550  * Py_INCREF(Py_None)
14551  *
14552  */
14553  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
14554 
14555  /* "View.MemoryView":1025
14556  * result.view.ndim = ndim
14557  * (<__pyx_buffer *> &result.view).obj = Py_None
14558  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
14559  *
14560  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
14561  */
14562  Py_INCREF(Py_None);
14563 
14564  /* "View.MemoryView":1027
14565  * Py_INCREF(Py_None)
14566  *
14567  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
14568  * result.flags = PyBUF_RECORDS
14569  * else:
14570  */
14571  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
14572  if (__pyx_t_1) {
14573 
14574  /* "View.MemoryView":1028
14575  *
14576  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
14577  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
14578  * else:
14579  * result.flags = PyBUF_RECORDS_RO
14580  */
14581  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
14582 
14583  /* "View.MemoryView":1027
14584  * Py_INCREF(Py_None)
14585  *
14586  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
14587  * result.flags = PyBUF_RECORDS
14588  * else:
14589  */
14590  goto __pyx_L4;
14591  }
14592 
14593  /* "View.MemoryView":1030
14594  * result.flags = PyBUF_RECORDS
14595  * else:
14596  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
14597  *
14598  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
14599  */
14600  /*else*/ {
14601  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
14602  }
14603  __pyx_L4:;
14604 
14605  /* "View.MemoryView":1032
14606  * result.flags = PyBUF_RECORDS_RO
14607  *
14608  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
14609  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
14610  *
14611  */
14612  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
14613 
14614  /* "View.MemoryView":1033
14615  *
14616  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
14617  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
14618  *
14619  *
14620  */
14621  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
14622 
14623  /* "View.MemoryView":1036
14624  *
14625  *
14626  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
14627  * for suboffset in result.from_slice.suboffsets[:ndim]:
14628  * if suboffset >= 0:
14629  */
14630  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
14631 
14632  /* "View.MemoryView":1037
14633  *
14634  * result.view.suboffsets = NULL
14635  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
14636  * if suboffset >= 0:
14637  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
14638  */
14639  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
14640  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
14641  __pyx_t_6 = __pyx_t_8;
14642  __pyx_v_suboffset = (__pyx_t_6[0]);
14643 
14644  /* "View.MemoryView":1038
14645  * result.view.suboffsets = NULL
14646  * for suboffset in result.from_slice.suboffsets[:ndim]:
14647  * if suboffset >= 0: # <<<<<<<<<<<<<<
14648  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
14649  * break
14650  */
14651  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
14652  if (__pyx_t_1) {
14653 
14654  /* "View.MemoryView":1039
14655  * for suboffset in result.from_slice.suboffsets[:ndim]:
14656  * if suboffset >= 0:
14657  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
14658  * break
14659  *
14660  */
14661  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
14662 
14663  /* "View.MemoryView":1040
14664  * if suboffset >= 0:
14665  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
14666  * break # <<<<<<<<<<<<<<
14667  *
14668  * result.view.len = result.view.itemsize
14669  */
14670  goto __pyx_L6_break;
14671 
14672  /* "View.MemoryView":1038
14673  * result.view.suboffsets = NULL
14674  * for suboffset in result.from_slice.suboffsets[:ndim]:
14675  * if suboffset >= 0: # <<<<<<<<<<<<<<
14676  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
14677  * break
14678  */
14679  }
14680  }
14681  __pyx_L6_break:;
14682 
14683  /* "View.MemoryView":1042
14684  * break
14685  *
14686  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
14687  * for length in result.view.shape[:ndim]:
14688  * result.view.len *= length
14689  */
14690  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
14691  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
14692 
14693  /* "View.MemoryView":1043
14694  *
14695  * result.view.len = result.view.itemsize
14696  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
14697  * result.view.len *= length
14698  *
14699  */
14700  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
14701  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
14702  __pyx_t_6 = __pyx_t_8;
14703  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error)
14704  __Pyx_GOTREF(__pyx_t_2);
14705  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
14706  __pyx_t_2 = 0;
14707 
14708  /* "View.MemoryView":1044
14709  * result.view.len = result.view.itemsize
14710  * for length in result.view.shape[:ndim]:
14711  * result.view.len *= length # <<<<<<<<<<<<<<
14712  *
14713  * result.to_object_func = to_object_func
14714  */
14715  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error)
14716  __Pyx_GOTREF(__pyx_t_2);
14717  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L1_error)
14718  __Pyx_GOTREF(__pyx_t_3);
14719  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14720  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1044, __pyx_L1_error)
14721  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14722  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
14723  }
14724 
14725  /* "View.MemoryView":1046
14726  * result.view.len *= length
14727  *
14728  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
14729  * result.to_dtype_func = to_dtype_func
14730  *
14731  */
14732  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
14733 
14734  /* "View.MemoryView":1047
14735  *
14736  * result.to_object_func = to_object_func
14737  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
14738  *
14739  * return result
14740  */
14741  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
14742 
14743  /* "View.MemoryView":1049
14744  * result.to_dtype_func = to_dtype_func
14745  *
14746  * return result # <<<<<<<<<<<<<<
14747  *
14748  * @cname('__pyx_memoryview_get_slice_from_memoryview')
14749  */
14750  __Pyx_XDECREF(__pyx_r);
14751  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14752  __pyx_r = ((PyObject *)__pyx_v_result);
14753  goto __pyx_L0;
14754 
14755  /* "View.MemoryView":999
14756  *
14757  * @cname('__pyx_memoryview_fromslice')
14758  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
14759  * int ndim,
14760  * object (*to_object_func)(char *),
14761  */
14762 
14763  /* function exit code */
14764  __pyx_L1_error:;
14765  __Pyx_XDECREF(__pyx_t_2);
14766  __Pyx_XDECREF(__pyx_t_3);
14767  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14768  __pyx_r = 0;
14769  __pyx_L0:;
14770  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14771  __Pyx_XDECREF(__pyx_v_length);
14772  __Pyx_XGIVEREF(__pyx_r);
14773  __Pyx_RefNannyFinishContext();
14774  return __pyx_r;
14775 }
14776 
14777 /* "View.MemoryView":1052
14778  *
14779  * @cname('__pyx_memoryview_get_slice_from_memoryview')
14780  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
14781  * __Pyx_memviewslice *mslice) except NULL:
14782  * cdef _memoryviewslice obj
14783  */
14784 
14785 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
14786  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
14787  __Pyx_memviewslice *__pyx_r;
14788  __Pyx_RefNannyDeclarations
14789  int __pyx_t_1;
14790  int __pyx_t_2;
14791  PyObject *__pyx_t_3 = NULL;
14792  int __pyx_lineno = 0;
14793  const char *__pyx_filename = NULL;
14794  int __pyx_clineno = 0;
14795  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
14796 
14797  /* "View.MemoryView":1055
14798  * __Pyx_memviewslice *mslice) except NULL:
14799  * cdef _memoryviewslice obj
14800  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14801  * obj = memview
14802  * return &obj.from_slice
14803  */
14804  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14805  __pyx_t_2 = (__pyx_t_1 != 0);
14806  if (__pyx_t_2) {
14807 
14808  /* "View.MemoryView":1056
14809  * cdef _memoryviewslice obj
14810  * if isinstance(memview, _memoryviewslice):
14811  * obj = memview # <<<<<<<<<<<<<<
14812  * return &obj.from_slice
14813  * else:
14814  */
14815  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(0, 1056, __pyx_L1_error)
14816  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
14817  __Pyx_INCREF(__pyx_t_3);
14818  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
14819  __pyx_t_3 = 0;
14820 
14821  /* "View.MemoryView":1057
14822  * if isinstance(memview, _memoryviewslice):
14823  * obj = memview
14824  * return &obj.from_slice # <<<<<<<<<<<<<<
14825  * else:
14826  * slice_copy(memview, mslice)
14827  */
14828  __pyx_r = (&__pyx_v_obj->from_slice);
14829  goto __pyx_L0;
14830 
14831  /* "View.MemoryView":1055
14832  * __Pyx_memviewslice *mslice) except NULL:
14833  * cdef _memoryviewslice obj
14834  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14835  * obj = memview
14836  * return &obj.from_slice
14837  */
14838  }
14839 
14840  /* "View.MemoryView":1059
14841  * return &obj.from_slice
14842  * else:
14843  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
14844  * return mslice
14845  *
14846  */
14847  /*else*/ {
14848  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
14849 
14850  /* "View.MemoryView":1060
14851  * else:
14852  * slice_copy(memview, mslice)
14853  * return mslice # <<<<<<<<<<<<<<
14854  *
14855  * @cname('__pyx_memoryview_slice_copy')
14856  */
14857  __pyx_r = __pyx_v_mslice;
14858  goto __pyx_L0;
14859  }
14860 
14861  /* "View.MemoryView":1052
14862  *
14863  * @cname('__pyx_memoryview_get_slice_from_memoryview')
14864  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
14865  * __Pyx_memviewslice *mslice) except NULL:
14866  * cdef _memoryviewslice obj
14867  */
14868 
14869  /* function exit code */
14870  __pyx_L1_error:;
14871  __Pyx_XDECREF(__pyx_t_3);
14872  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
14873  __pyx_r = NULL;
14874  __pyx_L0:;
14875  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
14876  __Pyx_RefNannyFinishContext();
14877  return __pyx_r;
14878 }
14879 
14880 /* "View.MemoryView":1063
14881  *
14882  * @cname('__pyx_memoryview_slice_copy')
14883  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
14884  * cdef int dim
14885  * cdef (Py_ssize_t*) shape, strides, suboffsets
14886  */
14887 
14888 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
14889  int __pyx_v_dim;
14890  Py_ssize_t *__pyx_v_shape;
14891  Py_ssize_t *__pyx_v_strides;
14892  Py_ssize_t *__pyx_v_suboffsets;
14893  __Pyx_RefNannyDeclarations
14894  Py_ssize_t *__pyx_t_1;
14895  int __pyx_t_2;
14896  int __pyx_t_3;
14897  int __pyx_t_4;
14898  Py_ssize_t __pyx_t_5;
14899  __Pyx_RefNannySetupContext("slice_copy", 0);
14900 
14901  /* "View.MemoryView":1067
14902  * cdef (Py_ssize_t*) shape, strides, suboffsets
14903  *
14904  * shape = memview.view.shape # <<<<<<<<<<<<<<
14905  * strides = memview.view.strides
14906  * suboffsets = memview.view.suboffsets
14907  */
14908  __pyx_t_1 = __pyx_v_memview->view.shape;
14909  __pyx_v_shape = __pyx_t_1;
14910 
14911  /* "View.MemoryView":1068
14912  *
14913  * shape = memview.view.shape
14914  * strides = memview.view.strides # <<<<<<<<<<<<<<
14915  * suboffsets = memview.view.suboffsets
14916  *
14917  */
14918  __pyx_t_1 = __pyx_v_memview->view.strides;
14919  __pyx_v_strides = __pyx_t_1;
14920 
14921  /* "View.MemoryView":1069
14922  * shape = memview.view.shape
14923  * strides = memview.view.strides
14924  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
14925  *
14926  * dst.memview = <__pyx_memoryview *> memview
14927  */
14928  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
14929  __pyx_v_suboffsets = __pyx_t_1;
14930 
14931  /* "View.MemoryView":1071
14932  * suboffsets = memview.view.suboffsets
14933  *
14934  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
14935  * dst.data = <char *> memview.view.buf
14936  *
14937  */
14938  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
14939 
14940  /* "View.MemoryView":1072
14941  *
14942  * dst.memview = <__pyx_memoryview *> memview
14943  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
14944  *
14945  * for dim in range(memview.view.ndim):
14946  */
14947  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
14948 
14949  /* "View.MemoryView":1074
14950  * dst.data = <char *> memview.view.buf
14951  *
14952  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
14953  * dst.shape[dim] = shape[dim]
14954  * dst.strides[dim] = strides[dim]
14955  */
14956  __pyx_t_2 = __pyx_v_memview->view.ndim;
14957  __pyx_t_3 = __pyx_t_2;
14958  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
14959  __pyx_v_dim = __pyx_t_4;
14960 
14961  /* "View.MemoryView":1075
14962  *
14963  * for dim in range(memview.view.ndim):
14964  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
14965  * dst.strides[dim] = strides[dim]
14966  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
14967  */
14968  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
14969 
14970  /* "View.MemoryView":1076
14971  * for dim in range(memview.view.ndim):
14972  * dst.shape[dim] = shape[dim]
14973  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
14974  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
14975  *
14976  */
14977  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
14978 
14979  /* "View.MemoryView":1077
14980  * dst.shape[dim] = shape[dim]
14981  * dst.strides[dim] = strides[dim]
14982  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
14983  *
14984  * @cname('__pyx_memoryview_copy_object')
14985  */
14986  if ((__pyx_v_suboffsets != 0)) {
14987  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
14988  } else {
14989  __pyx_t_5 = -1L;
14990  }
14991  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
14992  }
14993 
14994  /* "View.MemoryView":1063
14995  *
14996  * @cname('__pyx_memoryview_slice_copy')
14997  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
14998  * cdef int dim
14999  * cdef (Py_ssize_t*) shape, strides, suboffsets
15000  */
15001 
15002  /* function exit code */
15003  __Pyx_RefNannyFinishContext();
15004 }
15005 
15006 /* "View.MemoryView":1080
15007  *
15008  * @cname('__pyx_memoryview_copy_object')
15009  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
15010  * "Create a new memoryview object"
15011  * cdef __Pyx_memviewslice memviewslice
15012  */
15013 
15014 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
15015  __Pyx_memviewslice __pyx_v_memviewslice;
15016  PyObject *__pyx_r = NULL;
15017  __Pyx_RefNannyDeclarations
15018  PyObject *__pyx_t_1 = NULL;
15019  int __pyx_lineno = 0;
15020  const char *__pyx_filename = NULL;
15021  int __pyx_clineno = 0;
15022  __Pyx_RefNannySetupContext("memoryview_copy", 0);
15023 
15024  /* "View.MemoryView":1083
15025  * "Create a new memoryview object"
15026  * cdef __Pyx_memviewslice memviewslice
15027  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
15028  * return memoryview_copy_from_slice(memview, &memviewslice)
15029  *
15030  */
15031  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
15032 
15033  /* "View.MemoryView":1084
15034  * cdef __Pyx_memviewslice memviewslice
15035  * slice_copy(memview, &memviewslice)
15036  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
15037  *
15038  * @cname('__pyx_memoryview_copy_object_from_slice')
15039  */
15040  __Pyx_XDECREF(__pyx_r);
15041  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error)
15042  __Pyx_GOTREF(__pyx_t_1);
15043  __pyx_r = __pyx_t_1;
15044  __pyx_t_1 = 0;
15045  goto __pyx_L0;
15046 
15047  /* "View.MemoryView":1080
15048  *
15049  * @cname('__pyx_memoryview_copy_object')
15050  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
15051  * "Create a new memoryview object"
15052  * cdef __Pyx_memviewslice memviewslice
15053  */
15054 
15055  /* function exit code */
15056  __pyx_L1_error:;
15057  __Pyx_XDECREF(__pyx_t_1);
15058  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15059  __pyx_r = 0;
15060  __pyx_L0:;
15061  __Pyx_XGIVEREF(__pyx_r);
15062  __Pyx_RefNannyFinishContext();
15063  return __pyx_r;
15064 }
15065 
15066 /* "View.MemoryView":1087
15067  *
15068  * @cname('__pyx_memoryview_copy_object_from_slice')
15069  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
15070  * """
15071  * Create a new memoryview object from a given memoryview object and slice.
15072  */
15073 
15074 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
15075  PyObject *(*__pyx_v_to_object_func)(char *);
15076  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
15077  PyObject *__pyx_r = NULL;
15078  __Pyx_RefNannyDeclarations
15079  int __pyx_t_1;
15080  int __pyx_t_2;
15081  PyObject *(*__pyx_t_3)(char *);
15082  int (*__pyx_t_4)(char *, PyObject *);
15083  PyObject *__pyx_t_5 = NULL;
15084  int __pyx_lineno = 0;
15085  const char *__pyx_filename = NULL;
15086  int __pyx_clineno = 0;
15087  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
15088 
15089  /* "View.MemoryView":1094
15090  * cdef int (*to_dtype_func)(char *, object) except 0
15091  *
15092  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15093  * to_object_func = (<_memoryviewslice> memview).to_object_func
15094  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15095  */
15096  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15097  __pyx_t_2 = (__pyx_t_1 != 0);
15098  if (__pyx_t_2) {
15099 
15100  /* "View.MemoryView":1095
15101  *
15102  * if isinstance(memview, _memoryviewslice):
15103  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
15104  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15105  * else:
15106  */
15107  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
15108  __pyx_v_to_object_func = __pyx_t_3;
15109 
15110  /* "View.MemoryView":1096
15111  * if isinstance(memview, _memoryviewslice):
15112  * to_object_func = (<_memoryviewslice> memview).to_object_func
15113  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
15114  * else:
15115  * to_object_func = NULL
15116  */
15117  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
15118  __pyx_v_to_dtype_func = __pyx_t_4;
15119 
15120  /* "View.MemoryView":1094
15121  * cdef int (*to_dtype_func)(char *, object) except 0
15122  *
15123  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15124  * to_object_func = (<_memoryviewslice> memview).to_object_func
15125  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15126  */
15127  goto __pyx_L3;
15128  }
15129 
15130  /* "View.MemoryView":1098
15131  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15132  * else:
15133  * to_object_func = NULL # <<<<<<<<<<<<<<
15134  * to_dtype_func = NULL
15135  *
15136  */
15137  /*else*/ {
15138  __pyx_v_to_object_func = NULL;
15139 
15140  /* "View.MemoryView":1099
15141  * else:
15142  * to_object_func = NULL
15143  * to_dtype_func = NULL # <<<<<<<<<<<<<<
15144  *
15145  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
15146  */
15147  __pyx_v_to_dtype_func = NULL;
15148  }
15149  __pyx_L3:;
15150 
15151  /* "View.MemoryView":1101
15152  * to_dtype_func = NULL
15153  *
15154  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
15155  * to_object_func, to_dtype_func,
15156  * memview.dtype_is_object)
15157  */
15158  __Pyx_XDECREF(__pyx_r);
15159 
15160  /* "View.MemoryView":1103
15161  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
15162  * to_object_func, to_dtype_func,
15163  * memview.dtype_is_object) # <<<<<<<<<<<<<<
15164  *
15165  *
15166  */
15167  __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(0, 1101, __pyx_L1_error)
15168  __Pyx_GOTREF(__pyx_t_5);
15169  __pyx_r = __pyx_t_5;
15170  __pyx_t_5 = 0;
15171  goto __pyx_L0;
15172 
15173  /* "View.MemoryView":1087
15174  *
15175  * @cname('__pyx_memoryview_copy_object_from_slice')
15176  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
15177  * """
15178  * Create a new memoryview object from a given memoryview object and slice.
15179  */
15180 
15181  /* function exit code */
15182  __pyx_L1_error:;
15183  __Pyx_XDECREF(__pyx_t_5);
15184  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15185  __pyx_r = 0;
15186  __pyx_L0:;
15187  __Pyx_XGIVEREF(__pyx_r);
15188  __Pyx_RefNannyFinishContext();
15189  return __pyx_r;
15190 }
15191 
15192 /* "View.MemoryView":1109
15193  *
15194  *
15195  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
15196  * if arg < 0:
15197  * return -arg
15198  */
15199 
15200 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
15201  Py_ssize_t __pyx_r;
15202  int __pyx_t_1;
15203 
15204  /* "View.MemoryView":1110
15205  *
15206  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
15207  * if arg < 0: # <<<<<<<<<<<<<<
15208  * return -arg
15209  * else:
15210  */
15211  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
15212  if (__pyx_t_1) {
15213 
15214  /* "View.MemoryView":1111
15215  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
15216  * if arg < 0:
15217  * return -arg # <<<<<<<<<<<<<<
15218  * else:
15219  * return arg
15220  */
15221  __pyx_r = (-__pyx_v_arg);
15222  goto __pyx_L0;
15223 
15224  /* "View.MemoryView":1110
15225  *
15226  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
15227  * if arg < 0: # <<<<<<<<<<<<<<
15228  * return -arg
15229  * else:
15230  */
15231  }
15232 
15233  /* "View.MemoryView":1113
15234  * return -arg
15235  * else:
15236  * return arg # <<<<<<<<<<<<<<
15237  *
15238  * @cname('__pyx_get_best_slice_order')
15239  */
15240  /*else*/ {
15241  __pyx_r = __pyx_v_arg;
15242  goto __pyx_L0;
15243  }
15244 
15245  /* "View.MemoryView":1109
15246  *
15247  *
15248  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
15249  * if arg < 0:
15250  * return -arg
15251  */
15252 
15253  /* function exit code */
15254  __pyx_L0:;
15255  return __pyx_r;
15256 }
15257 
15258 /* "View.MemoryView":1116
15259  *
15260  * @cname('__pyx_get_best_slice_order')
15261  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
15262  * """
15263  * Figure out the best memory access order for a given slice.
15264  */
15265 
15266 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
15267  int __pyx_v_i;
15268  Py_ssize_t __pyx_v_c_stride;
15269  Py_ssize_t __pyx_v_f_stride;
15270  char __pyx_r;
15271  int __pyx_t_1;
15272  int __pyx_t_2;
15273  int __pyx_t_3;
15274  int __pyx_t_4;
15275 
15276  /* "View.MemoryView":1121
15277  * """
15278  * cdef int i
15279  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
15280  * cdef Py_ssize_t f_stride = 0
15281  *
15282  */
15283  __pyx_v_c_stride = 0;
15284 
15285  /* "View.MemoryView":1122
15286  * cdef int i
15287  * cdef Py_ssize_t c_stride = 0
15288  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
15289  *
15290  * for i in range(ndim - 1, -1, -1):
15291  */
15292  __pyx_v_f_stride = 0;
15293 
15294  /* "View.MemoryView":1124
15295  * cdef Py_ssize_t f_stride = 0
15296  *
15297  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
15298  * if mslice.shape[i] > 1:
15299  * c_stride = mslice.strides[i]
15300  */
15301  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
15302  __pyx_v_i = __pyx_t_1;
15303 
15304  /* "View.MemoryView":1125
15305  *
15306  * for i in range(ndim - 1, -1, -1):
15307  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15308  * c_stride = mslice.strides[i]
15309  * break
15310  */
15311  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
15312  if (__pyx_t_2) {
15313 
15314  /* "View.MemoryView":1126
15315  * for i in range(ndim - 1, -1, -1):
15316  * if mslice.shape[i] > 1:
15317  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
15318  * break
15319  *
15320  */
15321  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
15322 
15323  /* "View.MemoryView":1127
15324  * if mslice.shape[i] > 1:
15325  * c_stride = mslice.strides[i]
15326  * break # <<<<<<<<<<<<<<
15327  *
15328  * for i in range(ndim):
15329  */
15330  goto __pyx_L4_break;
15331 
15332  /* "View.MemoryView":1125
15333  *
15334  * for i in range(ndim - 1, -1, -1):
15335  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15336  * c_stride = mslice.strides[i]
15337  * break
15338  */
15339  }
15340  }
15341  __pyx_L4_break:;
15342 
15343  /* "View.MemoryView":1129
15344  * break
15345  *
15346  * for i in range(ndim): # <<<<<<<<<<<<<<
15347  * if mslice.shape[i] > 1:
15348  * f_stride = mslice.strides[i]
15349  */
15350  __pyx_t_1 = __pyx_v_ndim;
15351  __pyx_t_3 = __pyx_t_1;
15352  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15353  __pyx_v_i = __pyx_t_4;
15354 
15355  /* "View.MemoryView":1130
15356  *
15357  * for i in range(ndim):
15358  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15359  * f_stride = mslice.strides[i]
15360  * break
15361  */
15362  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
15363  if (__pyx_t_2) {
15364 
15365  /* "View.MemoryView":1131
15366  * for i in range(ndim):
15367  * if mslice.shape[i] > 1:
15368  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
15369  * break
15370  *
15371  */
15372  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
15373 
15374  /* "View.MemoryView":1132
15375  * if mslice.shape[i] > 1:
15376  * f_stride = mslice.strides[i]
15377  * break # <<<<<<<<<<<<<<
15378  *
15379  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
15380  */
15381  goto __pyx_L7_break;
15382 
15383  /* "View.MemoryView":1130
15384  *
15385  * for i in range(ndim):
15386  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15387  * f_stride = mslice.strides[i]
15388  * break
15389  */
15390  }
15391  }
15392  __pyx_L7_break:;
15393 
15394  /* "View.MemoryView":1134
15395  * break
15396  *
15397  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
15398  * return 'C'
15399  * else:
15400  */
15401  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
15402  if (__pyx_t_2) {
15403 
15404  /* "View.MemoryView":1135
15405  *
15406  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
15407  * return 'C' # <<<<<<<<<<<<<<
15408  * else:
15409  * return 'F'
15410  */
15411  __pyx_r = 'C';
15412  goto __pyx_L0;
15413 
15414  /* "View.MemoryView":1134
15415  * break
15416  *
15417  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
15418  * return 'C'
15419  * else:
15420  */
15421  }
15422 
15423  /* "View.MemoryView":1137
15424  * return 'C'
15425  * else:
15426  * return 'F' # <<<<<<<<<<<<<<
15427  *
15428  * @cython.cdivision(True)
15429  */
15430  /*else*/ {
15431  __pyx_r = 'F';
15432  goto __pyx_L0;
15433  }
15434 
15435  /* "View.MemoryView":1116
15436  *
15437  * @cname('__pyx_get_best_slice_order')
15438  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
15439  * """
15440  * Figure out the best memory access order for a given slice.
15441  */
15442 
15443  /* function exit code */
15444  __pyx_L0:;
15445  return __pyx_r;
15446 }
15447 
15448 /* "View.MemoryView":1140
15449  *
15450  * @cython.cdivision(True)
15451  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
15452  * char *dst_data, Py_ssize_t *dst_strides,
15453  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
15454  */
15455 
15456 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) {
15457  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
15458  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
15459  Py_ssize_t __pyx_v_dst_extent;
15460  Py_ssize_t __pyx_v_src_stride;
15461  Py_ssize_t __pyx_v_dst_stride;
15462  int __pyx_t_1;
15463  int __pyx_t_2;
15464  int __pyx_t_3;
15465  Py_ssize_t __pyx_t_4;
15466  Py_ssize_t __pyx_t_5;
15467  Py_ssize_t __pyx_t_6;
15468 
15469  /* "View.MemoryView":1147
15470  *
15471  * cdef Py_ssize_t i
15472  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
15473  * cdef Py_ssize_t dst_extent = dst_shape[0]
15474  * cdef Py_ssize_t src_stride = src_strides[0]
15475  */
15476  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
15477 
15478  /* "View.MemoryView":1148
15479  * cdef Py_ssize_t i
15480  * cdef Py_ssize_t src_extent = src_shape[0]
15481  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
15482  * cdef Py_ssize_t src_stride = src_strides[0]
15483  * cdef Py_ssize_t dst_stride = dst_strides[0]
15484  */
15485  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
15486 
15487  /* "View.MemoryView":1149
15488  * cdef Py_ssize_t src_extent = src_shape[0]
15489  * cdef Py_ssize_t dst_extent = dst_shape[0]
15490  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
15491  * cdef Py_ssize_t dst_stride = dst_strides[0]
15492  *
15493  */
15494  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
15495 
15496  /* "View.MemoryView":1150
15497  * cdef Py_ssize_t dst_extent = dst_shape[0]
15498  * cdef Py_ssize_t src_stride = src_strides[0]
15499  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
15500  *
15501  * if ndim == 1:
15502  */
15503  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
15504 
15505  /* "View.MemoryView":1152
15506  * cdef Py_ssize_t dst_stride = dst_strides[0]
15507  *
15508  * if ndim == 1: # <<<<<<<<<<<<<<
15509  * if (src_stride > 0 and dst_stride > 0 and
15510  * <size_t> src_stride == itemsize == <size_t> dst_stride):
15511  */
15512  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
15513  if (__pyx_t_1) {
15514 
15515  /* "View.MemoryView":1153
15516  *
15517  * if ndim == 1:
15518  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
15519  * <size_t> src_stride == itemsize == <size_t> dst_stride):
15520  * memcpy(dst_data, src_data, itemsize * dst_extent)
15521  */
15522  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
15523  if (__pyx_t_2) {
15524  } else {
15525  __pyx_t_1 = __pyx_t_2;
15526  goto __pyx_L5_bool_binop_done;
15527  }
15528  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
15529  if (__pyx_t_2) {
15530  } else {
15531  __pyx_t_1 = __pyx_t_2;
15532  goto __pyx_L5_bool_binop_done;
15533  }
15534 
15535  /* "View.MemoryView":1154
15536  * if ndim == 1:
15537  * if (src_stride > 0 and dst_stride > 0 and
15538  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
15539  * memcpy(dst_data, src_data, itemsize * dst_extent)
15540  * else:
15541  */
15542  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
15543  if (__pyx_t_2) {
15544  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
15545  }
15546  __pyx_t_3 = (__pyx_t_2 != 0);
15547  __pyx_t_1 = __pyx_t_3;
15548  __pyx_L5_bool_binop_done:;
15549 
15550  /* "View.MemoryView":1153
15551  *
15552  * if ndim == 1:
15553  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
15554  * <size_t> src_stride == itemsize == <size_t> dst_stride):
15555  * memcpy(dst_data, src_data, itemsize * dst_extent)
15556  */
15557  if (__pyx_t_1) {
15558 
15559  /* "View.MemoryView":1155
15560  * if (src_stride > 0 and dst_stride > 0 and
15561  * <size_t> src_stride == itemsize == <size_t> dst_stride):
15562  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
15563  * else:
15564  * for i in range(dst_extent):
15565  */
15566  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
15567 
15568  /* "View.MemoryView":1153
15569  *
15570  * if ndim == 1:
15571  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
15572  * <size_t> src_stride == itemsize == <size_t> dst_stride):
15573  * memcpy(dst_data, src_data, itemsize * dst_extent)
15574  */
15575  goto __pyx_L4;
15576  }
15577 
15578  /* "View.MemoryView":1157
15579  * memcpy(dst_data, src_data, itemsize * dst_extent)
15580  * else:
15581  * for i in range(dst_extent): # <<<<<<<<<<<<<<
15582  * memcpy(dst_data, src_data, itemsize)
15583  * src_data += src_stride
15584  */
15585  /*else*/ {
15586  __pyx_t_4 = __pyx_v_dst_extent;
15587  __pyx_t_5 = __pyx_t_4;
15588  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15589  __pyx_v_i = __pyx_t_6;
15590 
15591  /* "View.MemoryView":1158
15592  * else:
15593  * for i in range(dst_extent):
15594  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
15595  * src_data += src_stride
15596  * dst_data += dst_stride
15597  */
15598  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
15599 
15600  /* "View.MemoryView":1159
15601  * for i in range(dst_extent):
15602  * memcpy(dst_data, src_data, itemsize)
15603  * src_data += src_stride # <<<<<<<<<<<<<<
15604  * dst_data += dst_stride
15605  * else:
15606  */
15607  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
15608 
15609  /* "View.MemoryView":1160
15610  * memcpy(dst_data, src_data, itemsize)
15611  * src_data += src_stride
15612  * dst_data += dst_stride # <<<<<<<<<<<<<<
15613  * else:
15614  * for i in range(dst_extent):
15615  */
15616  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
15617  }
15618  }
15619  __pyx_L4:;
15620 
15621  /* "View.MemoryView":1152
15622  * cdef Py_ssize_t dst_stride = dst_strides[0]
15623  *
15624  * if ndim == 1: # <<<<<<<<<<<<<<
15625  * if (src_stride > 0 and dst_stride > 0 and
15626  * <size_t> src_stride == itemsize == <size_t> dst_stride):
15627  */
15628  goto __pyx_L3;
15629  }
15630 
15631  /* "View.MemoryView":1162
15632  * dst_data += dst_stride
15633  * else:
15634  * for i in range(dst_extent): # <<<<<<<<<<<<<<
15635  * _copy_strided_to_strided(src_data, src_strides + 1,
15636  * dst_data, dst_strides + 1,
15637  */
15638  /*else*/ {
15639  __pyx_t_4 = __pyx_v_dst_extent;
15640  __pyx_t_5 = __pyx_t_4;
15641  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15642  __pyx_v_i = __pyx_t_6;
15643 
15644  /* "View.MemoryView":1163
15645  * else:
15646  * for i in range(dst_extent):
15647  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
15648  * dst_data, dst_strides + 1,
15649  * src_shape + 1, dst_shape + 1,
15650  */
15651  _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);
15652 
15653  /* "View.MemoryView":1167
15654  * src_shape + 1, dst_shape + 1,
15655  * ndim - 1, itemsize)
15656  * src_data += src_stride # <<<<<<<<<<<<<<
15657  * dst_data += dst_stride
15658  *
15659  */
15660  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
15661 
15662  /* "View.MemoryView":1168
15663  * ndim - 1, itemsize)
15664  * src_data += src_stride
15665  * dst_data += dst_stride # <<<<<<<<<<<<<<
15666  *
15667  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
15668  */
15669  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
15670  }
15671  }
15672  __pyx_L3:;
15673 
15674  /* "View.MemoryView":1140
15675  *
15676  * @cython.cdivision(True)
15677  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
15678  * char *dst_data, Py_ssize_t *dst_strides,
15679  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
15680  */
15681 
15682  /* function exit code */
15683 }
15684 
15685 /* "View.MemoryView":1170
15686  * dst_data += dst_stride
15687  *
15688  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
15689  * __Pyx_memviewslice *dst,
15690  * int ndim, size_t itemsize) nogil:
15691  */
15692 
15693 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) {
15694 
15695  /* "View.MemoryView":1173
15696  * __Pyx_memviewslice *dst,
15697  * int ndim, size_t itemsize) nogil:
15698  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
15699  * src.shape, dst.shape, ndim, itemsize)
15700  *
15701  */
15702  _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);
15703 
15704  /* "View.MemoryView":1170
15705  * dst_data += dst_stride
15706  *
15707  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
15708  * __Pyx_memviewslice *dst,
15709  * int ndim, size_t itemsize) nogil:
15710  */
15711 
15712  /* function exit code */
15713 }
15714 
15715 /* "View.MemoryView":1177
15716  *
15717  * @cname('__pyx_memoryview_slice_get_size')
15718  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
15719  * "Return the size of the memory occupied by the slice in number of bytes"
15720  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
15721  */
15722 
15723 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
15724  Py_ssize_t __pyx_v_shape;
15725  Py_ssize_t __pyx_v_size;
15726  Py_ssize_t __pyx_r;
15727  Py_ssize_t __pyx_t_1;
15728  Py_ssize_t *__pyx_t_2;
15729  Py_ssize_t *__pyx_t_3;
15730  Py_ssize_t *__pyx_t_4;
15731 
15732  /* "View.MemoryView":1179
15733  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
15734  * "Return the size of the memory occupied by the slice in number of bytes"
15735  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
15736  *
15737  * for shape in src.shape[:ndim]:
15738  */
15739  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
15740  __pyx_v_size = __pyx_t_1;
15741 
15742  /* "View.MemoryView":1181
15743  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
15744  *
15745  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
15746  * size *= shape
15747  *
15748  */
15749  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
15750  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
15751  __pyx_t_2 = __pyx_t_4;
15752  __pyx_v_shape = (__pyx_t_2[0]);
15753 
15754  /* "View.MemoryView":1182
15755  *
15756  * for shape in src.shape[:ndim]:
15757  * size *= shape # <<<<<<<<<<<<<<
15758  *
15759  * return size
15760  */
15761  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
15762  }
15763 
15764  /* "View.MemoryView":1184
15765  * size *= shape
15766  *
15767  * return size # <<<<<<<<<<<<<<
15768  *
15769  * @cname('__pyx_fill_contig_strides_array')
15770  */
15771  __pyx_r = __pyx_v_size;
15772  goto __pyx_L0;
15773 
15774  /* "View.MemoryView":1177
15775  *
15776  * @cname('__pyx_memoryview_slice_get_size')
15777  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
15778  * "Return the size of the memory occupied by the slice in number of bytes"
15779  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
15780  */
15781 
15782  /* function exit code */
15783  __pyx_L0:;
15784  return __pyx_r;
15785 }
15786 
15787 /* "View.MemoryView":1187
15788  *
15789  * @cname('__pyx_fill_contig_strides_array')
15790  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
15791  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
15792  * int ndim, char order) nogil:
15793  */
15794 
15795 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) {
15796  int __pyx_v_idx;
15797  Py_ssize_t __pyx_r;
15798  int __pyx_t_1;
15799  int __pyx_t_2;
15800  int __pyx_t_3;
15801  int __pyx_t_4;
15802 
15803  /* "View.MemoryView":1196
15804  * cdef int idx
15805  *
15806  * if order == 'F': # <<<<<<<<<<<<<<
15807  * for idx in range(ndim):
15808  * strides[idx] = stride
15809  */
15810  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
15811  if (__pyx_t_1) {
15812 
15813  /* "View.MemoryView":1197
15814  *
15815  * if order == 'F':
15816  * for idx in range(ndim): # <<<<<<<<<<<<<<
15817  * strides[idx] = stride
15818  * stride *= shape[idx]
15819  */
15820  __pyx_t_2 = __pyx_v_ndim;
15821  __pyx_t_3 = __pyx_t_2;
15822  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15823  __pyx_v_idx = __pyx_t_4;
15824 
15825  /* "View.MemoryView":1198
15826  * if order == 'F':
15827  * for idx in range(ndim):
15828  * strides[idx] = stride # <<<<<<<<<<<<<<
15829  * stride *= shape[idx]
15830  * else:
15831  */
15832  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
15833 
15834  /* "View.MemoryView":1199
15835  * for idx in range(ndim):
15836  * strides[idx] = stride
15837  * stride *= shape[idx] # <<<<<<<<<<<<<<
15838  * else:
15839  * for idx in range(ndim - 1, -1, -1):
15840  */
15841  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
15842  }
15843 
15844  /* "View.MemoryView":1196
15845  * cdef int idx
15846  *
15847  * if order == 'F': # <<<<<<<<<<<<<<
15848  * for idx in range(ndim):
15849  * strides[idx] = stride
15850  */
15851  goto __pyx_L3;
15852  }
15853 
15854  /* "View.MemoryView":1201
15855  * stride *= shape[idx]
15856  * else:
15857  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
15858  * strides[idx] = stride
15859  * stride *= shape[idx]
15860  */
15861  /*else*/ {
15862  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
15863  __pyx_v_idx = __pyx_t_2;
15864 
15865  /* "View.MemoryView":1202
15866  * else:
15867  * for idx in range(ndim - 1, -1, -1):
15868  * strides[idx] = stride # <<<<<<<<<<<<<<
15869  * stride *= shape[idx]
15870  *
15871  */
15872  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
15873 
15874  /* "View.MemoryView":1203
15875  * for idx in range(ndim - 1, -1, -1):
15876  * strides[idx] = stride
15877  * stride *= shape[idx] # <<<<<<<<<<<<<<
15878  *
15879  * return stride
15880  */
15881  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
15882  }
15883  }
15884  __pyx_L3:;
15885 
15886  /* "View.MemoryView":1205
15887  * stride *= shape[idx]
15888  *
15889  * return stride # <<<<<<<<<<<<<<
15890  *
15891  * @cname('__pyx_memoryview_copy_data_to_temp')
15892  */
15893  __pyx_r = __pyx_v_stride;
15894  goto __pyx_L0;
15895 
15896  /* "View.MemoryView":1187
15897  *
15898  * @cname('__pyx_fill_contig_strides_array')
15899  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
15900  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
15901  * int ndim, char order) nogil:
15902  */
15903 
15904  /* function exit code */
15905  __pyx_L0:;
15906  return __pyx_r;
15907 }
15908 
15909 /* "View.MemoryView":1208
15910  *
15911  * @cname('__pyx_memoryview_copy_data_to_temp')
15912  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
15913  * __Pyx_memviewslice *tmpslice,
15914  * char order,
15915  */
15916 
15917 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) {
15918  int __pyx_v_i;
15919  void *__pyx_v_result;
15920  size_t __pyx_v_itemsize;
15921  size_t __pyx_v_size;
15922  void *__pyx_r;
15923  Py_ssize_t __pyx_t_1;
15924  int __pyx_t_2;
15925  int __pyx_t_3;
15926  struct __pyx_memoryview_obj *__pyx_t_4;
15927  int __pyx_t_5;
15928  int __pyx_t_6;
15929  int __pyx_lineno = 0;
15930  const char *__pyx_filename = NULL;
15931  int __pyx_clineno = 0;
15932 
15933  /* "View.MemoryView":1219
15934  * cdef void *result
15935  *
15936  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
15937  * cdef size_t size = slice_get_size(src, ndim)
15938  *
15939  */
15940  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
15941  __pyx_v_itemsize = __pyx_t_1;
15942 
15943  /* "View.MemoryView":1220
15944  *
15945  * cdef size_t itemsize = src.memview.view.itemsize
15946  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
15947  *
15948  * result = malloc(size)
15949  */
15950  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
15951 
15952  /* "View.MemoryView":1222
15953  * cdef size_t size = slice_get_size(src, ndim)
15954  *
15955  * result = malloc(size) # <<<<<<<<<<<<<<
15956  * if not result:
15957  * _err(MemoryError, NULL)
15958  */
15959  __pyx_v_result = malloc(__pyx_v_size);
15960 
15961  /* "View.MemoryView":1223
15962  *
15963  * result = malloc(size)
15964  * if not result: # <<<<<<<<<<<<<<
15965  * _err(MemoryError, NULL)
15966  *
15967  */
15968  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
15969  if (__pyx_t_2) {
15970 
15971  /* "View.MemoryView":1224
15972  * result = malloc(size)
15973  * if not result:
15974  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
15975  *
15976  *
15977  */
15978  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1224, __pyx_L1_error)
15979 
15980  /* "View.MemoryView":1223
15981  *
15982  * result = malloc(size)
15983  * if not result: # <<<<<<<<<<<<<<
15984  * _err(MemoryError, NULL)
15985  *
15986  */
15987  }
15988 
15989  /* "View.MemoryView":1227
15990  *
15991  *
15992  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
15993  * tmpslice.memview = src.memview
15994  * for i in range(ndim):
15995  */
15996  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
15997 
15998  /* "View.MemoryView":1228
15999  *
16000  * tmpslice.data = <char *> result
16001  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
16002  * for i in range(ndim):
16003  * tmpslice.shape[i] = src.shape[i]
16004  */
16005  __pyx_t_4 = __pyx_v_src->memview;
16006  __pyx_v_tmpslice->memview = __pyx_t_4;
16007 
16008  /* "View.MemoryView":1229
16009  * tmpslice.data = <char *> result
16010  * tmpslice.memview = src.memview
16011  * for i in range(ndim): # <<<<<<<<<<<<<<
16012  * tmpslice.shape[i] = src.shape[i]
16013  * tmpslice.suboffsets[i] = -1
16014  */
16015  __pyx_t_3 = __pyx_v_ndim;
16016  __pyx_t_5 = __pyx_t_3;
16017  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16018  __pyx_v_i = __pyx_t_6;
16019 
16020  /* "View.MemoryView":1230
16021  * tmpslice.memview = src.memview
16022  * for i in range(ndim):
16023  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
16024  * tmpslice.suboffsets[i] = -1
16025  *
16026  */
16027  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
16028 
16029  /* "View.MemoryView":1231
16030  * for i in range(ndim):
16031  * tmpslice.shape[i] = src.shape[i]
16032  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
16033  *
16034  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
16035  */
16036  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
16037  }
16038 
16039  /* "View.MemoryView":1233
16040  * tmpslice.suboffsets[i] = -1
16041  *
16042  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
16043  * ndim, order)
16044  *
16045  */
16046  (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));
16047 
16048  /* "View.MemoryView":1237
16049  *
16050  *
16051  * for i in range(ndim): # <<<<<<<<<<<<<<
16052  * if tmpslice.shape[i] == 1:
16053  * tmpslice.strides[i] = 0
16054  */
16055  __pyx_t_3 = __pyx_v_ndim;
16056  __pyx_t_5 = __pyx_t_3;
16057  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16058  __pyx_v_i = __pyx_t_6;
16059 
16060  /* "View.MemoryView":1238
16061  *
16062  * for i in range(ndim):
16063  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16064  * tmpslice.strides[i] = 0
16065  *
16066  */
16067  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
16068  if (__pyx_t_2) {
16069 
16070  /* "View.MemoryView":1239
16071  * for i in range(ndim):
16072  * if tmpslice.shape[i] == 1:
16073  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
16074  *
16075  * if slice_is_contig(src[0], order, ndim):
16076  */
16077  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
16078 
16079  /* "View.MemoryView":1238
16080  *
16081  * for i in range(ndim):
16082  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16083  * tmpslice.strides[i] = 0
16084  *
16085  */
16086  }
16087  }
16088 
16089  /* "View.MemoryView":1241
16090  * tmpslice.strides[i] = 0
16091  *
16092  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16093  * memcpy(result, src.data, size)
16094  * else:
16095  */
16096  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
16097  if (__pyx_t_2) {
16098 
16099  /* "View.MemoryView":1242
16100  *
16101  * if slice_is_contig(src[0], order, ndim):
16102  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
16103  * else:
16104  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16105  */
16106  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
16107 
16108  /* "View.MemoryView":1241
16109  * tmpslice.strides[i] = 0
16110  *
16111  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16112  * memcpy(result, src.data, size)
16113  * else:
16114  */
16115  goto __pyx_L9;
16116  }
16117 
16118  /* "View.MemoryView":1244
16119  * memcpy(result, src.data, size)
16120  * else:
16121  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
16122  *
16123  * return result
16124  */
16125  /*else*/ {
16126  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
16127  }
16128  __pyx_L9:;
16129 
16130  /* "View.MemoryView":1246
16131  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16132  *
16133  * return result # <<<<<<<<<<<<<<
16134  *
16135  *
16136  */
16137  __pyx_r = __pyx_v_result;
16138  goto __pyx_L0;
16139 
16140  /* "View.MemoryView":1208
16141  *
16142  * @cname('__pyx_memoryview_copy_data_to_temp')
16143  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16144  * __Pyx_memviewslice *tmpslice,
16145  * char order,
16146  */
16147 
16148  /* function exit code */
16149  __pyx_L1_error:;
16150  {
16151  #ifdef WITH_THREAD
16152  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16153  #endif
16154  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
16155  #ifdef WITH_THREAD
16156  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16157  #endif
16158  }
16159  __pyx_r = NULL;
16160  __pyx_L0:;
16161  return __pyx_r;
16162 }
16163 
16164 /* "View.MemoryView":1251
16165  *
16166  * @cname('__pyx_memoryview_err_extents')
16167  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
16168  * Py_ssize_t extent2) except -1 with gil:
16169  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
16170  */
16171 
16172 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
16173  int __pyx_r;
16174  __Pyx_RefNannyDeclarations
16175  PyObject *__pyx_t_1 = NULL;
16176  PyObject *__pyx_t_2 = NULL;
16177  PyObject *__pyx_t_3 = NULL;
16178  PyObject *__pyx_t_4 = NULL;
16179  int __pyx_lineno = 0;
16180  const char *__pyx_filename = NULL;
16181  int __pyx_clineno = 0;
16182  #ifdef WITH_THREAD
16183  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16184  #endif
16185  __Pyx_RefNannySetupContext("_err_extents", 0);
16186 
16187  /* "View.MemoryView":1254
16188  * Py_ssize_t extent2) except -1 with gil:
16189  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
16190  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
16191  *
16192  * @cname('__pyx_memoryview_err_dim')
16193  */
16194  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
16195  __Pyx_GOTREF(__pyx_t_1);
16196  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1254, __pyx_L1_error)
16197  __Pyx_GOTREF(__pyx_t_2);
16198  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L1_error)
16199  __Pyx_GOTREF(__pyx_t_3);
16200  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1254, __pyx_L1_error)
16201  __Pyx_GOTREF(__pyx_t_4);
16202  __Pyx_GIVEREF(__pyx_t_1);
16203  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
16204  __Pyx_GIVEREF(__pyx_t_2);
16205  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
16206  __Pyx_GIVEREF(__pyx_t_3);
16207  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
16208  __pyx_t_1 = 0;
16209  __pyx_t_2 = 0;
16210  __pyx_t_3 = 0;
16211 
16212  /* "View.MemoryView":1253
16213  * cdef int _err_extents(int i, Py_ssize_t extent1,
16214  * Py_ssize_t extent2) except -1 with gil:
16215  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
16216  * (i, extent1, extent2))
16217  *
16218  */
16219  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1253, __pyx_L1_error)
16220  __Pyx_GOTREF(__pyx_t_3);
16221  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16222  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1253, __pyx_L1_error)
16223  __Pyx_GOTREF(__pyx_t_4);
16224  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16225  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
16226  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16227  __PYX_ERR(0, 1253, __pyx_L1_error)
16228 
16229  /* "View.MemoryView":1251
16230  *
16231  * @cname('__pyx_memoryview_err_extents')
16232  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
16233  * Py_ssize_t extent2) except -1 with gil:
16234  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
16235  */
16236 
16237  /* function exit code */
16238  __pyx_L1_error:;
16239  __Pyx_XDECREF(__pyx_t_1);
16240  __Pyx_XDECREF(__pyx_t_2);
16241  __Pyx_XDECREF(__pyx_t_3);
16242  __Pyx_XDECREF(__pyx_t_4);
16243  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
16244  __pyx_r = -1;
16245  __Pyx_RefNannyFinishContext();
16246  #ifdef WITH_THREAD
16247  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16248  #endif
16249  return __pyx_r;
16250 }
16251 
16252 /* "View.MemoryView":1257
16253  *
16254  * @cname('__pyx_memoryview_err_dim')
16255  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
16256  * raise error(msg.decode('ascii') % dim)
16257  *
16258  */
16259 
16260 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
16261  int __pyx_r;
16262  __Pyx_RefNannyDeclarations
16263  PyObject *__pyx_t_1 = NULL;
16264  PyObject *__pyx_t_2 = NULL;
16265  PyObject *__pyx_t_3 = NULL;
16266  PyObject *__pyx_t_4 = NULL;
16267  int __pyx_lineno = 0;
16268  const char *__pyx_filename = NULL;
16269  int __pyx_clineno = 0;
16270  #ifdef WITH_THREAD
16271  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16272  #endif
16273  __Pyx_RefNannySetupContext("_err_dim", 0);
16274  __Pyx_INCREF(__pyx_v_error);
16275 
16276  /* "View.MemoryView":1258
16277  * @cname('__pyx_memoryview_err_dim')
16278  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
16279  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
16280  *
16281  * @cname('__pyx_memoryview_err')
16282  */
16283  __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(0, 1258, __pyx_L1_error)
16284  __Pyx_GOTREF(__pyx_t_2);
16285  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1258, __pyx_L1_error)
16286  __Pyx_GOTREF(__pyx_t_3);
16287  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L1_error)
16288  __Pyx_GOTREF(__pyx_t_4);
16289  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16290  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16291  __Pyx_INCREF(__pyx_v_error);
16292  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
16293  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
16294  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
16295  if (likely(__pyx_t_2)) {
16296  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
16297  __Pyx_INCREF(__pyx_t_2);
16298  __Pyx_INCREF(function);
16299  __Pyx_DECREF_SET(__pyx_t_3, function);
16300  }
16301  }
16302  __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);
16303  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16304  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16305  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error)
16306  __Pyx_GOTREF(__pyx_t_1);
16307  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16308  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16309  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16310  __PYX_ERR(0, 1258, __pyx_L1_error)
16311 
16312  /* "View.MemoryView":1257
16313  *
16314  * @cname('__pyx_memoryview_err_dim')
16315  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
16316  * raise error(msg.decode('ascii') % dim)
16317  *
16318  */
16319 
16320  /* function exit code */
16321  __pyx_L1_error:;
16322  __Pyx_XDECREF(__pyx_t_1);
16323  __Pyx_XDECREF(__pyx_t_2);
16324  __Pyx_XDECREF(__pyx_t_3);
16325  __Pyx_XDECREF(__pyx_t_4);
16326  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
16327  __pyx_r = -1;
16328  __Pyx_XDECREF(__pyx_v_error);
16329  __Pyx_RefNannyFinishContext();
16330  #ifdef WITH_THREAD
16331  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16332  #endif
16333  return __pyx_r;
16334 }
16335 
16336 /* "View.MemoryView":1261
16337  *
16338  * @cname('__pyx_memoryview_err')
16339  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
16340  * if msg != NULL:
16341  * raise error(msg.decode('ascii'))
16342  */
16343 
16344 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
16345  int __pyx_r;
16346  __Pyx_RefNannyDeclarations
16347  int __pyx_t_1;
16348  PyObject *__pyx_t_2 = NULL;
16349  PyObject *__pyx_t_3 = NULL;
16350  PyObject *__pyx_t_4 = NULL;
16351  PyObject *__pyx_t_5 = NULL;
16352  int __pyx_lineno = 0;
16353  const char *__pyx_filename = NULL;
16354  int __pyx_clineno = 0;
16355  #ifdef WITH_THREAD
16356  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16357  #endif
16358  __Pyx_RefNannySetupContext("_err", 0);
16359  __Pyx_INCREF(__pyx_v_error);
16360 
16361  /* "View.MemoryView":1262
16362  * @cname('__pyx_memoryview_err')
16363  * cdef int _err(object error, char *msg) except -1 with gil:
16364  * if msg != NULL: # <<<<<<<<<<<<<<
16365  * raise error(msg.decode('ascii'))
16366  * else:
16367  */
16368  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
16369  if (unlikely(__pyx_t_1)) {
16370 
16371  /* "View.MemoryView":1263
16372  * cdef int _err(object error, char *msg) except -1 with gil:
16373  * if msg != NULL:
16374  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
16375  * else:
16376  * raise error
16377  */
16378  __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(0, 1263, __pyx_L1_error)
16379  __Pyx_GOTREF(__pyx_t_3);
16380  __Pyx_INCREF(__pyx_v_error);
16381  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
16382  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
16383  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
16384  if (likely(__pyx_t_5)) {
16385  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
16386  __Pyx_INCREF(__pyx_t_5);
16387  __Pyx_INCREF(function);
16388  __Pyx_DECREF_SET(__pyx_t_4, function);
16389  }
16390  }
16391  __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);
16392  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16393  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16394  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1263, __pyx_L1_error)
16395  __Pyx_GOTREF(__pyx_t_2);
16396  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16397  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
16398  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16399  __PYX_ERR(0, 1263, __pyx_L1_error)
16400 
16401  /* "View.MemoryView":1262
16402  * @cname('__pyx_memoryview_err')
16403  * cdef int _err(object error, char *msg) except -1 with gil:
16404  * if msg != NULL: # <<<<<<<<<<<<<<
16405  * raise error(msg.decode('ascii'))
16406  * else:
16407  */
16408  }
16409 
16410  /* "View.MemoryView":1265
16411  * raise error(msg.decode('ascii'))
16412  * else:
16413  * raise error # <<<<<<<<<<<<<<
16414  *
16415  * @cname('__pyx_memoryview_copy_contents')
16416  */
16417  /*else*/ {
16418  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
16419  __PYX_ERR(0, 1265, __pyx_L1_error)
16420  }
16421 
16422  /* "View.MemoryView":1261
16423  *
16424  * @cname('__pyx_memoryview_err')
16425  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
16426  * if msg != NULL:
16427  * raise error(msg.decode('ascii'))
16428  */
16429 
16430  /* function exit code */
16431  __pyx_L1_error:;
16432  __Pyx_XDECREF(__pyx_t_2);
16433  __Pyx_XDECREF(__pyx_t_3);
16434  __Pyx_XDECREF(__pyx_t_4);
16435  __Pyx_XDECREF(__pyx_t_5);
16436  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
16437  __pyx_r = -1;
16438  __Pyx_XDECREF(__pyx_v_error);
16439  __Pyx_RefNannyFinishContext();
16440  #ifdef WITH_THREAD
16441  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16442  #endif
16443  return __pyx_r;
16444 }
16445 
16446 /* "View.MemoryView":1268
16447  *
16448  * @cname('__pyx_memoryview_copy_contents')
16449  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
16450  * __Pyx_memviewslice dst,
16451  * int src_ndim, int dst_ndim,
16452  */
16453 
16454 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) {
16455  void *__pyx_v_tmpdata;
16456  size_t __pyx_v_itemsize;
16457  int __pyx_v_i;
16458  char __pyx_v_order;
16459  int __pyx_v_broadcasting;
16460  int __pyx_v_direct_copy;
16461  __Pyx_memviewslice __pyx_v_tmp;
16462  int __pyx_v_ndim;
16463  int __pyx_r;
16464  Py_ssize_t __pyx_t_1;
16465  int __pyx_t_2;
16466  int __pyx_t_3;
16467  int __pyx_t_4;
16468  int __pyx_t_5;
16469  int __pyx_t_6;
16470  void *__pyx_t_7;
16471  int __pyx_t_8;
16472  int __pyx_lineno = 0;
16473  const char *__pyx_filename = NULL;
16474  int __pyx_clineno = 0;
16475 
16476  /* "View.MemoryView":1276
16477  * Check for overlapping memory and verify the shapes.
16478  * """
16479  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
16480  * cdef size_t itemsize = src.memview.view.itemsize
16481  * cdef int i
16482  */
16483  __pyx_v_tmpdata = NULL;
16484 
16485  /* "View.MemoryView":1277
16486  * """
16487  * cdef void *tmpdata = NULL
16488  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
16489  * cdef int i
16490  * cdef char order = get_best_order(&src, src_ndim)
16491  */
16492  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
16493  __pyx_v_itemsize = __pyx_t_1;
16494 
16495  /* "View.MemoryView":1279
16496  * cdef size_t itemsize = src.memview.view.itemsize
16497  * cdef int i
16498  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
16499  * cdef bint broadcasting = False
16500  * cdef bint direct_copy = False
16501  */
16502  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
16503 
16504  /* "View.MemoryView":1280
16505  * cdef int i
16506  * cdef char order = get_best_order(&src, src_ndim)
16507  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
16508  * cdef bint direct_copy = False
16509  * cdef __Pyx_memviewslice tmp
16510  */
16511  __pyx_v_broadcasting = 0;
16512 
16513  /* "View.MemoryView":1281
16514  * cdef char order = get_best_order(&src, src_ndim)
16515  * cdef bint broadcasting = False
16516  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
16517  * cdef __Pyx_memviewslice tmp
16518  *
16519  */
16520  __pyx_v_direct_copy = 0;
16521 
16522  /* "View.MemoryView":1284
16523  * cdef __Pyx_memviewslice tmp
16524  *
16525  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
16526  * broadcast_leading(&src, src_ndim, dst_ndim)
16527  * elif dst_ndim < src_ndim:
16528  */
16529  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
16530  if (__pyx_t_2) {
16531 
16532  /* "View.MemoryView":1285
16533  *
16534  * if src_ndim < dst_ndim:
16535  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
16536  * elif dst_ndim < src_ndim:
16537  * broadcast_leading(&dst, dst_ndim, src_ndim)
16538  */
16539  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
16540 
16541  /* "View.MemoryView":1284
16542  * cdef __Pyx_memviewslice tmp
16543  *
16544  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
16545  * broadcast_leading(&src, src_ndim, dst_ndim)
16546  * elif dst_ndim < src_ndim:
16547  */
16548  goto __pyx_L3;
16549  }
16550 
16551  /* "View.MemoryView":1286
16552  * if src_ndim < dst_ndim:
16553  * broadcast_leading(&src, src_ndim, dst_ndim)
16554  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
16555  * broadcast_leading(&dst, dst_ndim, src_ndim)
16556  *
16557  */
16558  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
16559  if (__pyx_t_2) {
16560 
16561  /* "View.MemoryView":1287
16562  * broadcast_leading(&src, src_ndim, dst_ndim)
16563  * elif dst_ndim < src_ndim:
16564  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
16565  *
16566  * cdef int ndim = max(src_ndim, dst_ndim)
16567  */
16568  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
16569 
16570  /* "View.MemoryView":1286
16571  * if src_ndim < dst_ndim:
16572  * broadcast_leading(&src, src_ndim, dst_ndim)
16573  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
16574  * broadcast_leading(&dst, dst_ndim, src_ndim)
16575  *
16576  */
16577  }
16578  __pyx_L3:;
16579 
16580  /* "View.MemoryView":1289
16581  * broadcast_leading(&dst, dst_ndim, src_ndim)
16582  *
16583  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
16584  *
16585  * for i in range(ndim):
16586  */
16587  __pyx_t_3 = __pyx_v_dst_ndim;
16588  __pyx_t_4 = __pyx_v_src_ndim;
16589  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
16590  __pyx_t_5 = __pyx_t_3;
16591  } else {
16592  __pyx_t_5 = __pyx_t_4;
16593  }
16594  __pyx_v_ndim = __pyx_t_5;
16595 
16596  /* "View.MemoryView":1291
16597  * cdef int ndim = max(src_ndim, dst_ndim)
16598  *
16599  * for i in range(ndim): # <<<<<<<<<<<<<<
16600  * if src.shape[i] != dst.shape[i]:
16601  * if src.shape[i] == 1:
16602  */
16603  __pyx_t_5 = __pyx_v_ndim;
16604  __pyx_t_3 = __pyx_t_5;
16605  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16606  __pyx_v_i = __pyx_t_4;
16607 
16608  /* "View.MemoryView":1292
16609  *
16610  * for i in range(ndim):
16611  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
16612  * if src.shape[i] == 1:
16613  * broadcasting = True
16614  */
16615  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
16616  if (__pyx_t_2) {
16617 
16618  /* "View.MemoryView":1293
16619  * for i in range(ndim):
16620  * if src.shape[i] != dst.shape[i]:
16621  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
16622  * broadcasting = True
16623  * src.strides[i] = 0
16624  */
16625  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
16626  if (__pyx_t_2) {
16627 
16628  /* "View.MemoryView":1294
16629  * if src.shape[i] != dst.shape[i]:
16630  * if src.shape[i] == 1:
16631  * broadcasting = True # <<<<<<<<<<<<<<
16632  * src.strides[i] = 0
16633  * else:
16634  */
16635  __pyx_v_broadcasting = 1;
16636 
16637  /* "View.MemoryView":1295
16638  * if src.shape[i] == 1:
16639  * broadcasting = True
16640  * src.strides[i] = 0 # <<<<<<<<<<<<<<
16641  * else:
16642  * _err_extents(i, dst.shape[i], src.shape[i])
16643  */
16644  (__pyx_v_src.strides[__pyx_v_i]) = 0;
16645 
16646  /* "View.MemoryView":1293
16647  * for i in range(ndim):
16648  * if src.shape[i] != dst.shape[i]:
16649  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
16650  * broadcasting = True
16651  * src.strides[i] = 0
16652  */
16653  goto __pyx_L7;
16654  }
16655 
16656  /* "View.MemoryView":1297
16657  * src.strides[i] = 0
16658  * else:
16659  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
16660  *
16661  * if src.suboffsets[i] >= 0:
16662  */
16663  /*else*/ {
16664  __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(0, 1297, __pyx_L1_error)
16665  }
16666  __pyx_L7:;
16667 
16668  /* "View.MemoryView":1292
16669  *
16670  * for i in range(ndim):
16671  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
16672  * if src.shape[i] == 1:
16673  * broadcasting = True
16674  */
16675  }
16676 
16677  /* "View.MemoryView":1299
16678  * _err_extents(i, dst.shape[i], src.shape[i])
16679  *
16680  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
16681  * _err_dim(ValueError, "Dimension %d is not direct", i)
16682  *
16683  */
16684  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
16685  if (__pyx_t_2) {
16686 
16687  /* "View.MemoryView":1300
16688  *
16689  * if src.suboffsets[i] >= 0:
16690  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
16691  *
16692  * if slices_overlap(&src, &dst, ndim, itemsize):
16693  */
16694  __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(0, 1300, __pyx_L1_error)
16695 
16696  /* "View.MemoryView":1299
16697  * _err_extents(i, dst.shape[i], src.shape[i])
16698  *
16699  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
16700  * _err_dim(ValueError, "Dimension %d is not direct", i)
16701  *
16702  */
16703  }
16704  }
16705 
16706  /* "View.MemoryView":1302
16707  * _err_dim(ValueError, "Dimension %d is not direct", i)
16708  *
16709  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
16710  *
16711  * if not slice_is_contig(src, order, ndim):
16712  */
16713  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
16714  if (__pyx_t_2) {
16715 
16716  /* "View.MemoryView":1304
16717  * if slices_overlap(&src, &dst, ndim, itemsize):
16718  *
16719  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
16720  * order = get_best_order(&dst, ndim)
16721  *
16722  */
16723  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
16724  if (__pyx_t_2) {
16725 
16726  /* "View.MemoryView":1305
16727  *
16728  * if not slice_is_contig(src, order, ndim):
16729  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
16730  *
16731  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
16732  */
16733  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
16734 
16735  /* "View.MemoryView":1304
16736  * if slices_overlap(&src, &dst, ndim, itemsize):
16737  *
16738  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
16739  * order = get_best_order(&dst, ndim)
16740  *
16741  */
16742  }
16743 
16744  /* "View.MemoryView":1307
16745  * order = get_best_order(&dst, ndim)
16746  *
16747  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
16748  * src = tmp
16749  *
16750  */
16751  __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(0, 1307, __pyx_L1_error)
16752  __pyx_v_tmpdata = __pyx_t_7;
16753 
16754  /* "View.MemoryView":1308
16755  *
16756  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
16757  * src = tmp # <<<<<<<<<<<<<<
16758  *
16759  * if not broadcasting:
16760  */
16761  __pyx_v_src = __pyx_v_tmp;
16762 
16763  /* "View.MemoryView":1302
16764  * _err_dim(ValueError, "Dimension %d is not direct", i)
16765  *
16766  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
16767  *
16768  * if not slice_is_contig(src, order, ndim):
16769  */
16770  }
16771 
16772  /* "View.MemoryView":1310
16773  * src = tmp
16774  *
16775  * if not broadcasting: # <<<<<<<<<<<<<<
16776  *
16777  *
16778  */
16779  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
16780  if (__pyx_t_2) {
16781 
16782  /* "View.MemoryView":1313
16783  *
16784  *
16785  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
16786  * direct_copy = slice_is_contig(dst, 'C', ndim)
16787  * elif slice_is_contig(src, 'F', ndim):
16788  */
16789  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
16790  if (__pyx_t_2) {
16791 
16792  /* "View.MemoryView":1314
16793  *
16794  * if slice_is_contig(src, 'C', ndim):
16795  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
16796  * elif slice_is_contig(src, 'F', ndim):
16797  * direct_copy = slice_is_contig(dst, 'F', ndim)
16798  */
16799  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
16800 
16801  /* "View.MemoryView":1313
16802  *
16803  *
16804  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
16805  * direct_copy = slice_is_contig(dst, 'C', ndim)
16806  * elif slice_is_contig(src, 'F', ndim):
16807  */
16808  goto __pyx_L12;
16809  }
16810 
16811  /* "View.MemoryView":1315
16812  * if slice_is_contig(src, 'C', ndim):
16813  * direct_copy = slice_is_contig(dst, 'C', ndim)
16814  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
16815  * direct_copy = slice_is_contig(dst, 'F', ndim)
16816  *
16817  */
16818  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
16819  if (__pyx_t_2) {
16820 
16821  /* "View.MemoryView":1316
16822  * direct_copy = slice_is_contig(dst, 'C', ndim)
16823  * elif slice_is_contig(src, 'F', ndim):
16824  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
16825  *
16826  * if direct_copy:
16827  */
16828  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
16829 
16830  /* "View.MemoryView":1315
16831  * if slice_is_contig(src, 'C', ndim):
16832  * direct_copy = slice_is_contig(dst, 'C', ndim)
16833  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
16834  * direct_copy = slice_is_contig(dst, 'F', ndim)
16835  *
16836  */
16837  }
16838  __pyx_L12:;
16839 
16840  /* "View.MemoryView":1318
16841  * direct_copy = slice_is_contig(dst, 'F', ndim)
16842  *
16843  * if direct_copy: # <<<<<<<<<<<<<<
16844  *
16845  * refcount_copying(&dst, dtype_is_object, ndim, False)
16846  */
16847  __pyx_t_2 = (__pyx_v_direct_copy != 0);
16848  if (__pyx_t_2) {
16849 
16850  /* "View.MemoryView":1320
16851  * if direct_copy:
16852  *
16853  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
16854  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
16855  * refcount_copying(&dst, dtype_is_object, ndim, True)
16856  */
16857  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
16858 
16859  /* "View.MemoryView":1321
16860  *
16861  * refcount_copying(&dst, dtype_is_object, ndim, False)
16862  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
16863  * refcount_copying(&dst, dtype_is_object, ndim, True)
16864  * free(tmpdata)
16865  */
16866  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
16867 
16868  /* "View.MemoryView":1322
16869  * refcount_copying(&dst, dtype_is_object, ndim, False)
16870  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
16871  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
16872  * free(tmpdata)
16873  * return 0
16874  */
16875  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
16876 
16877  /* "View.MemoryView":1323
16878  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
16879  * refcount_copying(&dst, dtype_is_object, ndim, True)
16880  * free(tmpdata) # <<<<<<<<<<<<<<
16881  * return 0
16882  *
16883  */
16884  free(__pyx_v_tmpdata);
16885 
16886  /* "View.MemoryView":1324
16887  * refcount_copying(&dst, dtype_is_object, ndim, True)
16888  * free(tmpdata)
16889  * return 0 # <<<<<<<<<<<<<<
16890  *
16891  * if order == 'F' == get_best_order(&dst, ndim):
16892  */
16893  __pyx_r = 0;
16894  goto __pyx_L0;
16895 
16896  /* "View.MemoryView":1318
16897  * direct_copy = slice_is_contig(dst, 'F', ndim)
16898  *
16899  * if direct_copy: # <<<<<<<<<<<<<<
16900  *
16901  * refcount_copying(&dst, dtype_is_object, ndim, False)
16902  */
16903  }
16904 
16905  /* "View.MemoryView":1310
16906  * src = tmp
16907  *
16908  * if not broadcasting: # <<<<<<<<<<<<<<
16909  *
16910  *
16911  */
16912  }
16913 
16914  /* "View.MemoryView":1326
16915  * return 0
16916  *
16917  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
16918  *
16919  *
16920  */
16921  __pyx_t_2 = (__pyx_v_order == 'F');
16922  if (__pyx_t_2) {
16923  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
16924  }
16925  __pyx_t_8 = (__pyx_t_2 != 0);
16926  if (__pyx_t_8) {
16927 
16928  /* "View.MemoryView":1329
16929  *
16930  *
16931  * transpose_memslice(&src) # <<<<<<<<<<<<<<
16932  * transpose_memslice(&dst)
16933  *
16934  */
16935  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(0, 1329, __pyx_L1_error)
16936 
16937  /* "View.MemoryView":1330
16938  *
16939  * transpose_memslice(&src)
16940  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
16941  *
16942  * refcount_copying(&dst, dtype_is_object, ndim, False)
16943  */
16944  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(0, 1330, __pyx_L1_error)
16945 
16946  /* "View.MemoryView":1326
16947  * return 0
16948  *
16949  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
16950  *
16951  *
16952  */
16953  }
16954 
16955  /* "View.MemoryView":1332
16956  * transpose_memslice(&dst)
16957  *
16958  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
16959  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
16960  * refcount_copying(&dst, dtype_is_object, ndim, True)
16961  */
16962  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
16963 
16964  /* "View.MemoryView":1333
16965  *
16966  * refcount_copying(&dst, dtype_is_object, ndim, False)
16967  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
16968  * refcount_copying(&dst, dtype_is_object, ndim, True)
16969  *
16970  */
16971  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
16972 
16973  /* "View.MemoryView":1334
16974  * refcount_copying(&dst, dtype_is_object, ndim, False)
16975  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
16976  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
16977  *
16978  * free(tmpdata)
16979  */
16980  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
16981 
16982  /* "View.MemoryView":1336
16983  * refcount_copying(&dst, dtype_is_object, ndim, True)
16984  *
16985  * free(tmpdata) # <<<<<<<<<<<<<<
16986  * return 0
16987  *
16988  */
16989  free(__pyx_v_tmpdata);
16990 
16991  /* "View.MemoryView":1337
16992  *
16993  * free(tmpdata)
16994  * return 0 # <<<<<<<<<<<<<<
16995  *
16996  * @cname('__pyx_memoryview_broadcast_leading')
16997  */
16998  __pyx_r = 0;
16999  goto __pyx_L0;
17000 
17001  /* "View.MemoryView":1268
17002  *
17003  * @cname('__pyx_memoryview_copy_contents')
17004  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
17005  * __Pyx_memviewslice dst,
17006  * int src_ndim, int dst_ndim,
17007  */
17008 
17009  /* function exit code */
17010  __pyx_L1_error:;
17011  {
17012  #ifdef WITH_THREAD
17013  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17014  #endif
17015  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17016  #ifdef WITH_THREAD
17017  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17018  #endif
17019  }
17020  __pyx_r = -1;
17021  __pyx_L0:;
17022  return __pyx_r;
17023 }
17024 
17025 /* "View.MemoryView":1340
17026  *
17027  * @cname('__pyx_memoryview_broadcast_leading')
17028  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
17029  * int ndim,
17030  * int ndim_other) nogil:
17031  */
17032 
17033 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
17034  int __pyx_v_i;
17035  int __pyx_v_offset;
17036  int __pyx_t_1;
17037  int __pyx_t_2;
17038  int __pyx_t_3;
17039 
17040  /* "View.MemoryView":1344
17041  * int ndim_other) nogil:
17042  * cdef int i
17043  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
17044  *
17045  * for i in range(ndim - 1, -1, -1):
17046  */
17047  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
17048 
17049  /* "View.MemoryView":1346
17050  * cdef int offset = ndim_other - ndim
17051  *
17052  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17053  * mslice.shape[i + offset] = mslice.shape[i]
17054  * mslice.strides[i + offset] = mslice.strides[i]
17055  */
17056  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17057  __pyx_v_i = __pyx_t_1;
17058 
17059  /* "View.MemoryView":1347
17060  *
17061  * for i in range(ndim - 1, -1, -1):
17062  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
17063  * mslice.strides[i + offset] = mslice.strides[i]
17064  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17065  */
17066  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
17067 
17068  /* "View.MemoryView":1348
17069  * for i in range(ndim - 1, -1, -1):
17070  * mslice.shape[i + offset] = mslice.shape[i]
17071  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
17072  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17073  *
17074  */
17075  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
17076 
17077  /* "View.MemoryView":1349
17078  * mslice.shape[i + offset] = mslice.shape[i]
17079  * mslice.strides[i + offset] = mslice.strides[i]
17080  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
17081  *
17082  * for i in range(offset):
17083  */
17084  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
17085  }
17086 
17087  /* "View.MemoryView":1351
17088  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17089  *
17090  * for i in range(offset): # <<<<<<<<<<<<<<
17091  * mslice.shape[i] = 1
17092  * mslice.strides[i] = mslice.strides[0]
17093  */
17094  __pyx_t_1 = __pyx_v_offset;
17095  __pyx_t_2 = __pyx_t_1;
17096  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17097  __pyx_v_i = __pyx_t_3;
17098 
17099  /* "View.MemoryView":1352
17100  *
17101  * for i in range(offset):
17102  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
17103  * mslice.strides[i] = mslice.strides[0]
17104  * mslice.suboffsets[i] = -1
17105  */
17106  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
17107 
17108  /* "View.MemoryView":1353
17109  * for i in range(offset):
17110  * mslice.shape[i] = 1
17111  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
17112  * mslice.suboffsets[i] = -1
17113  *
17114  */
17115  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
17116 
17117  /* "View.MemoryView":1354
17118  * mslice.shape[i] = 1
17119  * mslice.strides[i] = mslice.strides[0]
17120  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
17121  *
17122  *
17123  */
17124  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
17125  }
17126 
17127  /* "View.MemoryView":1340
17128  *
17129  * @cname('__pyx_memoryview_broadcast_leading')
17130  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
17131  * int ndim,
17132  * int ndim_other) nogil:
17133  */
17134 
17135  /* function exit code */
17136 }
17137 
17138 /* "View.MemoryView":1362
17139  *
17140  * @cname('__pyx_memoryview_refcount_copying')
17141  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
17142  * int ndim, bint inc) nogil:
17143  *
17144  */
17145 
17146 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) {
17147  int __pyx_t_1;
17148 
17149  /* "View.MemoryView":1366
17150  *
17151  *
17152  * if dtype_is_object: # <<<<<<<<<<<<<<
17153  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
17154  * dst.strides, ndim, inc)
17155  */
17156  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
17157  if (__pyx_t_1) {
17158 
17159  /* "View.MemoryView":1367
17160  *
17161  * if dtype_is_object:
17162  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
17163  * dst.strides, ndim, inc)
17164  *
17165  */
17166  __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);
17167 
17168  /* "View.MemoryView":1366
17169  *
17170  *
17171  * if dtype_is_object: # <<<<<<<<<<<<<<
17172  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
17173  * dst.strides, ndim, inc)
17174  */
17175  }
17176 
17177  /* "View.MemoryView":1362
17178  *
17179  * @cname('__pyx_memoryview_refcount_copying')
17180  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
17181  * int ndim, bint inc) nogil:
17182  *
17183  */
17184 
17185  /* function exit code */
17186 }
17187 
17188 /* "View.MemoryView":1371
17189  *
17190  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17191  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17192  * Py_ssize_t *strides, int ndim,
17193  * bint inc) with gil:
17194  */
17195 
17196 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) {
17197  __Pyx_RefNannyDeclarations
17198  #ifdef WITH_THREAD
17199  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17200  #endif
17201  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
17202 
17203  /* "View.MemoryView":1374
17204  * Py_ssize_t *strides, int ndim,
17205  * bint inc) with gil:
17206  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
17207  *
17208  * @cname('__pyx_memoryview_refcount_objects_in_slice')
17209  */
17210  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
17211 
17212  /* "View.MemoryView":1371
17213  *
17214  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17215  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17216  * Py_ssize_t *strides, int ndim,
17217  * bint inc) with gil:
17218  */
17219 
17220  /* function exit code */
17221  __Pyx_RefNannyFinishContext();
17222  #ifdef WITH_THREAD
17223  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17224  #endif
17225 }
17226 
17227 /* "View.MemoryView":1377
17228  *
17229  * @cname('__pyx_memoryview_refcount_objects_in_slice')
17230  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17231  * Py_ssize_t *strides, int ndim, bint inc):
17232  * cdef Py_ssize_t i
17233  */
17234 
17235 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) {
17236  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17237  __Pyx_RefNannyDeclarations
17238  Py_ssize_t __pyx_t_1;
17239  Py_ssize_t __pyx_t_2;
17240  Py_ssize_t __pyx_t_3;
17241  int __pyx_t_4;
17242  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
17243 
17244  /* "View.MemoryView":1381
17245  * cdef Py_ssize_t i
17246  *
17247  * for i in range(shape[0]): # <<<<<<<<<<<<<<
17248  * if ndim == 1:
17249  * if inc:
17250  */
17251  __pyx_t_1 = (__pyx_v_shape[0]);
17252  __pyx_t_2 = __pyx_t_1;
17253  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17254  __pyx_v_i = __pyx_t_3;
17255 
17256  /* "View.MemoryView":1382
17257  *
17258  * for i in range(shape[0]):
17259  * if ndim == 1: # <<<<<<<<<<<<<<
17260  * if inc:
17261  * Py_INCREF((<PyObject **> data)[0])
17262  */
17263  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
17264  if (__pyx_t_4) {
17265 
17266  /* "View.MemoryView":1383
17267  * for i in range(shape[0]):
17268  * if ndim == 1:
17269  * if inc: # <<<<<<<<<<<<<<
17270  * Py_INCREF((<PyObject **> data)[0])
17271  * else:
17272  */
17273  __pyx_t_4 = (__pyx_v_inc != 0);
17274  if (__pyx_t_4) {
17275 
17276  /* "View.MemoryView":1384
17277  * if ndim == 1:
17278  * if inc:
17279  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
17280  * else:
17281  * Py_DECREF((<PyObject **> data)[0])
17282  */
17283  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
17284 
17285  /* "View.MemoryView":1383
17286  * for i in range(shape[0]):
17287  * if ndim == 1:
17288  * if inc: # <<<<<<<<<<<<<<
17289  * Py_INCREF((<PyObject **> data)[0])
17290  * else:
17291  */
17292  goto __pyx_L6;
17293  }
17294 
17295  /* "View.MemoryView":1386
17296  * Py_INCREF((<PyObject **> data)[0])
17297  * else:
17298  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
17299  * else:
17300  * refcount_objects_in_slice(data, shape + 1, strides + 1,
17301  */
17302  /*else*/ {
17303  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
17304  }
17305  __pyx_L6:;
17306 
17307  /* "View.MemoryView":1382
17308  *
17309  * for i in range(shape[0]):
17310  * if ndim == 1: # <<<<<<<<<<<<<<
17311  * if inc:
17312  * Py_INCREF((<PyObject **> data)[0])
17313  */
17314  goto __pyx_L5;
17315  }
17316 
17317  /* "View.MemoryView":1388
17318  * Py_DECREF((<PyObject **> data)[0])
17319  * else:
17320  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
17321  * ndim - 1, inc)
17322  *
17323  */
17324  /*else*/ {
17325 
17326  /* "View.MemoryView":1389
17327  * else:
17328  * refcount_objects_in_slice(data, shape + 1, strides + 1,
17329  * ndim - 1, inc) # <<<<<<<<<<<<<<
17330  *
17331  * data += strides[0]
17332  */
17333  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
17334  }
17335  __pyx_L5:;
17336 
17337  /* "View.MemoryView":1391
17338  * ndim - 1, inc)
17339  *
17340  * data += strides[0] # <<<<<<<<<<<<<<
17341  *
17342  *
17343  */
17344  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
17345  }
17346 
17347  /* "View.MemoryView":1377
17348  *
17349  * @cname('__pyx_memoryview_refcount_objects_in_slice')
17350  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17351  * Py_ssize_t *strides, int ndim, bint inc):
17352  * cdef Py_ssize_t i
17353  */
17354 
17355  /* function exit code */
17356  __Pyx_RefNannyFinishContext();
17357 }
17358 
17359 /* "View.MemoryView":1397
17360  *
17361  * @cname('__pyx_memoryview_slice_assign_scalar')
17362  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
17363  * size_t itemsize, void *item,
17364  * bint dtype_is_object) nogil:
17365  */
17366 
17367 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) {
17368 
17369  /* "View.MemoryView":1400
17370  * size_t itemsize, void *item,
17371  * bint dtype_is_object) nogil:
17372  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
17373  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
17374  * itemsize, item)
17375  */
17376  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17377 
17378  /* "View.MemoryView":1401
17379  * bint dtype_is_object) nogil:
17380  * refcount_copying(dst, dtype_is_object, ndim, False)
17381  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
17382  * itemsize, item)
17383  * refcount_copying(dst, dtype_is_object, ndim, True)
17384  */
17385  __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);
17386 
17387  /* "View.MemoryView":1403
17388  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
17389  * itemsize, item)
17390  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
17391  *
17392  *
17393  */
17394  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17395 
17396  /* "View.MemoryView":1397
17397  *
17398  * @cname('__pyx_memoryview_slice_assign_scalar')
17399  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
17400  * size_t itemsize, void *item,
17401  * bint dtype_is_object) nogil:
17402  */
17403 
17404  /* function exit code */
17405 }
17406 
17407 /* "View.MemoryView":1407
17408  *
17409  * @cname('__pyx_memoryview__slice_assign_scalar')
17410  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17411  * Py_ssize_t *strides, int ndim,
17412  * size_t itemsize, void *item) nogil:
17413  */
17414 
17415 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) {
17416  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17417  Py_ssize_t __pyx_v_stride;
17418  Py_ssize_t __pyx_v_extent;
17419  int __pyx_t_1;
17420  Py_ssize_t __pyx_t_2;
17421  Py_ssize_t __pyx_t_3;
17422  Py_ssize_t __pyx_t_4;
17423 
17424  /* "View.MemoryView":1411
17425  * size_t itemsize, void *item) nogil:
17426  * cdef Py_ssize_t i
17427  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
17428  * cdef Py_ssize_t extent = shape[0]
17429  *
17430  */
17431  __pyx_v_stride = (__pyx_v_strides[0]);
17432 
17433  /* "View.MemoryView":1412
17434  * cdef Py_ssize_t i
17435  * cdef Py_ssize_t stride = strides[0]
17436  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
17437  *
17438  * if ndim == 1:
17439  */
17440  __pyx_v_extent = (__pyx_v_shape[0]);
17441 
17442  /* "View.MemoryView":1414
17443  * cdef Py_ssize_t extent = shape[0]
17444  *
17445  * if ndim == 1: # <<<<<<<<<<<<<<
17446  * for i in range(extent):
17447  * memcpy(data, item, itemsize)
17448  */
17449  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
17450  if (__pyx_t_1) {
17451 
17452  /* "View.MemoryView":1415
17453  *
17454  * if ndim == 1:
17455  * for i in range(extent): # <<<<<<<<<<<<<<
17456  * memcpy(data, item, itemsize)
17457  * data += stride
17458  */
17459  __pyx_t_2 = __pyx_v_extent;
17460  __pyx_t_3 = __pyx_t_2;
17461  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17462  __pyx_v_i = __pyx_t_4;
17463 
17464  /* "View.MemoryView":1416
17465  * if ndim == 1:
17466  * for i in range(extent):
17467  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
17468  * data += stride
17469  * else:
17470  */
17471  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
17472 
17473  /* "View.MemoryView":1417
17474  * for i in range(extent):
17475  * memcpy(data, item, itemsize)
17476  * data += stride # <<<<<<<<<<<<<<
17477  * else:
17478  * for i in range(extent):
17479  */
17480  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
17481  }
17482 
17483  /* "View.MemoryView":1414
17484  * cdef Py_ssize_t extent = shape[0]
17485  *
17486  * if ndim == 1: # <<<<<<<<<<<<<<
17487  * for i in range(extent):
17488  * memcpy(data, item, itemsize)
17489  */
17490  goto __pyx_L3;
17491  }
17492 
17493  /* "View.MemoryView":1419
17494  * data += stride
17495  * else:
17496  * for i in range(extent): # <<<<<<<<<<<<<<
17497  * _slice_assign_scalar(data, shape + 1, strides + 1,
17498  * ndim - 1, itemsize, item)
17499  */
17500  /*else*/ {
17501  __pyx_t_2 = __pyx_v_extent;
17502  __pyx_t_3 = __pyx_t_2;
17503  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17504  __pyx_v_i = __pyx_t_4;
17505 
17506  /* "View.MemoryView":1420
17507  * else:
17508  * for i in range(extent):
17509  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
17510  * ndim - 1, itemsize, item)
17511  * data += stride
17512  */
17513  __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);
17514 
17515  /* "View.MemoryView":1422
17516  * _slice_assign_scalar(data, shape + 1, strides + 1,
17517  * ndim - 1, itemsize, item)
17518  * data += stride # <<<<<<<<<<<<<<
17519  *
17520  *
17521  */
17522  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
17523  }
17524  }
17525  __pyx_L3:;
17526 
17527  /* "View.MemoryView":1407
17528  *
17529  * @cname('__pyx_memoryview__slice_assign_scalar')
17530  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17531  * Py_ssize_t *strides, int ndim,
17532  * size_t itemsize, void *item) nogil:
17533  */
17534 
17535  /* function exit code */
17536 }
17537 
17538 /* "(tree fragment)":1
17539  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
17540  * cdef object __pyx_PickleError
17541  * cdef object __pyx_result
17542  */
17543 
17544 /* Python wrapper */
17545 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17546 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};
17547 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17548  PyObject *__pyx_v___pyx_type = 0;
17549  long __pyx_v___pyx_checksum;
17550  PyObject *__pyx_v___pyx_state = 0;
17551  int __pyx_lineno = 0;
17552  const char *__pyx_filename = NULL;
17553  int __pyx_clineno = 0;
17554  PyObject *__pyx_r = 0;
17555  __Pyx_RefNannyDeclarations
17556  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
17557  {
17558  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
17559  PyObject* values[3] = {0,0,0};
17560  if (unlikely(__pyx_kwds)) {
17561  Py_ssize_t kw_args;
17562  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17563  switch (pos_args) {
17564  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17565  CYTHON_FALLTHROUGH;
17566  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17567  CYTHON_FALLTHROUGH;
17568  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17569  CYTHON_FALLTHROUGH;
17570  case 0: break;
17571  default: goto __pyx_L5_argtuple_error;
17572  }
17573  kw_args = PyDict_Size(__pyx_kwds);
17574  switch (pos_args) {
17575  case 0:
17576  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
17577  else goto __pyx_L5_argtuple_error;
17578  CYTHON_FALLTHROUGH;
17579  case 1:
17580  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
17581  else {
17582  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(0, 1, __pyx_L3_error)
17583  }
17584  CYTHON_FALLTHROUGH;
17585  case 2:
17586  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
17587  else {
17588  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(0, 1, __pyx_L3_error)
17589  }
17590  }
17591  if (unlikely(kw_args > 0)) {
17592  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(0, 1, __pyx_L3_error)
17593  }
17594  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
17595  goto __pyx_L5_argtuple_error;
17596  } else {
17597  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17598  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17599  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17600  }
17601  __pyx_v___pyx_type = values[0];
17602  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error)
17603  __pyx_v___pyx_state = values[2];
17604  }
17605  goto __pyx_L4_argument_unpacking_done;
17606  __pyx_L5_argtuple_error:;
17607  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1, __pyx_L3_error)
17608  __pyx_L3_error:;
17609  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
17610  __Pyx_RefNannyFinishContext();
17611  return NULL;
17612  __pyx_L4_argument_unpacking_done:;
17613  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
17614 
17615  /* function exit code */
17616  __Pyx_RefNannyFinishContext();
17617  return __pyx_r;
17618 }
17619 
17620 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) {
17621  PyObject *__pyx_v___pyx_PickleError = 0;
17622  PyObject *__pyx_v___pyx_result = 0;
17623  PyObject *__pyx_r = NULL;
17624  __Pyx_RefNannyDeclarations
17625  PyObject *__pyx_t_1 = NULL;
17626  int __pyx_t_2;
17627  int __pyx_t_3;
17628  PyObject *__pyx_t_4 = NULL;
17629  PyObject *__pyx_t_5 = NULL;
17630  PyObject *__pyx_t_6 = NULL;
17631  int __pyx_lineno = 0;
17632  const char *__pyx_filename = NULL;
17633  int __pyx_clineno = 0;
17634  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
17635 
17636  /* "(tree fragment)":4
17637  * cdef object __pyx_PickleError
17638  * cdef object __pyx_result
17639  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
17640  * from pickle import PickleError as __pyx_PickleError
17641  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
17642  */
17643  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
17644  __Pyx_GOTREF(__pyx_t_1);
17645  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__23, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4, __pyx_L1_error)
17646  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17647  __pyx_t_3 = (__pyx_t_2 != 0);
17648  if (__pyx_t_3) {
17649 
17650  /* "(tree fragment)":5
17651  * cdef object __pyx_result
17652  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
17653  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
17654  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
17655  * __pyx_result = Enum.__new__(__pyx_type)
17656  */
17657  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
17658  __Pyx_GOTREF(__pyx_t_1);
17659  __Pyx_INCREF(__pyx_n_s_PickleError);
17660  __Pyx_GIVEREF(__pyx_n_s_PickleError);
17661  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
17662  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5, __pyx_L1_error)
17663  __Pyx_GOTREF(__pyx_t_4);
17664  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17665  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
17666  __Pyx_GOTREF(__pyx_t_1);
17667  __Pyx_INCREF(__pyx_t_1);
17668  __pyx_v___pyx_PickleError = __pyx_t_1;
17669  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17670  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17671 
17672  /* "(tree fragment)":6
17673  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
17674  * from pickle import PickleError as __pyx_PickleError
17675  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
17676  * __pyx_result = Enum.__new__(__pyx_type)
17677  * if __pyx_state is not None:
17678  */
17679  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
17680  __Pyx_GOTREF(__pyx_t_1);
17681  __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(0, 6, __pyx_L1_error)
17682  __Pyx_GOTREF(__pyx_t_5);
17683  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17684  __Pyx_INCREF(__pyx_v___pyx_PickleError);
17685  __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
17686  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
17687  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
17688  if (likely(__pyx_t_6)) {
17689  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
17690  __Pyx_INCREF(__pyx_t_6);
17691  __Pyx_INCREF(function);
17692  __Pyx_DECREF_SET(__pyx_t_1, function);
17693  }
17694  }
17695  __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);
17696  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17697  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17698  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error)
17699  __Pyx_GOTREF(__pyx_t_4);
17700  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17701  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
17702  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17703  __PYX_ERR(0, 6, __pyx_L1_error)
17704 
17705  /* "(tree fragment)":4
17706  * cdef object __pyx_PickleError
17707  * cdef object __pyx_result
17708  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
17709  * from pickle import PickleError as __pyx_PickleError
17710  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
17711  */
17712  }
17713 
17714  /* "(tree fragment)":7
17715  * from pickle import PickleError as __pyx_PickleError
17716  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
17717  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
17718  * if __pyx_state is not None:
17719  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
17720  */
17721  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
17722  __Pyx_GOTREF(__pyx_t_1);
17723  __pyx_t_5 = NULL;
17724  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
17725  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
17726  if (likely(__pyx_t_5)) {
17727  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
17728  __Pyx_INCREF(__pyx_t_5);
17729  __Pyx_INCREF(function);
17730  __Pyx_DECREF_SET(__pyx_t_1, function);
17731  }
17732  }
17733  __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);
17734  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17735  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7, __pyx_L1_error)
17736  __Pyx_GOTREF(__pyx_t_4);
17737  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17738  __pyx_v___pyx_result = __pyx_t_4;
17739  __pyx_t_4 = 0;
17740 
17741  /* "(tree fragment)":8
17742  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
17743  * __pyx_result = Enum.__new__(__pyx_type)
17744  * if __pyx_state is not None: # <<<<<<<<<<<<<<
17745  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
17746  * return __pyx_result
17747  */
17748  __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
17749  __pyx_t_2 = (__pyx_t_3 != 0);
17750  if (__pyx_t_2) {
17751 
17752  /* "(tree fragment)":9
17753  * __pyx_result = Enum.__new__(__pyx_type)
17754  * if __pyx_state is not None:
17755  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
17756  * return __pyx_result
17757  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
17758  */
17759  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(0, 9, __pyx_L1_error)
17760  __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(0, 9, __pyx_L1_error)
17761  __Pyx_GOTREF(__pyx_t_4);
17762  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17763 
17764  /* "(tree fragment)":8
17765  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
17766  * __pyx_result = Enum.__new__(__pyx_type)
17767  * if __pyx_state is not None: # <<<<<<<<<<<<<<
17768  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
17769  * return __pyx_result
17770  */
17771  }
17772 
17773  /* "(tree fragment)":10
17774  * if __pyx_state is not None:
17775  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
17776  * return __pyx_result # <<<<<<<<<<<<<<
17777  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
17778  * __pyx_result.name = __pyx_state[0]
17779  */
17780  __Pyx_XDECREF(__pyx_r);
17781  __Pyx_INCREF(__pyx_v___pyx_result);
17782  __pyx_r = __pyx_v___pyx_result;
17783  goto __pyx_L0;
17784 
17785  /* "(tree fragment)":1
17786  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
17787  * cdef object __pyx_PickleError
17788  * cdef object __pyx_result
17789  */
17790 
17791  /* function exit code */
17792  __pyx_L1_error:;
17793  __Pyx_XDECREF(__pyx_t_1);
17794  __Pyx_XDECREF(__pyx_t_4);
17795  __Pyx_XDECREF(__pyx_t_5);
17796  __Pyx_XDECREF(__pyx_t_6);
17797  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
17798  __pyx_r = NULL;
17799  __pyx_L0:;
17800  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
17801  __Pyx_XDECREF(__pyx_v___pyx_result);
17802  __Pyx_XGIVEREF(__pyx_r);
17803  __Pyx_RefNannyFinishContext();
17804  return __pyx_r;
17805 }
17806 
17807 /* "(tree fragment)":11
17808  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
17809  * return __pyx_result
17810  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
17811  * __pyx_result.name = __pyx_state[0]
17812  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
17813  */
17814 
17815 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
17816  PyObject *__pyx_r = NULL;
17817  __Pyx_RefNannyDeclarations
17818  PyObject *__pyx_t_1 = NULL;
17819  int __pyx_t_2;
17820  Py_ssize_t __pyx_t_3;
17821  int __pyx_t_4;
17822  int __pyx_t_5;
17823  PyObject *__pyx_t_6 = NULL;
17824  PyObject *__pyx_t_7 = NULL;
17825  PyObject *__pyx_t_8 = NULL;
17826  int __pyx_lineno = 0;
17827  const char *__pyx_filename = NULL;
17828  int __pyx_clineno = 0;
17829  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
17830 
17831  /* "(tree fragment)":12
17832  * return __pyx_result
17833  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
17834  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
17835  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
17836  * __pyx_result.__dict__.update(__pyx_state[1])
17837  */
17838  if (unlikely(__pyx_v___pyx_state == Py_None)) {
17839  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17840  __PYX_ERR(0, 12, __pyx_L1_error)
17841  }
17842  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
17843  __Pyx_GOTREF(__pyx_t_1);
17844  __Pyx_GIVEREF(__pyx_t_1);
17845  __Pyx_GOTREF(__pyx_v___pyx_result->name);
17846  __Pyx_DECREF(__pyx_v___pyx_result->name);
17847  __pyx_v___pyx_result->name = __pyx_t_1;
17848  __pyx_t_1 = 0;
17849 
17850  /* "(tree fragment)":13
17851  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
17852  * __pyx_result.name = __pyx_state[0]
17853  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
17854  * __pyx_result.__dict__.update(__pyx_state[1])
17855  */
17856  if (unlikely(__pyx_v___pyx_state == Py_None)) {
17857  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
17858  __PYX_ERR(0, 13, __pyx_L1_error)
17859  }
17860  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 13, __pyx_L1_error)
17861  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
17862  if (__pyx_t_4) {
17863  } else {
17864  __pyx_t_2 = __pyx_t_4;
17865  goto __pyx_L4_bool_binop_done;
17866  }
17867  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 13, __pyx_L1_error)
17868  __pyx_t_5 = (__pyx_t_4 != 0);
17869  __pyx_t_2 = __pyx_t_5;
17870  __pyx_L4_bool_binop_done:;
17871  if (__pyx_t_2) {
17872 
17873  /* "(tree fragment)":14
17874  * __pyx_result.name = __pyx_state[0]
17875  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
17876  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
17877  */
17878  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 14, __pyx_L1_error)
17879  __Pyx_GOTREF(__pyx_t_6);
17880  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 14, __pyx_L1_error)
17881  __Pyx_GOTREF(__pyx_t_7);
17882  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17883  if (unlikely(__pyx_v___pyx_state == Py_None)) {
17884  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
17885  __PYX_ERR(0, 14, __pyx_L1_error)
17886  }
17887  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 14, __pyx_L1_error)
17888  __Pyx_GOTREF(__pyx_t_6);
17889  __pyx_t_8 = NULL;
17890  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
17891  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
17892  if (likely(__pyx_t_8)) {
17893  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
17894  __Pyx_INCREF(__pyx_t_8);
17895  __Pyx_INCREF(function);
17896  __Pyx_DECREF_SET(__pyx_t_7, function);
17897  }
17898  }
17899  __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);
17900  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
17901  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17902  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
17903  __Pyx_GOTREF(__pyx_t_1);
17904  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17905  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17906 
17907  /* "(tree fragment)":13
17908  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
17909  * __pyx_result.name = __pyx_state[0]
17910  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
17911  * __pyx_result.__dict__.update(__pyx_state[1])
17912  */
17913  }
17914 
17915  /* "(tree fragment)":11
17916  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
17917  * return __pyx_result
17918  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
17919  * __pyx_result.name = __pyx_state[0]
17920  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
17921  */
17922 
17923  /* function exit code */
17924  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17925  goto __pyx_L0;
17926  __pyx_L1_error:;
17927  __Pyx_XDECREF(__pyx_t_1);
17928  __Pyx_XDECREF(__pyx_t_6);
17929  __Pyx_XDECREF(__pyx_t_7);
17930  __Pyx_XDECREF(__pyx_t_8);
17931  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
17932  __pyx_r = 0;
17933  __pyx_L0:;
17934  __Pyx_XGIVEREF(__pyx_r);
17935  __Pyx_RefNannyFinishContext();
17936  return __pyx_r;
17937 }
17938 
17939 /* "BufferFormatFromTypeInfo":1463
17940  *
17941  * @cname('__pyx_format_from_typeinfo')
17942  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
17943  * cdef __Pyx_StructField *field
17944  * cdef __pyx_typeinfo_string fmt
17945  */
17946 
17947 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) {
17948  __Pyx_StructField *__pyx_v_field;
17949  struct __pyx_typeinfo_string __pyx_v_fmt;
17950  PyObject *__pyx_v_part = 0;
17951  PyObject *__pyx_v_result = 0;
17952  PyObject *__pyx_v_alignment = NULL;
17953  PyObject *__pyx_v_parts = NULL;
17954  PyObject *__pyx_v_extents = NULL;
17955  int __pyx_v_i;
17956  PyObject *__pyx_r = NULL;
17957  __Pyx_RefNannyDeclarations
17958  int __pyx_t_1;
17959  PyObject *__pyx_t_2 = NULL;
17960  __Pyx_StructField *__pyx_t_3;
17961  PyObject *__pyx_t_4 = NULL;
17962  PyObject *__pyx_t_5 = NULL;
17963  int __pyx_t_6;
17964  int __pyx_t_7;
17965  int __pyx_t_8;
17966  int __pyx_t_9;
17967  int __pyx_lineno = 0;
17968  const char *__pyx_filename = NULL;
17969  int __pyx_clineno = 0;
17970  __Pyx_RefNannySetupContext("format_from_typeinfo", 0);
17971 
17972  /* "BufferFormatFromTypeInfo":1468
17973  * cdef bytes part, result
17974  *
17975  * if type.typegroup == 'S': # <<<<<<<<<<<<<<
17976  * assert type.fields != NULL
17977  * assert type.fields.type != NULL
17978  */
17979  __pyx_t_1 = ((__pyx_v_type->typegroup == 'S') != 0);
17980  if (__pyx_t_1) {
17981 
17982  /* "BufferFormatFromTypeInfo":1469
17983  *
17984  * if type.typegroup == 'S':
17985  * assert type.fields != NULL # <<<<<<<<<<<<<<
17986  * assert type.fields.type != NULL
17987  *
17988  */
17989  #ifndef CYTHON_WITHOUT_ASSERTIONS
17990  if (unlikely(!Py_OptimizeFlag)) {
17991  if (unlikely(!((__pyx_v_type->fields != NULL) != 0))) {
17992  PyErr_SetNone(PyExc_AssertionError);
17993  __PYX_ERR(0, 1469, __pyx_L1_error)
17994  }
17995  }
17996  #endif
17997 
17998  /* "BufferFormatFromTypeInfo":1470
17999  * if type.typegroup == 'S':
18000  * assert type.fields != NULL
18001  * assert type.fields.type != NULL # <<<<<<<<<<<<<<
18002  *
18003  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
18004  */
18005  #ifndef CYTHON_WITHOUT_ASSERTIONS
18006  if (unlikely(!Py_OptimizeFlag)) {
18007  if (unlikely(!((__pyx_v_type->fields->type != NULL) != 0))) {
18008  PyErr_SetNone(PyExc_AssertionError);
18009  __PYX_ERR(0, 1470, __pyx_L1_error)
18010  }
18011  }
18012  #endif
18013 
18014  /* "BufferFormatFromTypeInfo":1472
18015  * assert type.fields.type != NULL
18016  *
18017  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
18018  * alignment = b'^'
18019  * else:
18020  */
18021  __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
18022  if (__pyx_t_1) {
18023 
18024  /* "BufferFormatFromTypeInfo":1473
18025  *
18026  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
18027  * alignment = b'^' # <<<<<<<<<<<<<<
18028  * else:
18029  * alignment = b''
18030  */
18031  __Pyx_INCREF(__pyx_kp_b__24);
18032  __pyx_v_alignment = __pyx_kp_b__24;
18033 
18034  /* "BufferFormatFromTypeInfo":1472
18035  * assert type.fields.type != NULL
18036  *
18037  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
18038  * alignment = b'^'
18039  * else:
18040  */
18041  goto __pyx_L4;
18042  }
18043 
18044  /* "BufferFormatFromTypeInfo":1475
18045  * alignment = b'^'
18046  * else:
18047  * alignment = b'' # <<<<<<<<<<<<<<
18048  *
18049  * parts = [b"T{"]
18050  */
18051  /*else*/ {
18052  __Pyx_INCREF(__pyx_kp_b__25);
18053  __pyx_v_alignment = __pyx_kp_b__25;
18054  }
18055  __pyx_L4:;
18056 
18057  /* "BufferFormatFromTypeInfo":1477
18058  * alignment = b''
18059  *
18060  * parts = [b"T{"] # <<<<<<<<<<<<<<
18061  * field = type.fields
18062  *
18063  */
18064  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error)
18065  __Pyx_GOTREF(__pyx_t_2);
18066  __Pyx_INCREF(__pyx_kp_b_T);
18067  __Pyx_GIVEREF(__pyx_kp_b_T);
18068  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_b_T);
18069  __pyx_v_parts = ((PyObject*)__pyx_t_2);
18070  __pyx_t_2 = 0;
18071 
18072  /* "BufferFormatFromTypeInfo":1478
18073  *
18074  * parts = [b"T{"]
18075  * field = type.fields # <<<<<<<<<<<<<<
18076  *
18077  * while field.type:
18078  */
18079  __pyx_t_3 = __pyx_v_type->fields;
18080  __pyx_v_field = __pyx_t_3;
18081 
18082  /* "BufferFormatFromTypeInfo":1480
18083  * field = type.fields
18084  *
18085  * while field.type: # <<<<<<<<<<<<<<
18086  * part = format_from_typeinfo(field.type)
18087  * parts.append(part + b':' + field.name + b':')
18088  */
18089  while (1) {
18090  __pyx_t_1 = (__pyx_v_field->type != 0);
18091  if (!__pyx_t_1) break;
18092 
18093  /* "BufferFormatFromTypeInfo":1481
18094  *
18095  * while field.type:
18096  * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<<
18097  * parts.append(part + b':' + field.name + b':')
18098  * field += 1
18099  */
18100  __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error)
18101  __Pyx_GOTREF(__pyx_t_2);
18102  __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
18103  __pyx_t_2 = 0;
18104 
18105  /* "BufferFormatFromTypeInfo":1482
18106  * while field.type:
18107  * part = format_from_typeinfo(field.type)
18108  * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<<
18109  * field += 1
18110  *
18111  */
18112  __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__26); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error)
18113  __Pyx_GOTREF(__pyx_t_2);
18114  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error)
18115  __Pyx_GOTREF(__pyx_t_4);
18116  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1482, __pyx_L1_error)
18117  __Pyx_GOTREF(__pyx_t_5);
18118  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18119  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18120  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__26); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error)
18121  __Pyx_GOTREF(__pyx_t_4);
18122  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18123  __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1482, __pyx_L1_error)
18124  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18125 
18126  /* "BufferFormatFromTypeInfo":1483
18127  * part = format_from_typeinfo(field.type)
18128  * parts.append(part + b':' + field.name + b':')
18129  * field += 1 # <<<<<<<<<<<<<<
18130  *
18131  * result = alignment.join(parts) + b'}'
18132  */
18133  __pyx_v_field = (__pyx_v_field + 1);
18134  }
18135 
18136  /* "BufferFormatFromTypeInfo":1485
18137  * field += 1
18138  *
18139  * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<<
18140  * else:
18141  * fmt = __Pyx_TypeInfoToFormat(type)
18142  */
18143  __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1485, __pyx_L1_error)
18144  __Pyx_GOTREF(__pyx_t_4);
18145  __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_b__27); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1485, __pyx_L1_error)
18146  __Pyx_GOTREF(__pyx_t_5);
18147  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18148  if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 1485, __pyx_L1_error)
18149  __pyx_v_result = ((PyObject*)__pyx_t_5);
18150  __pyx_t_5 = 0;
18151 
18152  /* "BufferFormatFromTypeInfo":1468
18153  * cdef bytes part, result
18154  *
18155  * if type.typegroup == 'S': # <<<<<<<<<<<<<<
18156  * assert type.fields != NULL
18157  * assert type.fields.type != NULL
18158  */
18159  goto __pyx_L3;
18160  }
18161 
18162  /* "BufferFormatFromTypeInfo":1487
18163  * result = alignment.join(parts) + b'}'
18164  * else:
18165  * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<<
18166  * if type.arraysize[0]:
18167  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
18168  */
18169  /*else*/ {
18170  __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
18171 
18172  /* "BufferFormatFromTypeInfo":1488
18173  * else:
18174  * fmt = __Pyx_TypeInfoToFormat(type)
18175  * if type.arraysize[0]: # <<<<<<<<<<<<<<
18176  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
18177  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
18178  */
18179  __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
18180  if (__pyx_t_1) {
18181 
18182  /* "BufferFormatFromTypeInfo":1489
18183  * fmt = __Pyx_TypeInfoToFormat(type)
18184  * if type.arraysize[0]:
18185  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] # <<<<<<<<<<<<<<
18186  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
18187  * else:
18188  */
18189  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1489, __pyx_L1_error)
18190  __Pyx_GOTREF(__pyx_t_5);
18191  __pyx_t_7 = __pyx_v_type->ndim;
18192  __pyx_t_8 = __pyx_t_7;
18193  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
18194  __pyx_v_i = __pyx_t_9;
18195  __pyx_t_4 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1489, __pyx_L1_error)
18196  __Pyx_GOTREF(__pyx_t_4);
18197  __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1489, __pyx_L1_error)
18198  __Pyx_GOTREF(__pyx_t_2);
18199  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18200  if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1489, __pyx_L1_error)
18201  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18202  }
18203  __pyx_v_extents = ((PyObject*)__pyx_t_5);
18204  __pyx_t_5 = 0;
18205 
18206  /* "BufferFormatFromTypeInfo":1490
18207  * if type.arraysize[0]:
18208  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
18209  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string # <<<<<<<<<<<<<<
18210  * else:
18211  * result = fmt.string
18212  */
18213  __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__28, __pyx_v_extents); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1490, __pyx_L1_error)
18214  __Pyx_GOTREF(__pyx_t_5);
18215  __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error)
18216  __Pyx_GOTREF(__pyx_t_2);
18217  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18218  __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1490, __pyx_L1_error)
18219  __Pyx_GOTREF(__pyx_t_5);
18220  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18221  __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error)
18222  __Pyx_GOTREF(__pyx_t_2);
18223  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1490, __pyx_L1_error)
18224  __Pyx_GOTREF(__pyx_t_4);
18225  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18226  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18227  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 1490, __pyx_L1_error)
18228  __pyx_v_result = ((PyObject*)__pyx_t_4);
18229  __pyx_t_4 = 0;
18230 
18231  /* "BufferFormatFromTypeInfo":1488
18232  * else:
18233  * fmt = __Pyx_TypeInfoToFormat(type)
18234  * if type.arraysize[0]: # <<<<<<<<<<<<<<
18235  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
18236  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
18237  */
18238  goto __pyx_L7;
18239  }
18240 
18241  /* "BufferFormatFromTypeInfo":1492
18242  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
18243  * else:
18244  * result = fmt.string # <<<<<<<<<<<<<<
18245  *
18246  * return result
18247  */
18248  /*else*/ {
18249  __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1492, __pyx_L1_error)
18250  __Pyx_GOTREF(__pyx_t_4);
18251  __pyx_v_result = ((PyObject*)__pyx_t_4);
18252  __pyx_t_4 = 0;
18253  }
18254  __pyx_L7:;
18255  }
18256  __pyx_L3:;
18257 
18258  /* "BufferFormatFromTypeInfo":1494
18259  * result = fmt.string
18260  *
18261  * return result # <<<<<<<<<<<<<<
18262  */
18263  __Pyx_XDECREF(__pyx_r);
18264  __Pyx_INCREF(__pyx_v_result);
18265  __pyx_r = __pyx_v_result;
18266  goto __pyx_L0;
18267 
18268  /* "BufferFormatFromTypeInfo":1463
18269  *
18270  * @cname('__pyx_format_from_typeinfo')
18271  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
18272  * cdef __Pyx_StructField *field
18273  * cdef __pyx_typeinfo_string fmt
18274  */
18275 
18276  /* function exit code */
18277  __pyx_L1_error:;
18278  __Pyx_XDECREF(__pyx_t_2);
18279  __Pyx_XDECREF(__pyx_t_4);
18280  __Pyx_XDECREF(__pyx_t_5);
18281  __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
18282  __pyx_r = 0;
18283  __pyx_L0:;
18284  __Pyx_XDECREF(__pyx_v_part);
18285  __Pyx_XDECREF(__pyx_v_result);
18286  __Pyx_XDECREF(__pyx_v_alignment);
18287  __Pyx_XDECREF(__pyx_v_parts);
18288  __Pyx_XDECREF(__pyx_v_extents);
18289  __Pyx_XGIVEREF(__pyx_r);
18290  __Pyx_RefNannyFinishContext();
18291  return __pyx_r;
18292 }
18293 
18294 static PyObject *__pyx_tp_new_9csparsity_PySparsityInfo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
18295  struct __pyx_obj_9csparsity_PySparsityInfo *p;
18296  PyObject *o;
18297  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18298  o = (*t->tp_alloc)(t, 0);
18299  } else {
18300  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18301  }
18302  if (unlikely(!o)) return 0;
18303  p = ((struct __pyx_obj_9csparsity_PySparsityInfo *)o);
18304  new((void*)&(p->cpp)) proteus::SparsityInfo();
18305  if (unlikely(__pyx_pw_9csparsity_14PySparsityInfo_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
18306  return o;
18307  bad:
18308  Py_DECREF(o); o = 0;
18309  return NULL;
18310 }
18311 
18312 static void __pyx_tp_dealloc_9csparsity_PySparsityInfo(PyObject *o) {
18313  struct __pyx_obj_9csparsity_PySparsityInfo *p = (struct __pyx_obj_9csparsity_PySparsityInfo *)o;
18314  #if CYTHON_USE_TP_FINALIZE
18315  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))) {
18316  if (PyObject_CallFinalizerFromDealloc(o)) return;
18317  }
18318  #endif
18319  {
18320  PyObject *etype, *eval, *etb;
18321  PyErr_Fetch(&etype, &eval, &etb);
18322  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
18323  __pyx_pw_9csparsity_14PySparsityInfo_3__dealloc__(o);
18324  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
18325  PyErr_Restore(etype, eval, etb);
18326  }
18327  __Pyx_call_destructor(p->cpp);
18328  (*Py_TYPE(o)->tp_free)(o);
18329 }
18330 
18331 static PyMethodDef __pyx_methods_9csparsity_PySparsityInfo[] = {
18332  {"findNonzeros", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_5findNonzeros, METH_VARARGS|METH_KEYWORDS, 0},
18333  {"getOffsets_CSR", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9csparsity_14PySparsityInfo_7getOffsets_CSR, METH_VARARGS|METH_KEYWORDS, 0},
18334  {"getCSR", (PyCFunction)__pyx_pw_9csparsity_14PySparsityInfo_9getCSR, METH_NOARGS, 0},
18335  {"__reduce_cython__", (PyCFunction)__pyx_pw_9csparsity_14PySparsityInfo_11__reduce_cython__, METH_NOARGS, 0},
18336  {"__setstate_cython__", (PyCFunction)__pyx_pw_9csparsity_14PySparsityInfo_13__setstate_cython__, METH_O, 0},
18337  {0, 0, 0, 0}
18338 };
18339 
18340 static PyTypeObject __pyx_type_9csparsity_PySparsityInfo = {
18341  PyVarObject_HEAD_INIT(0, 0)
18342  "csparsity.PySparsityInfo", /*tp_name*/
18343  sizeof(struct __pyx_obj_9csparsity_PySparsityInfo), /*tp_basicsize*/
18344  0, /*tp_itemsize*/
18345  __pyx_tp_dealloc_9csparsity_PySparsityInfo, /*tp_dealloc*/
18346  #if PY_VERSION_HEX < 0x030800b4
18347  0, /*tp_print*/
18348  #endif
18349  #if PY_VERSION_HEX >= 0x030800b4
18350  0, /*tp_vectorcall_offset*/
18351  #endif
18352  0, /*tp_getattr*/
18353  0, /*tp_setattr*/
18354  #if PY_MAJOR_VERSION < 3
18355  0, /*tp_compare*/
18356  #endif
18357  #if PY_MAJOR_VERSION >= 3
18358  0, /*tp_as_async*/
18359  #endif
18360  0, /*tp_repr*/
18361  0, /*tp_as_number*/
18362  0, /*tp_as_sequence*/
18363  0, /*tp_as_mapping*/
18364  0, /*tp_hash*/
18365  0, /*tp_call*/
18366  0, /*tp_str*/
18367  0, /*tp_getattro*/
18368  0, /*tp_setattro*/
18369  0, /*tp_as_buffer*/
18370  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
18371  0, /*tp_doc*/
18372  0, /*tp_traverse*/
18373  0, /*tp_clear*/
18374  0, /*tp_richcompare*/
18375  0, /*tp_weaklistoffset*/
18376  0, /*tp_iter*/
18377  0, /*tp_iternext*/
18378  __pyx_methods_9csparsity_PySparsityInfo, /*tp_methods*/
18379  0, /*tp_members*/
18380  0, /*tp_getset*/
18381  0, /*tp_base*/
18382  0, /*tp_dict*/
18383  0, /*tp_descr_get*/
18384  0, /*tp_descr_set*/
18385  0, /*tp_dictoffset*/
18386  0, /*tp_init*/
18387  0, /*tp_alloc*/
18388  __pyx_tp_new_9csparsity_PySparsityInfo, /*tp_new*/
18389  0, /*tp_free*/
18390  0, /*tp_is_gc*/
18391  0, /*tp_bases*/
18392  0, /*tp_mro*/
18393  0, /*tp_cache*/
18394  0, /*tp_subclasses*/
18395  0, /*tp_weaklist*/
18396  0, /*tp_del*/
18397  0, /*tp_version_tag*/
18398  #if PY_VERSION_HEX >= 0x030400a1
18399  0, /*tp_finalize*/
18400  #endif
18401  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
18402  0, /*tp_vectorcall*/
18403  #endif
18404  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
18405  0, /*tp_print*/
18406  #endif
18407  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
18408  0, /*tp_pypy_flags*/
18409  #endif
18410 };
18411 static struct __pyx_vtabstruct_array __pyx_vtable_array;
18412 
18413 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
18414  struct __pyx_array_obj *p;
18415  PyObject *o;
18416  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18417  o = (*t->tp_alloc)(t, 0);
18418  } else {
18419  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18420  }
18421  if (unlikely(!o)) return 0;
18422  p = ((struct __pyx_array_obj *)o);
18423  p->__pyx_vtab = __pyx_vtabptr_array;
18424  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
18425  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
18426  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
18427  return o;
18428  bad:
18429  Py_DECREF(o); o = 0;
18430  return NULL;
18431 }
18432 
18433 static void __pyx_tp_dealloc_array(PyObject *o) {
18434  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
18435  #if CYTHON_USE_TP_FINALIZE
18436  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))) {
18437  if (PyObject_CallFinalizerFromDealloc(o)) return;
18438  }
18439  #endif
18440  {
18441  PyObject *etype, *eval, *etb;
18442  PyErr_Fetch(&etype, &eval, &etb);
18443  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
18444  __pyx_array___dealloc__(o);
18445  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
18446  PyErr_Restore(etype, eval, etb);
18447  }
18448  Py_CLEAR(p->mode);
18449  Py_CLEAR(p->_format);
18450  (*Py_TYPE(o)->tp_free)(o);
18451 }
18452 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
18453  PyObject *r;
18454  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
18455  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18456  Py_DECREF(x);
18457  return r;
18458 }
18459 
18460 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
18461  if (v) {
18462  return __pyx_array___setitem__(o, i, v);
18463  }
18464  else {
18465  PyErr_Format(PyExc_NotImplementedError,
18466  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
18467  return -1;
18468  }
18469 }
18470 
18471 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
18472  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
18473  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
18474  PyErr_Clear();
18475  v = __pyx_array___getattr__(o, n);
18476  }
18477  return v;
18478 }
18479 
18480 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
18481  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
18482 }
18483 
18484 static PyMethodDef __pyx_methods_array[] = {
18485  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
18486  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
18487  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
18488  {0, 0, 0, 0}
18489 };
18490 
18491 static struct PyGetSetDef __pyx_getsets_array[] = {
18492  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
18493  {0, 0, 0, 0, 0}
18494 };
18495 
18496 static PySequenceMethods __pyx_tp_as_sequence_array = {
18497  __pyx_array___len__, /*sq_length*/
18498  0, /*sq_concat*/
18499  0, /*sq_repeat*/
18500  __pyx_sq_item_array, /*sq_item*/
18501  0, /*sq_slice*/
18502  0, /*sq_ass_item*/
18503  0, /*sq_ass_slice*/
18504  0, /*sq_contains*/
18505  0, /*sq_inplace_concat*/
18506  0, /*sq_inplace_repeat*/
18507 };
18508 
18509 static PyMappingMethods __pyx_tp_as_mapping_array = {
18510  __pyx_array___len__, /*mp_length*/
18511  __pyx_array___getitem__, /*mp_subscript*/
18512  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
18513 };
18514 
18515 static PyBufferProcs __pyx_tp_as_buffer_array = {
18516  #if PY_MAJOR_VERSION < 3
18517  0, /*bf_getreadbuffer*/
18518  #endif
18519  #if PY_MAJOR_VERSION < 3
18520  0, /*bf_getwritebuffer*/
18521  #endif
18522  #if PY_MAJOR_VERSION < 3
18523  0, /*bf_getsegcount*/
18524  #endif
18525  #if PY_MAJOR_VERSION < 3
18526  0, /*bf_getcharbuffer*/
18527  #endif
18528  __pyx_array_getbuffer, /*bf_getbuffer*/
18529  0, /*bf_releasebuffer*/
18530 };
18531 
18532 static PyTypeObject __pyx_type___pyx_array = {
18533  PyVarObject_HEAD_INIT(0, 0)
18534  "csparsity.array", /*tp_name*/
18535  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
18536  0, /*tp_itemsize*/
18537  __pyx_tp_dealloc_array, /*tp_dealloc*/
18538  #if PY_VERSION_HEX < 0x030800b4
18539  0, /*tp_print*/
18540  #endif
18541  #if PY_VERSION_HEX >= 0x030800b4
18542  0, /*tp_vectorcall_offset*/
18543  #endif
18544  0, /*tp_getattr*/
18545  0, /*tp_setattr*/
18546  #if PY_MAJOR_VERSION < 3
18547  0, /*tp_compare*/
18548  #endif
18549  #if PY_MAJOR_VERSION >= 3
18550  0, /*tp_as_async*/
18551  #endif
18552  0, /*tp_repr*/
18553  0, /*tp_as_number*/
18554  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
18555  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
18556  0, /*tp_hash*/
18557  0, /*tp_call*/
18558  0, /*tp_str*/
18559  __pyx_tp_getattro_array, /*tp_getattro*/
18560  0, /*tp_setattro*/
18561  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
18562  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
18563  0, /*tp_doc*/
18564  0, /*tp_traverse*/
18565  0, /*tp_clear*/
18566  0, /*tp_richcompare*/
18567  0, /*tp_weaklistoffset*/
18568  0, /*tp_iter*/
18569  0, /*tp_iternext*/
18570  __pyx_methods_array, /*tp_methods*/
18571  0, /*tp_members*/
18572  __pyx_getsets_array, /*tp_getset*/
18573  0, /*tp_base*/
18574  0, /*tp_dict*/
18575  0, /*tp_descr_get*/
18576  0, /*tp_descr_set*/
18577  0, /*tp_dictoffset*/
18578  0, /*tp_init*/
18579  0, /*tp_alloc*/
18580  __pyx_tp_new_array, /*tp_new*/
18581  0, /*tp_free*/
18582  0, /*tp_is_gc*/
18583  0, /*tp_bases*/
18584  0, /*tp_mro*/
18585  0, /*tp_cache*/
18586  0, /*tp_subclasses*/
18587  0, /*tp_weaklist*/
18588  0, /*tp_del*/
18589  0, /*tp_version_tag*/
18590  #if PY_VERSION_HEX >= 0x030400a1
18591  0, /*tp_finalize*/
18592  #endif
18593  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
18594  0, /*tp_vectorcall*/
18595  #endif
18596  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
18597  0, /*tp_print*/
18598  #endif
18599  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
18600  0, /*tp_pypy_flags*/
18601  #endif
18602 };
18603 
18604 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
18605  struct __pyx_MemviewEnum_obj *p;
18606  PyObject *o;
18607  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18608  o = (*t->tp_alloc)(t, 0);
18609  } else {
18610  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18611  }
18612  if (unlikely(!o)) return 0;
18613  p = ((struct __pyx_MemviewEnum_obj *)o);
18614  p->name = Py_None; Py_INCREF(Py_None);
18615  return o;
18616 }
18617 
18618 static void __pyx_tp_dealloc_Enum(PyObject *o) {
18619  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
18620  #if CYTHON_USE_TP_FINALIZE
18621  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
18622  if (PyObject_CallFinalizerFromDealloc(o)) return;
18623  }
18624  #endif
18625  PyObject_GC_UnTrack(o);
18626  Py_CLEAR(p->name);
18627  (*Py_TYPE(o)->tp_free)(o);
18628 }
18629 
18630 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
18631  int e;
18632  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
18633  if (p->name) {
18634  e = (*v)(p->name, a); if (e) return e;
18635  }
18636  return 0;
18637 }
18638 
18639 static int __pyx_tp_clear_Enum(PyObject *o) {
18640  PyObject* tmp;
18641  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
18642  tmp = ((PyObject*)p->name);
18643  p->name = Py_None; Py_INCREF(Py_None);
18644  Py_XDECREF(tmp);
18645  return 0;
18646 }
18647 
18648 static PyMethodDef __pyx_methods_Enum[] = {
18649  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
18650  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
18651  {0, 0, 0, 0}
18652 };
18653 
18654 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
18655  PyVarObject_HEAD_INIT(0, 0)
18656  "csparsity.Enum", /*tp_name*/
18657  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
18658  0, /*tp_itemsize*/
18659  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
18660  #if PY_VERSION_HEX < 0x030800b4
18661  0, /*tp_print*/
18662  #endif
18663  #if PY_VERSION_HEX >= 0x030800b4
18664  0, /*tp_vectorcall_offset*/
18665  #endif
18666  0, /*tp_getattr*/
18667  0, /*tp_setattr*/
18668  #if PY_MAJOR_VERSION < 3
18669  0, /*tp_compare*/
18670  #endif
18671  #if PY_MAJOR_VERSION >= 3
18672  0, /*tp_as_async*/
18673  #endif
18674  __pyx_MemviewEnum___repr__, /*tp_repr*/
18675  0, /*tp_as_number*/
18676  0, /*tp_as_sequence*/
18677  0, /*tp_as_mapping*/
18678  0, /*tp_hash*/
18679  0, /*tp_call*/
18680  0, /*tp_str*/
18681  0, /*tp_getattro*/
18682  0, /*tp_setattro*/
18683  0, /*tp_as_buffer*/
18684  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
18685  0, /*tp_doc*/
18686  __pyx_tp_traverse_Enum, /*tp_traverse*/
18687  __pyx_tp_clear_Enum, /*tp_clear*/
18688  0, /*tp_richcompare*/
18689  0, /*tp_weaklistoffset*/
18690  0, /*tp_iter*/
18691  0, /*tp_iternext*/
18692  __pyx_methods_Enum, /*tp_methods*/
18693  0, /*tp_members*/
18694  0, /*tp_getset*/
18695  0, /*tp_base*/
18696  0, /*tp_dict*/
18697  0, /*tp_descr_get*/
18698  0, /*tp_descr_set*/
18699  0, /*tp_dictoffset*/
18700  __pyx_MemviewEnum___init__, /*tp_init*/
18701  0, /*tp_alloc*/
18702  __pyx_tp_new_Enum, /*tp_new*/
18703  0, /*tp_free*/
18704  0, /*tp_is_gc*/
18705  0, /*tp_bases*/
18706  0, /*tp_mro*/
18707  0, /*tp_cache*/
18708  0, /*tp_subclasses*/
18709  0, /*tp_weaklist*/
18710  0, /*tp_del*/
18711  0, /*tp_version_tag*/
18712  #if PY_VERSION_HEX >= 0x030400a1
18713  0, /*tp_finalize*/
18714  #endif
18715  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
18716  0, /*tp_vectorcall*/
18717  #endif
18718  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
18719  0, /*tp_print*/
18720  #endif
18721  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
18722  0, /*tp_pypy_flags*/
18723  #endif
18724 };
18725 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
18726 
18727 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
18728  struct __pyx_memoryview_obj *p;
18729  PyObject *o;
18730  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
18731  o = (*t->tp_alloc)(t, 0);
18732  } else {
18733  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
18734  }
18735  if (unlikely(!o)) return 0;
18736  p = ((struct __pyx_memoryview_obj *)o);
18737  p->__pyx_vtab = __pyx_vtabptr_memoryview;
18738  p->obj = Py_None; Py_INCREF(Py_None);
18739  p->_size = Py_None; Py_INCREF(Py_None);
18740  p->_array_interface = Py_None; Py_INCREF(Py_None);
18741  p->view.obj = NULL;
18742  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
18743  return o;
18744  bad:
18745  Py_DECREF(o); o = 0;
18746  return NULL;
18747 }
18748 
18749 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
18750  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
18751  #if CYTHON_USE_TP_FINALIZE
18752  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
18753  if (PyObject_CallFinalizerFromDealloc(o)) return;
18754  }
18755  #endif
18756  PyObject_GC_UnTrack(o);
18757  {
18758  PyObject *etype, *eval, *etb;
18759  PyErr_Fetch(&etype, &eval, &etb);
18760  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
18761  __pyx_memoryview___dealloc__(o);
18762  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
18763  PyErr_Restore(etype, eval, etb);
18764  }
18765  Py_CLEAR(p->obj);
18766  Py_CLEAR(p->_size);
18767  Py_CLEAR(p->_array_interface);
18768  (*Py_TYPE(o)->tp_free)(o);
18769 }
18770 
18771 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
18772  int e;
18773  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
18774  if (p->obj) {
18775  e = (*v)(p->obj, a); if (e) return e;
18776  }
18777  if (p->_size) {
18778  e = (*v)(p->_size, a); if (e) return e;
18779  }
18780  if (p->_array_interface) {
18781  e = (*v)(p->_array_interface, a); if (e) return e;
18782  }
18783  if (p->view.obj) {
18784  e = (*v)(p->view.obj, a); if (e) return e;
18785  }
18786  return 0;
18787 }
18788 
18789 static int __pyx_tp_clear_memoryview(PyObject *o) {
18790  PyObject* tmp;
18791  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
18792  tmp = ((PyObject*)p->obj);
18793  p->obj = Py_None; Py_INCREF(Py_None);
18794  Py_XDECREF(tmp);
18795  tmp = ((PyObject*)p->_size);
18796  p->_size = Py_None; Py_INCREF(Py_None);
18797  Py_XDECREF(tmp);
18798  tmp = ((PyObject*)p->_array_interface);
18799  p->_array_interface = Py_None; Py_INCREF(Py_None);
18800  Py_XDECREF(tmp);
18801  Py_CLEAR(p->view.obj);
18802  return 0;
18803 }
18804 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
18805  PyObject *r;
18806  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
18807  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
18808  Py_DECREF(x);
18809  return r;
18810 }
18811 
18812 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
18813  if (v) {
18814  return __pyx_memoryview___setitem__(o, i, v);
18815  }
18816  else {
18817  PyErr_Format(PyExc_NotImplementedError,
18818  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
18819  return -1;
18820  }
18821 }
18822 
18823 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
18824  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
18825 }
18826 
18827 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
18828  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
18829 }
18830 
18831 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
18832  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
18833 }
18834 
18835 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
18836  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
18837 }
18838 
18839 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
18840  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
18841 }
18842 
18843 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
18844  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
18845 }
18846 
18847 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
18848  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
18849 }
18850 
18851 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
18852  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
18853 }
18854 
18855 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
18856  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
18857 }
18858 
18859 static PyMethodDef __pyx_methods_memoryview[] = {
18860  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
18861  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
18862  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
18863  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
18864  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
18865  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
18866  {0, 0, 0, 0}
18867 };
18868 
18869 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
18870  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
18871  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
18872  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
18873  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
18874  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
18875  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
18876  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
18877  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
18878  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
18879  {0, 0, 0, 0, 0}
18880 };
18881 
18882 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
18883  __pyx_memoryview___len__, /*sq_length*/
18884  0, /*sq_concat*/
18885  0, /*sq_repeat*/
18886  __pyx_sq_item_memoryview, /*sq_item*/
18887  0, /*sq_slice*/
18888  0, /*sq_ass_item*/
18889  0, /*sq_ass_slice*/
18890  0, /*sq_contains*/
18891  0, /*sq_inplace_concat*/
18892  0, /*sq_inplace_repeat*/
18893 };
18894 
18895 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
18896  __pyx_memoryview___len__, /*mp_length*/
18897  __pyx_memoryview___getitem__, /*mp_subscript*/
18898  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
18899 };
18900 
18901 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
18902  #if PY_MAJOR_VERSION < 3
18903  0, /*bf_getreadbuffer*/
18904  #endif
18905  #if PY_MAJOR_VERSION < 3
18906  0, /*bf_getwritebuffer*/
18907  #endif
18908  #if PY_MAJOR_VERSION < 3
18909  0, /*bf_getsegcount*/
18910  #endif
18911  #if PY_MAJOR_VERSION < 3
18912  0, /*bf_getcharbuffer*/
18913  #endif
18914  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
18915  0, /*bf_releasebuffer*/
18916 };
18917 
18918 static PyTypeObject __pyx_type___pyx_memoryview = {
18919  PyVarObject_HEAD_INIT(0, 0)
18920  "csparsity.memoryview", /*tp_name*/
18921  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
18922  0, /*tp_itemsize*/
18923  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
18924  #if PY_VERSION_HEX < 0x030800b4
18925  0, /*tp_print*/
18926  #endif
18927  #if PY_VERSION_HEX >= 0x030800b4
18928  0, /*tp_vectorcall_offset*/
18929  #endif
18930  0, /*tp_getattr*/
18931  0, /*tp_setattr*/
18932  #if PY_MAJOR_VERSION < 3
18933  0, /*tp_compare*/
18934  #endif
18935  #if PY_MAJOR_VERSION >= 3
18936  0, /*tp_as_async*/
18937  #endif
18938  __pyx_memoryview___repr__, /*tp_repr*/
18939  0, /*tp_as_number*/
18940  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
18941  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
18942  0, /*tp_hash*/
18943  0, /*tp_call*/
18944  __pyx_memoryview___str__, /*tp_str*/
18945  0, /*tp_getattro*/
18946  0, /*tp_setattro*/
18947  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
18948  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
18949  0, /*tp_doc*/
18950  __pyx_tp_traverse_memoryview, /*tp_traverse*/
18951  __pyx_tp_clear_memoryview, /*tp_clear*/
18952  0, /*tp_richcompare*/
18953  0, /*tp_weaklistoffset*/
18954  0, /*tp_iter*/
18955  0, /*tp_iternext*/
18956  __pyx_methods_memoryview, /*tp_methods*/
18957  0, /*tp_members*/
18958  __pyx_getsets_memoryview, /*tp_getset*/
18959  0, /*tp_base*/
18960  0, /*tp_dict*/
18961  0, /*tp_descr_get*/
18962  0, /*tp_descr_set*/
18963  0, /*tp_dictoffset*/
18964  0, /*tp_init*/
18965  0, /*tp_alloc*/
18966  __pyx_tp_new_memoryview, /*tp_new*/
18967  0, /*tp_free*/
18968  0, /*tp_is_gc*/
18969  0, /*tp_bases*/
18970  0, /*tp_mro*/
18971  0, /*tp_cache*/
18972  0, /*tp_subclasses*/
18973  0, /*tp_weaklist*/
18974  0, /*tp_del*/
18975  0, /*tp_version_tag*/
18976  #if PY_VERSION_HEX >= 0x030400a1
18977  0, /*tp_finalize*/
18978  #endif
18979  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
18980  0, /*tp_vectorcall*/
18981  #endif
18982  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
18983  0, /*tp_print*/
18984  #endif
18985  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
18986  0, /*tp_pypy_flags*/
18987  #endif
18988 };
18989 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
18990 
18991 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
18992  struct __pyx_memoryviewslice_obj *p;
18993  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
18994  if (unlikely(!o)) return 0;
18995  p = ((struct __pyx_memoryviewslice_obj *)o);
18996  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
18997  p->from_object = Py_None; Py_INCREF(Py_None);
18998  p->from_slice.memview = NULL;
18999  return o;
19000 }
19001 
19002 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
19003  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
19004  #if CYTHON_USE_TP_FINALIZE
19005  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
19006  if (PyObject_CallFinalizerFromDealloc(o)) return;
19007  }
19008  #endif
19009  PyObject_GC_UnTrack(o);
19010  {
19011  PyObject *etype, *eval, *etb;
19012  PyErr_Fetch(&etype, &eval, &etb);
19013  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
19014  __pyx_memoryviewslice___dealloc__(o);
19015  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
19016  PyErr_Restore(etype, eval, etb);
19017  }
19018  Py_CLEAR(p->from_object);
19019  PyObject_GC_Track(o);
19020  __pyx_tp_dealloc_memoryview(o);
19021 }
19022 
19023 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
19024  int e;
19025  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
19026  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
19027  if (p->from_object) {
19028  e = (*v)(p->from_object, a); if (e) return e;
19029  }
19030  return 0;
19031 }
19032 
19033 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
19034  PyObject* tmp;
19035  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
19036  __pyx_tp_clear_memoryview(o);
19037  tmp = ((PyObject*)p->from_object);
19038  p->from_object = Py_None; Py_INCREF(Py_None);
19039  Py_XDECREF(tmp);
19040  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
19041  return 0;
19042 }
19043 
19044 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
19045  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
19046 }
19047 
19048 static PyMethodDef __pyx_methods__memoryviewslice[] = {
19049  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
19050  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
19051  {0, 0, 0, 0}
19052 };
19053 
19054 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
19055  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
19056  {0, 0, 0, 0, 0}
19057 };
19058 
19059 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
19060  PyVarObject_HEAD_INIT(0, 0)
19061  "csparsity._memoryviewslice", /*tp_name*/
19062  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
19063  0, /*tp_itemsize*/
19064  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
19065  #if PY_VERSION_HEX < 0x030800b4
19066  0, /*tp_print*/
19067  #endif
19068  #if PY_VERSION_HEX >= 0x030800b4
19069  0, /*tp_vectorcall_offset*/
19070  #endif
19071  0, /*tp_getattr*/
19072  0, /*tp_setattr*/
19073  #if PY_MAJOR_VERSION < 3
19074  0, /*tp_compare*/
19075  #endif
19076  #if PY_MAJOR_VERSION >= 3
19077  0, /*tp_as_async*/
19078  #endif
19079  #if CYTHON_COMPILING_IN_PYPY
19080  __pyx_memoryview___repr__, /*tp_repr*/
19081  #else
19082  0, /*tp_repr*/
19083  #endif
19084  0, /*tp_as_number*/
19085  0, /*tp_as_sequence*/
19086  0, /*tp_as_mapping*/
19087  0, /*tp_hash*/
19088  0, /*tp_call*/
19089  #if CYTHON_COMPILING_IN_PYPY
19090  __pyx_memoryview___str__, /*tp_str*/
19091  #else
19092  0, /*tp_str*/
19093  #endif
19094  0, /*tp_getattro*/
19095  0, /*tp_setattro*/
19096  0, /*tp_as_buffer*/
19097  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
19098  "Internal class for passing memoryview slices to Python", /*tp_doc*/
19099  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
19100  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
19101  0, /*tp_richcompare*/
19102  0, /*tp_weaklistoffset*/
19103  0, /*tp_iter*/
19104  0, /*tp_iternext*/
19105  __pyx_methods__memoryviewslice, /*tp_methods*/
19106  0, /*tp_members*/
19107  __pyx_getsets__memoryviewslice, /*tp_getset*/
19108  0, /*tp_base*/
19109  0, /*tp_dict*/
19110  0, /*tp_descr_get*/
19111  0, /*tp_descr_set*/
19112  0, /*tp_dictoffset*/
19113  0, /*tp_init*/
19114  0, /*tp_alloc*/
19115  __pyx_tp_new__memoryviewslice, /*tp_new*/
19116  0, /*tp_free*/
19117  0, /*tp_is_gc*/
19118  0, /*tp_bases*/
19119  0, /*tp_mro*/
19120  0, /*tp_cache*/
19121  0, /*tp_subclasses*/
19122  0, /*tp_weaklist*/
19123  0, /*tp_del*/
19124  0, /*tp_version_tag*/
19125  #if PY_VERSION_HEX >= 0x030400a1
19126  0, /*tp_finalize*/
19127  #endif
19128  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
19129  0, /*tp_vectorcall*/
19130  #endif
19131  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19132  0, /*tp_print*/
19133  #endif
19134  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
19135  0, /*tp_pypy_flags*/
19136  #endif
19137 };
19138 
19139 static PyMethodDef __pyx_methods[] = {
19140  {0, 0, 0, 0}
19141 };
19142 
19143 #if PY_MAJOR_VERSION >= 3
19144 #if CYTHON_PEP489_MULTI_PHASE_INIT
19145 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
19146 static int __pyx_pymod_exec_csparsity(PyObject* module); /*proto*/
19147 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
19148  {Py_mod_create, (void*)__pyx_pymod_create},
19149  {Py_mod_exec, (void*)__pyx_pymod_exec_csparsity},
19150  {0, NULL}
19151 };
19152 #endif
19153 
19154 static struct PyModuleDef __pyx_moduledef = {
19155  PyModuleDef_HEAD_INIT,
19156  "csparsity",
19157  0, /* m_doc */
19158  #if CYTHON_PEP489_MULTI_PHASE_INIT
19159  0, /* m_size */
19160  #else
19161  -1, /* m_size */
19162  #endif
19163  __pyx_methods /* m_methods */,
19164  #if CYTHON_PEP489_MULTI_PHASE_INIT
19165  __pyx_moduledef_slots, /* m_slots */
19166  #else
19167  NULL, /* m_reload */
19168  #endif
19169  NULL, /* m_traverse */
19170  NULL, /* m_clear */
19171  NULL /* m_free */
19172 };
19173 #endif
19174 #ifndef CYTHON_SMALL_CODE
19175 #if defined(__clang__)
19176  #define CYTHON_SMALL_CODE
19177 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
19178  #define CYTHON_SMALL_CODE __attribute__((cold))
19179 #else
19180  #define CYTHON_SMALL_CODE
19181 #endif
19182 #endif
19183 
19184 static __Pyx_StringTabEntry __pyx_string_tab[] = {
19185  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
19186  {&__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},
19187  {&__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},
19188  {&__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},
19189  {&__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},
19190  {&__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},
19191  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
19192  {&__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},
19193  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
19194  {&__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},
19195  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
19196  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
19197  {&__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},
19198  {&__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},
19199  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
19200  {&__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},
19201  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
19202  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
19203  {&__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},
19204  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
19205  {&__pyx_n_s_PySparsityInfo, __pyx_k_PySparsityInfo, sizeof(__pyx_k_PySparsityInfo), 0, 0, 1, 1},
19206  {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 0},
19207  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
19208  {&__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},
19209  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
19210  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
19211  {&__pyx_kp_b__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 0, 0},
19212  {&__pyx_kp_b__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 0, 0, 0},
19213  {&__pyx_kp_b__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 0, 0},
19214  {&__pyx_kp_b__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 0, 0, 0},
19215  {&__pyx_kp_u__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 1, 0, 0},
19216  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
19217  {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
19218  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
19219  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
19220  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
19221  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
19222  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
19223  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
19224  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
19225  {&__pyx_n_s_csrColumnOffsets, __pyx_k_csrColumnOffsets, sizeof(__pyx_k_csrColumnOffsets), 0, 0, 1, 1},
19226  {&__pyx_n_s_csrColumnOffsets_eNebN, __pyx_k_csrColumnOffsets_eNebN, sizeof(__pyx_k_csrColumnOffsets_eNebN), 0, 0, 1, 1},
19227  {&__pyx_n_s_csrColumnOffsets_eb, __pyx_k_csrColumnOffsets_eb, sizeof(__pyx_k_csrColumnOffsets_eb), 0, 0, 1, 1},
19228  {&__pyx_n_s_csrColumnOffsets_eb_eNebN, __pyx_k_csrColumnOffsets_eb_eNebN, sizeof(__pyx_k_csrColumnOffsets_eb_eNebN), 0, 0, 1, 1},
19229  {&__pyx_n_s_csrRowIndeces, __pyx_k_csrRowIndeces, sizeof(__pyx_k_csrRowIndeces), 0, 0, 1, 1},
19230  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
19231  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
19232  {&__pyx_n_s_elementBoundaryElementsArray, __pyx_k_elementBoundaryElementsArray, sizeof(__pyx_k_elementBoundaryElementsArray), 0, 0, 1, 1},
19233  {&__pyx_n_s_elementBoundaryLocalElementBound, __pyx_k_elementBoundaryLocalElementBound, sizeof(__pyx_k_elementBoundaryLocalElementBound), 0, 0, 1, 1},
19234  {&__pyx_n_s_elementNeighborsArray, __pyx_k_elementNeighborsArray, sizeof(__pyx_k_elementNeighborsArray), 0, 0, 1, 1},
19235  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
19236  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
19237  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
19238  {&__pyx_n_s_exteriorElementBoundariesArray, __pyx_k_exteriorElementBoundariesArray, sizeof(__pyx_k_exteriorElementBoundariesArray), 0, 0, 1, 1},
19239  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
19240  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
19241  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
19242  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
19243  {&__pyx_n_s_freeGlobal_test, __pyx_k_freeGlobal_test, sizeof(__pyx_k_freeGlobal_test), 0, 0, 1, 1},
19244  {&__pyx_n_s_freeGlobal_trial, __pyx_k_freeGlobal_trial, sizeof(__pyx_k_freeGlobal_trial), 0, 0, 1, 1},
19245  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
19246  {&__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},
19247  {&__pyx_n_s_hasDiffusionInMixedForm, __pyx_k_hasDiffusionInMixedForm, sizeof(__pyx_k_hasDiffusionInMixedForm), 0, 0, 1, 1},
19248  {&__pyx_n_s_hasFluxBoundaryConditions, __pyx_k_hasFluxBoundaryConditions, sizeof(__pyx_k_hasFluxBoundaryConditions), 0, 0, 1, 1},
19249  {&__pyx_n_s_hasNumericalFlux, __pyx_k_hasNumericalFlux, sizeof(__pyx_k_hasNumericalFlux), 0, 0, 1, 1},
19250  {&__pyx_n_s_hasOutflowBoundary, __pyx_k_hasOutflowBoundary, sizeof(__pyx_k_hasOutflowBoundary), 0, 0, 1, 1},
19251  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
19252  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
19253  {&__pyx_n_s_interiorElementBoundariesArray, __pyx_k_interiorElementBoundariesArray, sizeof(__pyx_k_interiorElementBoundariesArray), 0, 0, 1, 1},
19254  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
19255  {&__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},
19256  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
19257  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
19258  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
19259  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
19260  {&__pyx_n_s_nDOF_test_element, __pyx_k_nDOF_test_element, sizeof(__pyx_k_nDOF_test_element), 0, 0, 1, 1},
19261  {&__pyx_n_s_nDOF_trial_element, __pyx_k_nDOF_trial_element, sizeof(__pyx_k_nDOF_trial_element), 0, 0, 1, 1},
19262  {&__pyx_n_s_nElementBoundaries_element, __pyx_k_nElementBoundaries_element, sizeof(__pyx_k_nElementBoundaries_element), 0, 0, 1, 1},
19263  {&__pyx_n_s_nElements_global, __pyx_k_nElements_global, sizeof(__pyx_k_nElements_global), 0, 0, 1, 1},
19264  {&__pyx_n_s_nExteriorElementBoundaries_globa, __pyx_k_nExteriorElementBoundaries_globa, sizeof(__pyx_k_nExteriorElementBoundaries_globa), 0, 0, 1, 1},
19265  {&__pyx_n_s_nFreeDOF_test, __pyx_k_nFreeDOF_test, sizeof(__pyx_k_nFreeDOF_test), 0, 0, 1, 1},
19266  {&__pyx_n_s_nFreeDOF_trial, __pyx_k_nFreeDOF_trial, sizeof(__pyx_k_nFreeDOF_trial), 0, 0, 1, 1},
19267  {&__pyx_n_s_nInteriorElementBoundaries_globa, __pyx_k_nInteriorElementBoundaries_globa, sizeof(__pyx_k_nInteriorElementBoundaries_globa), 0, 0, 1, 1},
19268  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
19269  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
19270  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
19271  {&__pyx_n_s_needNumericalFluxJacobian, __pyx_k_needNumericalFluxJacobian, sizeof(__pyx_k_needNumericalFluxJacobian), 0, 0, 1, 1},
19272  {&__pyx_n_s_needOutflowJacobian, __pyx_k_needOutflowJacobian, sizeof(__pyx_k_needOutflowJacobian), 0, 0, 1, 1},
19273  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
19274  {&__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},
19275  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
19276  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
19277  {&__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},
19278  {&__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},
19279  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
19280  {&__pyx_n_s_offset_test, __pyx_k_offset_test, sizeof(__pyx_k_offset_test), 0, 0, 1, 1},
19281  {&__pyx_n_s_offset_trial, __pyx_k_offset_trial, sizeof(__pyx_k_offset_trial), 0, 0, 1, 1},
19282  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
19283  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
19284  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
19285  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
19286  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
19287  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
19288  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
19289  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
19290  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
19291  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
19292  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
19293  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
19294  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
19295  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
19296  {&__pyx_n_s_rowptr, __pyx_k_rowptr, sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
19297  {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
19298  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
19299  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
19300  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
19301  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
19302  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
19303  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
19304  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
19305  {&__pyx_n_s_stride_test, __pyx_k_stride_test, sizeof(__pyx_k_stride_test), 0, 0, 1, 1},
19306  {&__pyx_n_s_stride_trial, __pyx_k_stride_trial, sizeof(__pyx_k_stride_trial), 0, 0, 1, 1},
19307  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
19308  {&__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},
19309  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
19310  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
19311  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
19312  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
19313  {&__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},
19314  {&__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},
19315  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
19316  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
19317  {0, 0, 0, 0, 0, 0, 0}
19318 };
19319 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
19320  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
19321  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
19322  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 133, __pyx_L1_error)
19323  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 148, __pyx_L1_error)
19324  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 151, __pyx_L1_error)
19325  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 180, __pyx_L1_error)
19326  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(0, 404, __pyx_L1_error)
19327  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 613, __pyx_L1_error)
19328  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 832, __pyx_L1_error)
19329  return 0;
19330  __pyx_L1_error:;
19331  return -1;
19332 }
19333 
19334 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
19335  __Pyx_RefNannyDeclarations
19336  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
19337 
19338  /* "(tree fragment)":2
19339  * def __reduce_cython__(self):
19340  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
19341  * def __setstate_cython__(self, __pyx_state):
19342  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19343  */
19344  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 2, __pyx_L1_error)
19345  __Pyx_GOTREF(__pyx_tuple_);
19346  __Pyx_GIVEREF(__pyx_tuple_);
19347 
19348  /* "(tree fragment)":4
19349  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19350  * def __setstate_cython__(self, __pyx_state):
19351  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
19352  */
19353  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4, __pyx_L1_error)
19354  __Pyx_GOTREF(__pyx_tuple__2);
19355  __Pyx_GIVEREF(__pyx_tuple__2);
19356 
19357  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
19358  * __pyx_import_array()
19359  * except Exception:
19360  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
19361  *
19362  * cdef inline int import_umath() except -1:
19363  */
19364  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 945, __pyx_L1_error)
19365  __Pyx_GOTREF(__pyx_tuple__3);
19366  __Pyx_GIVEREF(__pyx_tuple__3);
19367 
19368  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
19369  * _import_umath()
19370  * except Exception:
19371  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
19372  *
19373  * cdef inline int import_ufunc() except -1:
19374  */
19375  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 951, __pyx_L1_error)
19376  __Pyx_GOTREF(__pyx_tuple__4);
19377  __Pyx_GIVEREF(__pyx_tuple__4);
19378 
19379  /* "View.MemoryView":133
19380  *
19381  * if not self.ndim:
19382  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
19383  *
19384  * if itemsize <= 0:
19385  */
19386  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 133, __pyx_L1_error)
19387  __Pyx_GOTREF(__pyx_tuple__5);
19388  __Pyx_GIVEREF(__pyx_tuple__5);
19389 
19390  /* "View.MemoryView":136
19391  *
19392  * if itemsize <= 0:
19393  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
19394  *
19395  * if not isinstance(format, bytes):
19396  */
19397  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 136, __pyx_L1_error)
19398  __Pyx_GOTREF(__pyx_tuple__6);
19399  __Pyx_GIVEREF(__pyx_tuple__6);
19400 
19401  /* "View.MemoryView":148
19402  *
19403  * if not self._shape:
19404  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
19405  *
19406  *
19407  */
19408  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 148, __pyx_L1_error)
19409  __Pyx_GOTREF(__pyx_tuple__7);
19410  __Pyx_GIVEREF(__pyx_tuple__7);
19411 
19412  /* "View.MemoryView":176
19413  * self.data = <char *>malloc(self.len)
19414  * if not self.data:
19415  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
19416  *
19417  * if self.dtype_is_object:
19418  */
19419  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 176, __pyx_L1_error)
19420  __Pyx_GOTREF(__pyx_tuple__8);
19421  __Pyx_GIVEREF(__pyx_tuple__8);
19422 
19423  /* "View.MemoryView":192
19424  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
19425  * if not (flags & bufmode):
19426  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
19427  * info.buf = self.data
19428  * info.len = self.len
19429  */
19430  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 192, __pyx_L1_error)
19431  __Pyx_GOTREF(__pyx_tuple__9);
19432  __Pyx_GIVEREF(__pyx_tuple__9);
19433 
19434  /* "(tree fragment)":2
19435  * def __reduce_cython__(self):
19436  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
19437  * def __setstate_cython__(self, __pyx_state):
19438  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19439  */
19440  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 2, __pyx_L1_error)
19441  __Pyx_GOTREF(__pyx_tuple__10);
19442  __Pyx_GIVEREF(__pyx_tuple__10);
19443 
19444  /* "(tree fragment)":4
19445  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19446  * def __setstate_cython__(self, __pyx_state):
19447  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
19448  */
19449  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 4, __pyx_L1_error)
19450  __Pyx_GOTREF(__pyx_tuple__11);
19451  __Pyx_GIVEREF(__pyx_tuple__11);
19452 
19453  /* "View.MemoryView":418
19454  * def __setitem__(memoryview self, object index, object value):
19455  * if self.view.readonly:
19456  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
19457  *
19458  * have_slices, index = _unellipsify(index, self.view.ndim)
19459  */
19460  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 418, __pyx_L1_error)
19461  __Pyx_GOTREF(__pyx_tuple__12);
19462  __Pyx_GIVEREF(__pyx_tuple__12);
19463 
19464  /* "View.MemoryView":495
19465  * result = struct.unpack(self.view.format, bytesitem)
19466  * except struct.error:
19467  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
19468  * else:
19469  * if len(self.view.format) == 1:
19470  */
19471  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 495, __pyx_L1_error)
19472  __Pyx_GOTREF(__pyx_tuple__13);
19473  __Pyx_GIVEREF(__pyx_tuple__13);
19474 
19475  /* "View.MemoryView":520
19476  * def __getbuffer__(self, Py_buffer *info, int flags):
19477  * if flags & PyBUF_WRITABLE and self.view.readonly:
19478  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
19479  *
19480  * if flags & PyBUF_ND:
19481  */
19482  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 520, __pyx_L1_error)
19483  __Pyx_GOTREF(__pyx_tuple__14);
19484  __Pyx_GIVEREF(__pyx_tuple__14);
19485 
19486  /* "View.MemoryView":570
19487  * if self.view.strides == NULL:
19488  *
19489  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
19490  *
19491  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
19492  */
19493  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 570, __pyx_L1_error)
19494  __Pyx_GOTREF(__pyx_tuple__15);
19495  __Pyx_GIVEREF(__pyx_tuple__15);
19496 
19497  /* "View.MemoryView":577
19498  * def suboffsets(self):
19499  * if self.view.suboffsets == NULL:
19500  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
19501  *
19502  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
19503  */
19504  __pyx_tuple__16 = PyTuple_New(1); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 577, __pyx_L1_error)
19505  __Pyx_GOTREF(__pyx_tuple__16);
19506  __Pyx_INCREF(__pyx_int_neg_1);
19507  __Pyx_GIVEREF(__pyx_int_neg_1);
19508  PyTuple_SET_ITEM(__pyx_tuple__16, 0, __pyx_int_neg_1);
19509  __Pyx_GIVEREF(__pyx_tuple__16);
19510 
19511  /* "(tree fragment)":2
19512  * def __reduce_cython__(self):
19513  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
19514  * def __setstate_cython__(self, __pyx_state):
19515  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19516  */
19517  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 2, __pyx_L1_error)
19518  __Pyx_GOTREF(__pyx_tuple__17);
19519  __Pyx_GIVEREF(__pyx_tuple__17);
19520 
19521  /* "(tree fragment)":4
19522  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19523  * def __setstate_cython__(self, __pyx_state):
19524  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
19525  */
19526  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 4, __pyx_L1_error)
19527  __Pyx_GOTREF(__pyx_tuple__18);
19528  __Pyx_GIVEREF(__pyx_tuple__18);
19529 
19530  /* "View.MemoryView":682
19531  * if item is Ellipsis:
19532  * if not seen_ellipsis:
19533  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
19534  * seen_ellipsis = True
19535  * else:
19536  */
19537  __pyx_slice__19 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) __PYX_ERR(0, 682, __pyx_L1_error)
19538  __Pyx_GOTREF(__pyx_slice__19);
19539  __Pyx_GIVEREF(__pyx_slice__19);
19540 
19541  /* "View.MemoryView":703
19542  * for suboffset in suboffsets[:ndim]:
19543  * if suboffset >= 0:
19544  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
19545  *
19546  *
19547  */
19548  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 703, __pyx_L1_error)
19549  __Pyx_GOTREF(__pyx_tuple__20);
19550  __Pyx_GIVEREF(__pyx_tuple__20);
19551 
19552  /* "(tree fragment)":2
19553  * def __reduce_cython__(self):
19554  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
19555  * def __setstate_cython__(self, __pyx_state):
19556  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19557  */
19558  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 2, __pyx_L1_error)
19559  __Pyx_GOTREF(__pyx_tuple__21);
19560  __Pyx_GIVEREF(__pyx_tuple__21);
19561 
19562  /* "(tree fragment)":4
19563  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19564  * def __setstate_cython__(self, __pyx_state):
19565  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
19566  */
19567  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 4, __pyx_L1_error)
19568  __Pyx_GOTREF(__pyx_tuple__22);
19569  __Pyx_GIVEREF(__pyx_tuple__22);
19570  __pyx_tuple__23 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 4, __pyx_L1_error)
19571  __Pyx_GOTREF(__pyx_tuple__23);
19572  __Pyx_GIVEREF(__pyx_tuple__23);
19573 
19574  /* "View.MemoryView":286
19575  * return self.name
19576  *
19577  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
19578  * cdef strided = Enum("<strided and direct>") # default
19579  * cdef indirect = Enum("<strided and indirect>")
19580  */
19581  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 286, __pyx_L1_error)
19582  __Pyx_GOTREF(__pyx_tuple__29);
19583  __Pyx_GIVEREF(__pyx_tuple__29);
19584 
19585  /* "View.MemoryView":287
19586  *
19587  * cdef generic = Enum("<strided and direct or indirect>")
19588  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
19589  * cdef indirect = Enum("<strided and indirect>")
19590  *
19591  */
19592  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 287, __pyx_L1_error)
19593  __Pyx_GOTREF(__pyx_tuple__30);
19594  __Pyx_GIVEREF(__pyx_tuple__30);
19595 
19596  /* "View.MemoryView":288
19597  * cdef generic = Enum("<strided and direct or indirect>")
19598  * cdef strided = Enum("<strided and direct>") # default
19599  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
19600  *
19601  *
19602  */
19603  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 288, __pyx_L1_error)
19604  __Pyx_GOTREF(__pyx_tuple__31);
19605  __Pyx_GIVEREF(__pyx_tuple__31);
19606 
19607  /* "View.MemoryView":291
19608  *
19609  *
19610  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
19611  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
19612  *
19613  */
19614  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 291, __pyx_L1_error)
19615  __Pyx_GOTREF(__pyx_tuple__32);
19616  __Pyx_GIVEREF(__pyx_tuple__32);
19617 
19618  /* "View.MemoryView":292
19619  *
19620  * cdef contiguous = Enum("<contiguous and direct>")
19621  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
19622  *
19623  *
19624  */
19625  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 292, __pyx_L1_error)
19626  __Pyx_GOTREF(__pyx_tuple__33);
19627  __Pyx_GIVEREF(__pyx_tuple__33);
19628 
19629  /* "(tree fragment)":1
19630  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
19631  * cdef object __pyx_PickleError
19632  * cdef object __pyx_result
19633  */
19634  __pyx_tuple__34 = 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__34)) __PYX_ERR(0, 1, __pyx_L1_error)
19635  __Pyx_GOTREF(__pyx_tuple__34);
19636  __Pyx_GIVEREF(__pyx_tuple__34);
19637  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 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_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 1, __pyx_L1_error)
19638  __Pyx_RefNannyFinishContext();
19639  return 0;
19640  __pyx_L1_error:;
19641  __Pyx_RefNannyFinishContext();
19642  return -1;
19643 }
19644 
19645 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
19646  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
19647  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error)
19648  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error)
19649  __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(1, 1, __pyx_L1_error)
19650  __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(1, 1, __pyx_L1_error)
19651  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(1, 1, __pyx_L1_error)
19652  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(1, 1, __pyx_L1_error)
19653  return 0;
19654  __pyx_L1_error:;
19655  return -1;
19656 }
19657 
19658 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
19659 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
19660 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
19661 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
19662 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
19663 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
19664 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
19665 
19666 static int __Pyx_modinit_global_init_code(void) {
19667  __Pyx_RefNannyDeclarations
19668  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
19669  /*--- Global init code ---*/
19670  generic = Py_None; Py_INCREF(Py_None);
19671  strided = Py_None; Py_INCREF(Py_None);
19672  indirect = Py_None; Py_INCREF(Py_None);
19673  contiguous = Py_None; Py_INCREF(Py_None);
19674  indirect_contiguous = Py_None; Py_INCREF(Py_None);
19675  __Pyx_RefNannyFinishContext();
19676  return 0;
19677 }
19678 
19679 static int __Pyx_modinit_variable_export_code(void) {
19680  __Pyx_RefNannyDeclarations
19681  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
19682  /*--- Variable export code ---*/
19683  __Pyx_RefNannyFinishContext();
19684  return 0;
19685 }
19686 
19687 static int __Pyx_modinit_function_export_code(void) {
19688  __Pyx_RefNannyDeclarations
19689  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
19690  /*--- Function export code ---*/
19691  __Pyx_RefNannyFinishContext();
19692  return 0;
19693 }
19694 
19695 static int __Pyx_modinit_type_init_code(void) {
19696  __Pyx_RefNannyDeclarations
19697  int __pyx_lineno = 0;
19698  const char *__pyx_filename = NULL;
19699  int __pyx_clineno = 0;
19700  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
19701  /*--- Type init code ---*/
19702  if (PyType_Ready(&__pyx_type_9csparsity_PySparsityInfo) < 0) __PYX_ERR(1, 6, __pyx_L1_error)
19703  #if PY_VERSION_HEX < 0x030800B1
19704  __pyx_type_9csparsity_PySparsityInfo.tp_print = 0;
19705  #endif
19706  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9csparsity_PySparsityInfo.tp_dictoffset && __pyx_type_9csparsity_PySparsityInfo.tp_getattro == PyObject_GenericGetAttr)) {
19707  __pyx_type_9csparsity_PySparsityInfo.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19708  }
19709  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PySparsityInfo, (PyObject *)&__pyx_type_9csparsity_PySparsityInfo) < 0) __PYX_ERR(1, 6, __pyx_L1_error)
19710  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9csparsity_PySparsityInfo) < 0) __PYX_ERR(1, 6, __pyx_L1_error)
19711  __pyx_ptype_9csparsity_PySparsityInfo = &__pyx_type_9csparsity_PySparsityInfo;
19712  __pyx_vtabptr_array = &__pyx_vtable_array;
19713  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
19714  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
19715  #if PY_VERSION_HEX < 0x030800B1
19716  __pyx_type___pyx_array.tp_print = 0;
19717  #endif
19718  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
19719  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
19720  __pyx_array_type = &__pyx_type___pyx_array;
19721  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
19722  #if PY_VERSION_HEX < 0x030800B1
19723  __pyx_type___pyx_MemviewEnum.tp_print = 0;
19724  #endif
19725  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
19726  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19727  }
19728  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
19729  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
19730  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
19731  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
19732  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
19733  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
19734  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
19735  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
19736  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
19737  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
19738  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
19739  #if PY_VERSION_HEX < 0x030800B1
19740  __pyx_type___pyx_memoryview.tp_print = 0;
19741  #endif
19742  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
19743  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19744  }
19745  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
19746  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
19747  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
19748  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
19749  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
19750  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
19751  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
19752  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
19753  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(0, 965, __pyx_L1_error)
19754  #if PY_VERSION_HEX < 0x030800B1
19755  __pyx_type___pyx_memoryviewslice.tp_print = 0;
19756  #endif
19757  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
19758  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
19759  }
19760  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(0, 965, __pyx_L1_error)
19761  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(0, 965, __pyx_L1_error)
19762  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
19763  __Pyx_RefNannyFinishContext();
19764  return 0;
19765  __pyx_L1_error:;
19766  __Pyx_RefNannyFinishContext();
19767  return -1;
19768 }
19769 
19770 static int __Pyx_modinit_type_import_code(void) {
19771  __Pyx_RefNannyDeclarations
19772  PyObject *__pyx_t_1 = NULL;
19773  int __pyx_lineno = 0;
19774  const char *__pyx_filename = NULL;
19775  int __pyx_clineno = 0;
19776  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
19777  /*--- Type import code ---*/
19778  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
19779  __Pyx_GOTREF(__pyx_t_1);
19780  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
19781  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19782  sizeof(PyTypeObject),
19783  #else
19784  sizeof(PyHeapTypeObject),
19785  #endif
19786  __Pyx_ImportType_CheckSize_Warn);
19787  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
19788  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19789  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
19790  __Pyx_GOTREF(__pyx_t_1);
19791  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
19792  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
19793  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
19794  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
19795  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
19796  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
19797  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
19798  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
19799  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
19800  if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
19801  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
19802  if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
19803  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
19804  if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
19805  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
19806  if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
19807  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
19808  if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
19809  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
19810  if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
19811  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
19812  if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
19813  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
19814  if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
19815  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
19816  if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
19817  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
19818  if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
19819  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
19820  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
19821  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19822  __Pyx_RefNannyFinishContext();
19823  return 0;
19824  __pyx_L1_error:;
19825  __Pyx_XDECREF(__pyx_t_1);
19826  __Pyx_RefNannyFinishContext();
19827  return -1;
19828 }
19829 
19830 static int __Pyx_modinit_variable_import_code(void) {
19831  __Pyx_RefNannyDeclarations
19832  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
19833  /*--- Variable import code ---*/
19834  __Pyx_RefNannyFinishContext();
19835  return 0;
19836 }
19837 
19838 static int __Pyx_modinit_function_import_code(void) {
19839  __Pyx_RefNannyDeclarations
19840  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
19841  /*--- Function import code ---*/
19842  __Pyx_RefNannyFinishContext();
19843  return 0;
19844 }
19845 
19846 
19847 #ifndef CYTHON_NO_PYINIT_EXPORT
19848 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
19849 #elif PY_MAJOR_VERSION < 3
19850 #ifdef __cplusplus
19851 #define __Pyx_PyMODINIT_FUNC extern "C" void
19852 #else
19853 #define __Pyx_PyMODINIT_FUNC void
19854 #endif
19855 #else
19856 #ifdef __cplusplus
19857 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
19858 #else
19859 #define __Pyx_PyMODINIT_FUNC PyObject *
19860 #endif
19861 #endif
19862 
19863 
19864 #if PY_MAJOR_VERSION < 3
19865 __Pyx_PyMODINIT_FUNC initcsparsity(void) CYTHON_SMALL_CODE; /*proto*/
19866 __Pyx_PyMODINIT_FUNC initcsparsity(void)
19867 #else
19868 __Pyx_PyMODINIT_FUNC PyInit_csparsity(void) CYTHON_SMALL_CODE; /*proto*/
19869 __Pyx_PyMODINIT_FUNC PyInit_csparsity(void)
19870 #if CYTHON_PEP489_MULTI_PHASE_INIT
19871 {
19872  return PyModuleDef_Init(&__pyx_moduledef);
19873 }
19874 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
19875  #if PY_VERSION_HEX >= 0x030700A1
19876  static PY_INT64_T main_interpreter_id = -1;
19877  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
19878  if (main_interpreter_id == -1) {
19879  main_interpreter_id = current_id;
19880  return (unlikely(current_id == -1)) ? -1 : 0;
19881  } else if (unlikely(main_interpreter_id != current_id))
19882  #else
19883  static PyInterpreterState *main_interpreter = NULL;
19884  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
19885  if (!main_interpreter) {
19886  main_interpreter = current_interpreter;
19887  } else if (unlikely(main_interpreter != current_interpreter))
19888  #endif
19889  {
19890  PyErr_SetString(
19891  PyExc_ImportError,
19892  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
19893  return -1;
19894  }
19895  return 0;
19896 }
19897 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) {
19898  PyObject *value = PyObject_GetAttrString(spec, from_name);
19899  int result = 0;
19900  if (likely(value)) {
19901  if (allow_none || value != Py_None) {
19902  result = PyDict_SetItemString(moddict, to_name, value);
19903  }
19904  Py_DECREF(value);
19905  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
19906  PyErr_Clear();
19907  } else {
19908  result = -1;
19909  }
19910  return result;
19911 }
19912 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
19913  PyObject *module = NULL, *moddict, *modname;
19914  if (__Pyx_check_single_interpreter())
19915  return NULL;
19916  if (__pyx_m)
19917  return __Pyx_NewRef(__pyx_m);
19918  modname = PyObject_GetAttrString(spec, "name");
19919  if (unlikely(!modname)) goto bad;
19920  module = PyModule_NewObject(modname);
19921  Py_DECREF(modname);
19922  if (unlikely(!module)) goto bad;
19923  moddict = PyModule_GetDict(module);
19924  if (unlikely(!moddict)) goto bad;
19925  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
19926  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
19927  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
19928  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
19929  return module;
19930 bad:
19931  Py_XDECREF(module);
19932  return NULL;
19933 }
19934 
19935 
19936 static CYTHON_SMALL_CODE int __pyx_pymod_exec_csparsity(PyObject *__pyx_pyinit_module)
19937 #endif
19938 #endif
19939 {
19940  PyObject *__pyx_t_1 = NULL;
19941  static PyThread_type_lock __pyx_t_2[8];
19942  int __pyx_lineno = 0;
19943  const char *__pyx_filename = NULL;
19944  int __pyx_clineno = 0;
19945  __Pyx_RefNannyDeclarations
19946  #if CYTHON_PEP489_MULTI_PHASE_INIT
19947  if (__pyx_m) {
19948  if (__pyx_m == __pyx_pyinit_module) return 0;
19949  PyErr_SetString(PyExc_RuntimeError, "Module 'csparsity' has already been imported. Re-initialisation is not supported.");
19950  return -1;
19951  }
19952  #elif PY_MAJOR_VERSION >= 3
19953  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
19954  #endif
19955  #if CYTHON_REFNANNY
19956 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
19957 if (!__Pyx_RefNanny) {
19958  PyErr_Clear();
19959  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
19960  if (!__Pyx_RefNanny)
19961  Py_FatalError("failed to import 'refnanny' module");
19962 }
19963 #endif
19964  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_csparsity(void)", 0);
19965  if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
19966  #ifdef __Pxy_PyFrame_Initialize_Offsets
19967  __Pxy_PyFrame_Initialize_Offsets();
19968  #endif
19969  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
19970  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
19971  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
19972  #ifdef __Pyx_CyFunction_USED
19973  if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
19974  #endif
19975  #ifdef __Pyx_FusedFunction_USED
19976  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
19977  #endif
19978  #ifdef __Pyx_Coroutine_USED
19979  if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
19980  #endif
19981  #ifdef __Pyx_Generator_USED
19982  if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
19983  #endif
19984  #ifdef __Pyx_AsyncGen_USED
19985  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
19986  #endif
19987  #ifdef __Pyx_StopAsyncIteration_USED
19988  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
19989  #endif
19990  /*--- Library function declarations ---*/
19991  /*--- Threads initialization code ---*/
19992  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
19993  PyEval_InitThreads();
19994  #endif
19995  /*--- Module creation code ---*/
19996  #if CYTHON_PEP489_MULTI_PHASE_INIT
19997  __pyx_m = __pyx_pyinit_module;
19998  Py_INCREF(__pyx_m);
19999  #else
20000  #if PY_MAJOR_VERSION < 3
20001  __pyx_m = Py_InitModule4("csparsity", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
20002  #else
20003  __pyx_m = PyModule_Create(&__pyx_moduledef);
20004  #endif
20005  if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
20006  #endif
20007  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
20008  Py_INCREF(__pyx_d);
20009  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
20010  Py_INCREF(__pyx_b);
20011  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
20012  Py_INCREF(__pyx_cython_runtime);
20013  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
20014  /*--- Initialize various global constants etc. ---*/
20015  if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20016  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
20017  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20018  #endif
20019  if (__pyx_module_is_main_csparsity) {
20020  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20021  }
20022  #if PY_MAJOR_VERSION >= 3
20023  {
20024  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
20025  if (!PyDict_GetItemString(modules, "csparsity")) {
20026  if (unlikely(PyDict_SetItemString(modules, "csparsity", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
20027  }
20028  }
20029  #endif
20030  /*--- Builtin init code ---*/
20031  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20032  /*--- Constants init code ---*/
20033  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20034  /*--- Global type/function init code ---*/
20035  (void)__Pyx_modinit_global_init_code();
20036  (void)__Pyx_modinit_variable_export_code();
20037  (void)__Pyx_modinit_function_export_code();
20038  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
20039  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
20040  (void)__Pyx_modinit_variable_import_code();
20041  (void)__Pyx_modinit_function_import_code();
20042  /*--- Execution code ---*/
20043  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
20044  if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20045  #endif
20046 
20047  /* "csparsity.pyx":2
20048  * # A type of -*- python -*- file
20049  * import numpy as np # <<<<<<<<<<<<<<
20050  * cimport numpy as np
20051  * from csparsity cimport SparsityInfo
20052  */
20053  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
20054  __Pyx_GOTREF(__pyx_t_1);
20055  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
20056  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20057 
20058  /* "csparsity.pyx":1
20059  * # A type of -*- python -*- file # <<<<<<<<<<<<<<
20060  * import numpy as np
20061  * cimport numpy as np
20062  */
20063  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
20064  __Pyx_GOTREF(__pyx_t_1);
20065  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
20066  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20067 
20068  /* "View.MemoryView":209
20069  * info.obj = self
20070  *
20071  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
20072  *
20073  * def __dealloc__(array self):
20074  */
20075  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
20076  __Pyx_GOTREF(__pyx_t_1);
20077  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
20078  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20079  PyType_Modified(__pyx_array_type);
20080 
20081  /* "View.MemoryView":286
20082  * return self.name
20083  *
20084  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
20085  * cdef strided = Enum("<strided and direct>") # default
20086  * cdef indirect = Enum("<strided and indirect>")
20087  */
20088  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
20089  __Pyx_GOTREF(__pyx_t_1);
20090  __Pyx_XGOTREF(generic);
20091  __Pyx_DECREF_SET(generic, __pyx_t_1);
20092  __Pyx_GIVEREF(__pyx_t_1);
20093  __pyx_t_1 = 0;
20094 
20095  /* "View.MemoryView":287
20096  *
20097  * cdef generic = Enum("<strided and direct or indirect>")
20098  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
20099  * cdef indirect = Enum("<strided and indirect>")
20100  *
20101  */
20102  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
20103  __Pyx_GOTREF(__pyx_t_1);
20104  __Pyx_XGOTREF(strided);
20105  __Pyx_DECREF_SET(strided, __pyx_t_1);
20106  __Pyx_GIVEREF(__pyx_t_1);
20107  __pyx_t_1 = 0;
20108 
20109  /* "View.MemoryView":288
20110  * cdef generic = Enum("<strided and direct or indirect>")
20111  * cdef strided = Enum("<strided and direct>") # default
20112  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
20113  *
20114  *
20115  */
20116  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
20117  __Pyx_GOTREF(__pyx_t_1);
20118  __Pyx_XGOTREF(indirect);
20119  __Pyx_DECREF_SET(indirect, __pyx_t_1);
20120  __Pyx_GIVEREF(__pyx_t_1);
20121  __pyx_t_1 = 0;
20122 
20123  /* "View.MemoryView":291
20124  *
20125  *
20126  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
20127  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
20128  *
20129  */
20130  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
20131  __Pyx_GOTREF(__pyx_t_1);
20132  __Pyx_XGOTREF(contiguous);
20133  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
20134  __Pyx_GIVEREF(__pyx_t_1);
20135  __pyx_t_1 = 0;
20136 
20137  /* "View.MemoryView":292
20138  *
20139  * cdef contiguous = Enum("<contiguous and direct>")
20140  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
20141  *
20142  *
20143  */
20144  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
20145  __Pyx_GOTREF(__pyx_t_1);
20146  __Pyx_XGOTREF(indirect_contiguous);
20147  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
20148  __Pyx_GIVEREF(__pyx_t_1);
20149  __pyx_t_1 = 0;
20150 
20151  /* "View.MemoryView":316
20152  *
20153  * DEF THREAD_LOCKS_PREALLOCATED = 8
20154  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
20155  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
20156  * PyThread_allocate_lock(),
20157  */
20158  __pyx_memoryview_thread_locks_used = 0;
20159 
20160  /* "View.MemoryView":317
20161  * DEF THREAD_LOCKS_PREALLOCATED = 8
20162  * cdef int __pyx_memoryview_thread_locks_used = 0
20163  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
20164  * PyThread_allocate_lock(),
20165  * PyThread_allocate_lock(),
20166  */
20167  __pyx_t_2[0] = PyThread_allocate_lock();
20168  __pyx_t_2[1] = PyThread_allocate_lock();
20169  __pyx_t_2[2] = PyThread_allocate_lock();
20170  __pyx_t_2[3] = PyThread_allocate_lock();
20171  __pyx_t_2[4] = PyThread_allocate_lock();
20172  __pyx_t_2[5] = PyThread_allocate_lock();
20173  __pyx_t_2[6] = PyThread_allocate_lock();
20174  __pyx_t_2[7] = PyThread_allocate_lock();
20175  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
20176 
20177  /* "View.MemoryView":549
20178  * info.obj = self
20179  *
20180  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
20181  *
20182  *
20183  */
20184  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
20185  __Pyx_GOTREF(__pyx_t_1);
20186  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
20187  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20188  PyType_Modified(__pyx_memoryview_type);
20189 
20190  /* "View.MemoryView":995
20191  * return self.from_object
20192  *
20193  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
20194  *
20195  *
20196  */
20197  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error)
20198  __Pyx_GOTREF(__pyx_t_1);
20199  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 995, __pyx_L1_error)
20200  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20201  PyType_Modified(__pyx_memoryviewslice_type);
20202 
20203  /* "(tree fragment)":1
20204  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20205  * cdef object __pyx_PickleError
20206  * cdef object __pyx_result
20207  */
20208  __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(0, 1, __pyx_L1_error)
20209  __Pyx_GOTREF(__pyx_t_1);
20210  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20211  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20212 
20213  /* "BufferFormatFromTypeInfo":1463
20214  *
20215  * @cname('__pyx_format_from_typeinfo')
20216  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
20217  * cdef __Pyx_StructField *field
20218  * cdef __pyx_typeinfo_string fmt
20219  */
20220 
20221  /*--- Wrapped vars code ---*/
20222 
20223  goto __pyx_L0;
20224  __pyx_L1_error:;
20225  __Pyx_XDECREF(__pyx_t_1);
20226  if (__pyx_m) {
20227  if (__pyx_d) {
20228  __Pyx_AddTraceback("init csparsity", __pyx_clineno, __pyx_lineno, __pyx_filename);
20229  }
20230  Py_CLEAR(__pyx_m);
20231  } else if (!PyErr_Occurred()) {
20232  PyErr_SetString(PyExc_ImportError, "init csparsity");
20233  }
20234  __pyx_L0:;
20235  __Pyx_RefNannyFinishContext();
20236  #if CYTHON_PEP489_MULTI_PHASE_INIT
20237  return (__pyx_m != NULL) ? 0 : -1;
20238  #elif PY_MAJOR_VERSION >= 3
20239  return __pyx_m;
20240  #else
20241  return;
20242  #endif
20243 }
20244 
20245 /* --- Runtime support code --- */
20246 /* Refnanny */
20247 #if CYTHON_REFNANNY
20248 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
20249  PyObject *m = NULL, *p = NULL;
20250  void *r = NULL;
20251  m = PyImport_ImportModule(modname);
20252  if (!m) goto end;
20253  p = PyObject_GetAttrString(m, "RefNannyAPI");
20254  if (!p) goto end;
20255  r = PyLong_AsVoidPtr(p);
20256 end:
20257  Py_XDECREF(p);
20258  Py_XDECREF(m);
20259  return (__Pyx_RefNannyAPIStruct *)r;
20260 }
20261 #endif
20262 
20263 /* PyObjectGetAttrStr */
20264 #if CYTHON_USE_TYPE_SLOTS
20265 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
20266  PyTypeObject* tp = Py_TYPE(obj);
20267  if (likely(tp->tp_getattro))
20268  return tp->tp_getattro(obj, attr_name);
20269 #if PY_MAJOR_VERSION < 3
20270  if (likely(tp->tp_getattr))
20271  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
20272 #endif
20273  return PyObject_GetAttr(obj, attr_name);
20274 }
20275 #endif
20276 
20277 /* GetBuiltinName */
20278 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
20279  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
20280  if (unlikely(!result)) {
20281  PyErr_Format(PyExc_NameError,
20282 #if PY_MAJOR_VERSION >= 3
20283  "name '%U' is not defined", name);
20284 #else
20285  "name '%.200s' is not defined", PyString_AS_STRING(name));
20286 #endif
20287  }
20288  return result;
20289 }
20290 
20291 /* RaiseArgTupleInvalid */
20292 static void __Pyx_RaiseArgtupleInvalid(
20293  const char* func_name,
20294  int exact,
20295  Py_ssize_t num_min,
20296  Py_ssize_t num_max,
20297  Py_ssize_t num_found)
20298 {
20299  Py_ssize_t num_expected;
20300  const char *more_or_less;
20301  if (num_found < num_min) {
20302  num_expected = num_min;
20303  more_or_less = "at least";
20304  } else {
20305  num_expected = num_max;
20306  more_or_less = "at most";
20307  }
20308  if (exact) {
20309  more_or_less = "exactly";
20310  }
20311  PyErr_Format(PyExc_TypeError,
20312  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
20313  func_name, more_or_less, num_expected,
20314  (num_expected == 1) ? "" : "s", num_found);
20315 }
20316 
20317 /* KeywordStringCheck */
20318 static int __Pyx_CheckKeywordStrings(
20319  PyObject *kwdict,
20320  const char* function_name,
20321  int kw_allowed)
20322 {
20323  PyObject* key = 0;
20324  Py_ssize_t pos = 0;
20325 #if CYTHON_COMPILING_IN_PYPY
20326  if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
20327  goto invalid_keyword;
20328  return 1;
20329 #else
20330  while (PyDict_Next(kwdict, &pos, &key, 0)) {
20331  #if PY_MAJOR_VERSION < 3
20332  if (unlikely(!PyString_Check(key)))
20333  #endif
20334  if (unlikely(!PyUnicode_Check(key)))
20335  goto invalid_keyword_type;
20336  }
20337  if ((!kw_allowed) && unlikely(key))
20338  goto invalid_keyword;
20339  return 1;
20340 invalid_keyword_type:
20341  PyErr_Format(PyExc_TypeError,
20342  "%.200s() keywords must be strings", function_name);
20343  return 0;
20344 #endif
20345 invalid_keyword:
20346  PyErr_Format(PyExc_TypeError,
20347  #if PY_MAJOR_VERSION < 3
20348  "%.200s() got an unexpected keyword argument '%.200s'",
20349  function_name, PyString_AsString(key));
20350  #else
20351  "%s() got an unexpected keyword argument '%U'",
20352  function_name, key);
20353  #endif
20354  return 0;
20355 }
20356 
20357 /* RaiseDoubleKeywords */
20358 static void __Pyx_RaiseDoubleKeywordsError(
20359  const char* func_name,
20360  PyObject* kw_name)
20361 {
20362  PyErr_Format(PyExc_TypeError,
20363  #if PY_MAJOR_VERSION >= 3
20364  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
20365  #else
20366  "%s() got multiple values for keyword argument '%s'", func_name,
20367  PyString_AsString(kw_name));
20368  #endif
20369 }
20370 
20371 /* ParseKeywords */
20372 static int __Pyx_ParseOptionalKeywords(
20373  PyObject *kwds,
20374  PyObject **argnames[],
20375  PyObject *kwds2,
20376  PyObject *values[],
20377  Py_ssize_t num_pos_args,
20378  const char* function_name)
20379 {
20380  PyObject *key = 0, *value = 0;
20381  Py_ssize_t pos = 0;
20382  PyObject*** name;
20383  PyObject*** first_kw_arg = argnames + num_pos_args;
20384  while (PyDict_Next(kwds, &pos, &key, &value)) {
20385  name = first_kw_arg;
20386  while (*name && (**name != key)) name++;
20387  if (*name) {
20388  values[name-argnames] = value;
20389  continue;
20390  }
20391  name = first_kw_arg;
20392  #if PY_MAJOR_VERSION < 3
20393  if (likely(PyString_Check(key))) {
20394  while (*name) {
20395  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
20396  && _PyString_Eq(**name, key)) {
20397  values[name-argnames] = value;
20398  break;
20399  }
20400  name++;
20401  }
20402  if (*name) continue;
20403  else {
20404  PyObject*** argname = argnames;
20405  while (argname != first_kw_arg) {
20406  if ((**argname == key) || (
20407  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
20408  && _PyString_Eq(**argname, key))) {
20409  goto arg_passed_twice;
20410  }
20411  argname++;
20412  }
20413  }
20414  } else
20415  #endif
20416  if (likely(PyUnicode_Check(key))) {
20417  while (*name) {
20418  int cmp = (**name == key) ? 0 :
20419  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
20420  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
20421  #endif
20422  PyUnicode_Compare(**name, key);
20423  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
20424  if (cmp == 0) {
20425  values[name-argnames] = value;
20426  break;
20427  }
20428  name++;
20429  }
20430  if (*name) continue;
20431  else {
20432  PyObject*** argname = argnames;
20433  while (argname != first_kw_arg) {
20434  int cmp = (**argname == key) ? 0 :
20435  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
20436  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
20437  #endif
20438  PyUnicode_Compare(**argname, key);
20439  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
20440  if (cmp == 0) goto arg_passed_twice;
20441  argname++;
20442  }
20443  }
20444  } else
20445  goto invalid_keyword_type;
20446  if (kwds2) {
20447  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
20448  } else {
20449  goto invalid_keyword;
20450  }
20451  }
20452  return 0;
20453 arg_passed_twice:
20454  __Pyx_RaiseDoubleKeywordsError(function_name, key);
20455  goto bad;
20456 invalid_keyword_type:
20457  PyErr_Format(PyExc_TypeError,
20458  "%.200s() keywords must be strings", function_name);
20459  goto bad;
20460 invalid_keyword:
20461  PyErr_Format(PyExc_TypeError,
20462  #if PY_MAJOR_VERSION < 3
20463  "%.200s() got an unexpected keyword argument '%.200s'",
20464  function_name, PyString_AsString(key));
20465  #else
20466  "%s() got an unexpected keyword argument '%U'",
20467  function_name, key);
20468  #endif
20469 bad:
20470  return -1;
20471 }
20472 
20473 /* ArgTypeTest */
20474 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
20475 {
20476  if (unlikely(!type)) {
20477  PyErr_SetString(PyExc_SystemError, "Missing type object");
20478  return 0;
20479  }
20480  else if (exact) {
20481  #if PY_MAJOR_VERSION == 2
20482  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
20483  #endif
20484  }
20485  else {
20486  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
20487  }
20488  PyErr_Format(PyExc_TypeError,
20489  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
20490  name, type->tp_name, Py_TYPE(obj)->tp_name);
20491  return 0;
20492 }
20493 
20494 /* PyDictVersioning */
20495 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
20496 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
20497  PyObject *dict = Py_TYPE(obj)->tp_dict;
20498  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
20499 }
20500 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
20501  PyObject **dictptr = NULL;
20502  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
20503  if (offset) {
20504 #if CYTHON_COMPILING_IN_CPYTHON
20505  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
20506 #else
20507  dictptr = _PyObject_GetDictPtr(obj);
20508 #endif
20509  }
20510  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
20511 }
20512 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
20513  PyObject *dict = Py_TYPE(obj)->tp_dict;
20514  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
20515  return 0;
20516  return obj_dict_version == __Pyx_get_object_dict_version(obj);
20517 }
20518 #endif
20519 
20520 /* GetModuleGlobalName */
20521 #if CYTHON_USE_DICT_VERSIONS
20522 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
20523 #else
20524 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
20525 #endif
20526 {
20527  PyObject *result;
20528 #if !CYTHON_AVOID_BORROWED_REFS
20529 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
20530  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
20531  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
20532  if (likely(result)) {
20533  return __Pyx_NewRef(result);
20534  } else if (unlikely(PyErr_Occurred())) {
20535  return NULL;
20536  }
20537 #else
20538  result = PyDict_GetItem(__pyx_d, name);
20539  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
20540  if (likely(result)) {
20541  return __Pyx_NewRef(result);
20542  }
20543 #endif
20544 #else
20545  result = PyObject_GetItem(__pyx_d, name);
20546  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
20547  if (likely(result)) {
20548  return __Pyx_NewRef(result);
20549  }
20550  PyErr_Clear();
20551 #endif
20552  return __Pyx_GetBuiltinName(name);
20553 }
20554 
20555 /* PyCFunctionFastCall */
20556 #if CYTHON_FAST_PYCCALL
20557 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
20558  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
20559  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
20560  PyObject *self = PyCFunction_GET_SELF(func);
20561  int flags = PyCFunction_GET_FLAGS(func);
20562  assert(PyCFunction_Check(func));
20563  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
20564  assert(nargs >= 0);
20565  assert(nargs == 0 || args != NULL);
20566  /* _PyCFunction_FastCallDict() must not be called with an exception set,
20567  because it may clear it (directly or indirectly) and so the
20568  caller loses its exception */
20569  assert(!PyErr_Occurred());
20570  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
20571  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
20572  } else {
20573  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
20574  }
20575 }
20576 #endif
20577 
20578 /* PyFunctionFastCall */
20579 #if CYTHON_FAST_PYCALL
20580 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
20581  PyObject *globals) {
20582  PyFrameObject *f;
20583  PyThreadState *tstate = __Pyx_PyThreadState_Current;
20584  PyObject **fastlocals;
20585  Py_ssize_t i;
20586  PyObject *result;
20587  assert(globals != NULL);
20588  /* XXX Perhaps we should create a specialized
20589  PyFrame_New() that doesn't take locals, but does
20590  take builtins without sanity checking them.
20591  */
20592  assert(tstate != NULL);
20593  f = PyFrame_New(tstate, co, globals, NULL);
20594  if (f == NULL) {
20595  return NULL;
20596  }
20597  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
20598  for (i = 0; i < na; i++) {
20599  Py_INCREF(*args);
20600  fastlocals[i] = *args++;
20601  }
20602  result = PyEval_EvalFrameEx(f,0);
20603  ++tstate->recursion_depth;
20604  Py_DECREF(f);
20605  --tstate->recursion_depth;
20606  return result;
20607 }
20608 #if 1 || PY_VERSION_HEX < 0x030600B1
20609 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
20610  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
20611  PyObject *globals = PyFunction_GET_GLOBALS(func);
20612  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
20613  PyObject *closure;
20614 #if PY_MAJOR_VERSION >= 3
20615  PyObject *kwdefs;
20616 #endif
20617  PyObject *kwtuple, **k;
20618  PyObject **d;
20619  Py_ssize_t nd;
20620  Py_ssize_t nk;
20621  PyObject *result;
20622  assert(kwargs == NULL || PyDict_Check(kwargs));
20623  nk = kwargs ? PyDict_Size(kwargs) : 0;
20624  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
20625  return NULL;
20626  }
20627  if (
20628 #if PY_MAJOR_VERSION >= 3
20629  co->co_kwonlyargcount == 0 &&
20630 #endif
20631  likely(kwargs == NULL || nk == 0) &&
20632  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
20633  if (argdefs == NULL && co->co_argcount == nargs) {
20634  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
20635  goto done;
20636  }
20637  else if (nargs == 0 && argdefs != NULL
20638  && co->co_argcount == Py_SIZE(argdefs)) {
20639  /* function called with no arguments, but all parameters have
20640  a default value: use default values as arguments .*/
20641  args = &PyTuple_GET_ITEM(argdefs, 0);
20642  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
20643  goto done;
20644  }
20645  }
20646  if (kwargs != NULL) {
20647  Py_ssize_t pos, i;
20648  kwtuple = PyTuple_New(2 * nk);
20649  if (kwtuple == NULL) {
20650  result = NULL;
20651  goto done;
20652  }
20653  k = &PyTuple_GET_ITEM(kwtuple, 0);
20654  pos = i = 0;
20655  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
20656  Py_INCREF(k[i]);
20657  Py_INCREF(k[i+1]);
20658  i += 2;
20659  }
20660  nk = i / 2;
20661  }
20662  else {
20663  kwtuple = NULL;
20664  k = NULL;
20665  }
20666  closure = PyFunction_GET_CLOSURE(func);
20667 #if PY_MAJOR_VERSION >= 3
20668  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
20669 #endif
20670  if (argdefs != NULL) {
20671  d = &PyTuple_GET_ITEM(argdefs, 0);
20672  nd = Py_SIZE(argdefs);
20673  }
20674  else {
20675  d = NULL;
20676  nd = 0;
20677  }
20678 #if PY_MAJOR_VERSION >= 3
20679  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
20680  args, (int)nargs,
20681  k, (int)nk,
20682  d, (int)nd, kwdefs, closure);
20683 #else
20684  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
20685  args, (int)nargs,
20686  k, (int)nk,
20687  d, (int)nd, closure);
20688 #endif
20689  Py_XDECREF(kwtuple);
20690 done:
20691  Py_LeaveRecursiveCall();
20692  return result;
20693 }
20694 #endif
20695 #endif
20696 
20697 /* PyObjectCall */
20698 #if CYTHON_COMPILING_IN_CPYTHON
20699 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
20700  PyObject *result;
20701  ternaryfunc call = Py_TYPE(func)->tp_call;
20702  if (unlikely(!call))
20703  return PyObject_Call(func, arg, kw);
20704  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
20705  return NULL;
20706  result = (*call)(func, arg, kw);
20707  Py_LeaveRecursiveCall();
20708  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
20709  PyErr_SetString(
20710  PyExc_SystemError,
20711  "NULL result without error in PyObject_Call");
20712  }
20713  return result;
20714 }
20715 #endif
20716 
20717 /* PyObjectCall2Args */
20718 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
20719  PyObject *args, *result = NULL;
20720  #if CYTHON_FAST_PYCALL
20721  if (PyFunction_Check(function)) {
20722  PyObject *args[2] = {arg1, arg2};
20723  return __Pyx_PyFunction_FastCall(function, args, 2);
20724  }
20725  #endif
20726  #if CYTHON_FAST_PYCCALL
20727  if (__Pyx_PyFastCFunction_Check(function)) {
20728  PyObject *args[2] = {arg1, arg2};
20729  return __Pyx_PyCFunction_FastCall(function, args, 2);
20730  }
20731  #endif
20732  args = PyTuple_New(2);
20733  if (unlikely(!args)) goto done;
20734  Py_INCREF(arg1);
20735  PyTuple_SET_ITEM(args, 0, arg1);
20736  Py_INCREF(arg2);
20737  PyTuple_SET_ITEM(args, 1, arg2);
20738  Py_INCREF(function);
20739  result = __Pyx_PyObject_Call(function, args, NULL);
20740  Py_DECREF(args);
20741  Py_DECREF(function);
20742 done:
20743  return result;
20744 }
20745 
20746 /* PyObjectCallMethO */
20747 #if CYTHON_COMPILING_IN_CPYTHON
20748 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
20749  PyObject *self, *result;
20750  PyCFunction cfunc;
20751  cfunc = PyCFunction_GET_FUNCTION(func);
20752  self = PyCFunction_GET_SELF(func);
20753  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
20754  return NULL;
20755  result = cfunc(self, arg);
20756  Py_LeaveRecursiveCall();
20757  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
20758  PyErr_SetString(
20759  PyExc_SystemError,
20760  "NULL result without error in PyObject_Call");
20761  }
20762  return result;
20763 }
20764 #endif
20765 
20766 /* PyObjectCallOneArg */
20767 #if CYTHON_COMPILING_IN_CPYTHON
20768 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
20769  PyObject *result;
20770  PyObject *args = PyTuple_New(1);
20771  if (unlikely(!args)) return NULL;
20772  Py_INCREF(arg);
20773  PyTuple_SET_ITEM(args, 0, arg);
20774  result = __Pyx_PyObject_Call(func, args, NULL);
20775  Py_DECREF(args);
20776  return result;
20777 }
20778 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
20779 #if CYTHON_FAST_PYCALL
20780  if (PyFunction_Check(func)) {
20781  return __Pyx_PyFunction_FastCall(func, &arg, 1);
20782  }
20783 #endif
20784  if (likely(PyCFunction_Check(func))) {
20785  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
20786  return __Pyx_PyObject_CallMethO(func, arg);
20787 #if CYTHON_FAST_PYCCALL
20788  } else if (__Pyx_PyFastCFunction_Check(func)) {
20789  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
20790 #endif
20791  }
20792  }
20793  return __Pyx__PyObject_CallOneArg(func, arg);
20794 }
20795 #else
20796 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
20797  PyObject *result;
20798  PyObject *args = PyTuple_Pack(1, arg);
20799  if (unlikely(!args)) return NULL;
20800  result = __Pyx_PyObject_Call(func, args, NULL);
20801  Py_DECREF(args);
20802  return result;
20803 }
20804 #endif
20805 
20806 /* PyErrFetchRestore */
20807 #if CYTHON_FAST_THREAD_STATE
20808 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
20809  PyObject *tmp_type, *tmp_value, *tmp_tb;
20810  tmp_type = tstate->curexc_type;
20811  tmp_value = tstate->curexc_value;
20812  tmp_tb = tstate->curexc_traceback;
20813  tstate->curexc_type = type;
20814  tstate->curexc_value = value;
20815  tstate->curexc_traceback = tb;
20816  Py_XDECREF(tmp_type);
20817  Py_XDECREF(tmp_value);
20818  Py_XDECREF(tmp_tb);
20819 }
20820 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
20821  *type = tstate->curexc_type;
20822  *value = tstate->curexc_value;
20823  *tb = tstate->curexc_traceback;
20824  tstate->curexc_type = 0;
20825  tstate->curexc_value = 0;
20826  tstate->curexc_traceback = 0;
20827 }
20828 #endif
20829 
20830 /* RaiseException */
20831 #if PY_MAJOR_VERSION < 3
20832 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
20833  CYTHON_UNUSED PyObject *cause) {
20834  __Pyx_PyThreadState_declare
20835  Py_XINCREF(type);
20836  if (!value || value == Py_None)
20837  value = NULL;
20838  else
20839  Py_INCREF(value);
20840  if (!tb || tb == Py_None)
20841  tb = NULL;
20842  else {
20843  Py_INCREF(tb);
20844  if (!PyTraceBack_Check(tb)) {
20845  PyErr_SetString(PyExc_TypeError,
20846  "raise: arg 3 must be a traceback or None");
20847  goto raise_error;
20848  }
20849  }
20850  if (PyType_Check(type)) {
20851 #if CYTHON_COMPILING_IN_PYPY
20852  if (!value) {
20853  Py_INCREF(Py_None);
20854  value = Py_None;
20855  }
20856 #endif
20857  PyErr_NormalizeException(&type, &value, &tb);
20858  } else {
20859  if (value) {
20860  PyErr_SetString(PyExc_TypeError,
20861  "instance exception may not have a separate value");
20862  goto raise_error;
20863  }
20864  value = type;
20865  type = (PyObject*) Py_TYPE(type);
20866  Py_INCREF(type);
20867  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
20868  PyErr_SetString(PyExc_TypeError,
20869  "raise: exception class must be a subclass of BaseException");
20870  goto raise_error;
20871  }
20872  }
20873  __Pyx_PyThreadState_assign
20874  __Pyx_ErrRestore(type, value, tb);
20875  return;
20876 raise_error:
20877  Py_XDECREF(value);
20878  Py_XDECREF(type);
20879  Py_XDECREF(tb);
20880  return;
20881 }
20882 #else
20883 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
20884  PyObject* owned_instance = NULL;
20885  if (tb == Py_None) {
20886  tb = 0;
20887  } else if (tb && !PyTraceBack_Check(tb)) {
20888  PyErr_SetString(PyExc_TypeError,
20889  "raise: arg 3 must be a traceback or None");
20890  goto bad;
20891  }
20892  if (value == Py_None)
20893  value = 0;
20894  if (PyExceptionInstance_Check(type)) {
20895  if (value) {
20896  PyErr_SetString(PyExc_TypeError,
20897  "instance exception may not have a separate value");
20898  goto bad;
20899  }
20900  value = type;
20901  type = (PyObject*) Py_TYPE(value);
20902  } else if (PyExceptionClass_Check(type)) {
20903  PyObject *instance_class = NULL;
20904  if (value && PyExceptionInstance_Check(value)) {
20905  instance_class = (PyObject*) Py_TYPE(value);
20906  if (instance_class != type) {
20907  int is_subclass = PyObject_IsSubclass(instance_class, type);
20908  if (!is_subclass) {
20909  instance_class = NULL;
20910  } else if (unlikely(is_subclass == -1)) {
20911  goto bad;
20912  } else {
20913  type = instance_class;
20914  }
20915  }
20916  }
20917  if (!instance_class) {
20918  PyObject *args;
20919  if (!value)
20920  args = PyTuple_New(0);
20921  else if (PyTuple_Check(value)) {
20922  Py_INCREF(value);
20923  args = value;
20924  } else
20925  args = PyTuple_Pack(1, value);
20926  if (!args)
20927  goto bad;
20928  owned_instance = PyObject_Call(type, args, NULL);
20929  Py_DECREF(args);
20930  if (!owned_instance)
20931  goto bad;
20932  value = owned_instance;
20933  if (!PyExceptionInstance_Check(value)) {
20934  PyErr_Format(PyExc_TypeError,
20935  "calling %R should have returned an instance of "
20936  "BaseException, not %R",
20937  type, Py_TYPE(value));
20938  goto bad;
20939  }
20940  }
20941  } else {
20942  PyErr_SetString(PyExc_TypeError,
20943  "raise: exception class must be a subclass of BaseException");
20944  goto bad;
20945  }
20946  if (cause) {
20947  PyObject *fixed_cause;
20948  if (cause == Py_None) {
20949  fixed_cause = NULL;
20950  } else if (PyExceptionClass_Check(cause)) {
20951  fixed_cause = PyObject_CallObject(cause, NULL);
20952  if (fixed_cause == NULL)
20953  goto bad;
20954  } else if (PyExceptionInstance_Check(cause)) {
20955  fixed_cause = cause;
20956  Py_INCREF(fixed_cause);
20957  } else {
20958  PyErr_SetString(PyExc_TypeError,
20959  "exception causes must derive from "
20960  "BaseException");
20961  goto bad;
20962  }
20963  PyException_SetCause(value, fixed_cause);
20964  }
20965  PyErr_SetObject(type, value);
20966  if (tb) {
20967 #if CYTHON_COMPILING_IN_PYPY
20968  PyObject *tmp_type, *tmp_value, *tmp_tb;
20969  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
20970  Py_INCREF(tb);
20971  PyErr_Restore(tmp_type, tmp_value, tb);
20972  Py_XDECREF(tmp_tb);
20973 #else
20974  PyThreadState *tstate = __Pyx_PyThreadState_Current;
20975  PyObject* tmp_tb = tstate->curexc_traceback;
20976  if (tb != tmp_tb) {
20977  Py_INCREF(tb);
20978  tstate->curexc_traceback = tb;
20979  Py_XDECREF(tmp_tb);
20980  }
20981 #endif
20982  }
20983 bad:
20984  Py_XDECREF(owned_instance);
20985  return;
20986 }
20987 #endif
20988 
20989 /* GetTopmostException */
20990 #if CYTHON_USE_EXC_INFO_STACK
20991 static _PyErr_StackItem *
20992 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
20993 {
20994  _PyErr_StackItem *exc_info = tstate->exc_info;
20995  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
20996  exc_info->previous_item != NULL)
20997  {
20998  exc_info = exc_info->previous_item;
20999  }
21000  return exc_info;
21001 }
21002 #endif
21003 
21004 /* SaveResetException */
21005 #if CYTHON_FAST_THREAD_STATE
21006 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21007  #if CYTHON_USE_EXC_INFO_STACK
21008  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
21009  *type = exc_info->exc_type;
21010  *value = exc_info->exc_value;
21011  *tb = exc_info->exc_traceback;
21012  #else
21013  *type = tstate->exc_type;
21014  *value = tstate->exc_value;
21015  *tb = tstate->exc_traceback;
21016  #endif
21017  Py_XINCREF(*type);
21018  Py_XINCREF(*value);
21019  Py_XINCREF(*tb);
21020 }
21021 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21022  PyObject *tmp_type, *tmp_value, *tmp_tb;
21023  #if CYTHON_USE_EXC_INFO_STACK
21024  _PyErr_StackItem *exc_info = tstate->exc_info;
21025  tmp_type = exc_info->exc_type;
21026  tmp_value = exc_info->exc_value;
21027  tmp_tb = exc_info->exc_traceback;
21028  exc_info->exc_type = type;
21029  exc_info->exc_value = value;
21030  exc_info->exc_traceback = tb;
21031  #else
21032  tmp_type = tstate->exc_type;
21033  tmp_value = tstate->exc_value;
21034  tmp_tb = tstate->exc_traceback;
21035  tstate->exc_type = type;
21036  tstate->exc_value = value;
21037  tstate->exc_traceback = tb;
21038  #endif
21039  Py_XDECREF(tmp_type);
21040  Py_XDECREF(tmp_value);
21041  Py_XDECREF(tmp_tb);
21042 }
21043 #endif
21044 
21045 /* PyErrExceptionMatches */
21046 #if CYTHON_FAST_THREAD_STATE
21047 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
21048  Py_ssize_t i, n;
21049  n = PyTuple_GET_SIZE(tuple);
21050 #if PY_MAJOR_VERSION >= 3
21051  for (i=0; i<n; i++) {
21052  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
21053  }
21054 #endif
21055  for (i=0; i<n; i++) {
21056  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
21057  }
21058  return 0;
21059 }
21060 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
21061  PyObject *exc_type = tstate->curexc_type;
21062  if (exc_type == err) return 1;
21063  if (unlikely(!exc_type)) return 0;
21064  if (unlikely(PyTuple_Check(err)))
21065  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
21066  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
21067 }
21068 #endif
21069 
21070 /* GetException */
21071 #if CYTHON_FAST_THREAD_STATE
21072 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
21073 #else
21074 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
21075 #endif
21076 {
21077  PyObject *local_type, *local_value, *local_tb;
21078 #if CYTHON_FAST_THREAD_STATE
21079  PyObject *tmp_type, *tmp_value, *tmp_tb;
21080  local_type = tstate->curexc_type;
21081  local_value = tstate->curexc_value;
21082  local_tb = tstate->curexc_traceback;
21083  tstate->curexc_type = 0;
21084  tstate->curexc_value = 0;
21085  tstate->curexc_traceback = 0;
21086 #else
21087  PyErr_Fetch(&local_type, &local_value, &local_tb);
21088 #endif
21089  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
21090 #if CYTHON_FAST_THREAD_STATE
21091  if (unlikely(tstate->curexc_type))
21092 #else
21093  if (unlikely(PyErr_Occurred()))
21094 #endif
21095  goto bad;
21096  #if PY_MAJOR_VERSION >= 3
21097  if (local_tb) {
21098  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
21099  goto bad;
21100  }
21101  #endif
21102  Py_XINCREF(local_tb);
21103  Py_XINCREF(local_type);
21104  Py_XINCREF(local_value);
21105  *type = local_type;
21106  *value = local_value;
21107  *tb = local_tb;
21108 #if CYTHON_FAST_THREAD_STATE
21109  #if CYTHON_USE_EXC_INFO_STACK
21110  {
21111  _PyErr_StackItem *exc_info = tstate->exc_info;
21112  tmp_type = exc_info->exc_type;
21113  tmp_value = exc_info->exc_value;
21114  tmp_tb = exc_info->exc_traceback;
21115  exc_info->exc_type = local_type;
21116  exc_info->exc_value = local_value;
21117  exc_info->exc_traceback = local_tb;
21118  }
21119  #else
21120  tmp_type = tstate->exc_type;
21121  tmp_value = tstate->exc_value;
21122  tmp_tb = tstate->exc_traceback;
21123  tstate->exc_type = local_type;
21124  tstate->exc_value = local_value;
21125  tstate->exc_traceback = local_tb;
21126  #endif
21127  Py_XDECREF(tmp_type);
21128  Py_XDECREF(tmp_value);
21129  Py_XDECREF(tmp_tb);
21130 #else
21131  PyErr_SetExcInfo(local_type, local_value, local_tb);
21132 #endif
21133  return 0;
21134 bad:
21135  *type = 0;
21136  *value = 0;
21137  *tb = 0;
21138  Py_XDECREF(local_type);
21139  Py_XDECREF(local_value);
21140  Py_XDECREF(local_tb);
21141  return -1;
21142 }
21143 
21144 /* BytesEquals */
21145 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
21146 #if CYTHON_COMPILING_IN_PYPY
21147  return PyObject_RichCompareBool(s1, s2, equals);
21148 #else
21149  if (s1 == s2) {
21150  return (equals == Py_EQ);
21151  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
21152  const char *ps1, *ps2;
21153  Py_ssize_t length = PyBytes_GET_SIZE(s1);
21154  if (length != PyBytes_GET_SIZE(s2))
21155  return (equals == Py_NE);
21156  ps1 = PyBytes_AS_STRING(s1);
21157  ps2 = PyBytes_AS_STRING(s2);
21158  if (ps1[0] != ps2[0]) {
21159  return (equals == Py_NE);
21160  } else if (length == 1) {
21161  return (equals == Py_EQ);
21162  } else {
21163  int result;
21164 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
21165  Py_hash_t hash1, hash2;
21166  hash1 = ((PyBytesObject*)s1)->ob_shash;
21167  hash2 = ((PyBytesObject*)s2)->ob_shash;
21168  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
21169  return (equals == Py_NE);
21170  }
21171 #endif
21172  result = memcmp(ps1, ps2, (size_t)length);
21173  return (equals == Py_EQ) ? (result == 0) : (result != 0);
21174  }
21175  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
21176  return (equals == Py_NE);
21177  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
21178  return (equals == Py_NE);
21179  } else {
21180  int result;
21181  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
21182  if (!py_result)
21183  return -1;
21184  result = __Pyx_PyObject_IsTrue(py_result);
21185  Py_DECREF(py_result);
21186  return result;
21187  }
21188 #endif
21189 }
21190 
21191 /* UnicodeEquals */
21192 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
21193 #if CYTHON_COMPILING_IN_PYPY
21194  return PyObject_RichCompareBool(s1, s2, equals);
21195 #else
21196 #if PY_MAJOR_VERSION < 3
21197  PyObject* owned_ref = NULL;
21198 #endif
21199  int s1_is_unicode, s2_is_unicode;
21200  if (s1 == s2) {
21201  goto return_eq;
21202  }
21203  s1_is_unicode = PyUnicode_CheckExact(s1);
21204  s2_is_unicode = PyUnicode_CheckExact(s2);
21205 #if PY_MAJOR_VERSION < 3
21206  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
21207  owned_ref = PyUnicode_FromObject(s2);
21208  if (unlikely(!owned_ref))
21209  return -1;
21210  s2 = owned_ref;
21211  s2_is_unicode = 1;
21212  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
21213  owned_ref = PyUnicode_FromObject(s1);
21214  if (unlikely(!owned_ref))
21215  return -1;
21216  s1 = owned_ref;
21217  s1_is_unicode = 1;
21218  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
21219  return __Pyx_PyBytes_Equals(s1, s2, equals);
21220  }
21221 #endif
21222  if (s1_is_unicode & s2_is_unicode) {
21223  Py_ssize_t length;
21224  int kind;
21225  void *data1, *data2;
21226  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
21227  return -1;
21228  length = __Pyx_PyUnicode_GET_LENGTH(s1);
21229  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
21230  goto return_ne;
21231  }
21232 #if CYTHON_USE_UNICODE_INTERNALS
21233  {
21234  Py_hash_t hash1, hash2;
21235  #if CYTHON_PEP393_ENABLED
21236  hash1 = ((PyASCIIObject*)s1)->hash;
21237  hash2 = ((PyASCIIObject*)s2)->hash;
21238  #else
21239  hash1 = ((PyUnicodeObject*)s1)->hash;
21240  hash2 = ((PyUnicodeObject*)s2)->hash;
21241  #endif
21242  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
21243  goto return_ne;
21244  }
21245  }
21246 #endif
21247  kind = __Pyx_PyUnicode_KIND(s1);
21248  if (kind != __Pyx_PyUnicode_KIND(s2)) {
21249  goto return_ne;
21250  }
21251  data1 = __Pyx_PyUnicode_DATA(s1);
21252  data2 = __Pyx_PyUnicode_DATA(s2);
21253  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
21254  goto return_ne;
21255  } else if (length == 1) {
21256  goto return_eq;
21257  } else {
21258  int result = memcmp(data1, data2, (size_t)(length * kind));
21259  #if PY_MAJOR_VERSION < 3
21260  Py_XDECREF(owned_ref);
21261  #endif
21262  return (equals == Py_EQ) ? (result == 0) : (result != 0);
21263  }
21264  } else if ((s1 == Py_None) & s2_is_unicode) {
21265  goto return_ne;
21266  } else if ((s2 == Py_None) & s1_is_unicode) {
21267  goto return_ne;
21268  } else {
21269  int result;
21270  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
21271  #if PY_MAJOR_VERSION < 3
21272  Py_XDECREF(owned_ref);
21273  #endif
21274  if (!py_result)
21275  return -1;
21276  result = __Pyx_PyObject_IsTrue(py_result);
21277  Py_DECREF(py_result);
21278  return result;
21279  }
21280 return_eq:
21281  #if PY_MAJOR_VERSION < 3
21282  Py_XDECREF(owned_ref);
21283  #endif
21284  return (equals == Py_EQ);
21285 return_ne:
21286  #if PY_MAJOR_VERSION < 3
21287  Py_XDECREF(owned_ref);
21288  #endif
21289  return (equals == Py_NE);
21290 #endif
21291 }
21292 
21293 /* DivInt[Py_ssize_t] */
21294 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
21295  Py_ssize_t q = a / b;
21296  Py_ssize_t r = a - q*b;
21297  q -= ((r != 0) & ((r ^ b) < 0));
21298  return q;
21299 }
21300 
21301 /* GetAttr */
21302 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
21303 #if CYTHON_USE_TYPE_SLOTS
21304 #if PY_MAJOR_VERSION >= 3
21305  if (likely(PyUnicode_Check(n)))
21306 #else
21307  if (likely(PyString_Check(n)))
21308 #endif
21309  return __Pyx_PyObject_GetAttrStr(o, n);
21310 #endif
21311  return PyObject_GetAttr(o, n);
21312 }
21313 
21314 /* GetItemInt */
21315 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
21316  PyObject *r;
21317  if (!j) return NULL;
21318  r = PyObject_GetItem(o, j);
21319  Py_DECREF(j);
21320  return r;
21321 }
21322 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
21323  CYTHON_NCP_UNUSED int wraparound,
21324  CYTHON_NCP_UNUSED int boundscheck) {
21325 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21326  Py_ssize_t wrapped_i = i;
21327  if (wraparound & unlikely(i < 0)) {
21328  wrapped_i += PyList_GET_SIZE(o);
21329  }
21330  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
21331  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
21332  Py_INCREF(r);
21333  return r;
21334  }
21335  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
21336 #else
21337  return PySequence_GetItem(o, i);
21338 #endif
21339 }
21340 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
21341  CYTHON_NCP_UNUSED int wraparound,
21342  CYTHON_NCP_UNUSED int boundscheck) {
21343 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21344  Py_ssize_t wrapped_i = i;
21345  if (wraparound & unlikely(i < 0)) {
21346  wrapped_i += PyTuple_GET_SIZE(o);
21347  }
21348  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
21349  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
21350  Py_INCREF(r);
21351  return r;
21352  }
21353  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
21354 #else
21355  return PySequence_GetItem(o, i);
21356 #endif
21357 }
21358 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
21359  CYTHON_NCP_UNUSED int wraparound,
21360  CYTHON_NCP_UNUSED int boundscheck) {
21361 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
21362  if (is_list || PyList_CheckExact(o)) {
21363  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
21364  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
21365  PyObject *r = PyList_GET_ITEM(o, n);
21366  Py_INCREF(r);
21367  return r;
21368  }
21369  }
21370  else if (PyTuple_CheckExact(o)) {
21371  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
21372  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
21373  PyObject *r = PyTuple_GET_ITEM(o, n);
21374  Py_INCREF(r);
21375  return r;
21376  }
21377  } else {
21378  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
21379  if (likely(m && m->sq_item)) {
21380  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
21381  Py_ssize_t l = m->sq_length(o);
21382  if (likely(l >= 0)) {
21383  i += l;
21384  } else {
21385  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
21386  return NULL;
21387  PyErr_Clear();
21388  }
21389  }
21390  return m->sq_item(o, i);
21391  }
21392  }
21393 #else
21394  if (is_list || PySequence_Check(o)) {
21395  return PySequence_GetItem(o, i);
21396  }
21397 #endif
21398  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
21399 }
21400 
21401 /* ObjectGetItem */
21402 #if CYTHON_USE_TYPE_SLOTS
21403 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
21404  PyObject *runerr;
21405  Py_ssize_t key_value;
21406  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
21407  if (unlikely(!(m && m->sq_item))) {
21408  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
21409  return NULL;
21410  }
21411  key_value = __Pyx_PyIndex_AsSsize_t(index);
21412  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
21413  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
21414  }
21415  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
21416  PyErr_Clear();
21417  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
21418  }
21419  return NULL;
21420 }
21421 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
21422  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
21423  if (likely(m && m->mp_subscript)) {
21424  return m->mp_subscript(obj, key);
21425  }
21426  return __Pyx_PyObject_GetIndex(obj, key);
21427 }
21428 #endif
21429 
21430 /* decode_c_string */
21431 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
21432  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
21433  const char* encoding, const char* errors,
21434  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
21435  Py_ssize_t length;
21436  if (unlikely((start < 0) | (stop < 0))) {
21437  size_t slen = strlen(cstring);
21438  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
21439  PyErr_SetString(PyExc_OverflowError,
21440  "c-string too long to convert to Python");
21441  return NULL;
21442  }
21443  length = (Py_ssize_t) slen;
21444  if (start < 0) {
21445  start += length;
21446  if (start < 0)
21447  start = 0;
21448  }
21449  if (stop < 0)
21450  stop += length;
21451  }
21452  if (unlikely(stop <= start))
21453  return __Pyx_NewRef(__pyx_empty_unicode);
21454  length = stop - start;
21455  cstring += start;
21456  if (decode_func) {
21457  return decode_func(cstring, length, errors);
21458  } else {
21459  return PyUnicode_Decode(cstring, length, encoding, errors);
21460  }
21461 }
21462 
21463 /* GetAttr3 */
21464 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
21465  __Pyx_PyThreadState_declare
21466  __Pyx_PyThreadState_assign
21467  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
21468  return NULL;
21469  __Pyx_PyErr_Clear();
21470  Py_INCREF(d);
21471  return d;
21472 }
21473 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
21474  PyObject *r = __Pyx_GetAttr(o, n);
21475  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
21476 }
21477 
21478 /* RaiseTooManyValuesToUnpack */
21479 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
21480  PyErr_Format(PyExc_ValueError,
21481  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
21482 }
21483 
21484 /* RaiseNeedMoreValuesToUnpack */
21485 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
21486  PyErr_Format(PyExc_ValueError,
21487  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
21488  index, (index == 1) ? "" : "s");
21489 }
21490 
21491 /* RaiseNoneIterError */
21492 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
21493  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
21494 }
21495 
21496 /* ExtTypeTest */
21497 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
21498  if (unlikely(!type)) {
21499  PyErr_SetString(PyExc_SystemError, "Missing type object");
21500  return 0;
21501  }
21502  if (likely(__Pyx_TypeCheck(obj, type)))
21503  return 1;
21504  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
21505  Py_TYPE(obj)->tp_name, type->tp_name);
21506  return 0;
21507 }
21508 
21509 /* SwapException */
21510 #if CYTHON_FAST_THREAD_STATE
21511 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21512  PyObject *tmp_type, *tmp_value, *tmp_tb;
21513  #if CYTHON_USE_EXC_INFO_STACK
21514  _PyErr_StackItem *exc_info = tstate->exc_info;
21515  tmp_type = exc_info->exc_type;
21516  tmp_value = exc_info->exc_value;
21517  tmp_tb = exc_info->exc_traceback;
21518  exc_info->exc_type = *type;
21519  exc_info->exc_value = *value;
21520  exc_info->exc_traceback = *tb;
21521  #else
21522  tmp_type = tstate->exc_type;
21523  tmp_value = tstate->exc_value;
21524  tmp_tb = tstate->exc_traceback;
21525  tstate->exc_type = *type;
21526  tstate->exc_value = *value;
21527  tstate->exc_traceback = *tb;
21528  #endif
21529  *type = tmp_type;
21530  *value = tmp_value;
21531  *tb = tmp_tb;
21532 }
21533 #else
21534 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
21535  PyObject *tmp_type, *tmp_value, *tmp_tb;
21536  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
21537  PyErr_SetExcInfo(*type, *value, *tb);
21538  *type = tmp_type;
21539  *value = tmp_value;
21540  *tb = tmp_tb;
21541 }
21542 #endif
21543 
21544 /* Import */
21545 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
21546  PyObject *empty_list = 0;
21547  PyObject *module = 0;
21548  PyObject *global_dict = 0;
21549  PyObject *empty_dict = 0;
21550  PyObject *list;
21551  #if PY_MAJOR_VERSION < 3
21552  PyObject *py_import;
21553  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
21554  if (!py_import)
21555  goto bad;
21556  #endif
21557  if (from_list)
21558  list = from_list;
21559  else {
21560  empty_list = PyList_New(0);
21561  if (!empty_list)
21562  goto bad;
21563  list = empty_list;
21564  }
21565  global_dict = PyModule_GetDict(__pyx_m);
21566  if (!global_dict)
21567  goto bad;
21568  empty_dict = PyDict_New();
21569  if (!empty_dict)
21570  goto bad;
21571  {
21572  #if PY_MAJOR_VERSION >= 3
21573  if (level == -1) {
21574  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
21575  module = PyImport_ImportModuleLevelObject(
21576  name, global_dict, empty_dict, list, 1);
21577  if (!module) {
21578  if (!PyErr_ExceptionMatches(PyExc_ImportError))
21579  goto bad;
21580  PyErr_Clear();
21581  }
21582  }
21583  level = 0;
21584  }
21585  #endif
21586  if (!module) {
21587  #if PY_MAJOR_VERSION < 3
21588  PyObject *py_level = PyInt_FromLong(level);
21589  if (!py_level)
21590  goto bad;
21591  module = PyObject_CallFunctionObjArgs(py_import,
21592  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
21593  Py_DECREF(py_level);
21594  #else
21595  module = PyImport_ImportModuleLevelObject(
21596  name, global_dict, empty_dict, list, level);
21597  #endif
21598  }
21599  }
21600 bad:
21601  #if PY_MAJOR_VERSION < 3
21602  Py_XDECREF(py_import);
21603  #endif
21604  Py_XDECREF(empty_list);
21605  Py_XDECREF(empty_dict);
21606  return module;
21607 }
21608 
21609 /* FastTypeChecks */
21610 #if CYTHON_COMPILING_IN_CPYTHON
21611 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
21612  while (a) {
21613  a = a->tp_base;
21614  if (a == b)
21615  return 1;
21616  }
21617  return b == &PyBaseObject_Type;
21618 }
21619 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
21620  PyObject *mro;
21621  if (a == b) return 1;
21622  mro = a->tp_mro;
21623  if (likely(mro)) {
21624  Py_ssize_t i, n;
21625  n = PyTuple_GET_SIZE(mro);
21626  for (i = 0; i < n; i++) {
21627  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
21628  return 1;
21629  }
21630  return 0;
21631  }
21632  return __Pyx_InBases(a, b);
21633 }
21634 #if PY_MAJOR_VERSION == 2
21635 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
21636  PyObject *exception, *value, *tb;
21637  int res;
21638  __Pyx_PyThreadState_declare
21639  __Pyx_PyThreadState_assign
21640  __Pyx_ErrFetch(&exception, &value, &tb);
21641  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
21642  if (unlikely(res == -1)) {
21643  PyErr_WriteUnraisable(err);
21644  res = 0;
21645  }
21646  if (!res) {
21647  res = PyObject_IsSubclass(err, exc_type2);
21648  if (unlikely(res == -1)) {
21649  PyErr_WriteUnraisable(err);
21650  res = 0;
21651  }
21652  }
21653  __Pyx_ErrRestore(exception, value, tb);
21654  return res;
21655 }
21656 #else
21657 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
21658  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
21659  if (!res) {
21660  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
21661  }
21662  return res;
21663 }
21664 #endif
21665 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
21666  Py_ssize_t i, n;
21667  assert(PyExceptionClass_Check(exc_type));
21668  n = PyTuple_GET_SIZE(tuple);
21669 #if PY_MAJOR_VERSION >= 3
21670  for (i=0; i<n; i++) {
21671  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
21672  }
21673 #endif
21674  for (i=0; i<n; i++) {
21675  PyObject *t = PyTuple_GET_ITEM(tuple, i);
21676  #if PY_MAJOR_VERSION < 3
21677  if (likely(exc_type == t)) return 1;
21678  #endif
21679  if (likely(PyExceptionClass_Check(t))) {
21680  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
21681  } else {
21682  }
21683  }
21684  return 0;
21685 }
21686 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
21687  if (likely(err == exc_type)) return 1;
21688  if (likely(PyExceptionClass_Check(err))) {
21689  if (likely(PyExceptionClass_Check(exc_type))) {
21690  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
21691  } else if (likely(PyTuple_Check(exc_type))) {
21692  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
21693  } else {
21694  }
21695  }
21696  return PyErr_GivenExceptionMatches(err, exc_type);
21697 }
21698 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
21699  assert(PyExceptionClass_Check(exc_type1));
21700  assert(PyExceptionClass_Check(exc_type2));
21701  if (likely(err == exc_type1 || err == exc_type2)) return 1;
21702  if (likely(PyExceptionClass_Check(err))) {
21703  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
21704  }
21705  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
21706 }
21707 #endif
21708 
21709 /* PyIntBinop */
21710 #if !CYTHON_COMPILING_IN_PYPY
21711 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
21712  (void)inplace;
21713  (void)zerodivision_check;
21714  #if PY_MAJOR_VERSION < 3
21715  if (likely(PyInt_CheckExact(op1))) {
21716  const long b = intval;
21717  long x;
21718  long a = PyInt_AS_LONG(op1);
21719  x = (long)((unsigned long)a + b);
21720  if (likely((x^a) >= 0 || (x^b) >= 0))
21721  return PyInt_FromLong(x);
21722  return PyLong_Type.tp_as_number->nb_add(op1, op2);
21723  }
21724  #endif
21725  #if CYTHON_USE_PYLONG_INTERNALS
21726  if (likely(PyLong_CheckExact(op1))) {
21727  const long b = intval;
21728  long a, x;
21729 #ifdef HAVE_LONG_LONG
21730  const PY_LONG_LONG llb = intval;
21731  PY_LONG_LONG lla, llx;
21732 #endif
21733  const digit* digits = ((PyLongObject*)op1)->ob_digit;
21734  const Py_ssize_t size = Py_SIZE(op1);
21735  if (likely(__Pyx_sst_abs(size) <= 1)) {
21736  a = likely(size) ? digits[0] : 0;
21737  if (size == -1) a = -a;
21738  } else {
21739  switch (size) {
21740  case -2:
21741  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
21742  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
21743  break;
21744 #ifdef HAVE_LONG_LONG
21745  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21746  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
21747  goto long_long;
21748 #endif
21749  }
21750  CYTHON_FALLTHROUGH;
21751  case 2:
21752  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
21753  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
21754  break;
21755 #ifdef HAVE_LONG_LONG
21756  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
21757  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
21758  goto long_long;
21759 #endif
21760  }
21761  CYTHON_FALLTHROUGH;
21762  case -3:
21763  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
21764  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
21765  break;
21766 #ifdef HAVE_LONG_LONG
21767  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21768  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]));
21769  goto long_long;
21770 #endif
21771  }
21772  CYTHON_FALLTHROUGH;
21773  case 3:
21774  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
21775  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
21776  break;
21777 #ifdef HAVE_LONG_LONG
21778  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
21779  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]));
21780  goto long_long;
21781 #endif
21782  }
21783  CYTHON_FALLTHROUGH;
21784  case -4:
21785  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
21786  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
21787  break;
21788 #ifdef HAVE_LONG_LONG
21789  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21790  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]));
21791  goto long_long;
21792 #endif
21793  }
21794  CYTHON_FALLTHROUGH;
21795  case 4:
21796  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
21797  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
21798  break;
21799 #ifdef HAVE_LONG_LONG
21800  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
21801  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]));
21802  goto long_long;
21803 #endif
21804  }
21805  CYTHON_FALLTHROUGH;
21806  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
21807  }
21808  }
21809  x = a + b;
21810  return PyLong_FromLong(x);
21811 #ifdef HAVE_LONG_LONG
21812  long_long:
21813  llx = lla + llb;
21814  return PyLong_FromLongLong(llx);
21815 #endif
21816 
21817 
21818  }
21819  #endif
21820  if (PyFloat_CheckExact(op1)) {
21821  const long b = intval;
21822  double a = PyFloat_AS_DOUBLE(op1);
21823  double result;
21824  PyFPE_START_PROTECT("add", return NULL)
21825  result = ((double)a) + (double)b;
21826  PyFPE_END_PROTECT(result)
21827  return PyFloat_FromDouble(result);
21828  }
21829  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
21830 }
21831 #endif
21832 
21833 /* None */
21834 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
21835  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
21836 }
21837 
21838 /* DivInt[long] */
21839 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
21840  long q = a / b;
21841  long r = a - q*b;
21842  q -= ((r != 0) & ((r ^ b) < 0));
21843  return q;
21844 }
21845 
21846 /* ImportFrom */
21847 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
21848  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
21849  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21850  PyErr_Format(PyExc_ImportError,
21851  #if PY_MAJOR_VERSION < 3
21852  "cannot import name %.230s", PyString_AS_STRING(name));
21853  #else
21854  "cannot import name %S", name);
21855  #endif
21856  }
21857  return value;
21858 }
21859 
21860 /* HasAttr */
21861 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
21862  PyObject *r;
21863  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
21864  PyErr_SetString(PyExc_TypeError,
21865  "hasattr(): attribute name must be string");
21866  return -1;
21867  }
21868  r = __Pyx_GetAttr(o, n);
21869  if (unlikely(!r)) {
21870  PyErr_Clear();
21871  return 0;
21872  } else {
21873  Py_DECREF(r);
21874  return 1;
21875  }
21876 }
21877 
21878 /* StringJoin */
21879 #if !CYTHON_COMPILING_IN_CPYTHON
21880 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
21881  return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
21882 }
21883 #endif
21884 
21885 /* PyObject_GenericGetAttrNoDict */
21886 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
21887 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
21888  PyErr_Format(PyExc_AttributeError,
21889 #if PY_MAJOR_VERSION >= 3
21890  "'%.50s' object has no attribute '%U'",
21891  tp->tp_name, attr_name);
21892 #else
21893  "'%.50s' object has no attribute '%.400s'",
21894  tp->tp_name, PyString_AS_STRING(attr_name));
21895 #endif
21896  return NULL;
21897 }
21898 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
21899  PyObject *descr;
21900  PyTypeObject *tp = Py_TYPE(obj);
21901  if (unlikely(!PyString_Check(attr_name))) {
21902  return PyObject_GenericGetAttr(obj, attr_name);
21903  }
21904  assert(!tp->tp_dictoffset);
21905  descr = _PyType_Lookup(tp, attr_name);
21906  if (unlikely(!descr)) {
21907  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
21908  }
21909  Py_INCREF(descr);
21910  #if PY_MAJOR_VERSION < 3
21911  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
21912  #endif
21913  {
21914  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
21915  if (unlikely(f)) {
21916  PyObject *res = f(descr, obj, (PyObject *)tp);
21917  Py_DECREF(descr);
21918  return res;
21919  }
21920  }
21921  return descr;
21922 }
21923 #endif
21924 
21925 /* PyObject_GenericGetAttr */
21926 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
21927 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
21928  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
21929  return PyObject_GenericGetAttr(obj, attr_name);
21930  }
21931  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
21932 }
21933 #endif
21934 
21935 /* PyObjectGetAttrStrNoError */
21936 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
21937  __Pyx_PyThreadState_declare
21938  __Pyx_PyThreadState_assign
21939  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
21940  __Pyx_PyErr_Clear();
21941 }
21942 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
21943  PyObject *result;
21944 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
21945  PyTypeObject* tp = Py_TYPE(obj);
21946  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
21947  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
21948  }
21949 #endif
21950  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
21951  if (unlikely(!result)) {
21952  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
21953  }
21954  return result;
21955 }
21956 
21957 /* SetupReduce */
21958 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
21959  int ret;
21960  PyObject *name_attr;
21961  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
21962  if (likely(name_attr)) {
21963  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
21964  } else {
21965  ret = -1;
21966  }
21967  if (unlikely(ret < 0)) {
21968  PyErr_Clear();
21969  ret = 0;
21970  }
21971  Py_XDECREF(name_attr);
21972  return ret;
21973 }
21974 static int __Pyx_setup_reduce(PyObject* type_obj) {
21975  int ret = 0;
21976  PyObject *object_reduce = NULL;
21977  PyObject *object_getstate = NULL;
21978  PyObject *object_reduce_ex = NULL;
21979  PyObject *reduce = NULL;
21980  PyObject *reduce_ex = NULL;
21981  PyObject *reduce_cython = NULL;
21982  PyObject *setstate = NULL;
21983  PyObject *setstate_cython = NULL;
21984  PyObject *getstate = NULL;
21985 #if CYTHON_USE_PYTYPE_LOOKUP
21986  getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
21987 #else
21988  getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
21989  if (!getstate && PyErr_Occurred()) {
21990  goto __PYX_BAD;
21991  }
21992 #endif
21993  if (getstate) {
21994 #if CYTHON_USE_PYTYPE_LOOKUP
21995  object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
21996 #else
21997  object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
21998  if (!object_getstate && PyErr_Occurred()) {
21999  goto __PYX_BAD;
22000  }
22001 #endif
22002  if (object_getstate != getstate) {
22003  goto __PYX_GOOD;
22004  }
22005  }
22006 #if CYTHON_USE_PYTYPE_LOOKUP
22007  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
22008 #else
22009  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
22010 #endif
22011  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
22012  if (reduce_ex == object_reduce_ex) {
22013 #if CYTHON_USE_PYTYPE_LOOKUP
22014  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
22015 #else
22016  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
22017 #endif
22018  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
22019  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
22020  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
22021  if (likely(reduce_cython)) {
22022  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
22023  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
22024  } else if (reduce == object_reduce || PyErr_Occurred()) {
22025  goto __PYX_BAD;
22026  }
22027  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
22028  if (!setstate) PyErr_Clear();
22029  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
22030  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
22031  if (likely(setstate_cython)) {
22032  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
22033  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
22034  } else if (!setstate || PyErr_Occurred()) {
22035  goto __PYX_BAD;
22036  }
22037  }
22038  PyType_Modified((PyTypeObject*)type_obj);
22039  }
22040  }
22041  goto __PYX_GOOD;
22042 __PYX_BAD:
22043  if (!PyErr_Occurred())
22044  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
22045  ret = -1;
22046 __PYX_GOOD:
22047 #if !CYTHON_USE_PYTYPE_LOOKUP
22048  Py_XDECREF(object_reduce);
22049  Py_XDECREF(object_reduce_ex);
22050  Py_XDECREF(object_getstate);
22051  Py_XDECREF(getstate);
22052 #endif
22053  Py_XDECREF(reduce);
22054  Py_XDECREF(reduce_ex);
22055  Py_XDECREF(reduce_cython);
22056  Py_XDECREF(setstate);
22057  Py_XDECREF(setstate_cython);
22058  return ret;
22059 }
22060 
22061 /* SetVTable */
22062 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
22063 #if PY_VERSION_HEX >= 0x02070000
22064  PyObject *ob = PyCapsule_New(vtable, 0, 0);
22065 #else
22066  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
22067 #endif
22068  if (!ob)
22069  goto bad;
22070  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
22071  goto bad;
22072  Py_DECREF(ob);
22073  return 0;
22074 bad:
22075  Py_XDECREF(ob);
22076  return -1;
22077 }
22078 
22079 /* TypeImport */
22080 #ifndef __PYX_HAVE_RT_ImportType
22081 #define __PYX_HAVE_RT_ImportType
22082 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
22083  size_t size, enum __Pyx_ImportType_CheckSize check_size)
22084 {
22085  PyObject *result = 0;
22086  char warning[200];
22087  Py_ssize_t basicsize;
22088 #ifdef Py_LIMITED_API
22089  PyObject *py_basicsize;
22090 #endif
22091  result = PyObject_GetAttrString(module, class_name);
22092  if (!result)
22093  goto bad;
22094  if (!PyType_Check(result)) {
22095  PyErr_Format(PyExc_TypeError,
22096  "%.200s.%.200s is not a type object",
22097  module_name, class_name);
22098  goto bad;
22099  }
22100 #ifndef Py_LIMITED_API
22101  basicsize = ((PyTypeObject *)result)->tp_basicsize;
22102 #else
22103  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
22104  if (!py_basicsize)
22105  goto bad;
22106  basicsize = PyLong_AsSsize_t(py_basicsize);
22107  Py_DECREF(py_basicsize);
22108  py_basicsize = 0;
22109  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
22110  goto bad;
22111 #endif
22112  if ((size_t)basicsize < size) {
22113  PyErr_Format(PyExc_ValueError,
22114  "%.200s.%.200s size changed, may indicate binary incompatibility. "
22115  "Expected %zd from C header, got %zd from PyObject",
22116  module_name, class_name, size, basicsize);
22117  goto bad;
22118  }
22119  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
22120  PyErr_Format(PyExc_ValueError,
22121  "%.200s.%.200s size changed, may indicate binary incompatibility. "
22122  "Expected %zd from C header, got %zd from PyObject",
22123  module_name, class_name, size, basicsize);
22124  goto bad;
22125  }
22126  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
22127  PyOS_snprintf(warning, sizeof(warning),
22128  "%s.%s size changed, may indicate binary incompatibility. "
22129  "Expected %zd from C header, got %zd from PyObject",
22130  module_name, class_name, size, basicsize);
22131  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
22132  }
22133  return (PyTypeObject *)result;
22134 bad:
22135  Py_XDECREF(result);
22136  return NULL;
22137 }
22138 #endif
22139 
22140 /* CLineInTraceback */
22141 #ifndef CYTHON_CLINE_IN_TRACEBACK
22142 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
22143  PyObject *use_cline;
22144  PyObject *ptype, *pvalue, *ptraceback;
22145 #if CYTHON_COMPILING_IN_CPYTHON
22146  PyObject **cython_runtime_dict;
22147 #endif
22148  if (unlikely(!__pyx_cython_runtime)) {
22149  return c_line;
22150  }
22151  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
22152 #if CYTHON_COMPILING_IN_CPYTHON
22153  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
22154  if (likely(cython_runtime_dict)) {
22155  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
22156  use_cline, *cython_runtime_dict,
22157  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
22158  } else
22159 #endif
22160  {
22161  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
22162  if (use_cline_obj) {
22163  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
22164  Py_DECREF(use_cline_obj);
22165  } else {
22166  PyErr_Clear();
22167  use_cline = NULL;
22168  }
22169  }
22170  if (!use_cline) {
22171  c_line = 0;
22172  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
22173  }
22174  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
22175  c_line = 0;
22176  }
22177  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
22178  return c_line;
22179 }
22180 #endif
22181 
22182 /* CodeObjectCache */
22183 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
22184  int start = 0, mid = 0, end = count - 1;
22185  if (end >= 0 && code_line > entries[end].code_line) {
22186  return count;
22187  }
22188  while (start < end) {
22189  mid = start + (end - start) / 2;
22190  if (code_line < entries[mid].code_line) {
22191  end = mid;
22192  } else if (code_line > entries[mid].code_line) {
22193  start = mid + 1;
22194  } else {
22195  return mid;
22196  }
22197  }
22198  if (code_line <= entries[mid].code_line) {
22199  return mid;
22200  } else {
22201  return mid + 1;
22202  }
22203 }
22204 static PyCodeObject *__pyx_find_code_object(int code_line) {
22205  PyCodeObject* code_object;
22206  int pos;
22207  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
22208  return NULL;
22209  }
22210  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22211  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
22212  return NULL;
22213  }
22214  code_object = __pyx_code_cache.entries[pos].code_object;
22215  Py_INCREF(code_object);
22216  return code_object;
22217 }
22218 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
22219  int pos, i;
22220  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
22221  if (unlikely(!code_line)) {
22222  return;
22223  }
22224  if (unlikely(!entries)) {
22225  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
22226  if (likely(entries)) {
22227  __pyx_code_cache.entries = entries;
22228  __pyx_code_cache.max_count = 64;
22229  __pyx_code_cache.count = 1;
22230  entries[0].code_line = code_line;
22231  entries[0].code_object = code_object;
22232  Py_INCREF(code_object);
22233  }
22234  return;
22235  }
22236  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
22237  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
22238  PyCodeObject* tmp = entries[pos].code_object;
22239  entries[pos].code_object = code_object;
22240  Py_DECREF(tmp);
22241  return;
22242  }
22243  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
22244  int new_max = __pyx_code_cache.max_count + 64;
22245  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
22246  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
22247  if (unlikely(!entries)) {
22248  return;
22249  }
22250  __pyx_code_cache.entries = entries;
22251  __pyx_code_cache.max_count = new_max;
22252  }
22253  for (i=__pyx_code_cache.count; i>pos; i--) {
22254  entries[i] = entries[i-1];
22255  }
22256  entries[pos].code_line = code_line;
22257  entries[pos].code_object = code_object;
22258  __pyx_code_cache.count++;
22259  Py_INCREF(code_object);
22260 }
22261 
22262 /* AddTraceback */
22263 #include "compile.h"
22264 #include "frameobject.h"
22265 #include "traceback.h"
22266 #if PY_VERSION_HEX >= 0x030b00a6
22267  #ifndef Py_BUILD_CORE
22268  #define Py_BUILD_CORE 1
22269  #endif
22270  #include "internal/pycore_frame.h"
22271 #endif
22272 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
22273  const char *funcname, int c_line,
22274  int py_line, const char *filename) {
22275  PyCodeObject *py_code = NULL;
22276  PyObject *py_funcname = NULL;
22277  #if PY_MAJOR_VERSION < 3
22278  PyObject *py_srcfile = NULL;
22279  py_srcfile = PyString_FromString(filename);
22280  if (!py_srcfile) goto bad;
22281  #endif
22282  if (c_line) {
22283  #if PY_MAJOR_VERSION < 3
22284  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
22285  if (!py_funcname) goto bad;
22286  #else
22287  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
22288  if (!py_funcname) goto bad;
22289  funcname = PyUnicode_AsUTF8(py_funcname);
22290  if (!funcname) goto bad;
22291  #endif
22292  }
22293  else {
22294  #if PY_MAJOR_VERSION < 3
22295  py_funcname = PyString_FromString(funcname);
22296  if (!py_funcname) goto bad;
22297  #endif
22298  }
22299  #if PY_MAJOR_VERSION < 3
22300  py_code = __Pyx_PyCode_New(
22301  0,
22302  0,
22303  0,
22304  0,
22305  0,
22306  __pyx_empty_bytes, /*PyObject *code,*/
22307  __pyx_empty_tuple, /*PyObject *consts,*/
22308  __pyx_empty_tuple, /*PyObject *names,*/
22309  __pyx_empty_tuple, /*PyObject *varnames,*/
22310  __pyx_empty_tuple, /*PyObject *freevars,*/
22311  __pyx_empty_tuple, /*PyObject *cellvars,*/
22312  py_srcfile, /*PyObject *filename,*/
22313  py_funcname, /*PyObject *name,*/
22314  py_line,
22315  __pyx_empty_bytes /*PyObject *lnotab*/
22316  );
22317  Py_DECREF(py_srcfile);
22318  #else
22319  py_code = PyCode_NewEmpty(filename, funcname, py_line);
22320  #endif
22321  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
22322  return py_code;
22323 bad:
22324  Py_XDECREF(py_funcname);
22325  #if PY_MAJOR_VERSION < 3
22326  Py_XDECREF(py_srcfile);
22327  #endif
22328  return NULL;
22329 }
22330 static void __Pyx_AddTraceback(const char *funcname, int c_line,
22331  int py_line, const char *filename) {
22332  PyCodeObject *py_code = 0;
22333  PyFrameObject *py_frame = 0;
22334  PyThreadState *tstate = __Pyx_PyThreadState_Current;
22335  PyObject *ptype, *pvalue, *ptraceback;
22336  if (c_line) {
22337  c_line = __Pyx_CLineForTraceback(tstate, c_line);
22338  }
22339  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
22340  if (!py_code) {
22341  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
22342  py_code = __Pyx_CreateCodeObjectForTraceback(
22343  funcname, c_line, py_line, filename);
22344  if (!py_code) {
22345  /* If the code object creation fails, then we should clear the
22346  fetched exception references and propagate the new exception */
22347  Py_XDECREF(ptype);
22348  Py_XDECREF(pvalue);
22349  Py_XDECREF(ptraceback);
22350  goto bad;
22351  }
22352  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
22353  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
22354  }
22355  py_frame = PyFrame_New(
22356  tstate, /*PyThreadState *tstate,*/
22357  py_code, /*PyCodeObject *code,*/
22358  __pyx_d, /*PyObject *globals,*/
22359  0 /*PyObject *locals*/
22360  );
22361  if (!py_frame) goto bad;
22362  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
22363  PyTraceBack_Here(py_frame);
22364 bad:
22365  Py_XDECREF(py_code);
22366  Py_XDECREF(py_frame);
22367 }
22368 
22369 /* CIntFromPyVerify */
22370 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
22371  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
22372 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
22373  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
22374 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
22375  {\
22376  func_type value = func_value;\
22377  if (sizeof(target_type) < sizeof(func_type)) {\
22378  if (unlikely(value != (func_type) (target_type) value)) {\
22379  func_type zero = 0;\
22380  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
22381  return (target_type) -1;\
22382  if (is_unsigned && unlikely(value < zero))\
22383  goto raise_neg_overflow;\
22384  else\
22385  goto raise_overflow;\
22386  }\
22387  }\
22388  return (target_type) value;\
22389  }
22390 
22391 /* MemviewDtypeToObject */
22392 static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp) {
22393  return (PyObject *) __Pyx_PyInt_From_int(*(int *) itemp);
22394 }
22395 static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj) {
22396  int value = __Pyx_PyInt_As_int(obj);
22397  if ((value == (int)-1) && PyErr_Occurred())
22398  return 0;
22399  *(int *) itemp = value;
22400  return 1;
22401 }
22402 
22403 /* MemviewDtypeToObject */
22404 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
22405  return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
22406 }
22407 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
22408  double value = __pyx_PyFloat_AsDouble(obj);
22409  if ((value == (double)-1) && PyErr_Occurred())
22410  return 0;
22411  *(double *) itemp = value;
22412  return 1;
22413 }
22414 
22415 /* Declarations */
22416 #if CYTHON_CCOMPLEX
22417  #ifdef __cplusplus
22418  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
22419  return ::std::complex< float >(x, y);
22420  }
22421  #else
22422  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
22423  return x + y*(__pyx_t_float_complex)_Complex_I;
22424  }
22425  #endif
22426 #else
22427  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
22428  __pyx_t_float_complex z;
22429  z.real = x;
22430  z.imag = y;
22431  return z;
22432  }
22433 #endif
22434 
22435 /* Arithmetic */
22436 #if CYTHON_CCOMPLEX
22437 #else
22438  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
22439  return (a.real == b.real) && (a.imag == b.imag);
22440  }
22441  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
22442  __pyx_t_float_complex z;
22443  z.real = a.real + b.real;
22444  z.imag = a.imag + b.imag;
22445  return z;
22446  }
22447  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
22448  __pyx_t_float_complex z;
22449  z.real = a.real - b.real;
22450  z.imag = a.imag - b.imag;
22451  return z;
22452  }
22453  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
22454  __pyx_t_float_complex z;
22455  z.real = a.real * b.real - a.imag * b.imag;
22456  z.imag = a.real * b.imag + a.imag * b.real;
22457  return z;
22458  }
22459  #if 1
22460  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
22461  if (b.imag == 0) {
22462  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
22463  } else if (fabsf(b.real) >= fabsf(b.imag)) {
22464  if (b.real == 0 && b.imag == 0) {
22465  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
22466  } else {
22467  float r = b.imag / b.real;
22468  float s = (float)(1.0) / (b.real + b.imag * r);
22469  return __pyx_t_float_complex_from_parts(
22470  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
22471  }
22472  } else {
22473  float r = b.real / b.imag;
22474  float s = (float)(1.0) / (b.imag + b.real * r);
22475  return __pyx_t_float_complex_from_parts(
22476  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
22477  }
22478  }
22479  #else
22480  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
22481  if (b.imag == 0) {
22482  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
22483  } else {
22484  float denom = b.real * b.real + b.imag * b.imag;
22485  return __pyx_t_float_complex_from_parts(
22486  (a.real * b.real + a.imag * b.imag) / denom,
22487  (a.imag * b.real - a.real * b.imag) / denom);
22488  }
22489  }
22490  #endif
22491  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
22492  __pyx_t_float_complex z;
22493  z.real = -a.real;
22494  z.imag = -a.imag;
22495  return z;
22496  }
22497  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
22498  return (a.real == 0) && (a.imag == 0);
22499  }
22500  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
22501  __pyx_t_float_complex z;
22502  z.real = a.real;
22503  z.imag = -a.imag;
22504  return z;
22505  }
22506  #if 1
22507  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
22508  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
22509  return sqrtf(z.real*z.real + z.imag*z.imag);
22510  #else
22511  return hypotf(z.real, z.imag);
22512  #endif
22513  }
22514  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
22515  __pyx_t_float_complex z;
22516  float r, lnr, theta, z_r, z_theta;
22517  if (b.imag == 0 && b.real == (int)b.real) {
22518  if (b.real < 0) {
22519  float denom = a.real * a.real + a.imag * a.imag;
22520  a.real = a.real / denom;
22521  a.imag = -a.imag / denom;
22522  b.real = -b.real;
22523  }
22524  switch ((int)b.real) {
22525  case 0:
22526  z.real = 1;
22527  z.imag = 0;
22528  return z;
22529  case 1:
22530  return a;
22531  case 2:
22532  return __Pyx_c_prod_float(a, a);
22533  case 3:
22534  z = __Pyx_c_prod_float(a, a);
22535  return __Pyx_c_prod_float(z, a);
22536  case 4:
22537  z = __Pyx_c_prod_float(a, a);
22538  return __Pyx_c_prod_float(z, z);
22539  }
22540  }
22541  if (a.imag == 0) {
22542  if (a.real == 0) {
22543  return a;
22544  } else if (b.imag == 0) {
22545  z.real = powf(a.real, b.real);
22546  z.imag = 0;
22547  return z;
22548  } else if (a.real > 0) {
22549  r = a.real;
22550  theta = 0;
22551  } else {
22552  r = -a.real;
22553  theta = atan2f(0.0, -1.0);
22554  }
22555  } else {
22556  r = __Pyx_c_abs_float(a);
22557  theta = atan2f(a.imag, a.real);
22558  }
22559  lnr = logf(r);
22560  z_r = expf(lnr * b.real - theta * b.imag);
22561  z_theta = theta * b.real + lnr * b.imag;
22562  z.real = z_r * cosf(z_theta);
22563  z.imag = z_r * sinf(z_theta);
22564  return z;
22565  }
22566  #endif
22567 #endif
22568 
22569 /* Declarations */
22570 #if CYTHON_CCOMPLEX
22571  #ifdef __cplusplus
22572  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
22573  return ::std::complex< double >(x, y);
22574  }
22575  #else
22576  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
22577  return x + y*(__pyx_t_double_complex)_Complex_I;
22578  }
22579  #endif
22580 #else
22581  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
22582  __pyx_t_double_complex z;
22583  z.real = x;
22584  z.imag = y;
22585  return z;
22586  }
22587 #endif
22588 
22589 /* Arithmetic */
22590 #if CYTHON_CCOMPLEX
22591 #else
22592  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
22593  return (a.real == b.real) && (a.imag == b.imag);
22594  }
22595  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
22596  __pyx_t_double_complex z;
22597  z.real = a.real + b.real;
22598  z.imag = a.imag + b.imag;
22599  return z;
22600  }
22601  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
22602  __pyx_t_double_complex z;
22603  z.real = a.real - b.real;
22604  z.imag = a.imag - b.imag;
22605  return z;
22606  }
22607  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
22608  __pyx_t_double_complex z;
22609  z.real = a.real * b.real - a.imag * b.imag;
22610  z.imag = a.real * b.imag + a.imag * b.real;
22611  return z;
22612  }
22613  #if 1
22614  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
22615  if (b.imag == 0) {
22616  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
22617  } else if (fabs(b.real) >= fabs(b.imag)) {
22618  if (b.real == 0 && b.imag == 0) {
22619  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
22620  } else {
22621  double r = b.imag / b.real;
22622  double s = (double)(1.0) / (b.real + b.imag * r);
22623  return __pyx_t_double_complex_from_parts(
22624  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
22625  }
22626  } else {
22627  double r = b.real / b.imag;
22628  double s = (double)(1.0) / (b.imag + b.real * r);
22629  return __pyx_t_double_complex_from_parts(
22630  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
22631  }
22632  }
22633  #else
22634  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
22635  if (b.imag == 0) {
22636  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
22637  } else {
22638  double denom = b.real * b.real + b.imag * b.imag;
22639  return __pyx_t_double_complex_from_parts(
22640  (a.real * b.real + a.imag * b.imag) / denom,
22641  (a.imag * b.real - a.real * b.imag) / denom);
22642  }
22643  }
22644  #endif
22645  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
22646  __pyx_t_double_complex z;
22647  z.real = -a.real;
22648  z.imag = -a.imag;
22649  return z;
22650  }
22651  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
22652  return (a.real == 0) && (a.imag == 0);
22653  }
22654  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
22655  __pyx_t_double_complex z;
22656  z.real = a.real;
22657  z.imag = -a.imag;
22658  return z;
22659  }
22660  #if 1
22661  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
22662  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
22663  return sqrt(z.real*z.real + z.imag*z.imag);
22664  #else
22665  return hypot(z.real, z.imag);
22666  #endif
22667  }
22668  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
22669  __pyx_t_double_complex z;
22670  double r, lnr, theta, z_r, z_theta;
22671  if (b.imag == 0 && b.real == (int)b.real) {
22672  if (b.real < 0) {
22673  double denom = a.real * a.real + a.imag * a.imag;
22674  a.real = a.real / denom;
22675  a.imag = -a.imag / denom;
22676  b.real = -b.real;
22677  }
22678  switch ((int)b.real) {
22679  case 0:
22680  z.real = 1;
22681  z.imag = 0;
22682  return z;
22683  case 1:
22684  return a;
22685  case 2:
22686  return __Pyx_c_prod_double(a, a);
22687  case 3:
22688  z = __Pyx_c_prod_double(a, a);
22689  return __Pyx_c_prod_double(z, a);
22690  case 4:
22691  z = __Pyx_c_prod_double(a, a);
22692  return __Pyx_c_prod_double(z, z);
22693  }
22694  }
22695  if (a.imag == 0) {
22696  if (a.real == 0) {
22697  return a;
22698  } else if (b.imag == 0) {
22699  z.real = pow(a.real, b.real);
22700  z.imag = 0;
22701  return z;
22702  } else if (a.real > 0) {
22703  r = a.real;
22704  theta = 0;
22705  } else {
22706  r = -a.real;
22707  theta = atan2(0.0, -1.0);
22708  }
22709  } else {
22710  r = __Pyx_c_abs_double(a);
22711  theta = atan2(a.imag, a.real);
22712  }
22713  lnr = log(r);
22714  z_r = exp(lnr * b.real - theta * b.imag);
22715  z_theta = theta * b.real + lnr * b.imag;
22716  z.real = z_r * cos(z_theta);
22717  z.imag = z_r * sin(z_theta);
22718  return z;
22719  }
22720  #endif
22721 #endif
22722 
22723 #if PY_MAJOR_VERSION < 3
22724 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
22725  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
22726  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
22727  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
22728  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
22729  return -1;
22730 }
22731 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
22732  PyObject *obj = view->obj;
22733  if (!obj) return;
22734  if (PyObject_CheckBuffer(obj)) {
22735  PyBuffer_Release(view);
22736  return;
22737  }
22738  if ((0)) {}
22739  view->obj = NULL;
22740  Py_DECREF(obj);
22741 }
22742 #endif
22743 
22744 
22745 /* MemviewSliceIsContig */
22746 static int
22747 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
22748 {
22749  int i, index, step, start;
22750  Py_ssize_t itemsize = mvs.memview->view.itemsize;
22751  if (order == 'F') {
22752  step = 1;
22753  start = 0;
22754  } else {
22755  step = -1;
22756  start = ndim - 1;
22757  }
22758  for (i = 0; i < ndim; i++) {
22759  index = start + step * i;
22760  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
22761  return 0;
22762  itemsize *= mvs.shape[index];
22763  }
22764  return 1;
22765 }
22766 
22767 /* OverlappingSlices */
22768 static void
22769 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
22770  void **out_start, void **out_end,
22771  int ndim, size_t itemsize)
22772 {
22773  char *start, *end;
22774  int i;
22775  start = end = slice->data;
22776  for (i = 0; i < ndim; i++) {
22777  Py_ssize_t stride = slice->strides[i];
22778  Py_ssize_t extent = slice->shape[i];
22779  if (extent == 0) {
22780  *out_start = *out_end = start;
22781  return;
22782  } else {
22783  if (stride > 0)
22784  end += stride * (extent - 1);
22785  else
22786  start += stride * (extent - 1);
22787  }
22788  }
22789  *out_start = start;
22790  *out_end = end + itemsize;
22791 }
22792 static int
22793 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
22794  __Pyx_memviewslice *slice2,
22795  int ndim, size_t itemsize)
22796 {
22797  void *start1, *end1, *start2, *end2;
22798  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
22799  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
22800  return (start1 < end2) && (start2 < end1);
22801 }
22802 
22803 /* Capsule */
22804 static CYTHON_INLINE PyObject *
22805 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
22806 {
22807  PyObject *cobj;
22808 #if PY_VERSION_HEX >= 0x02070000
22809  cobj = PyCapsule_New(p, sig, NULL);
22810 #else
22811  cobj = PyCObject_FromVoidPtr(p, NULL);
22812 #endif
22813  return cobj;
22814 }
22815 
22816 /* CIntFromPy */
22817 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
22818 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
22819 #pragma GCC diagnostic push
22820 #pragma GCC diagnostic ignored "-Wconversion"
22821 #endif
22822  const int neg_one = (int) -1, const_zero = (int) 0;
22823 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
22824 #pragma GCC diagnostic pop
22825 #endif
22826  const int is_unsigned = neg_one > const_zero;
22827 #if PY_MAJOR_VERSION < 3
22828  if (likely(PyInt_Check(x))) {
22829  if (sizeof(int) < sizeof(long)) {
22830  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
22831  } else {
22832  long val = PyInt_AS_LONG(x);
22833  if (is_unsigned && unlikely(val < 0)) {
22834  goto raise_neg_overflow;
22835  }
22836  return (int) val;
22837  }
22838  } else
22839 #endif
22840  if (likely(PyLong_Check(x))) {
22841  if (is_unsigned) {
22842 #if CYTHON_USE_PYLONG_INTERNALS
22843  const digit* digits = ((PyLongObject*)x)->ob_digit;
22844  switch (Py_SIZE(x)) {
22845  case 0: return (int) 0;
22846  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
22847  case 2:
22848  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
22849  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
22850  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22851  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
22852  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
22853  }
22854  }
22855  break;
22856  case 3:
22857  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
22858  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
22859  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22860  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
22861  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
22862  }
22863  }
22864  break;
22865  case 4:
22866  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
22867  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22868  __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])))
22869  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
22870  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
22871  }
22872  }
22873  break;
22874  }
22875 #endif
22876 #if CYTHON_COMPILING_IN_CPYTHON
22877  if (unlikely(Py_SIZE(x) < 0)) {
22878  goto raise_neg_overflow;
22879  }
22880 #else
22881  {
22882  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22883  if (unlikely(result < 0))
22884  return (int) -1;
22885  if (unlikely(result == 1))
22886  goto raise_neg_overflow;
22887  }
22888 #endif
22889  if (sizeof(int) <= sizeof(unsigned long)) {
22890  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
22891 #ifdef HAVE_LONG_LONG
22892  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
22893  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22894 #endif
22895  }
22896  } else {
22897 #if CYTHON_USE_PYLONG_INTERNALS
22898  const digit* digits = ((PyLongObject*)x)->ob_digit;
22899  switch (Py_SIZE(x)) {
22900  case 0: return (int) 0;
22901  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
22902  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
22903  case -2:
22904  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
22905  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
22906  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22907  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
22908  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22909  }
22910  }
22911  break;
22912  case 2:
22913  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
22914  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
22915  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22916  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
22917  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22918  }
22919  }
22920  break;
22921  case -3:
22922  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
22923  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
22924  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22925  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
22926  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22927  }
22928  }
22929  break;
22930  case 3:
22931  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
22932  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
22933  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22934  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
22935  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22936  }
22937  }
22938  break;
22939  case -4:
22940  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
22941  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22942  __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])))
22943  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
22944  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22945  }
22946  }
22947  break;
22948  case 4:
22949  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
22950  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22951  __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])))
22952  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
22953  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22954  }
22955  }
22956  break;
22957  }
22958 #endif
22959  if (sizeof(int) <= sizeof(long)) {
22960  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
22961 #ifdef HAVE_LONG_LONG
22962  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
22963  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
22964 #endif
22965  }
22966  }
22967  {
22968 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
22969  PyErr_SetString(PyExc_RuntimeError,
22970  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22971 #else
22972  int val;
22973  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22974  #if PY_MAJOR_VERSION < 3
22975  if (likely(v) && !PyLong_Check(v)) {
22976  PyObject *tmp = v;
22977  v = PyNumber_Long(tmp);
22978  Py_DECREF(tmp);
22979  }
22980  #endif
22981  if (likely(v)) {
22982  int one = 1; int is_little = (int)*(unsigned char *)&one;
22983  unsigned char *bytes = (unsigned char *)&val;
22984  int ret = _PyLong_AsByteArray((PyLongObject *)v,
22985  bytes, sizeof(val),
22986  is_little, !is_unsigned);
22987  Py_DECREF(v);
22988  if (likely(!ret))
22989  return val;
22990  }
22991 #endif
22992  return (int) -1;
22993  }
22994  } else {
22995  int val;
22996  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22997  if (!tmp) return (int) -1;
22998  val = __Pyx_PyInt_As_int(tmp);
22999  Py_DECREF(tmp);
23000  return val;
23001  }
23002 raise_overflow:
23003  PyErr_SetString(PyExc_OverflowError,
23004  "value too large to convert to int");
23005  return (int) -1;
23006 raise_neg_overflow:
23007  PyErr_SetString(PyExc_OverflowError,
23008  "can't convert negative value to int");
23009  return (int) -1;
23010 }
23011 
23012 /* CIntToPy */
23013 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
23014 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
23015 #pragma GCC diagnostic push
23016 #pragma GCC diagnostic ignored "-Wconversion"
23017 #endif
23018  const int neg_one = (int) -1, const_zero = (int) 0;
23019 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
23020 #pragma GCC diagnostic pop
23021 #endif
23022  const int is_unsigned = neg_one > const_zero;
23023  if (is_unsigned) {
23024  if (sizeof(int) < sizeof(long)) {
23025  return PyInt_FromLong((long) value);
23026  } else if (sizeof(int) <= sizeof(unsigned long)) {
23027  return PyLong_FromUnsignedLong((unsigned long) value);
23028 #ifdef HAVE_LONG_LONG
23029  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
23030  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
23031 #endif
23032  }
23033  } else {
23034  if (sizeof(int) <= sizeof(long)) {
23035  return PyInt_FromLong((long) value);
23036 #ifdef HAVE_LONG_LONG
23037  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
23038  return PyLong_FromLongLong((PY_LONG_LONG) value);
23039 #endif
23040  }
23041  }
23042  {
23043  int one = 1; int little = (int)*(unsigned char *)&one;
23044  unsigned char *bytes = (unsigned char *)&value;
23045  return _PyLong_FromByteArray(bytes, sizeof(int),
23046  little, !is_unsigned);
23047  }
23048 }
23049 
23050 /* TypeInfoToFormat */
23051 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) {
23052  struct __pyx_typeinfo_string result = { {0} };
23053  char *buf = (char *) result.string;
23054  size_t size = type->size;
23055  switch (type->typegroup) {
23056  case 'H':
23057  *buf = 'c';
23058  break;
23059  case 'I':
23060  case 'U':
23061  if (size == 1)
23062  *buf = (type->is_unsigned) ? 'B' : 'b';
23063  else if (size == 2)
23064  *buf = (type->is_unsigned) ? 'H' : 'h';
23065  else if (size == 4)
23066  *buf = (type->is_unsigned) ? 'I' : 'i';
23067  else if (size == 8)
23068  *buf = (type->is_unsigned) ? 'Q' : 'q';
23069  break;
23070  case 'P':
23071  *buf = 'P';
23072  break;
23073  case 'C':
23074  {
23075  __Pyx_TypeInfo complex_type = *type;
23076  complex_type.typegroup = 'R';
23077  complex_type.size /= 2;
23078  *buf++ = 'Z';
23079  *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
23080  break;
23081  }
23082  case 'R':
23083  if (size == 4)
23084  *buf = 'f';
23085  else if (size == 8)
23086  *buf = 'd';
23087  else
23088  *buf = 'g';
23089  break;
23090  }
23091  return result;
23092 }
23093 
23094 /* MemviewSliceCopyTemplate */
23095 static __Pyx_memviewslice
23096 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
23097  const char *mode, int ndim,
23098  size_t sizeof_dtype, int contig_flag,
23099  int dtype_is_object)
23100 {
23101  __Pyx_RefNannyDeclarations
23102  int i;
23103  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
23104  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
23105  Py_buffer *buf = &from_memview->view;
23106  PyObject *shape_tuple = NULL;
23107  PyObject *temp_int = NULL;
23108  struct __pyx_array_obj *array_obj = NULL;
23109  struct __pyx_memoryview_obj *memview_obj = NULL;
23110  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
23111  for (i = 0; i < ndim; i++) {
23112  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
23113  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
23114  "indirect dimensions (axis %d)", i);
23115  goto fail;
23116  }
23117  }
23118  shape_tuple = PyTuple_New(ndim);
23119  if (unlikely(!shape_tuple)) {
23120  goto fail;
23121  }
23122  __Pyx_GOTREF(shape_tuple);
23123  for(i = 0; i < ndim; i++) {
23124  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
23125  if(unlikely(!temp_int)) {
23126  goto fail;
23127  } else {
23128  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
23129  temp_int = NULL;
23130  }
23131  }
23132  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
23133  if (unlikely(!array_obj)) {
23134  goto fail;
23135  }
23136  __Pyx_GOTREF(array_obj);
23137  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
23138  (PyObject *) array_obj, contig_flag,
23139  dtype_is_object,
23140  from_mvs->memview->typeinfo);
23141  if (unlikely(!memview_obj))
23142  goto fail;
23143  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
23144  goto fail;
23145  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
23146  dtype_is_object) < 0))
23147  goto fail;
23148  goto no_fail;
23149 fail:
23150  __Pyx_XDECREF(new_mvs.memview);
23151  new_mvs.memview = NULL;
23152  new_mvs.data = NULL;
23153 no_fail:
23154  __Pyx_XDECREF(shape_tuple);
23155  __Pyx_XDECREF(temp_int);
23156  __Pyx_XDECREF(array_obj);
23157  __Pyx_RefNannyFinishContext();
23158  return new_mvs;
23159 }
23160 
23161 /* MemviewSliceInit */
23162 static int
23163 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
23164  int ndim,
23165  __Pyx_memviewslice *memviewslice,
23166  int memview_is_new_reference)
23167 {
23168  __Pyx_RefNannyDeclarations
23169  int i, retval=-1;
23170  Py_buffer *buf = &memview->view;
23171  __Pyx_RefNannySetupContext("init_memviewslice", 0);
23172  if (unlikely(memviewslice->memview || memviewslice->data)) {
23173  PyErr_SetString(PyExc_ValueError,
23174  "memviewslice is already initialized!");
23175  goto fail;
23176  }
23177  if (buf->strides) {
23178  for (i = 0; i < ndim; i++) {
23179  memviewslice->strides[i] = buf->strides[i];
23180  }
23181  } else {
23182  Py_ssize_t stride = buf->itemsize;
23183  for (i = ndim - 1; i >= 0; i--) {
23184  memviewslice->strides[i] = stride;
23185  stride *= buf->shape[i];
23186  }
23187  }
23188  for (i = 0; i < ndim; i++) {
23189  memviewslice->shape[i] = buf->shape[i];
23190  if (buf->suboffsets) {
23191  memviewslice->suboffsets[i] = buf->suboffsets[i];
23192  } else {
23193  memviewslice->suboffsets[i] = -1;
23194  }
23195  }
23196  memviewslice->memview = memview;
23197  memviewslice->data = (char *)buf->buf;
23198  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
23199  Py_INCREF(memview);
23200  }
23201  retval = 0;
23202  goto no_fail;
23203 fail:
23204  memviewslice->memview = 0;
23205  memviewslice->data = 0;
23206  retval = -1;
23207 no_fail:
23208  __Pyx_RefNannyFinishContext();
23209  return retval;
23210 }
23211 #ifndef Py_NO_RETURN
23212 #define Py_NO_RETURN
23213 #endif
23214 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
23215  va_list vargs;
23216  char msg[200];
23217 #ifdef HAVE_STDARG_PROTOTYPES
23218  va_start(vargs, fmt);
23219 #else
23220  va_start(vargs);
23221 #endif
23222  vsnprintf(msg, 200, fmt, vargs);
23223  va_end(vargs);
23224  Py_FatalError(msg);
23225 }
23226 static CYTHON_INLINE int
23227 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
23228  PyThread_type_lock lock)
23229 {
23230  int result;
23231  PyThread_acquire_lock(lock, 1);
23232  result = (*acquisition_count)++;
23233  PyThread_release_lock(lock);
23234  return result;
23235 }
23236 static CYTHON_INLINE int
23237 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
23238  PyThread_type_lock lock)
23239 {
23240  int result;
23241  PyThread_acquire_lock(lock, 1);
23242  result = (*acquisition_count)--;
23243  PyThread_release_lock(lock);
23244  return result;
23245 }
23246 static CYTHON_INLINE void
23247 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
23248 {
23249  int first_time;
23250  struct __pyx_memoryview_obj *memview = memslice->memview;
23251  if (unlikely(!memview || (PyObject *) memview == Py_None))
23252  return;
23253  if (unlikely(__pyx_get_slice_count(memview) < 0))
23254  __pyx_fatalerror("Acquisition count is %d (line %d)",
23255  __pyx_get_slice_count(memview), lineno);
23256  first_time = __pyx_add_acquisition_count(memview) == 0;
23257  if (unlikely(first_time)) {
23258  if (have_gil) {
23259  Py_INCREF((PyObject *) memview);
23260  } else {
23261  PyGILState_STATE _gilstate = PyGILState_Ensure();
23262  Py_INCREF((PyObject *) memview);
23263  PyGILState_Release(_gilstate);
23264  }
23265  }
23266 }
23267 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
23268  int have_gil, int lineno) {
23269  int last_time;
23270  struct __pyx_memoryview_obj *memview = memslice->memview;
23271  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
23272  memslice->memview = NULL;
23273  return;
23274  }
23275  if (unlikely(__pyx_get_slice_count(memview) <= 0))
23276  __pyx_fatalerror("Acquisition count is %d (line %d)",
23277  __pyx_get_slice_count(memview), lineno);
23278  last_time = __pyx_sub_acquisition_count(memview) == 1;
23279  memslice->data = NULL;
23280  if (unlikely(last_time)) {
23281  if (have_gil) {
23282  Py_CLEAR(memslice->memview);
23283  } else {
23284  PyGILState_STATE _gilstate = PyGILState_Ensure();
23285  Py_CLEAR(memslice->memview);
23286  PyGILState_Release(_gilstate);
23287  }
23288  } else {
23289  memslice->memview = NULL;
23290  }
23291 }
23292 
23293 /* CIntFromPy */
23294 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
23295 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
23296 #pragma GCC diagnostic push
23297 #pragma GCC diagnostic ignored "-Wconversion"
23298 #endif
23299  const long neg_one = (long) -1, const_zero = (long) 0;
23300 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
23301 #pragma GCC diagnostic pop
23302 #endif
23303  const int is_unsigned = neg_one > const_zero;
23304 #if PY_MAJOR_VERSION < 3
23305  if (likely(PyInt_Check(x))) {
23306  if (sizeof(long) < sizeof(long)) {
23307  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
23308  } else {
23309  long val = PyInt_AS_LONG(x);
23310  if (is_unsigned && unlikely(val < 0)) {
23311  goto raise_neg_overflow;
23312  }
23313  return (long) val;
23314  }
23315  } else
23316 #endif
23317  if (likely(PyLong_Check(x))) {
23318  if (is_unsigned) {
23319 #if CYTHON_USE_PYLONG_INTERNALS
23320  const digit* digits = ((PyLongObject*)x)->ob_digit;
23321  switch (Py_SIZE(x)) {
23322  case 0: return (long) 0;
23323  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
23324  case 2:
23325  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
23326  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
23327  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
23328  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
23329  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
23330  }
23331  }
23332  break;
23333  case 3:
23334  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
23335  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
23336  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
23337  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
23338  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
23339  }
23340  }
23341  break;
23342  case 4:
23343  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
23344  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
23345  __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])))
23346  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
23347  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
23348  }
23349  }
23350  break;
23351  }
23352 #endif
23353 #if CYTHON_COMPILING_IN_CPYTHON
23354  if (unlikely(Py_SIZE(x) < 0)) {
23355  goto raise_neg_overflow;
23356  }
23357 #else
23358  {
23359  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
23360  if (unlikely(result < 0))
23361  return (long) -1;
23362  if (unlikely(result == 1))
23363  goto raise_neg_overflow;
23364  }
23365 #endif
23366  if (sizeof(long) <= sizeof(unsigned long)) {
23367  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
23368 #ifdef HAVE_LONG_LONG
23369  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
23370  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
23371 #endif
23372  }
23373  } else {
23374 #if CYTHON_USE_PYLONG_INTERNALS
23375  const digit* digits = ((PyLongObject*)x)->ob_digit;
23376  switch (Py_SIZE(x)) {
23377  case 0: return (long) 0;
23378  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
23379  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
23380  case -2:
23381  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
23382  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
23383  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
23384  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
23385  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
23386  }
23387  }
23388  break;
23389  case 2:
23390  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
23391  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
23392  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
23393  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
23394  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
23395  }
23396  }
23397  break;
23398  case -3:
23399  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
23400  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
23401  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
23402  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
23403  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
23404  }
23405  }
23406  break;
23407  case 3:
23408  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
23409  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
23410  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
23411  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
23412  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
23413  }
23414  }
23415  break;
23416  case -4:
23417  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
23418  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
23419  __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])))
23420  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
23421  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
23422  }
23423  }
23424  break;
23425  case 4:
23426  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
23427  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
23428  __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])))
23429  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
23430  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
23431  }
23432  }
23433  break;
23434  }
23435 #endif
23436  if (sizeof(long) <= sizeof(long)) {
23437  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
23438 #ifdef HAVE_LONG_LONG
23439  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
23440  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
23441 #endif
23442  }
23443  }
23444  {
23445 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
23446  PyErr_SetString(PyExc_RuntimeError,
23447  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
23448 #else
23449  long val;
23450  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
23451  #if PY_MAJOR_VERSION < 3
23452  if (likely(v) && !PyLong_Check(v)) {
23453  PyObject *tmp = v;
23454  v = PyNumber_Long(tmp);
23455  Py_DECREF(tmp);
23456  }
23457  #endif
23458  if (likely(v)) {
23459  int one = 1; int is_little = (int)*(unsigned char *)&one;
23460  unsigned char *bytes = (unsigned char *)&val;
23461  int ret = _PyLong_AsByteArray((PyLongObject *)v,
23462  bytes, sizeof(val),
23463  is_little, !is_unsigned);
23464  Py_DECREF(v);
23465  if (likely(!ret))
23466  return val;
23467  }
23468 #endif
23469  return (long) -1;
23470  }
23471  } else {
23472  long val;
23473  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
23474  if (!tmp) return (long) -1;
23475  val = __Pyx_PyInt_As_long(tmp);
23476  Py_DECREF(tmp);
23477  return val;
23478  }
23479 raise_overflow:
23480  PyErr_SetString(PyExc_OverflowError,
23481  "value too large to convert to long");
23482  return (long) -1;
23483 raise_neg_overflow:
23484  PyErr_SetString(PyExc_OverflowError,
23485  "can't convert negative value to long");
23486  return (long) -1;
23487 }
23488 
23489 /* CIntToPy */
23490 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
23491 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
23492 #pragma GCC diagnostic push
23493 #pragma GCC diagnostic ignored "-Wconversion"
23494 #endif
23495  const long neg_one = (long) -1, const_zero = (long) 0;
23496 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
23497 #pragma GCC diagnostic pop
23498 #endif
23499  const int is_unsigned = neg_one > const_zero;
23500  if (is_unsigned) {
23501  if (sizeof(long) < sizeof(long)) {
23502  return PyInt_FromLong((long) value);
23503  } else if (sizeof(long) <= sizeof(unsigned long)) {
23504  return PyLong_FromUnsignedLong((unsigned long) value);
23505 #ifdef HAVE_LONG_LONG
23506  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
23507  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
23508 #endif
23509  }
23510  } else {
23511  if (sizeof(long) <= sizeof(long)) {
23512  return PyInt_FromLong((long) value);
23513 #ifdef HAVE_LONG_LONG
23514  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
23515  return PyLong_FromLongLong((PY_LONG_LONG) value);
23516 #endif
23517  }
23518  }
23519  {
23520  int one = 1; int little = (int)*(unsigned char *)&one;
23521  unsigned char *bytes = (unsigned char *)&value;
23522  return _PyLong_FromByteArray(bytes, sizeof(long),
23523  little, !is_unsigned);
23524  }
23525 }
23526 
23527 /* CIntFromPy */
23528 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
23529 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
23530 #pragma GCC diagnostic push
23531 #pragma GCC diagnostic ignored "-Wconversion"
23532 #endif
23533  const char neg_one = (char) -1, const_zero = (char) 0;
23534 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
23535 #pragma GCC diagnostic pop
23536 #endif
23537  const int is_unsigned = neg_one > const_zero;
23538 #if PY_MAJOR_VERSION < 3
23539  if (likely(PyInt_Check(x))) {
23540  if (sizeof(char) < sizeof(long)) {
23541  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
23542  } else {
23543  long val = PyInt_AS_LONG(x);
23544  if (is_unsigned && unlikely(val < 0)) {
23545  goto raise_neg_overflow;
23546  }
23547  return (char) val;
23548  }
23549  } else
23550 #endif
23551  if (likely(PyLong_Check(x))) {
23552  if (is_unsigned) {
23553 #if CYTHON_USE_PYLONG_INTERNALS
23554  const digit* digits = ((PyLongObject*)x)->ob_digit;
23555  switch (Py_SIZE(x)) {
23556  case 0: return (char) 0;
23557  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
23558  case 2:
23559  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
23560  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
23561  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
23562  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
23563  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
23564  }
23565  }
23566  break;
23567  case 3:
23568  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
23569  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
23570  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
23571  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
23572  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
23573  }
23574  }
23575  break;
23576  case 4:
23577  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
23578  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
23579  __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])))
23580  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
23581  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
23582  }
23583  }
23584  break;
23585  }
23586 #endif
23587 #if CYTHON_COMPILING_IN_CPYTHON
23588  if (unlikely(Py_SIZE(x) < 0)) {
23589  goto raise_neg_overflow;
23590  }
23591 #else
23592  {
23593  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
23594  if (unlikely(result < 0))
23595  return (char) -1;
23596  if (unlikely(result == 1))
23597  goto raise_neg_overflow;
23598  }
23599 #endif
23600  if (sizeof(char) <= sizeof(unsigned long)) {
23601  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
23602 #ifdef HAVE_LONG_LONG
23603  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
23604  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
23605 #endif
23606  }
23607  } else {
23608 #if CYTHON_USE_PYLONG_INTERNALS
23609  const digit* digits = ((PyLongObject*)x)->ob_digit;
23610  switch (Py_SIZE(x)) {
23611  case 0: return (char) 0;
23612  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
23613  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
23614  case -2:
23615  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
23616  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
23617  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
23618  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
23619  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
23620  }
23621  }
23622  break;
23623  case 2:
23624  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
23625  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
23626  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
23627  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
23628  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
23629  }
23630  }
23631  break;
23632  case -3:
23633  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
23634  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
23635  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
23636  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
23637  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
23638  }
23639  }
23640  break;
23641  case 3:
23642  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
23643  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
23644  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
23645  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
23646  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
23647  }
23648  }
23649  break;
23650  case -4:
23651  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
23652  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
23653  __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])))
23654  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
23655  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
23656  }
23657  }
23658  break;
23659  case 4:
23660  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
23661  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
23662  __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])))
23663  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
23664  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
23665  }
23666  }
23667  break;
23668  }
23669 #endif
23670  if (sizeof(char) <= sizeof(long)) {
23671  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
23672 #ifdef HAVE_LONG_LONG
23673  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
23674  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
23675 #endif
23676  }
23677  }
23678  {
23679 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
23680  PyErr_SetString(PyExc_RuntimeError,
23681  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
23682 #else
23683  char val;
23684  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
23685  #if PY_MAJOR_VERSION < 3
23686  if (likely(v) && !PyLong_Check(v)) {
23687  PyObject *tmp = v;
23688  v = PyNumber_Long(tmp);
23689  Py_DECREF(tmp);
23690  }
23691  #endif
23692  if (likely(v)) {
23693  int one = 1; int is_little = (int)*(unsigned char *)&one;
23694  unsigned char *bytes = (unsigned char *)&val;
23695  int ret = _PyLong_AsByteArray((PyLongObject *)v,
23696  bytes, sizeof(val),
23697  is_little, !is_unsigned);
23698  Py_DECREF(v);
23699  if (likely(!ret))
23700  return val;
23701  }
23702 #endif
23703  return (char) -1;
23704  }
23705  } else {
23706  char val;
23707  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
23708  if (!tmp) return (char) -1;
23709  val = __Pyx_PyInt_As_char(tmp);
23710  Py_DECREF(tmp);
23711  return val;
23712  }
23713 raise_overflow:
23714  PyErr_SetString(PyExc_OverflowError,
23715  "value too large to convert to char");
23716  return (char) -1;
23717 raise_neg_overflow:
23718  PyErr_SetString(PyExc_OverflowError,
23719  "can't convert negative value to char");
23720  return (char) -1;
23721 }
23722 
23723 /* CheckBinaryVersion */
23724 static int __Pyx_check_binary_version(void) {
23725  char ctversion[5];
23726  int same=1, i, found_dot;
23727  const char* rt_from_call = Py_GetVersion();
23728  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
23729  found_dot = 0;
23730  for (i = 0; i < 4; i++) {
23731  if (!ctversion[i]) {
23732  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
23733  break;
23734  }
23735  if (rt_from_call[i] != ctversion[i]) {
23736  same = 0;
23737  break;
23738  }
23739  }
23740  if (!same) {
23741  char rtversion[5] = {'\0'};
23742  char message[200];
23743  for (i=0; i<4; ++i) {
23744  if (rt_from_call[i] == '.') {
23745  if (found_dot) break;
23746  found_dot = 1;
23747  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
23748  break;
23749  }
23750  rtversion[i] = rt_from_call[i];
23751  }
23752  PyOS_snprintf(message, sizeof(message),
23753  "compiletime version %s of module '%.100s' "
23754  "does not match runtime version %s",
23755  ctversion, __Pyx_MODULE_NAME, rtversion);
23756  return PyErr_WarnEx(NULL, message, 1);
23757  }
23758  return 0;
23759 }
23760 
23761 /* InitStrings */
23762 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
23763  while (t->p) {
23764  #if PY_MAJOR_VERSION < 3
23765  if (t->is_unicode) {
23766  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
23767  } else if (t->intern) {
23768  *t->p = PyString_InternFromString(t->s);
23769  } else {
23770  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
23771  }
23772  #else
23773  if (t->is_unicode | t->is_str) {
23774  if (t->intern) {
23775  *t->p = PyUnicode_InternFromString(t->s);
23776  } else if (t->encoding) {
23777  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
23778  } else {
23779  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
23780  }
23781  } else {
23782  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
23783  }
23784  #endif
23785  if (!*t->p)
23786  return -1;
23787  if (PyObject_Hash(*t->p) == -1)
23788  return -1;
23789  ++t;
23790  }
23791  return 0;
23792 }
23793 
23794 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
23795  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
23796 }
23797 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
23798  Py_ssize_t ignore;
23799  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
23800 }
23801 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
23802 #if !CYTHON_PEP393_ENABLED
23803 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23804  char* defenc_c;
23805  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
23806  if (!defenc) return NULL;
23807  defenc_c = PyBytes_AS_STRING(defenc);
23808 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
23809  {
23810  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
23811  char* c;
23812  for (c = defenc_c; c < end; c++) {
23813  if ((unsigned char) (*c) >= 128) {
23814  PyUnicode_AsASCIIString(o);
23815  return NULL;
23816  }
23817  }
23818  }
23819 #endif
23820  *length = PyBytes_GET_SIZE(defenc);
23821  return defenc_c;
23822 }
23823 #else
23824 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23825  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
23826 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
23827  if (likely(PyUnicode_IS_ASCII(o))) {
23828  *length = PyUnicode_GET_LENGTH(o);
23829  return PyUnicode_AsUTF8(o);
23830  } else {
23831  PyUnicode_AsASCIIString(o);
23832  return NULL;
23833  }
23834 #else
23835  return PyUnicode_AsUTF8AndSize(o, length);
23836 #endif
23837 }
23838 #endif
23839 #endif
23840 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23841 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
23842  if (
23843 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
23844  __Pyx_sys_getdefaultencoding_not_ascii &&
23845 #endif
23846  PyUnicode_Check(o)) {
23847  return __Pyx_PyUnicode_AsStringAndSize(o, length);
23848  } else
23849 #endif
23850 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
23851  if (PyByteArray_Check(o)) {
23852  *length = PyByteArray_GET_SIZE(o);
23853  return PyByteArray_AS_STRING(o);
23854  } else
23855 #endif
23856  {
23857  char* result;
23858  int r = PyBytes_AsStringAndSize(o, &result, length);
23859  if (unlikely(r < 0)) {
23860  return NULL;
23861  } else {
23862  return result;
23863  }
23864  }
23865 }
23866 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
23867  int is_true = x == Py_True;
23868  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
23869  else return PyObject_IsTrue(x);
23870 }
23871 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
23872  int retval;
23873  if (unlikely(!x)) return -1;
23874  retval = __Pyx_PyObject_IsTrue(x);
23875  Py_DECREF(x);
23876  return retval;
23877 }
23878 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
23879 #if PY_MAJOR_VERSION >= 3
23880  if (PyLong_Check(result)) {
23881  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
23882  "__int__ returned non-int (type %.200s). "
23883  "The ability to return an instance of a strict subclass of int "
23884  "is deprecated, and may be removed in a future version of Python.",
23885  Py_TYPE(result)->tp_name)) {
23886  Py_DECREF(result);
23887  return NULL;
23888  }
23889  return result;
23890  }
23891 #endif
23892  PyErr_Format(PyExc_TypeError,
23893  "__%.4s__ returned non-%.4s (type %.200s)",
23894  type_name, type_name, Py_TYPE(result)->tp_name);
23895  Py_DECREF(result);
23896  return NULL;
23897 }
23898 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
23899 #if CYTHON_USE_TYPE_SLOTS
23900  PyNumberMethods *m;
23901 #endif
23902  const char *name = NULL;
23903  PyObject *res = NULL;
23904 #if PY_MAJOR_VERSION < 3
23905  if (likely(PyInt_Check(x) || PyLong_Check(x)))
23906 #else
23907  if (likely(PyLong_Check(x)))
23908 #endif
23909  return __Pyx_NewRef(x);
23910 #if CYTHON_USE_TYPE_SLOTS
23911  m = Py_TYPE(x)->tp_as_number;
23912  #if PY_MAJOR_VERSION < 3
23913  if (m && m->nb_int) {
23914  name = "int";
23915  res = m->nb_int(x);
23916  }
23917  else if (m && m->nb_long) {
23918  name = "long";
23919  res = m->nb_long(x);
23920  }
23921  #else
23922  if (likely(m && m->nb_int)) {
23923  name = "int";
23924  res = m->nb_int(x);
23925  }
23926  #endif
23927 #else
23928  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
23929  res = PyNumber_Int(x);
23930  }
23931 #endif
23932  if (likely(res)) {
23933 #if PY_MAJOR_VERSION < 3
23934  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
23935 #else
23936  if (unlikely(!PyLong_CheckExact(res))) {
23937 #endif
23938  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
23939  }
23940  }
23941  else if (!PyErr_Occurred()) {
23942  PyErr_SetString(PyExc_TypeError,
23943  "an integer is required");
23944  }
23945  return res;
23946 }
23947 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
23948  Py_ssize_t ival;
23949  PyObject *x;
23950 #if PY_MAJOR_VERSION < 3
23951  if (likely(PyInt_CheckExact(b))) {
23952  if (sizeof(Py_ssize_t) >= sizeof(long))
23953  return PyInt_AS_LONG(b);
23954  else
23955  return PyInt_AsSsize_t(b);
23956  }
23957 #endif
23958  if (likely(PyLong_CheckExact(b))) {
23959  #if CYTHON_USE_PYLONG_INTERNALS
23960  const digit* digits = ((PyLongObject*)b)->ob_digit;
23961  const Py_ssize_t size = Py_SIZE(b);
23962  if (likely(__Pyx_sst_abs(size) <= 1)) {
23963  ival = likely(size) ? digits[0] : 0;
23964  if (size == -1) ival = -ival;
23965  return ival;
23966  } else {
23967  switch (size) {
23968  case 2:
23969  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
23970  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
23971  }
23972  break;
23973  case -2:
23974  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
23975  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
23976  }
23977  break;
23978  case 3:
23979  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
23980  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
23981  }
23982  break;
23983  case -3:
23984  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
23985  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
23986  }
23987  break;
23988  case 4:
23989  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
23990  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]));
23991  }
23992  break;
23993  case -4:
23994  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
23995  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]));
23996  }
23997  break;
23998  }
23999  }
24000  #endif
24001  return PyLong_AsSsize_t(b);
24002  }
24003  x = PyNumber_Index(b);
24004  if (!x) return -1;
24005  ival = PyInt_AsSsize_t(x);
24006  Py_DECREF(x);
24007  return ival;
24008 }
24009 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
24010  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
24011  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
24012 #if PY_MAJOR_VERSION < 3
24013  } else if (likely(PyInt_CheckExact(o))) {
24014  return PyInt_AS_LONG(o);
24015 #endif
24016  } else {
24017  Py_ssize_t ival;
24018  PyObject *x;
24019  x = PyNumber_Index(o);
24020  if (!x) return -1;
24021  ival = PyInt_AsLong(x);
24022  Py_DECREF(x);
24023  return ival;
24024  }
24025 }
24026 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
24027  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
24028 }
24029 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
24030  return PyInt_FromSize_t(ival);
24031 }
24032 
24033 
24034 #endif /* Py_PYTHON_H */
sparsity.h
f
Double f
Definition: Headers.h:64
s
Double s
Definition: Headers.h:84
proteus::SparsityInfo
Definition: sparsity.h:11
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
c
Double c
Definition: Headers.h:54
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8