proteus  1.8.1
C/C++/Fortran libraries
cpartitioning.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__cpartitioning
708 #define __PYX_HAVE_API__cpartitioning
709 /* Early includes */
710 #include <string.h>
711 #include <stdio.h>
712 #include "numpy/arrayobject.h"
713 #include "numpy/ndarrayobject.h"
714 #include "numpy/ndarraytypes.h"
715 #include "numpy/arrayscalars.h"
716 #include "numpy/ufuncobject.h"
717 
718  /* NumPy API declarations from "numpy/__init__.pxd" */
719 
720 #include "mpi.h"
721 #include "mesh.h"
722 #include "partitioning.h"
723 #include "pythread.h"
724 #include <stdlib.h>
725 #include "pystate.h"
726 #ifdef _OPENMP
727 #include <omp.h>
728 #endif /* _OPENMP */
729 
730 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
731 #define CYTHON_WITHOUT_ASSERTIONS
732 #endif
733 
734 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
735  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
736 
737 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
738 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
739 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
740 #define __PYX_DEFAULT_STRING_ENCODING ""
741 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
742 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
743 #define __Pyx_uchar_cast(c) ((unsigned char)c)
744 #define __Pyx_long_cast(x) ((long)x)
745 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
746  (sizeof(type) < sizeof(Py_ssize_t)) ||\
747  (sizeof(type) > sizeof(Py_ssize_t) &&\
748  likely(v < (type)PY_SSIZE_T_MAX ||\
749  v == (type)PY_SSIZE_T_MAX) &&\
750  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
751  v == (type)PY_SSIZE_T_MIN))) ||\
752  (sizeof(type) == sizeof(Py_ssize_t) &&\
753  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
754  v == (type)PY_SSIZE_T_MAX))) )
755 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
756  return (size_t) i < (size_t) limit;
757 }
758 #if defined (__cplusplus) && __cplusplus >= 201103L
759  #include <cstdlib>
760  #define __Pyx_sst_abs(value) std::abs(value)
761 #elif SIZEOF_INT >= SIZEOF_SIZE_T
762  #define __Pyx_sst_abs(value) abs(value)
763 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
764  #define __Pyx_sst_abs(value) labs(value)
765 #elif defined (_MSC_VER)
766  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
767 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
768  #define __Pyx_sst_abs(value) llabs(value)
769 #elif defined (__GNUC__)
770  #define __Pyx_sst_abs(value) __builtin_llabs(value)
771 #else
772  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
773 #endif
774 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
775 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
776 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
777 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
778 #define __Pyx_PyBytes_FromString PyBytes_FromString
779 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
780 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
781 #if PY_MAJOR_VERSION < 3
782  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
783  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
784 #else
785  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
786  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
787 #endif
788 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
789 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
790 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
791 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
792 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
793 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
794 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
795 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
796 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
797 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
798 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
799 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
800 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
801 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
802 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
803 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
804 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
805  const Py_UNICODE *u_end = u;
806  while (*u_end++) ;
807  return (size_t)(u_end - u - 1);
808 }
809 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
810 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
811 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
812 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
813 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
814 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
815 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
816 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
817 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
818 #define __Pyx_PySequence_Tuple(obj)\
819  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
820 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
821 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
822 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
823 #if CYTHON_ASSUME_SAFE_MACROS
824 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
825 #else
826 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
827 #endif
828 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
829 #if PY_MAJOR_VERSION >= 3
830 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
831 #else
832 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
833 #endif
834 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
835 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
836 static int __Pyx_sys_getdefaultencoding_not_ascii;
837 static int __Pyx_init_sys_getdefaultencoding_params(void) {
838  PyObject* sys;
839  PyObject* default_encoding = NULL;
840  PyObject* ascii_chars_u = NULL;
841  PyObject* ascii_chars_b = NULL;
842  const char* default_encoding_c;
843  sys = PyImport_ImportModule("sys");
844  if (!sys) goto bad;
845  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
846  Py_DECREF(sys);
847  if (!default_encoding) goto bad;
848  default_encoding_c = PyBytes_AsString(default_encoding);
849  if (!default_encoding_c) goto bad;
850  if (strcmp(default_encoding_c, "ascii") == 0) {
851  __Pyx_sys_getdefaultencoding_not_ascii = 0;
852  } else {
853  char ascii_chars[128];
854  int c;
855  for (c = 0; c < 128; c++) {
856  ascii_chars[c] = c;
857  }
858  __Pyx_sys_getdefaultencoding_not_ascii = 1;
859  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
860  if (!ascii_chars_u) goto bad;
861  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
862  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
863  PyErr_Format(
864  PyExc_ValueError,
865  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
866  default_encoding_c);
867  goto bad;
868  }
869  Py_DECREF(ascii_chars_u);
870  Py_DECREF(ascii_chars_b);
871  }
872  Py_DECREF(default_encoding);
873  return 0;
874 bad:
875  Py_XDECREF(default_encoding);
876  Py_XDECREF(ascii_chars_u);
877  Py_XDECREF(ascii_chars_b);
878  return -1;
879 }
880 #endif
881 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
882 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
883 #else
884 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
885 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
886 static char* __PYX_DEFAULT_STRING_ENCODING;
887 static int __Pyx_init_sys_getdefaultencoding_params(void) {
888  PyObject* sys;
889  PyObject* default_encoding = NULL;
890  char* default_encoding_c;
891  sys = PyImport_ImportModule("sys");
892  if (!sys) goto bad;
893  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
894  Py_DECREF(sys);
895  if (!default_encoding) goto bad;
896  default_encoding_c = PyBytes_AsString(default_encoding);
897  if (!default_encoding_c) goto bad;
898  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
899  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
900  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
901  Py_DECREF(default_encoding);
902  return 0;
903 bad:
904  Py_XDECREF(default_encoding);
905  return -1;
906 }
907 #endif
908 #endif
909 
910 
911 /* Test for GCC > 2.95 */
912 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
913  #define likely(x) __builtin_expect(!!(x), 1)
914  #define unlikely(x) __builtin_expect(!!(x), 0)
915 #else /* !__GNUC__ or GCC < 2.95 */
916  #define likely(x) (x)
917  #define unlikely(x) (x)
918 #endif /* __GNUC__ */
919 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
920 
921 static PyObject *__pyx_m = NULL;
922 static PyObject *__pyx_d;
923 static PyObject *__pyx_b;
924 static PyObject *__pyx_cython_runtime = NULL;
925 static PyObject *__pyx_empty_tuple;
926 static PyObject *__pyx_empty_bytes;
927 static PyObject *__pyx_empty_unicode;
928 static int __pyx_lineno;
929 static int __pyx_clineno = 0;
930 static const char * __pyx_cfilenm= __FILE__;
931 static const char *__pyx_filename;
932 
933 /* Header.proto */
934 #if !defined(CYTHON_CCOMPLEX)
935  #if defined(__cplusplus)
936  #define CYTHON_CCOMPLEX 1
937  #elif defined(_Complex_I)
938  #define CYTHON_CCOMPLEX 1
939  #else
940  #define CYTHON_CCOMPLEX 0
941  #endif
942 #endif
943 #if CYTHON_CCOMPLEX
944  #ifdef __cplusplus
945  #include <complex>
946  #else
947  #include <complex.h>
948  #endif
949 #endif
950 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
951  #undef _Complex_I
952  #define _Complex_I 1.0fj
953 #endif
954 
955 
956 static const char *__pyx_f[] = {
957  "proteus/cpartitioning.pyx",
958  "__init__.pxd",
959  "stringsource",
960  "type.pxd",
961  "MPI.pxd",
962  "proteus/cmeshTools.pxd",
963 };
964 /* ForceInitThreads.proto */
965 #ifndef __PYX_FORCE_INIT_THREADS
966  #define __PYX_FORCE_INIT_THREADS 0
967 #endif
968 
969 /* NoFastGil.proto */
970 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
971 #define __Pyx_PyGILState_Release PyGILState_Release
972 #define __Pyx_FastGIL_Remember()
973 #define __Pyx_FastGIL_Forget()
974 #define __Pyx_FastGilFuncInit()
975 
976 /* BufferFormatStructs.proto */
977 #define IS_UNSIGNED(type) (((type) -1) > 0)
978 struct __Pyx_StructField_;
979 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
980 typedef struct {
981  const char* name;
982  struct __Pyx_StructField_* fields;
983  size_t size;
984  size_t arraysize[8];
985  int ndim;
986  char typegroup;
987  char is_unsigned;
988  int flags;
989 } __Pyx_TypeInfo;
990 typedef struct __Pyx_StructField_ {
991  __Pyx_TypeInfo* type;
992  const char* name;
993  size_t offset;
994 } __Pyx_StructField;
995 typedef struct {
996  __Pyx_StructField* field;
997  size_t parent_offset;
998 } __Pyx_BufFmt_StackElem;
999 typedef struct {
1000  __Pyx_StructField root;
1001  __Pyx_BufFmt_StackElem* head;
1002  size_t fmt_offset;
1003  size_t new_count, enc_count;
1004  size_t struct_alignment;
1005  int is_complex;
1006  char enc_type;
1007  char new_packmode;
1008  char enc_packmode;
1009  char is_valid_array;
1010 } __Pyx_BufFmt_Context;
1011 
1012 /* Atomics.proto */
1013 #include <pythread.h>
1014 #ifndef CYTHON_ATOMICS
1015  #define CYTHON_ATOMICS 1
1016 #endif
1017 #define __pyx_atomic_int_type int
1018 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
1019  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
1020  !defined(__i386__)
1021  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
1022  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
1023  #ifdef __PYX_DEBUG_ATOMICS
1024  #warning "Using GNU atomics"
1025  #endif
1026 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
1027  #include <Windows.h>
1028  #undef __pyx_atomic_int_type
1029  #define __pyx_atomic_int_type LONG
1030  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
1031  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
1032  #ifdef __PYX_DEBUG_ATOMICS
1033  #pragma message ("Using MSVC atomics")
1034  #endif
1035 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
1036  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
1037  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
1038  #ifdef __PYX_DEBUG_ATOMICS
1039  #warning "Using Intel atomics"
1040  #endif
1041 #else
1042  #undef CYTHON_ATOMICS
1043  #define CYTHON_ATOMICS 0
1044  #ifdef __PYX_DEBUG_ATOMICS
1045  #warning "Not using atomics"
1046  #endif
1047 #endif
1048 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1049 #if CYTHON_ATOMICS
1050  #define __pyx_add_acquisition_count(memview)\
1051  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1052  #define __pyx_sub_acquisition_count(memview)\
1053  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1054 #else
1055  #define __pyx_add_acquisition_count(memview)\
1056  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1057  #define __pyx_sub_acquisition_count(memview)\
1058  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1059 #endif
1060 
1061 /* MemviewSliceStruct.proto */
1062 struct __pyx_memoryview_obj;
1063 typedef struct {
1064  struct __pyx_memoryview_obj *memview;
1065  char *data;
1066  Py_ssize_t shape[8];
1067  Py_ssize_t strides[8];
1068  Py_ssize_t suboffsets[8];
1069 } __Pyx_memviewslice;
1070 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1071 
1072 
1073 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":690
1074  * # in Cython to enable them only on the right systems.
1075  *
1076  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1077  * ctypedef npy_int16 int16_t
1078  * ctypedef npy_int32 int32_t
1079  */
1080 typedef npy_int8 __pyx_t_5numpy_int8_t;
1081 
1082 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":691
1083  *
1084  * ctypedef npy_int8 int8_t
1085  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1086  * ctypedef npy_int32 int32_t
1087  * ctypedef npy_int64 int64_t
1088  */
1089 typedef npy_int16 __pyx_t_5numpy_int16_t;
1090 
1091 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":692
1092  * ctypedef npy_int8 int8_t
1093  * ctypedef npy_int16 int16_t
1094  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1095  * ctypedef npy_int64 int64_t
1096  * #ctypedef npy_int96 int96_t
1097  */
1098 typedef npy_int32 __pyx_t_5numpy_int32_t;
1099 
1100 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":693
1101  * ctypedef npy_int16 int16_t
1102  * ctypedef npy_int32 int32_t
1103  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1104  * #ctypedef npy_int96 int96_t
1105  * #ctypedef npy_int128 int128_t
1106  */
1107 typedef npy_int64 __pyx_t_5numpy_int64_t;
1108 
1109 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":697
1110  * #ctypedef npy_int128 int128_t
1111  *
1112  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1113  * ctypedef npy_uint16 uint16_t
1114  * ctypedef npy_uint32 uint32_t
1115  */
1116 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1117 
1118 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":698
1119  *
1120  * ctypedef npy_uint8 uint8_t
1121  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1122  * ctypedef npy_uint32 uint32_t
1123  * ctypedef npy_uint64 uint64_t
1124  */
1125 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1126 
1127 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":699
1128  * ctypedef npy_uint8 uint8_t
1129  * ctypedef npy_uint16 uint16_t
1130  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1131  * ctypedef npy_uint64 uint64_t
1132  * #ctypedef npy_uint96 uint96_t
1133  */
1134 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1135 
1136 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":700
1137  * ctypedef npy_uint16 uint16_t
1138  * ctypedef npy_uint32 uint32_t
1139  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1140  * #ctypedef npy_uint96 uint96_t
1141  * #ctypedef npy_uint128 uint128_t
1142  */
1143 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1144 
1145 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":704
1146  * #ctypedef npy_uint128 uint128_t
1147  *
1148  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1149  * ctypedef npy_float64 float64_t
1150  * #ctypedef npy_float80 float80_t
1151  */
1152 typedef npy_float32 __pyx_t_5numpy_float32_t;
1153 
1154 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":705
1155  *
1156  * ctypedef npy_float32 float32_t
1157  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1158  * #ctypedef npy_float80 float80_t
1159  * #ctypedef npy_float128 float128_t
1160  */
1161 typedef npy_float64 __pyx_t_5numpy_float64_t;
1162 
1163 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":714
1164  * # The int types are mapped a bit surprising --
1165  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1166  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1167  * ctypedef npy_longlong long_t
1168  * ctypedef npy_longlong longlong_t
1169  */
1170 typedef npy_long __pyx_t_5numpy_int_t;
1171 
1172 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":715
1173  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1174  * ctypedef npy_long int_t
1175  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1176  * ctypedef npy_longlong longlong_t
1177  *
1178  */
1179 typedef npy_longlong __pyx_t_5numpy_long_t;
1180 
1181 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":716
1182  * ctypedef npy_long int_t
1183  * ctypedef npy_longlong long_t
1184  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1185  *
1186  * ctypedef npy_ulong uint_t
1187  */
1188 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1189 
1190 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":718
1191  * ctypedef npy_longlong longlong_t
1192  *
1193  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1194  * ctypedef npy_ulonglong ulong_t
1195  * ctypedef npy_ulonglong ulonglong_t
1196  */
1197 typedef npy_ulong __pyx_t_5numpy_uint_t;
1198 
1199 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":719
1200  *
1201  * ctypedef npy_ulong uint_t
1202  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1203  * ctypedef npy_ulonglong ulonglong_t
1204  *
1205  */
1206 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1207 
1208 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":720
1209  * ctypedef npy_ulong uint_t
1210  * ctypedef npy_ulonglong ulong_t
1211  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1212  *
1213  * ctypedef npy_intp intp_t
1214  */
1215 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1216 
1217 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":722
1218  * ctypedef npy_ulonglong ulonglong_t
1219  *
1220  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1221  * ctypedef npy_uintp uintp_t
1222  *
1223  */
1224 typedef npy_intp __pyx_t_5numpy_intp_t;
1225 
1226 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":723
1227  *
1228  * ctypedef npy_intp intp_t
1229  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1230  *
1231  * ctypedef npy_double float_t
1232  */
1233 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1234 
1235 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":725
1236  * ctypedef npy_uintp uintp_t
1237  *
1238  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1239  * ctypedef npy_double double_t
1240  * ctypedef npy_longdouble longdouble_t
1241  */
1242 typedef npy_double __pyx_t_5numpy_float_t;
1243 
1244 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":726
1245  *
1246  * ctypedef npy_double float_t
1247  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1248  * ctypedef npy_longdouble longdouble_t
1249  *
1250  */
1251 typedef npy_double __pyx_t_5numpy_double_t;
1252 
1253 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":727
1254  * ctypedef npy_double float_t
1255  * ctypedef npy_double double_t
1256  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1257  *
1258  * ctypedef npy_cfloat cfloat_t
1259  */
1260 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1261 /* Declarations.proto */
1262 #if CYTHON_CCOMPLEX
1263  #ifdef __cplusplus
1264  typedef ::std::complex< float > __pyx_t_float_complex;
1265  #else
1266  typedef float _Complex __pyx_t_float_complex;
1267  #endif
1268 #else
1269  typedef struct { float real, imag; } __pyx_t_float_complex;
1270 #endif
1271 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1272 
1273 /* Declarations.proto */
1274 #if CYTHON_CCOMPLEX
1275  #ifdef __cplusplus
1276  typedef ::std::complex< double > __pyx_t_double_complex;
1277  #else
1278  typedef double _Complex __pyx_t_double_complex;
1279  #endif
1280 #else
1281  typedef struct { double real, imag; } __pyx_t_double_complex;
1282 #endif
1283 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1284 
1285 
1286 /*--- Type declarations ---*/
1287 struct PyMPIDatatypeObject;
1288 struct PyMPIStatusObject;
1289 struct PyMPIRequestObject;
1290 struct PyMPIPrequestObject;
1291 struct PyMPIGrequestObject;
1292 struct PyMPIMessageObject;
1293 struct PyMPIOpObject;
1294 struct PyMPIGroupObject;
1295 struct PyMPIInfoObject;
1296 struct PyMPIErrhandlerObject;
1297 struct PyMPICommObject;
1298 struct PyMPIIntracommObject;
1299 struct PyMPITopocommObject;
1300 struct PyMPICartcommObject;
1301 struct PyMPIGraphcommObject;
1302 struct PyMPIDistgraphcommObject;
1303 struct PyMPIIntercommObject;
1304 struct PyMPIWinObject;
1305 struct PyMPIFileObject;
1306 struct __pyx_obj_7proteus_10cmeshTools_CMesh;
1307 struct __pyx_array_obj;
1308 struct __pyx_MemviewEnum_obj;
1309 struct __pyx_memoryview_obj;
1310 struct __pyx_memoryviewslice_obj;
1311 
1312 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":729
1313  * ctypedef npy_longdouble longdouble_t
1314  *
1315  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1316  * ctypedef npy_cdouble cdouble_t
1317  * ctypedef npy_clongdouble clongdouble_t
1318  */
1319 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1320 
1321 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":730
1322  *
1323  * ctypedef npy_cfloat cfloat_t
1324  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1325  * ctypedef npy_clongdouble clongdouble_t
1326  *
1327  */
1328 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1329 
1330 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":731
1331  * ctypedef npy_cfloat cfloat_t
1332  * ctypedef npy_cdouble cdouble_t
1333  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1334  *
1335  * ctypedef npy_cdouble complex_t
1336  */
1337 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1338 
1339 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":733
1340  * ctypedef npy_clongdouble clongdouble_t
1341  *
1342  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1343  *
1344  * cdef inline object PyArray_MultiIterNew1(a):
1345  */
1346 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1347 
1348 /* "mpi4py/MPI.pxd":28
1349  * ctypedef MPI_Count Count "MPI_Count"
1350  *
1351  * ctypedef public api class Datatype [ # <<<<<<<<<<<<<<
1352  * type PyMPIDatatype_Type,
1353  * object PyMPIDatatypeObject,
1354  */
1355 struct PyMPIDatatypeObject {
1356  PyObject_HEAD
1357  MPI_Datatype ob_mpi;
1358  unsigned int flags;
1359  PyObject *__weakref__;
1360 };
1361 typedef struct PyMPIDatatypeObject PyMPIDatatypeObject;
1362 
1363 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDatatype_Type;
1364 
1365 /* "mpi4py/MPI.pxd":36
1366  * cdef object __weakref__
1367  *
1368  * ctypedef public api class Status [ # <<<<<<<<<<<<<<
1369  * type PyMPIStatus_Type,
1370  * object PyMPIStatusObject,
1371  */
1372 struct PyMPIStatusObject {
1373  PyObject_HEAD
1374  MPI_Status ob_mpi;
1375  unsigned int flags;
1376  PyObject *__weakref__;
1377 };
1378 typedef struct PyMPIStatusObject PyMPIStatusObject;
1379 
1380 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIStatus_Type;
1381 
1382 /* "mpi4py/MPI.pxd":44
1383  * cdef object __weakref__
1384  *
1385  * ctypedef public api class Request [ # <<<<<<<<<<<<<<
1386  * type PyMPIRequest_Type,
1387  * object PyMPIRequestObject,
1388  */
1389 struct PyMPIRequestObject {
1390  PyObject_HEAD
1391  MPI_Request ob_mpi;
1392  unsigned int flags;
1393  PyObject *__weakref__;
1394  PyObject *ob_buf;
1395 };
1396 typedef struct PyMPIRequestObject PyMPIRequestObject;
1397 
1398 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIRequest_Type;
1399 
1400 /* "mpi4py/MPI.pxd":53
1401  * cdef object ob_buf
1402  *
1403  * ctypedef public api class Prequest(Request) [ # <<<<<<<<<<<<<<
1404  * type PyMPIPrequest_Type,
1405  * object PyMPIPrequestObject,
1406  */
1407 struct PyMPIPrequestObject {
1408  struct PyMPIRequestObject __pyx_base;
1409 };
1410 typedef struct PyMPIPrequestObject PyMPIPrequestObject;
1411 
1412 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIPrequest_Type;
1413 
1414 /* "mpi4py/MPI.pxd":59
1415  * pass
1416  *
1417  * ctypedef public api class Grequest(Request) [ # <<<<<<<<<<<<<<
1418  * type PyMPIGrequest_Type,
1419  * object PyMPIGrequestObject,
1420  */
1421 struct PyMPIGrequestObject {
1422  struct PyMPIRequestObject __pyx_base;
1423  MPI_Request ob_grequest;
1424 };
1425 typedef struct PyMPIGrequestObject PyMPIGrequestObject;
1426 
1427 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGrequest_Type;
1428 
1429 /* "mpi4py/MPI.pxd":65
1430  * cdef MPI_Request ob_grequest
1431  *
1432  * ctypedef public api class Message [ # <<<<<<<<<<<<<<
1433  * type PyMPIMessage_Type,
1434  * object PyMPIMessageObject,
1435  */
1436 struct PyMPIMessageObject {
1437  PyObject_HEAD
1438  MPI_Message ob_mpi;
1439  unsigned int flags;
1440  PyObject *__weakref__;
1441  PyObject *ob_buf;
1442 };
1443 typedef struct PyMPIMessageObject PyMPIMessageObject;
1444 
1445 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIMessage_Type;
1446 
1447 /* "mpi4py/MPI.pxd":74
1448  * cdef object ob_buf
1449  *
1450  * ctypedef public api class Op [ # <<<<<<<<<<<<<<
1451  * type PyMPIOp_Type,
1452  * object PyMPIOpObject,
1453  */
1454 struct PyMPIOpObject {
1455  PyObject_HEAD
1456  MPI_Op ob_mpi;
1457  unsigned int flags;
1458  PyObject *__weakref__;
1459  PyObject *(*ob_func)(PyObject *, PyObject *);
1460  int ob_usrid;
1461 };
1462 typedef struct PyMPIOpObject PyMPIOpObject;
1463 
1464 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIOp_Type;
1465 
1466 /* "mpi4py/MPI.pxd":84
1467  * cdef int ob_usrid
1468  *
1469  * ctypedef public api class Group [ # <<<<<<<<<<<<<<
1470  * type PyMPIGroup_Type,
1471  * object PyMPIGroupObject,
1472  */
1473 struct PyMPIGroupObject {
1474  PyObject_HEAD
1475  MPI_Group ob_mpi;
1476  unsigned int flags;
1477  PyObject *__weakref__;
1478 };
1479 typedef struct PyMPIGroupObject PyMPIGroupObject;
1480 
1481 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGroup_Type;
1482 
1483 /* "mpi4py/MPI.pxd":92
1484  * cdef object __weakref__
1485  *
1486  * ctypedef public api class Info [ # <<<<<<<<<<<<<<
1487  * type PyMPIInfo_Type,
1488  * object PyMPIInfoObject,
1489  */
1490 struct PyMPIInfoObject {
1491  PyObject_HEAD
1492  MPI_Info ob_mpi;
1493  unsigned int flags;
1494  PyObject *__weakref__;
1495 };
1496 typedef struct PyMPIInfoObject PyMPIInfoObject;
1497 
1498 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIInfo_Type;
1499 
1500 /* "mpi4py/MPI.pxd":100
1501  * cdef object __weakref__
1502  *
1503  * ctypedef public api class Errhandler [ # <<<<<<<<<<<<<<
1504  * type PyMPIErrhandler_Type,
1505  * object PyMPIErrhandlerObject,
1506  */
1507 struct PyMPIErrhandlerObject {
1508  PyObject_HEAD
1509  MPI_Errhandler ob_mpi;
1510  unsigned int flags;
1511  PyObject *__weakref__;
1512 };
1513 typedef struct PyMPIErrhandlerObject PyMPIErrhandlerObject;
1514 
1515 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIErrhandler_Type;
1516 
1517 /* "mpi4py/MPI.pxd":108
1518  * cdef object __weakref__
1519  *
1520  * ctypedef public api class Comm [ # <<<<<<<<<<<<<<
1521  * type PyMPIComm_Type,
1522  * object PyMPICommObject,
1523  */
1524 struct PyMPICommObject {
1525  PyObject_HEAD
1526  MPI_Comm ob_mpi;
1527  unsigned int flags;
1528  PyObject *__weakref__;
1529 };
1530 typedef struct PyMPICommObject PyMPICommObject;
1531 
1532 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIComm_Type;
1533 
1534 /* "mpi4py/MPI.pxd":116
1535  * cdef object __weakref__
1536  *
1537  * ctypedef public api class Intracomm(Comm) [ # <<<<<<<<<<<<<<
1538  * type PyMPIIntracomm_Type,
1539  * object PyMPIIntracommObject,
1540  */
1541 struct PyMPIIntracommObject {
1542  struct PyMPICommObject __pyx_base;
1543 };
1544 typedef struct PyMPIIntracommObject PyMPIIntracommObject;
1545 
1546 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntracomm_Type;
1547 
1548 /* "mpi4py/MPI.pxd":122
1549  * pass
1550  *
1551  * ctypedef public api class Topocomm(Intracomm) [ # <<<<<<<<<<<<<<
1552  * type PyMPITopocomm_Type,
1553  * object PyMPITopocommObject,
1554  */
1555 struct PyMPITopocommObject {
1556  struct PyMPIIntracommObject __pyx_base;
1557 };
1558 typedef struct PyMPITopocommObject PyMPITopocommObject;
1559 
1560 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPITopocomm_Type;
1561 
1562 /* "mpi4py/MPI.pxd":128
1563  * pass
1564  *
1565  * ctypedef public api class Cartcomm(Topocomm) [ # <<<<<<<<<<<<<<
1566  * type PyMPICartcomm_Type,
1567  * object PyMPICartcommObject,
1568  */
1569 struct PyMPICartcommObject {
1570  struct PyMPITopocommObject __pyx_base;
1571 };
1572 typedef struct PyMPICartcommObject PyMPICartcommObject;
1573 
1574 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPICartcomm_Type;
1575 
1576 /* "mpi4py/MPI.pxd":134
1577  * pass
1578  *
1579  * ctypedef public api class Graphcomm(Topocomm) [ # <<<<<<<<<<<<<<
1580  * type PyMPIGraphcomm_Type,
1581  * object PyMPIGraphcommObject,
1582  */
1583 struct PyMPIGraphcommObject {
1584  struct PyMPITopocommObject __pyx_base;
1585 };
1586 typedef struct PyMPIGraphcommObject PyMPIGraphcommObject;
1587 
1588 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIGraphcomm_Type;
1589 
1590 /* "mpi4py/MPI.pxd":140
1591  * pass
1592  *
1593  * ctypedef public api class Distgraphcomm(Topocomm) [ # <<<<<<<<<<<<<<
1594  * type PyMPIDistgraphcomm_Type,
1595  * object PyMPIDistgraphcommObject,
1596  */
1597 struct PyMPIDistgraphcommObject {
1598  struct PyMPITopocommObject __pyx_base;
1599 };
1600 typedef struct PyMPIDistgraphcommObject PyMPIDistgraphcommObject;
1601 
1602 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIDistgraphcomm_Type;
1603 
1604 /* "mpi4py/MPI.pxd":146
1605  * pass
1606  *
1607  * ctypedef public api class Intercomm(Comm) [ # <<<<<<<<<<<<<<
1608  * type PyMPIIntercomm_Type,
1609  * object PyMPIIntercommObject,
1610  */
1611 struct PyMPIIntercommObject {
1612  struct PyMPICommObject __pyx_base;
1613 };
1614 typedef struct PyMPIIntercommObject PyMPIIntercommObject;
1615 
1616 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIIntercomm_Type;
1617 
1618 /* "mpi4py/MPI.pxd":152
1619  * pass
1620  *
1621  * ctypedef public api class Win [ # <<<<<<<<<<<<<<
1622  * type PyMPIWin_Type,
1623  * object PyMPIWinObject,
1624  */
1625 struct PyMPIWinObject {
1626  PyObject_HEAD
1627  MPI_Win ob_mpi;
1628  unsigned int flags;
1629  PyObject *__weakref__;
1630  PyObject *ob_mem;
1631 };
1632 typedef struct PyMPIWinObject PyMPIWinObject;
1633 
1634 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIWin_Type;
1635 
1636 /* "mpi4py/MPI.pxd":161
1637  * cdef object ob_mem
1638  *
1639  * ctypedef public api class File [ # <<<<<<<<<<<<<<
1640  * type PyMPIFile_Type,
1641  * object PyMPIFileObject,
1642  */
1643 struct PyMPIFileObject {
1644  PyObject_HEAD
1645  MPI_File ob_mpi;
1646  unsigned int flags;
1647  PyObject *__weakref__;
1648 };
1649 typedef struct PyMPIFileObject PyMPIFileObject;
1650 
1651 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyMPIFile_Type;
1652 
1653 /* "cmeshTools.pxd":5
1654  * cimport mesh as cppm
1655  *
1656  * cdef class CMesh: # <<<<<<<<<<<<<<
1657  * cdef cppm.Mesh mesh
1658  * cdef public:
1659  */
1660 struct __pyx_obj_7proteus_10cmeshTools_CMesh {
1661  PyObject_HEAD
1662  struct Mesh mesh;
1663  int nElements_global;
1664  int nNodes_global;
1665  int nNodes_element;
1671  int max_nElements_node;
1672  int nEdges_global;
1674  PyArrayObject *elementNodesArray;
1675  PyArrayObject *nodeElementsArray;
1676  PyArrayObject *nodeElementOffsets;
1677  PyArrayObject *elementNeighborsArray;
1678  PyArrayObject *elementBoundariesArray;
1679  PyArrayObject *elementBoundaryNodesArray;
1680  PyArrayObject *elementBoundaryElementsArray;
1682  PyArrayObject *interiorElementBoundariesArray;
1683  PyArrayObject *exteriorElementBoundariesArray;
1684  PyArrayObject *edgeNodesArray;
1685  PyArrayObject *nodeStarArray;
1686  PyArrayObject *nodeStarOffsets;
1687  PyArrayObject *elementMaterialTypes;
1688  PyArrayObject *elementBoundaryMaterialTypes;
1689  PyArrayObject *nodeMaterialTypes;
1690  PyArrayObject *nodeArray;
1691  int nx;
1692  int ny;
1693  int nz;
1694  int px;
1695  int py;
1696  int pz;
1697  PyArrayObject *elementIJK;
1698  PyArrayObject *weights;
1699  PyArrayObject *U_KNOT;
1700  PyArrayObject *V_KNOT;
1701  PyArrayObject *W_KNOT;
1702  PyArrayObject *elementDiametersArray;
1703  PyArrayObject *elementInnerDiametersArray;
1704  PyArrayObject *elementBoundaryDiametersArray;
1705  PyArrayObject *elementBarycentersArray;
1706  PyArrayObject *elementBoundaryBarycentersArray;
1707  PyArrayObject *nodeDiametersArray;
1708  PyArrayObject *nodeSupportArray;
1709  double h;
1710  double hMin;
1711  double sigmaMax;
1712  double volume;
1713 };
1714 
1715 
1716 /* "View.MemoryView":105
1717  *
1718  * @cname("__pyx_array")
1719  * cdef class array: # <<<<<<<<<<<<<<
1720  *
1721  * cdef:
1722  */
1723 struct __pyx_array_obj {
1724  PyObject_HEAD
1725  struct __pyx_vtabstruct_array *__pyx_vtab;
1726  char *data;
1727  Py_ssize_t len;
1728  char *format;
1729  int ndim;
1730  Py_ssize_t *_shape;
1731  Py_ssize_t *_strides;
1732  Py_ssize_t itemsize;
1733  PyObject *mode;
1734  PyObject *_format;
1735  void (*callback_free_data)(void *);
1736  int free_data;
1737  int dtype_is_object;
1738 };
1739 
1740 
1741 /* "View.MemoryView":279
1742  *
1743  * @cname('__pyx_MemviewEnum')
1744  * cdef class Enum(object): # <<<<<<<<<<<<<<
1745  * cdef object name
1746  * def __init__(self, name):
1747  */
1748 struct __pyx_MemviewEnum_obj {
1749  PyObject_HEAD
1750  PyObject *name;
1751 };
1752 
1753 
1754 /* "View.MemoryView":330
1755  *
1756  * @cname('__pyx_memoryview')
1757  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1758  *
1759  * cdef object obj
1760  */
1761 struct __pyx_memoryview_obj {
1762  PyObject_HEAD
1763  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1764  PyObject *obj;
1765  PyObject *_size;
1766  PyObject *_array_interface;
1767  PyThread_type_lock lock;
1768  __pyx_atomic_int acquisition_count[2];
1769  __pyx_atomic_int *acquisition_count_aligned_p;
1770  Py_buffer view;
1771  int flags;
1772  int dtype_is_object;
1773  __Pyx_TypeInfo *typeinfo;
1774 };
1775 
1776 
1777 /* "View.MemoryView":965
1778  *
1779  * @cname('__pyx_memoryviewslice')
1780  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1781  * "Internal class for passing memoryview slices to Python"
1782  *
1783  */
1784 struct __pyx_memoryviewslice_obj {
1785  struct __pyx_memoryview_obj __pyx_base;
1786  __Pyx_memviewslice from_slice;
1787  PyObject *from_object;
1788  PyObject *(*to_object_func)(char *);
1789  int (*to_dtype_func)(char *, PyObject *);
1790 };
1791 
1792 
1793 
1794 /* "View.MemoryView":105
1795  *
1796  * @cname("__pyx_array")
1797  * cdef class array: # <<<<<<<<<<<<<<
1798  *
1799  * cdef:
1800  */
1801 
1802 struct __pyx_vtabstruct_array {
1803  PyObject *(*get_memview)(struct __pyx_array_obj *);
1804 };
1805 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1806 
1807 
1808 /* "View.MemoryView":330
1809  *
1810  * @cname('__pyx_memoryview')
1811  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1812  *
1813  * cdef object obj
1814  */
1815 
1816 struct __pyx_vtabstruct_memoryview {
1817  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1818  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1819  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1820  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1821  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1822  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1823  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1824 };
1825 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1826 
1827 
1828 /* "View.MemoryView":965
1829  *
1830  * @cname('__pyx_memoryviewslice')
1831  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1832  * "Internal class for passing memoryview slices to Python"
1833  *
1834  */
1835 
1836 struct __pyx_vtabstruct__memoryviewslice {
1837  struct __pyx_vtabstruct_memoryview __pyx_base;
1838 };
1839 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1840 
1841 /* --- Runtime support code (head) --- */
1842 /* Refnanny.proto */
1843 #ifndef CYTHON_REFNANNY
1844  #define CYTHON_REFNANNY 0
1845 #endif
1846 #if CYTHON_REFNANNY
1847  typedef struct {
1848  void (*INCREF)(void*, PyObject*, int);
1849  void (*DECREF)(void*, PyObject*, int);
1850  void (*GOTREF)(void*, PyObject*, int);
1851  void (*GIVEREF)(void*, PyObject*, int);
1852  void* (*SetupContext)(const char*, int, const char*);
1853  void (*FinishContext)(void**);
1854  } __Pyx_RefNannyAPIStruct;
1855  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1856  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1857  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1858 #ifdef WITH_THREAD
1859  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1860  if (acquire_gil) {\
1861  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1862  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1863  PyGILState_Release(__pyx_gilstate_save);\
1864  } else {\
1865  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1866  }
1867 #else
1868  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1869  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1870 #endif
1871  #define __Pyx_RefNannyFinishContext()\
1872  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1873  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1874  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1875  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1876  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1877  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1878  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1879  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1880  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1881 #else
1882  #define __Pyx_RefNannyDeclarations
1883  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1884  #define __Pyx_RefNannyFinishContext()
1885  #define __Pyx_INCREF(r) Py_INCREF(r)
1886  #define __Pyx_DECREF(r) Py_DECREF(r)
1887  #define __Pyx_GOTREF(r)
1888  #define __Pyx_GIVEREF(r)
1889  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1890  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1891  #define __Pyx_XGOTREF(r)
1892  #define __Pyx_XGIVEREF(r)
1893 #endif
1894 #define __Pyx_XDECREF_SET(r, v) do {\
1895  PyObject *tmp = (PyObject *) r;\
1896  r = v; __Pyx_XDECREF(tmp);\
1897  } while (0)
1898 #define __Pyx_DECREF_SET(r, v) do {\
1899  PyObject *tmp = (PyObject *) r;\
1900  r = v; __Pyx_DECREF(tmp);\
1901  } while (0)
1902 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1903 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1904 
1905 /* RaiseArgTupleInvalid.proto */
1906 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1907  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1908 
1909 /* RaiseDoubleKeywords.proto */
1910 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1911 
1912 /* ParseKeywords.proto */
1913 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1914  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1915  const char* function_name);
1916 
1917 /* ArgTypeTest.proto */
1918 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1919  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1920  __Pyx__ArgTypeTest(obj, type, name, exact))
1921 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1922 
1923 /* PyObjectGetAttrStr.proto */
1924 #if CYTHON_USE_TYPE_SLOTS
1925 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1926 #else
1927 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1928 #endif
1929 
1930 /* GetBuiltinName.proto */
1931 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1932 
1933 /* PyDictVersioning.proto */
1934 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1935 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1936 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1937 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1938  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1939  (cache_var) = (value);
1940 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1941  static PY_UINT64_T __pyx_dict_version = 0;\
1942  static PyObject *__pyx_dict_cached_value = NULL;\
1943  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1944  (VAR) = __pyx_dict_cached_value;\
1945  } else {\
1946  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1947  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1948  }\
1949 }
1950 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1951 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1952 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1953 #else
1954 #define __PYX_GET_DICT_VERSION(dict) (0)
1955 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1956 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1957 #endif
1958 
1959 /* GetModuleGlobalName.proto */
1960 #if CYTHON_USE_DICT_VERSIONS
1961 #define __Pyx_GetModuleGlobalName(var, name) {\
1962  static PY_UINT64_T __pyx_dict_version = 0;\
1963  static PyObject *__pyx_dict_cached_value = NULL;\
1964  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1965  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1966  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1967 }
1968 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1969  PY_UINT64_T __pyx_dict_version;\
1970  PyObject *__pyx_dict_cached_value;\
1971  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1972 }
1973 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1974 #else
1975 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1976 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1977 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1978 #endif
1979 
1980 /* PyIntBinop.proto */
1981 #if !CYTHON_COMPILING_IN_PYPY
1982 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1983 #else
1984 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1985  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1986 #endif
1987 
1988 /* PyCFunctionFastCall.proto */
1989 #if CYTHON_FAST_PYCCALL
1990 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1991 #else
1992 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1993 #endif
1994 
1995 /* PyFunctionFastCall.proto */
1996 #if CYTHON_FAST_PYCALL
1997 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1998  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1999 #if 1 || PY_VERSION_HEX < 0x030600B1
2000 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
2001 #else
2002 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
2003 #endif
2004 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
2005  (sizeof(char [1 - 2*!(cond)]) - 1)
2006 #ifndef Py_MEMBER_SIZE
2007 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
2008 #endif
2009 #if CYTHON_FAST_PYCALL
2010  static size_t __pyx_pyframe_localsplus_offset = 0;
2011  #include "frameobject.h"
2012 #if PY_VERSION_HEX >= 0x030b00a6
2013  #ifndef Py_BUILD_CORE
2014  #define Py_BUILD_CORE 1
2015  #endif
2016  #include "internal/pycore_frame.h"
2017 #endif
2018  #define __Pxy_PyFrame_Initialize_Offsets()\
2019  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2020  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2021  #define __Pyx_PyFrame_GetLocalsplus(frame)\
2022  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2023 #endif // CYTHON_FAST_PYCALL
2024 #endif
2025 
2026 /* PyObjectCall.proto */
2027 #if CYTHON_COMPILING_IN_CPYTHON
2028 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2029 #else
2030 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2031 #endif
2032 
2033 /* PyObjectCall2Args.proto */
2034 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
2035 
2036 /* PyObjectCallMethO.proto */
2037 #if CYTHON_COMPILING_IN_CPYTHON
2038 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2039 #endif
2040 
2041 /* PyObjectCallOneArg.proto */
2042 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2043 
2044 /* PyObjectCallNoArg.proto */
2045 #if CYTHON_COMPILING_IN_CPYTHON
2046 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2047 #else
2048 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
2049 #endif
2050 
2051 /* GetTopmostException.proto */
2052 #if CYTHON_USE_EXC_INFO_STACK
2053 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2054 #endif
2055 
2056 /* PyThreadStateGet.proto */
2057 #if CYTHON_FAST_THREAD_STATE
2058 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2059 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2060 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
2061 #else
2062 #define __Pyx_PyThreadState_declare
2063 #define __Pyx_PyThreadState_assign
2064 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
2065 #endif
2066 
2067 /* SaveResetException.proto */
2068 #if CYTHON_FAST_THREAD_STATE
2069 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2070 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2071 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2072 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2073 #else
2074 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2075 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2076 #endif
2077 
2078 /* PyErrExceptionMatches.proto */
2079 #if CYTHON_FAST_THREAD_STATE
2080 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2081 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2082 #else
2083 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2084 #endif
2085 
2086 /* GetException.proto */
2087 #if CYTHON_FAST_THREAD_STATE
2088 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2089 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2090 #else
2091 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2092 #endif
2093 
2094 /* PyErrFetchRestore.proto */
2095 #if CYTHON_FAST_THREAD_STATE
2096 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2097 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2098 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2099 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2100 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2101 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2102 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2103 #if CYTHON_COMPILING_IN_CPYTHON
2104 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2105 #else
2106 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2107 #endif
2108 #else
2109 #define __Pyx_PyErr_Clear() PyErr_Clear()
2110 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2111 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2112 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2113 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2114 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2115 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2116 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2117 #endif
2118 
2119 /* RaiseException.proto */
2120 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2121 
2122 /* IncludeStringH.proto */
2123 #include <string.h>
2124 
2125 /* BytesEquals.proto */
2126 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2127 
2128 /* UnicodeEquals.proto */
2129 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2130 
2131 /* StrEquals.proto */
2132 #if PY_MAJOR_VERSION >= 3
2133 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2134 #else
2135 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2136 #endif
2137 
2138 /* DivInt[Py_ssize_t].proto */
2139 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2140 
2141 /* UnaryNegOverflows.proto */
2142 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2143  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2144 
2145 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2146 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2147 /* GetAttr.proto */
2148 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2149 
2150 /* GetItemInt.proto */
2151 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2152  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2153  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2154  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2155  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2156 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2157  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2158  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2159  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2160 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2161  int wraparound, int boundscheck);
2162 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2163  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2164  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2165  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2166 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2167  int wraparound, int boundscheck);
2168 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2169 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2170  int is_list, int wraparound, int boundscheck);
2171 
2172 /* ObjectGetItem.proto */
2173 #if CYTHON_USE_TYPE_SLOTS
2174 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2175 #else
2176 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2177 #endif
2178 
2179 /* decode_c_string_utf16.proto */
2180 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2181  int byteorder = 0;
2182  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2183 }
2184 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2185  int byteorder = -1;
2186  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2187 }
2188 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2189  int byteorder = 1;
2190  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2191 }
2192 
2193 /* decode_c_string.proto */
2194 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2195  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2196  const char* encoding, const char* errors,
2197  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2198 
2199 /* GetAttr3.proto */
2200 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2201 
2202 /* RaiseTooManyValuesToUnpack.proto */
2203 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2204 
2205 /* RaiseNeedMoreValuesToUnpack.proto */
2206 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2207 
2208 /* RaiseNoneIterError.proto */
2209 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2210 
2211 /* ExtTypeTest.proto */
2212 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2213 
2214 /* SwapException.proto */
2215 #if CYTHON_FAST_THREAD_STATE
2216 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2217 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2218 #else
2219 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2220 #endif
2221 
2222 /* Import.proto */
2223 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2224 
2225 /* FastTypeChecks.proto */
2226 #if CYTHON_COMPILING_IN_CPYTHON
2227 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2228 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2229 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2230 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2231 #else
2232 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2233 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2234 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2235 #endif
2236 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2237 
2238 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2239 /* ListCompAppend.proto */
2240 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2241 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2242  PyListObject* L = (PyListObject*) list;
2243  Py_ssize_t len = Py_SIZE(list);
2244  if (likely(L->allocated > len)) {
2245  Py_INCREF(x);
2246  PyList_SET_ITEM(list, len, x);
2247  __Pyx_SET_SIZE(list, len + 1);
2248  return 0;
2249  }
2250  return PyList_Append(list, x);
2251 }
2252 #else
2253 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2254 #endif
2255 
2256 /* ListExtend.proto */
2257 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2258 #if CYTHON_COMPILING_IN_CPYTHON
2259  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2260  if (unlikely(!none))
2261  return -1;
2262  Py_DECREF(none);
2263  return 0;
2264 #else
2265  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2266 #endif
2267 }
2268 
2269 /* ListAppend.proto */
2270 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2271 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2272  PyListObject* L = (PyListObject*) list;
2273  Py_ssize_t len = Py_SIZE(list);
2274  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2275  Py_INCREF(x);
2276  PyList_SET_ITEM(list, len, x);
2277  __Pyx_SET_SIZE(list, len + 1);
2278  return 0;
2279  }
2280  return PyList_Append(list, x);
2281 }
2282 #else
2283 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2284 #endif
2285 
2286 /* None.proto */
2287 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2288 
2289 /* DivInt[long].proto */
2290 static CYTHON_INLINE long __Pyx_div_long(long, long);
2291 
2292 /* PySequenceContains.proto */
2293 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2294  int result = PySequence_Contains(seq, item);
2295  return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2296 }
2297 
2298 /* ImportFrom.proto */
2299 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2300 
2301 /* HasAttr.proto */
2302 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2303 
2304 /* StringJoin.proto */
2305 #if PY_MAJOR_VERSION < 3
2306 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
2307 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
2308 #else
2309 #define __Pyx_PyString_Join PyUnicode_Join
2310 #define __Pyx_PyBaseString_Join PyUnicode_Join
2311 #endif
2312 #if CYTHON_COMPILING_IN_CPYTHON
2313  #if PY_MAJOR_VERSION < 3
2314  #define __Pyx_PyBytes_Join _PyString_Join
2315  #else
2316  #define __Pyx_PyBytes_Join _PyBytes_Join
2317  #endif
2318 #else
2319 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
2320 #endif
2321 
2322 /* PyObject_Unicode.proto */
2323 #if PY_MAJOR_VERSION >= 3
2324 #define __Pyx_PyObject_Unicode(obj)\
2325  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2326 #else
2327 #define __Pyx_PyObject_Unicode(obj)\
2328  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
2329 #endif
2330 
2331 /* PyObject_GenericGetAttrNoDict.proto */
2332 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2333 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2334 #else
2335 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2336 #endif
2337 
2338 /* PyObject_GenericGetAttr.proto */
2339 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2340 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2341 #else
2342 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2343 #endif
2344 
2345 /* SetVTable.proto */
2346 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2347 
2348 /* PyObjectGetAttrStrNoError.proto */
2349 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2350 
2351 /* SetupReduce.proto */
2352 static int __Pyx_setup_reduce(PyObject* type_obj);
2353 
2354 /* TypeImport.proto */
2355 #ifndef __PYX_HAVE_RT_ImportType_proto
2356 #define __PYX_HAVE_RT_ImportType_proto
2357 enum __Pyx_ImportType_CheckSize {
2358  __Pyx_ImportType_CheckSize_Error = 0,
2359  __Pyx_ImportType_CheckSize_Warn = 1,
2360  __Pyx_ImportType_CheckSize_Ignore = 2
2361 };
2362 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2363 #endif
2364 
2365 /* CLineInTraceback.proto */
2366 #ifdef CYTHON_CLINE_IN_TRACEBACK
2367 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2368 #else
2369 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2370 #endif
2371 
2372 /* CodeObjectCache.proto */
2373 typedef struct {
2374  PyCodeObject* code_object;
2375  int code_line;
2376 } __Pyx_CodeObjectCacheEntry;
2377 struct __Pyx_CodeObjectCache {
2378  int count;
2379  int max_count;
2380  __Pyx_CodeObjectCacheEntry* entries;
2381 };
2382 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2383 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2384 static PyCodeObject *__pyx_find_code_object(int code_line);
2385 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2386 
2387 /* AddTraceback.proto */
2388 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2389  int py_line, const char *filename);
2390 
2391 /* GCCDiagnostics.proto */
2392 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2393 #define __Pyx_HAS_GCC_DIAGNOSTIC
2394 #endif
2395 
2396 /* MemviewDtypeToObject.proto */
2397 static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp);
2398 static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj);
2399 
2400 /* RealImag.proto */
2401 #if CYTHON_CCOMPLEX
2402  #ifdef __cplusplus
2403  #define __Pyx_CREAL(z) ((z).real())
2404  #define __Pyx_CIMAG(z) ((z).imag())
2405  #else
2406  #define __Pyx_CREAL(z) (__real__(z))
2407  #define __Pyx_CIMAG(z) (__imag__(z))
2408  #endif
2409 #else
2410  #define __Pyx_CREAL(z) ((z).real)
2411  #define __Pyx_CIMAG(z) ((z).imag)
2412 #endif
2413 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2414  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2415  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2416  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2417 #else
2418  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2419  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2420 #endif
2421 
2422 /* Arithmetic.proto */
2423 #if CYTHON_CCOMPLEX
2424  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2425  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2426  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2427  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2428  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2429  #define __Pyx_c_neg_float(a) (-(a))
2430  #ifdef __cplusplus
2431  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2432  #define __Pyx_c_conj_float(z) (::std::conj(z))
2433  #if 1
2434  #define __Pyx_c_abs_float(z) (::std::abs(z))
2435  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2436  #endif
2437  #else
2438  #define __Pyx_c_is_zero_float(z) ((z)==0)
2439  #define __Pyx_c_conj_float(z) (conjf(z))
2440  #if 1
2441  #define __Pyx_c_abs_float(z) (cabsf(z))
2442  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2443  #endif
2444  #endif
2445 #else
2446  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2447  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2448  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2449  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2450  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2451  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2452  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2453  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2454  #if 1
2455  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2456  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2457  #endif
2458 #endif
2459 
2460 /* Arithmetic.proto */
2461 #if CYTHON_CCOMPLEX
2462  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2463  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2464  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2465  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2466  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2467  #define __Pyx_c_neg_double(a) (-(a))
2468  #ifdef __cplusplus
2469  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2470  #define __Pyx_c_conj_double(z) (::std::conj(z))
2471  #if 1
2472  #define __Pyx_c_abs_double(z) (::std::abs(z))
2473  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2474  #endif
2475  #else
2476  #define __Pyx_c_is_zero_double(z) ((z)==0)
2477  #define __Pyx_c_conj_double(z) (conj(z))
2478  #if 1
2479  #define __Pyx_c_abs_double(z) (cabs(z))
2480  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2481  #endif
2482  #endif
2483 #else
2484  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2485  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2486  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2487  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2488  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2489  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2490  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2491  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2492  #if 1
2493  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2494  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2495  #endif
2496 #endif
2497 
2498 #if PY_MAJOR_VERSION < 3
2499  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2500  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2501 #else
2502  #define __Pyx_GetBuffer PyObject_GetBuffer
2503  #define __Pyx_ReleaseBuffer PyBuffer_Release
2504 #endif
2505 
2506 
2507 /* BufferStructDeclare.proto */
2508 typedef struct {
2509  Py_ssize_t shape, strides, suboffsets;
2510 } __Pyx_Buf_DimInfo;
2511 typedef struct {
2512  size_t refcount;
2513  Py_buffer pybuffer;
2514 } __Pyx_Buffer;
2515 typedef struct {
2516  __Pyx_Buffer *rcbuffer;
2517  char *data;
2518  __Pyx_Buf_DimInfo diminfo[8];
2519 } __Pyx_LocalBuf_ND;
2520 
2521 /* MemviewSliceIsContig.proto */
2522 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2523 
2524 /* OverlappingSlices.proto */
2525 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2526  __Pyx_memviewslice *slice2,
2527  int ndim, size_t itemsize);
2528 
2529 /* Capsule.proto */
2530 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2531 
2532 /* CIntFromPy.proto */
2533 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2534 
2535 /* CIntToPy.proto */
2536 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2537 
2538 /* TypeInfoToFormat.proto */
2539 struct __pyx_typeinfo_string {
2540  char string[3];
2541 };
2542 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2543 
2544 /* MemviewSliceCopyTemplate.proto */
2545 static __Pyx_memviewslice
2546 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2547  const char *mode, int ndim,
2548  size_t sizeof_dtype, int contig_flag,
2549  int dtype_is_object);
2550 
2551 /* MemviewSliceInit.proto */
2552 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2553 #define __Pyx_MEMVIEW_DIRECT 1
2554 #define __Pyx_MEMVIEW_PTR 2
2555 #define __Pyx_MEMVIEW_FULL 4
2556 #define __Pyx_MEMVIEW_CONTIG 8
2557 #define __Pyx_MEMVIEW_STRIDED 16
2558 #define __Pyx_MEMVIEW_FOLLOW 32
2559 #define __Pyx_IS_C_CONTIG 1
2560 #define __Pyx_IS_F_CONTIG 2
2561 static int __Pyx_init_memviewslice(
2562  struct __pyx_memoryview_obj *memview,
2563  int ndim,
2564  __Pyx_memviewslice *memviewslice,
2565  int memview_is_new_reference);
2566 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
2567  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2568 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
2569  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2570 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2571 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2572 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2573 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2574 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
2575 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
2576 
2577 /* CIntFromPy.proto */
2578 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2579 
2580 /* CIntToPy.proto */
2581 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2582 
2583 /* CIntFromPy.proto */
2584 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2585 
2586 /* CheckBinaryVersion.proto */
2587 static int __Pyx_check_binary_version(void);
2588 
2589 /* InitStrings.proto */
2590 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2591 
2592 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2593 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2594 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2595 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2596 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*/
2597 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2598 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2599 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2600 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2601 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2602 
2603 /* Module declarations from 'cpython.buffer' */
2604 
2605 /* Module declarations from 'libc.string' */
2606 
2607 /* Module declarations from 'libc.stdio' */
2608 
2609 /* Module declarations from '__builtin__' */
2610 
2611 /* Module declarations from 'cpython.type' */
2612 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2613 
2614 /* Module declarations from 'cpython' */
2615 
2616 /* Module declarations from 'cpython.object' */
2617 
2618 /* Module declarations from 'cpython.ref' */
2619 
2620 /* Module declarations from 'cpython.mem' */
2621 
2622 /* Module declarations from 'numpy' */
2623 
2624 /* Module declarations from 'numpy' */
2625 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2626 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2627 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2628 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2629 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2630 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2631 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2632 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2633 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2634 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2635 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2636 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2637 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2638 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2639 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2640 
2641 /* Module declarations from 'mpi4py.libmpi' */
2642 
2643 /* Module declarations from 'mpi4py.MPI' */
2644 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Datatype = 0;
2645 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Status = 0;
2646 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Request = 0;
2647 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Prequest = 0;
2648 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Grequest = 0;
2649 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Message = 0;
2650 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Op = 0;
2651 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Group = 0;
2652 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Info = 0;
2653 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Errhandler = 0;
2654 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Comm = 0;
2655 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intracomm = 0;
2656 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Topocomm = 0;
2657 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Cartcomm = 0;
2658 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Graphcomm = 0;
2659 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Distgraphcomm = 0;
2660 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intercomm = 0;
2661 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Win = 0;
2662 static PyTypeObject *__pyx_ptype_6mpi4py_3MPI_File = 0;
2663 
2664 /* Module declarations from 'libcpp' */
2665 
2666 /* Module declarations from 'mesh' */
2667 
2668 /* Module declarations from 'proteus' */
2669 
2670 /* Module declarations from 'proteus.mesh' */
2671 
2672 /* Module declarations from 'proteus.cmeshTools' */
2673 static PyTypeObject *__pyx_ptype_7proteus_10cmeshTools_CMesh = 0;
2674 
2675 /* Module declarations from 'proteus.partitioning' */
2676 
2677 /* Module declarations from 'cpartitioning' */
2678 static PyTypeObject *__pyx_array_type = 0;
2679 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2680 static PyTypeObject *__pyx_memoryview_type = 0;
2681 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2682 static PyObject *generic = 0;
2683 static PyObject *strided = 0;
2684 static PyObject *indirect = 0;
2685 static PyObject *contiguous = 0;
2686 static PyObject *indirect_contiguous = 0;
2687 static int __pyx_memoryview_thread_locks_used;
2688 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2689 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2690 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2691 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2692 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2693 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2694 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2695 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2696 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*/
2697 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2698 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2699 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2700 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2701 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2702 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2703 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2704 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2705 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2706 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2707 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2708 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2709 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2710 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2711 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2712 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2713 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2714 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2715 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2716 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2717 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2718 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2719 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2720 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2721 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2722 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/
2723 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2724 #define __Pyx_MODULE_NAME "cpartitioning"
2725 extern int __pyx_module_is_main_cpartitioning;
2726 int __pyx_module_is_main_cpartitioning = 0;
2727 
2728 /* Implementation of 'cpartitioning' */
2729 static PyObject *__pyx_builtin_ImportError;
2730 static PyObject *__pyx_builtin_ValueError;
2731 static PyObject *__pyx_builtin_MemoryError;
2732 static PyObject *__pyx_builtin_enumerate;
2733 static PyObject *__pyx_builtin_range;
2734 static PyObject *__pyx_builtin_TypeError;
2735 static PyObject *__pyx_builtin_Ellipsis;
2736 static PyObject *__pyx_builtin_id;
2737 static PyObject *__pyx_builtin_IndexError;
2738 static const char __pyx_k_O[] = "O";
2739 static const char __pyx_k_T[] = "T{";
2740  static const char __pyx_k_c[] = "c";
2741  static const char __pyx_k_s[] = "(%s)";
2742  static const char __pyx_k_id[] = "id";
2743  static const char __pyx_k_np[] = "np";
2744  static const char __pyx_k__22[] = "^";
2745  static const char __pyx_k__23[] = "";
2746  static const char __pyx_k__24[] = ":";
2747 static const char __pyx_k__25[] = "}";
2748 static const char __pyx_k__26[] = ",";
2749 static const char __pyx_k_new[] = "__new__";
2750 static const char __pyx_k_obj[] = "obj";
2751 static const char __pyx_k_Comm[] = "Comm";
2752 static const char __pyx_k_base[] = "base";
2753 static const char __pyx_k_comm[] = "comm";
2754 static const char __pyx_k_dict[] = "__dict__";
2755 static const char __pyx_k_join[] = "join";
2756 static const char __pyx_k_main[] = "__main__";
2757 static const char __pyx_k_mode[] = "mode";
2758 static const char __pyx_k_name[] = "name";
2759 static const char __pyx_k_ndim[] = "ndim";
2760 static const char __pyx_k_pack[] = "pack";
2761 static const char __pyx_k_size[] = "size";
2762 static const char __pyx_k_step[] = "step";
2763 static const char __pyx_k_stop[] = "stop";
2764 static const char __pyx_k_test[] = "__test__";
2765 static const char __pyx_k_ASCII[] = "ASCII";
2766 static const char __pyx_k_class[] = "__class__";
2767 static const char __pyx_k_cmesh[] = "cmesh";
2768 static const char __pyx_k_error[] = "error";
2769 static const char __pyx_k_flags[] = "flags";
2770 static const char __pyx_k_numpy[] = "numpy";
2771 static const char __pyx_k_range[] = "range";
2772 static const char __pyx_k_shape[] = "shape";
2773 static const char __pyx_k_start[] = "start";
2774 static const char __pyx_k_encode[] = "encode";
2775 static const char __pyx_k_format[] = "format";
2776 static const char __pyx_k_import[] = "__import__";
2777 static const char __pyx_k_nSpace[] = "nSpace";
2778 static const char __pyx_k_name_2[] = "__name__";
2779 static const char __pyx_k_pickle[] = "pickle";
2780 static const char __pyx_k_reduce[] = "__reduce__";
2781 static const char __pyx_k_struct[] = "struct";
2782 static const char __pyx_k_unpack[] = "unpack";
2783 static const char __pyx_k_update[] = "update";
2784 static const char __pyx_k_asarray[] = "asarray";
2785 static const char __pyx_k_fortran[] = "fortran";
2786 static const char __pyx_k_memview[] = "memview";
2787 static const char __pyx_k_proteus[] = "proteus";
2788 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2789 static const char __pyx_k_filebase[] = "filebase";
2790 static const char __pyx_k_getstate[] = "__getstate__";
2791 static const char __pyx_k_itemsize[] = "itemsize";
2792 static const char __pyx_k_pyx_type[] = "__pyx_type";
2793 static const char __pyx_k_setstate[] = "__setstate__";
2794 static const char __pyx_k_TypeError[] = "TypeError";
2795 static const char __pyx_k_enumerate[] = "enumerate";
2796 static const char __pyx_k_indexBase[] = "indexBase";
2797 static const char __pyx_k_pyx_state[] = "__pyx_state";
2798 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2799 static const char __pyx_k_IndexError[] = "IndexError";
2800 static const char __pyx_k_ValueError[] = "ValueError";
2801 static const char __pyx_k_pyx_result[] = "__pyx_result";
2802 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2803 static const char __pyx_k_ImportError[] = "ImportError";
2804 static const char __pyx_k_MemoryError[] = "MemoryError";
2805 static const char __pyx_k_PickleError[] = "PickleError";
2806 static const char __pyx_k_nDOF_element[] = "nDOF_element";
2807 static const char __pyx_k_proteus_Comm[] = "proteus_Comm";
2808 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2809 static const char __pyx_k_stringsource[] = "stringsource";
2810 static const char __pyx_k_cpartitioning[] = "cpartitioning";
2811 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2812 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2813 static const char __pyx_k_nDOF_subdomain[] = "nDOF_subdomain";
2814 static const char __pyx_k_partitionNodes[] = "partitionNodes";
2815 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2816 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2817 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2818 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2819 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2820 static const char __pyx_k_subdomain_cmesh[] = "subdomain_cmesh";
2821 static const char __pyx_k_dg_subdomain_l2g[] = "dg_subdomain_l2g";
2822 static const char __pyx_k_nLayersOfOverlap[] = "nLayersOfOverlap";
2823 static const char __pyx_k_max_dof_neighbors[] = "max_dof_neighbors";
2824 static const char __pyx_k_partitionElements[] = "partitionElements";
2825 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2826 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2827 static const char __pyx_k_nDOF_all_processes[] = "nDOF_all_processes";
2828 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2829 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2830 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2831 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2832 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2833 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2834 static const char __pyx_k_quadratic_lagrangeNodes[] = "quadratic_lagrangeNodes";
2835 static const char __pyx_k_quadratic_subdomain_l2g[] = "quadratic_subdomain_l2g";
2836 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2837 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2838 static const char __pyx_k_proteus_cpartitioning_pyx[] = "proteus/cpartitioning.pyx";
2839 static const char __pyx_k_edgeOffsets_subdomain_owned[] = "edgeOffsets_subdomain_owned";
2840 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2841 static const char __pyx_k_nodeOffsets_subdomain_owned[] = "nodeOffsets_subdomain_owned";
2842 static const char __pyx_k_convertPUMIPartitionToPython[] = "convertPUMIPartitionToPython";
2843 static const char __pyx_k_dgNumbering_subdomain2global[] = "dgNumbering_subdomain2global";
2844 static const char __pyx_k_partitionNodesFromTetgenFiles[] = "partitionNodesFromTetgenFiles";
2845 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2846 static const char __pyx_k_dg_dof_offsets_subdomain_owned[] = "dg_dof_offsets_subdomain_owned";
2847 static const char __pyx_k_edgeNumbering_subdomain2global[] = "edgeNumbering_subdomain2global";
2848 static const char __pyx_k_elementOffsets_subdomain_owned[] = "elementOffsets_subdomain_owned";
2849 static const char __pyx_k_nodeNumbering_subdomain2global[] = "nodeNumbering_subdomain2global";
2850 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2851 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2852 static const char __pyx_k_partitionNodesFromTriangleFiles[] = "partitionNodesFromTriangleFiles";
2853 static const char __pyx_k_quadratic_dof_offsets_subdomain[] = "quadratic_dof_offsets_subdomain_owned";
2854 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2855 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2856 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2857 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2858 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2859 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2860 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2861 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2862 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2863 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2864 static const char __pyx_k_buildDiscontinuousGalerkinLocal2[] = "buildDiscontinuousGalerkinLocal2GlobalMappings";
2865 static const char __pyx_k_buildQuadraticCubeLocal2GlobalMa[] = "buildQuadraticCubeLocal2GlobalMappings";
2866 static const char __pyx_k_buildQuadraticCubeSubdomain2Glob[] = "buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!";
2867 static const char __pyx_k_buildQuadraticLocal2GlobalMappin[] = "buildQuadraticLocal2GlobalMappings";
2868 static const char __pyx_k_elementBoundaryNumbering_subdoma[] = "elementBoundaryNumbering_subdomain2global";
2869 static const char __pyx_k_elementBoundaryOffsets_subdomain[] = "elementBoundaryOffsets_subdomain_owned";
2870 static const char __pyx_k_elementNumbering_subdomain2globa[] = "elementNumbering_subdomain2global";
2871 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2872 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2873 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2874 static const char __pyx_k_quadraticNumbering_subdomain2glo[] = "quadraticNumbering_subdomain2global";
2875 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2876 static const char __pyx_k_buildQuadraticCubeSubdomain2Glob_2[] = "buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!";
2877 static PyObject *__pyx_n_s_ASCII;
2878 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2879 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2880 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2881 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2882 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2883 static PyObject *__pyx_n_s_Comm;
2884 static PyObject *__pyx_n_s_Ellipsis;
2885 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2886 static PyObject *__pyx_n_s_ImportError;
2887 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2888 static PyObject *__pyx_n_s_IndexError;
2889 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2890 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2891 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2892 static PyObject *__pyx_n_s_MemoryError;
2893 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2894 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2895 static PyObject *__pyx_n_b_O;
2896 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2897 static PyObject *__pyx_n_s_PickleError;
2898 static PyObject *__pyx_kp_b_T;
2899 static PyObject *__pyx_n_s_TypeError;
2900 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2901 static PyObject *__pyx_n_s_ValueError;
2902 static PyObject *__pyx_n_s_View_MemoryView;
2903 static PyObject *__pyx_kp_b__22;
2904 static PyObject *__pyx_kp_b__23;
2905 static PyObject *__pyx_kp_b__24;
2906 static PyObject *__pyx_kp_b__25;
2907 static PyObject *__pyx_kp_u__26;
2908 static PyObject *__pyx_n_s_allocate_buffer;
2909 static PyObject *__pyx_n_s_asarray;
2910 static PyObject *__pyx_n_s_base;
2911 static PyObject *__pyx_n_s_buildDiscontinuousGalerkinLocal2;
2912 static PyObject *__pyx_n_s_buildQuadraticCubeLocal2GlobalMa;
2913 static PyObject *__pyx_kp_s_buildQuadraticCubeSubdomain2Glob;
2914 static PyObject *__pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2;
2915 static PyObject *__pyx_n_s_buildQuadraticLocal2GlobalMappin;
2916 static PyObject *__pyx_n_s_c;
2917 static PyObject *__pyx_n_u_c;
2918 static PyObject *__pyx_n_s_class;
2919 static PyObject *__pyx_n_s_cline_in_traceback;
2920 static PyObject *__pyx_n_s_cmesh;
2921 static PyObject *__pyx_n_s_comm;
2922 static PyObject *__pyx_kp_s_contiguous_and_direct;
2923 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2924 static PyObject *__pyx_n_s_convertPUMIPartitionToPython;
2925 static PyObject *__pyx_n_s_cpartitioning;
2926 static PyObject *__pyx_n_s_dgNumbering_subdomain2global;
2927 static PyObject *__pyx_n_s_dg_dof_offsets_subdomain_owned;
2928 static PyObject *__pyx_n_s_dg_subdomain_l2g;
2929 static PyObject *__pyx_n_s_dict;
2930 static PyObject *__pyx_n_s_dtype_is_object;
2931 static PyObject *__pyx_n_s_edgeNumbering_subdomain2global;
2932 static PyObject *__pyx_n_s_edgeOffsets_subdomain_owned;
2933 static PyObject *__pyx_n_s_elementBoundaryNumbering_subdoma;
2934 static PyObject *__pyx_n_s_elementBoundaryOffsets_subdomain;
2935 static PyObject *__pyx_n_s_elementNumbering_subdomain2globa;
2936 static PyObject *__pyx_n_s_elementOffsets_subdomain_owned;
2937 static PyObject *__pyx_n_s_encode;
2938 static PyObject *__pyx_n_s_enumerate;
2939 static PyObject *__pyx_n_s_error;
2940 static PyObject *__pyx_n_s_filebase;
2941 static PyObject *__pyx_n_s_flags;
2942 static PyObject *__pyx_n_s_format;
2943 static PyObject *__pyx_n_s_fortran;
2944 static PyObject *__pyx_n_u_fortran;
2945 static PyObject *__pyx_n_s_getstate;
2946 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2947 static PyObject *__pyx_n_s_id;
2948 static PyObject *__pyx_n_s_import;
2949 static PyObject *__pyx_n_s_indexBase;
2950 static PyObject *__pyx_n_s_itemsize;
2951 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2952 static PyObject *__pyx_n_s_join;
2953 static PyObject *__pyx_n_s_main;
2954 static PyObject *__pyx_n_s_max_dof_neighbors;
2955 static PyObject *__pyx_n_s_memview;
2956 static PyObject *__pyx_n_s_mode;
2957 static PyObject *__pyx_n_s_nDOF_all_processes;
2958 static PyObject *__pyx_n_s_nDOF_element;
2959 static PyObject *__pyx_n_s_nDOF_subdomain;
2960 static PyObject *__pyx_n_s_nLayersOfOverlap;
2961 static PyObject *__pyx_n_s_nSpace;
2962 static PyObject *__pyx_n_s_name;
2963 static PyObject *__pyx_n_s_name_2;
2964 static PyObject *__pyx_n_s_ndim;
2965 static PyObject *__pyx_n_s_new;
2966 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2967 static PyObject *__pyx_n_s_nodeNumbering_subdomain2global;
2968 static PyObject *__pyx_n_s_nodeOffsets_subdomain_owned;
2969 static PyObject *__pyx_n_s_np;
2970 static PyObject *__pyx_n_s_numpy;
2971 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2972 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2973 static PyObject *__pyx_n_s_obj;
2974 static PyObject *__pyx_n_s_pack;
2975 static PyObject *__pyx_n_s_partitionElements;
2976 static PyObject *__pyx_n_s_partitionNodes;
2977 static PyObject *__pyx_n_s_partitionNodesFromTetgenFiles;
2978 static PyObject *__pyx_n_s_partitionNodesFromTriangleFiles;
2979 static PyObject *__pyx_n_s_pickle;
2980 static PyObject *__pyx_n_s_proteus;
2981 static PyObject *__pyx_n_s_proteus_Comm;
2982 static PyObject *__pyx_kp_s_proteus_cpartitioning_pyx;
2983 static PyObject *__pyx_n_s_pyx_PickleError;
2984 static PyObject *__pyx_n_s_pyx_checksum;
2985 static PyObject *__pyx_n_s_pyx_getbuffer;
2986 static PyObject *__pyx_n_s_pyx_result;
2987 static PyObject *__pyx_n_s_pyx_state;
2988 static PyObject *__pyx_n_s_pyx_type;
2989 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2990 static PyObject *__pyx_n_s_pyx_vtable;
2991 static PyObject *__pyx_n_s_quadraticNumbering_subdomain2glo;
2992 static PyObject *__pyx_n_s_quadratic_dof_offsets_subdomain;
2993 static PyObject *__pyx_n_s_quadratic_lagrangeNodes;
2994 static PyObject *__pyx_n_s_quadratic_subdomain_l2g;
2995 static PyObject *__pyx_n_s_range;
2996 static PyObject *__pyx_n_s_reduce;
2997 static PyObject *__pyx_n_s_reduce_cython;
2998 static PyObject *__pyx_n_s_reduce_ex;
2999 static PyObject *__pyx_kp_u_s;
3000 static PyObject *__pyx_n_s_setstate;
3001 static PyObject *__pyx_n_s_setstate_cython;
3002 static PyObject *__pyx_n_s_shape;
3003 static PyObject *__pyx_n_s_size;
3004 static PyObject *__pyx_n_s_start;
3005 static PyObject *__pyx_n_s_step;
3006 static PyObject *__pyx_n_s_stop;
3007 static PyObject *__pyx_kp_s_strided_and_direct;
3008 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
3009 static PyObject *__pyx_kp_s_strided_and_indirect;
3010 static PyObject *__pyx_kp_s_stringsource;
3011 static PyObject *__pyx_n_s_struct;
3012 static PyObject *__pyx_n_s_subdomain_cmesh;
3013 static PyObject *__pyx_n_s_test;
3014 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3015 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3016 static PyObject *__pyx_n_s_unpack;
3017 static PyObject *__pyx_n_s_update;
3018 static PyObject *__pyx_pf_13cpartitioning_partitionElements(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
3019 static PyObject *__pyx_pf_13cpartitioning_2partitionNodes(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
3020 static PyObject *__pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
3021 static PyObject *__pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
3022 static PyObject *__pyx_pf_13cpartitioning_8partitionNodesFromTriangleFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
3023 static PyObject *__pyx_pf_13cpartitioning_10buildQuadraticLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes); /* proto */
3024 static PyObject *__pyx_pf_13cpartitioning_12buildQuadraticCubeLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes); /* proto */
3025 static PyObject *__pyx_pf_13cpartitioning_14buildDiscontinuousGalerkinLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nDOF_element, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_dg_subdomain_l2g, PyArrayObject *__pyx_v_dgNumbering_subdomain2global); /* proto */
3026 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 */
3027 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 */
3028 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3029 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3030 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3031 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3032 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3033 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 */
3034 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3035 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 */
3036 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3037 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3038 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3039 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3040 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 */
3041 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3042 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3043 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 */
3044 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 */
3045 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3046 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3047 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3048 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3049 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3050 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3051 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3052 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3053 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3054 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3055 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3056 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3057 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3058 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3059 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3060 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3061 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3062 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 */
3063 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3064 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3065 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3066 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 */
3067 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 */
3068 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3069 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3070 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3071 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3072 static PyObject *__pyx_int_0;
3073 static PyObject *__pyx_int_1;
3074 static PyObject *__pyx_int_112105877;
3075 static PyObject *__pyx_int_136983863;
3076 static PyObject *__pyx_int_184977713;
3077 static PyObject *__pyx_int_neg_1;
3078 static PyObject *__pyx_tuple_;
3079 static PyObject *__pyx_tuple__2;
3080 static PyObject *__pyx_tuple__3;
3081 static PyObject *__pyx_tuple__4;
3082 static PyObject *__pyx_tuple__5;
3083 static PyObject *__pyx_tuple__6;
3084 static PyObject *__pyx_tuple__7;
3085 static PyObject *__pyx_tuple__8;
3086 static PyObject *__pyx_tuple__9;
3087 static PyObject *__pyx_slice__17;
3088 static PyObject *__pyx_tuple__10;
3089 static PyObject *__pyx_tuple__11;
3090 static PyObject *__pyx_tuple__12;
3091 static PyObject *__pyx_tuple__13;
3092 static PyObject *__pyx_tuple__14;
3093 static PyObject *__pyx_tuple__15;
3094 static PyObject *__pyx_tuple__16;
3095 static PyObject *__pyx_tuple__18;
3096 static PyObject *__pyx_tuple__19;
3097 static PyObject *__pyx_tuple__20;
3098 static PyObject *__pyx_tuple__21;
3099 static PyObject *__pyx_tuple__27;
3100 static PyObject *__pyx_tuple__29;
3101 static PyObject *__pyx_tuple__31;
3102 static PyObject *__pyx_tuple__33;
3103 static PyObject *__pyx_tuple__35;
3104 static PyObject *__pyx_tuple__37;
3105 static PyObject *__pyx_tuple__39;
3106 static PyObject *__pyx_tuple__41;
3107 static PyObject *__pyx_tuple__43;
3108 static PyObject *__pyx_tuple__44;
3109 static PyObject *__pyx_tuple__45;
3110 static PyObject *__pyx_tuple__46;
3111 static PyObject *__pyx_tuple__47;
3112 static PyObject *__pyx_tuple__48;
3113 static PyObject *__pyx_codeobj__28;
3114 static PyObject *__pyx_codeobj__30;
3115 static PyObject *__pyx_codeobj__32;
3116 static PyObject *__pyx_codeobj__34;
3117 static PyObject *__pyx_codeobj__36;
3118 static PyObject *__pyx_codeobj__38;
3119 static PyObject *__pyx_codeobj__40;
3120 static PyObject *__pyx_codeobj__42;
3121 static PyObject *__pyx_codeobj__49;
3122 /* Late includes */
3123 
3124 /* "cpartitioning.pyx":20
3125  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
3126  *
3127  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3128  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3129  * c_partitionElements(comm.ob_mpi,
3130  */
3131 
3132 /* Python wrapper */
3133 static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3134 static PyMethodDef __pyx_mdef_13cpartitioning_1partitionElements = {"partitionElements", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_1partitionElements, METH_VARARGS|METH_KEYWORDS, 0};
3135 static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3136  struct PyMPICommObject *__pyx_v_comm = 0;
3137  int __pyx_v_nLayersOfOverlap;
3138  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3139  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
3140  int __pyx_lineno = 0;
3141  const char *__pyx_filename = NULL;
3142  int __pyx_clineno = 0;
3143  PyObject *__pyx_r = 0;
3144  __Pyx_RefNannyDeclarations
3145  __Pyx_RefNannySetupContext("partitionElements (wrapper)", 0);
3146  {
3147  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
3148  PyObject* values[4] = {0,0,0,0};
3149  if (unlikely(__pyx_kwds)) {
3150  Py_ssize_t kw_args;
3151  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3152  switch (pos_args) {
3153  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3154  CYTHON_FALLTHROUGH;
3155  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3156  CYTHON_FALLTHROUGH;
3157  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3158  CYTHON_FALLTHROUGH;
3159  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3160  CYTHON_FALLTHROUGH;
3161  case 0: break;
3162  default: goto __pyx_L5_argtuple_error;
3163  }
3164  kw_args = PyDict_Size(__pyx_kwds);
3165  switch (pos_args) {
3166  case 0:
3167  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
3168  else goto __pyx_L5_argtuple_error;
3169  CYTHON_FALLTHROUGH;
3170  case 1:
3171  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
3172  else {
3173  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 1); __PYX_ERR(0, 20, __pyx_L3_error)
3174  }
3175  CYTHON_FALLTHROUGH;
3176  case 2:
3177  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3178  else {
3179  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 2); __PYX_ERR(0, 20, __pyx_L3_error)
3180  }
3181  CYTHON_FALLTHROUGH;
3182  case 3:
3183  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
3184  else {
3185  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, 3); __PYX_ERR(0, 20, __pyx_L3_error)
3186  }
3187  }
3188  if (unlikely(kw_args > 0)) {
3189  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionElements") < 0)) __PYX_ERR(0, 20, __pyx_L3_error)
3190  }
3191  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3192  goto __pyx_L5_argtuple_error;
3193  } else {
3194  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3195  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3196  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3197  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3198  }
3199  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
3200  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L3_error)
3201  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
3202  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
3203  }
3204  goto __pyx_L4_argument_unpacking_done;
3205  __pyx_L5_argtuple_error:;
3206  __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 20, __pyx_L3_error)
3207  __pyx_L3_error:;
3208  __Pyx_AddTraceback("cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3209  __Pyx_RefNannyFinishContext();
3210  return NULL;
3211  __pyx_L4_argument_unpacking_done:;
3212  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
3213  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
3214  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
3215  __pyx_r = __pyx_pf_13cpartitioning_partitionElements(__pyx_self, __pyx_v_comm, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
3216 
3217  /* function exit code */
3218  goto __pyx_L0;
3219  __pyx_L1_error:;
3220  __pyx_r = NULL;
3221  __pyx_L0:;
3222  __Pyx_RefNannyFinishContext();
3223  return __pyx_r;
3224 }
3225 
3226 static PyObject *__pyx_pf_13cpartitioning_partitionElements(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
3227  PyObject *__pyx_r = NULL;
3228  __Pyx_RefNannyDeclarations
3229  PyObject *__pyx_t_1 = NULL;
3230  PyObject *__pyx_t_2 = NULL;
3231  PyObject *__pyx_t_3 = NULL;
3232  int *__pyx_t_4;
3233  PyObject *__pyx_t_5 = NULL;
3234  Py_ssize_t __pyx_t_6;
3235  struct __pyx_array_obj *__pyx_t_7 = NULL;
3236  PyObject *__pyx_t_8 = NULL;
3237  PyObject *__pyx_t_9 = NULL;
3238  PyObject *__pyx_t_10 = NULL;
3239  PyObject *__pyx_t_11 = NULL;
3240  PyObject *__pyx_t_12 = NULL;
3241  PyObject *__pyx_t_13 = NULL;
3242  PyObject *__pyx_t_14 = NULL;
3243  int __pyx_lineno = 0;
3244  const char *__pyx_filename = NULL;
3245  int __pyx_clineno = 0;
3246  __Pyx_RefNannySetupContext("partitionElements", 0);
3247 
3248  /* "cpartitioning.pyx":21
3249  *
3250  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3251  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
3252  * c_partitionElements(comm.ob_mpi,
3253  * cmesh.mesh,
3254  */
3255  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
3256 
3257  /* "cpartitioning.pyx":22
3258  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3259  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3260  * c_partitionElements(comm.ob_mpi, # <<<<<<<<<<<<<<
3261  * cmesh.mesh,
3262  * nLayersOfOverlap)
3263  */
3264  (void)(proteus::partitionElements(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
3265 
3266  /* "cpartitioning.pyx":25
3267  * cmesh.mesh,
3268  * nLayersOfOverlap)
3269  * return ( # <<<<<<<<<<<<<<
3270  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3271  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3272  */
3273  __Pyx_XDECREF(__pyx_r);
3274 
3275  /* "cpartitioning.pyx":26
3276  * nLayersOfOverlap)
3277  * return (
3278  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3279  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3280  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3281  */
3282  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3283  __Pyx_GOTREF(__pyx_t_2);
3284  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
3285  __Pyx_GOTREF(__pyx_t_3);
3286  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3287  __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
3288  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3289  __Pyx_GOTREF(__pyx_t_2);
3290  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
3291  __Pyx_GOTREF(__pyx_t_5);
3292  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3293  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L1_error)
3294  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3295  if (!__pyx_t_4) {
3296  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3297  __PYX_ERR(0, 26, __pyx_L1_error)
3298  }
3299  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3300  __Pyx_GOTREF(__pyx_t_2);
3301  __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
3302  __Pyx_GOTREF(__pyx_t_5);
3303  __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(int), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_4);
3304  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 26, __pyx_L1_error)
3305  __Pyx_GOTREF(__pyx_t_7);
3306  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3307  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3308  __pyx_t_2 = NULL;
3309  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3310  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3311  if (likely(__pyx_t_2)) {
3312  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3313  __Pyx_INCREF(__pyx_t_2);
3314  __Pyx_INCREF(function);
3315  __Pyx_DECREF_SET(__pyx_t_3, function);
3316  }
3317  }
3318  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
3319  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3320  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3321  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
3322  __Pyx_GOTREF(__pyx_t_1);
3323  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3324 
3325  /* "cpartitioning.pyx":27
3326  * return (
3327  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3328  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
3329  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3330  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3331  */
3332  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3333  __Pyx_GOTREF(__pyx_t_2);
3334  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error)
3335  __Pyx_GOTREF(__pyx_t_5);
3336  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3337  __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
3338  if (!__pyx_t_4) {
3339  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3340  __PYX_ERR(0, 27, __pyx_L1_error)
3341  }
3342  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 27, __pyx_L1_error)
3343  __Pyx_GOTREF(__pyx_t_8);
3344  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3345  __Pyx_GOTREF(__pyx_t_2);
3346  __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3347  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 27, __pyx_L1_error)
3348  __Pyx_GOTREF(__pyx_t_7);
3349  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3350  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3351  __pyx_t_8 = NULL;
3352  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3353  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
3354  if (likely(__pyx_t_8)) {
3355  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3356  __Pyx_INCREF(__pyx_t_8);
3357  __Pyx_INCREF(function);
3358  __Pyx_DECREF_SET(__pyx_t_5, function);
3359  }
3360  }
3361  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
3362  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3363  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3364  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error)
3365  __Pyx_GOTREF(__pyx_t_3);
3366  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3367 
3368  /* "cpartitioning.pyx":28
3369  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
3370  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3371  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3372  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3373  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3374  */
3375  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error)
3376  __Pyx_GOTREF(__pyx_t_8);
3377  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
3378  __Pyx_GOTREF(__pyx_t_2);
3379  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3380  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
3381  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error)
3382  __Pyx_GOTREF(__pyx_t_8);
3383  __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 28, __pyx_L1_error)
3384  __Pyx_GOTREF(__pyx_t_9);
3385  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3386  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L1_error)
3387  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3388  if (!__pyx_t_4) {
3389  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3390  __PYX_ERR(0, 28, __pyx_L1_error)
3391  }
3392  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error)
3393  __Pyx_GOTREF(__pyx_t_8);
3394  __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 28, __pyx_L1_error)
3395  __Pyx_GOTREF(__pyx_t_9);
3396  __pyx_t_7 = __pyx_array_new(__pyx_t_9, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3397  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 28, __pyx_L1_error)
3398  __Pyx_GOTREF(__pyx_t_7);
3399  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3400  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3401  __pyx_t_8 = NULL;
3402  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3403  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
3404  if (likely(__pyx_t_8)) {
3405  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3406  __Pyx_INCREF(__pyx_t_8);
3407  __Pyx_INCREF(function);
3408  __Pyx_DECREF_SET(__pyx_t_2, function);
3409  }
3410  }
3411  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
3412  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3413  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3414  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 28, __pyx_L1_error)
3415  __Pyx_GOTREF(__pyx_t_5);
3416  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3417 
3418  /* "cpartitioning.pyx":29
3419  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3420  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3421  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
3422  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3423  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3424  */
3425  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error)
3426  __Pyx_GOTREF(__pyx_t_8);
3427  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 29, __pyx_L1_error)
3428  __Pyx_GOTREF(__pyx_t_9);
3429  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3430  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
3431  if (!__pyx_t_4) {
3432  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3433  __PYX_ERR(0, 29, __pyx_L1_error)
3434  }
3435  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 29, __pyx_L1_error)
3436  __Pyx_GOTREF(__pyx_t_10);
3437  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 29, __pyx_L1_error)
3438  __Pyx_GOTREF(__pyx_t_8);
3439  __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3440  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 29, __pyx_L1_error)
3441  __Pyx_GOTREF(__pyx_t_7);
3442  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3443  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3444  __pyx_t_10 = NULL;
3445  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
3446  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
3447  if (likely(__pyx_t_10)) {
3448  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
3449  __Pyx_INCREF(__pyx_t_10);
3450  __Pyx_INCREF(function);
3451  __Pyx_DECREF_SET(__pyx_t_9, function);
3452  }
3453  }
3454  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
3455  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3456  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3457  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
3458  __Pyx_GOTREF(__pyx_t_2);
3459  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3460 
3461  /* "cpartitioning.pyx":30
3462  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3463  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3464  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3465  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3466  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3467  */
3468  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 30, __pyx_L1_error)
3469  __Pyx_GOTREF(__pyx_t_10);
3470  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 30, __pyx_L1_error)
3471  __Pyx_GOTREF(__pyx_t_8);
3472  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3473  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
3474  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 30, __pyx_L1_error)
3475  __Pyx_GOTREF(__pyx_t_10);
3476  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 30, __pyx_L1_error)
3477  __Pyx_GOTREF(__pyx_t_11);
3478  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3479  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L1_error)
3480  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3481  if (!__pyx_t_4) {
3482  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3483  __PYX_ERR(0, 30, __pyx_L1_error)
3484  }
3485  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 30, __pyx_L1_error)
3486  __Pyx_GOTREF(__pyx_t_10);
3487  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 30, __pyx_L1_error)
3488  __Pyx_GOTREF(__pyx_t_11);
3489  __pyx_t_7 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
3490  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 30, __pyx_L1_error)
3491  __Pyx_GOTREF(__pyx_t_7);
3492  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3493  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3494  __pyx_t_10 = NULL;
3495  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
3496  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
3497  if (likely(__pyx_t_10)) {
3498  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
3499  __Pyx_INCREF(__pyx_t_10);
3500  __Pyx_INCREF(function);
3501  __Pyx_DECREF_SET(__pyx_t_8, function);
3502  }
3503  }
3504  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
3505  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3506  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3507  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 30, __pyx_L1_error)
3508  __Pyx_GOTREF(__pyx_t_9);
3509  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3510 
3511  /* "cpartitioning.pyx":31
3512  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3513  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3514  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
3515  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3516  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
3517  */
3518  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 31, __pyx_L1_error)
3519  __Pyx_GOTREF(__pyx_t_10);
3520  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 31, __pyx_L1_error)
3521  __Pyx_GOTREF(__pyx_t_11);
3522  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3523  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
3524  if (!__pyx_t_4) {
3525  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3526  __PYX_ERR(0, 31, __pyx_L1_error)
3527  }
3528  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 31, __pyx_L1_error)
3529  __Pyx_GOTREF(__pyx_t_12);
3530  __pyx_t_10 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 31, __pyx_L1_error)
3531  __Pyx_GOTREF(__pyx_t_10);
3532  __pyx_t_7 = __pyx_array_new(__pyx_t_10, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
3533  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 31, __pyx_L1_error)
3534  __Pyx_GOTREF(__pyx_t_7);
3535  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3536  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3537  __pyx_t_12 = NULL;
3538  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
3539  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
3540  if (likely(__pyx_t_12)) {
3541  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
3542  __Pyx_INCREF(__pyx_t_12);
3543  __Pyx_INCREF(function);
3544  __Pyx_DECREF_SET(__pyx_t_11, function);
3545  }
3546  }
3547  __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
3548  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3549  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3550  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 31, __pyx_L1_error)
3551  __Pyx_GOTREF(__pyx_t_8);
3552  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3553 
3554  /* "cpartitioning.pyx":32
3555  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3556  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3557  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3558  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
3559  * )
3560  */
3561  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 32, __pyx_L1_error)
3562  __Pyx_GOTREF(__pyx_t_12);
3563  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 32, __pyx_L1_error)
3564  __Pyx_GOTREF(__pyx_t_10);
3565  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3566  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
3567  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 32, __pyx_L1_error)
3568  __Pyx_GOTREF(__pyx_t_12);
3569  __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 32, __pyx_L1_error)
3570  __Pyx_GOTREF(__pyx_t_13);
3571  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3572  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L1_error)
3573  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3574  if (!__pyx_t_4) {
3575  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3576  __PYX_ERR(0, 32, __pyx_L1_error)
3577  }
3578  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 32, __pyx_L1_error)
3579  __Pyx_GOTREF(__pyx_t_12);
3580  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 32, __pyx_L1_error)
3581  __Pyx_GOTREF(__pyx_t_13);
3582  __pyx_t_7 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
3583  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 32, __pyx_L1_error)
3584  __Pyx_GOTREF(__pyx_t_7);
3585  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3586  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3587  __pyx_t_12 = NULL;
3588  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
3589  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
3590  if (likely(__pyx_t_12)) {
3591  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
3592  __Pyx_INCREF(__pyx_t_12);
3593  __Pyx_INCREF(function);
3594  __Pyx_DECREF_SET(__pyx_t_10, function);
3595  }
3596  }
3597  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
3598  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3599  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3600  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 32, __pyx_L1_error)
3601  __Pyx_GOTREF(__pyx_t_11);
3602  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3603 
3604  /* "cpartitioning.pyx":33
3605  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
3606  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
3607  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
3608  * )
3609  *
3610  */
3611  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 33, __pyx_L1_error)
3612  __Pyx_GOTREF(__pyx_t_12);
3613  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 33, __pyx_L1_error)
3614  __Pyx_GOTREF(__pyx_t_13);
3615  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3616  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
3617  if (!__pyx_t_4) {
3618  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3619  __PYX_ERR(0, 33, __pyx_L1_error)
3620  }
3621  __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 33, __pyx_L1_error)
3622  __Pyx_GOTREF(__pyx_t_14);
3623  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 33, __pyx_L1_error)
3624  __Pyx_GOTREF(__pyx_t_12);
3625  __pyx_t_7 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_t_4);
3626  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 33, __pyx_L1_error)
3627  __Pyx_GOTREF(__pyx_t_7);
3628  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3629  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3630  __pyx_t_14 = NULL;
3631  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
3632  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
3633  if (likely(__pyx_t_14)) {
3634  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
3635  __Pyx_INCREF(__pyx_t_14);
3636  __Pyx_INCREF(function);
3637  __Pyx_DECREF_SET(__pyx_t_13, function);
3638  }
3639  }
3640  __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
3641  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3642  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3643  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 33, __pyx_L1_error)
3644  __Pyx_GOTREF(__pyx_t_10);
3645  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3646 
3647  /* "cpartitioning.pyx":26
3648  * nLayersOfOverlap)
3649  * return (
3650  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3651  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3652  * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
3653  */
3654  __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 26, __pyx_L1_error)
3655  __Pyx_GOTREF(__pyx_t_13);
3656  __Pyx_GIVEREF(__pyx_t_1);
3657  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
3658  __Pyx_GIVEREF(__pyx_t_3);
3659  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
3660  __Pyx_GIVEREF(__pyx_t_5);
3661  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
3662  __Pyx_GIVEREF(__pyx_t_2);
3663  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
3664  __Pyx_GIVEREF(__pyx_t_9);
3665  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
3666  __Pyx_GIVEREF(__pyx_t_8);
3667  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
3668  __Pyx_GIVEREF(__pyx_t_11);
3669  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
3670  __Pyx_GIVEREF(__pyx_t_10);
3671  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
3672  __pyx_t_1 = 0;
3673  __pyx_t_3 = 0;
3674  __pyx_t_5 = 0;
3675  __pyx_t_2 = 0;
3676  __pyx_t_9 = 0;
3677  __pyx_t_8 = 0;
3678  __pyx_t_11 = 0;
3679  __pyx_t_10 = 0;
3680  __pyx_r = __pyx_t_13;
3681  __pyx_t_13 = 0;
3682  goto __pyx_L0;
3683 
3684  /* "cpartitioning.pyx":20
3685  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
3686  *
3687  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3688  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3689  * c_partitionElements(comm.ob_mpi,
3690  */
3691 
3692  /* function exit code */
3693  __pyx_L1_error:;
3694  __Pyx_XDECREF(__pyx_t_1);
3695  __Pyx_XDECREF(__pyx_t_2);
3696  __Pyx_XDECREF(__pyx_t_3);
3697  __Pyx_XDECREF(__pyx_t_5);
3698  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
3699  __Pyx_XDECREF(__pyx_t_8);
3700  __Pyx_XDECREF(__pyx_t_9);
3701  __Pyx_XDECREF(__pyx_t_10);
3702  __Pyx_XDECREF(__pyx_t_11);
3703  __Pyx_XDECREF(__pyx_t_12);
3704  __Pyx_XDECREF(__pyx_t_13);
3705  __Pyx_XDECREF(__pyx_t_14);
3706  __Pyx_AddTraceback("cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3707  __pyx_r = NULL;
3708  __pyx_L0:;
3709  __Pyx_XGIVEREF(__pyx_r);
3710  __Pyx_RefNannyFinishContext();
3711  return __pyx_r;
3712 }
3713 
3714 /* "cpartitioning.pyx":36
3715  * )
3716  *
3717  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
3718  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3719  * c_partitionNodes(comm.ob_mpi,
3720  */
3721 
3722 /* Python wrapper */
3723 static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3724 static PyMethodDef __pyx_mdef_13cpartitioning_3partitionNodes = {"partitionNodes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_3partitionNodes, METH_VARARGS|METH_KEYWORDS, 0};
3725 static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3726  struct PyMPICommObject *__pyx_v_comm = 0;
3727  int __pyx_v_nLayersOfOverlap;
3728  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
3729  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
3730  int __pyx_lineno = 0;
3731  const char *__pyx_filename = NULL;
3732  int __pyx_clineno = 0;
3733  PyObject *__pyx_r = 0;
3734  __Pyx_RefNannyDeclarations
3735  __Pyx_RefNannySetupContext("partitionNodes (wrapper)", 0);
3736  {
3737  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
3738  PyObject* values[4] = {0,0,0,0};
3739  if (unlikely(__pyx_kwds)) {
3740  Py_ssize_t kw_args;
3741  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3742  switch (pos_args) {
3743  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3744  CYTHON_FALLTHROUGH;
3745  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3746  CYTHON_FALLTHROUGH;
3747  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3748  CYTHON_FALLTHROUGH;
3749  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3750  CYTHON_FALLTHROUGH;
3751  case 0: break;
3752  default: goto __pyx_L5_argtuple_error;
3753  }
3754  kw_args = PyDict_Size(__pyx_kwds);
3755  switch (pos_args) {
3756  case 0:
3757  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
3758  else goto __pyx_L5_argtuple_error;
3759  CYTHON_FALLTHROUGH;
3760  case 1:
3761  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
3762  else {
3763  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 1); __PYX_ERR(0, 36, __pyx_L3_error)
3764  }
3765  CYTHON_FALLTHROUGH;
3766  case 2:
3767  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
3768  else {
3769  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 2); __PYX_ERR(0, 36, __pyx_L3_error)
3770  }
3771  CYTHON_FALLTHROUGH;
3772  case 3:
3773  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
3774  else {
3775  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, 3); __PYX_ERR(0, 36, __pyx_L3_error)
3776  }
3777  }
3778  if (unlikely(kw_args > 0)) {
3779  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionNodes") < 0)) __PYX_ERR(0, 36, __pyx_L3_error)
3780  }
3781  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3782  goto __pyx_L5_argtuple_error;
3783  } else {
3784  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3785  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3786  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3787  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3788  }
3789  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
3790  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error)
3791  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
3792  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
3793  }
3794  goto __pyx_L4_argument_unpacking_done;
3795  __pyx_L5_argtuple_error:;
3796  __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 36, __pyx_L3_error)
3797  __pyx_L3_error:;
3798  __Pyx_AddTraceback("cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
3799  __Pyx_RefNannyFinishContext();
3800  return NULL;
3801  __pyx_L4_argument_unpacking_done:;
3802  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
3803  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
3804  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
3805  __pyx_r = __pyx_pf_13cpartitioning_2partitionNodes(__pyx_self, __pyx_v_comm, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
3806 
3807  /* function exit code */
3808  goto __pyx_L0;
3809  __pyx_L1_error:;
3810  __pyx_r = NULL;
3811  __pyx_L0:;
3812  __Pyx_RefNannyFinishContext();
3813  return __pyx_r;
3814 }
3815 
3816 static PyObject *__pyx_pf_13cpartitioning_2partitionNodes(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
3817  PyObject *__pyx_r = NULL;
3818  __Pyx_RefNannyDeclarations
3819  PyObject *__pyx_t_1 = NULL;
3820  PyObject *__pyx_t_2 = NULL;
3821  PyObject *__pyx_t_3 = NULL;
3822  int *__pyx_t_4;
3823  PyObject *__pyx_t_5 = NULL;
3824  Py_ssize_t __pyx_t_6;
3825  struct __pyx_array_obj *__pyx_t_7 = NULL;
3826  PyObject *__pyx_t_8 = NULL;
3827  PyObject *__pyx_t_9 = NULL;
3828  PyObject *__pyx_t_10 = NULL;
3829  PyObject *__pyx_t_11 = NULL;
3830  PyObject *__pyx_t_12 = NULL;
3831  PyObject *__pyx_t_13 = NULL;
3832  PyObject *__pyx_t_14 = NULL;
3833  int __pyx_lineno = 0;
3834  const char *__pyx_filename = NULL;
3835  int __pyx_clineno = 0;
3836  __Pyx_RefNannySetupContext("partitionNodes", 0);
3837 
3838  /* "cpartitioning.pyx":37
3839  *
3840  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3841  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
3842  * c_partitionNodes(comm.ob_mpi,
3843  * cmesh.mesh,
3844  */
3845  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
3846 
3847  /* "cpartitioning.pyx":38
3848  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
3849  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
3850  * c_partitionNodes(comm.ob_mpi, # <<<<<<<<<<<<<<
3851  * cmesh.mesh,
3852  * nLayersOfOverlap)
3853  */
3854  (void)(proteus::partitionNodes(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
3855 
3856  /* "cpartitioning.pyx":41
3857  * cmesh.mesh,
3858  * nLayersOfOverlap)
3859  * return ( # <<<<<<<<<<<<<<
3860  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3861  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3862  */
3863  __Pyx_XDECREF(__pyx_r);
3864 
3865  /* "cpartitioning.pyx":42
3866  * nLayersOfOverlap)
3867  * return (
3868  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3869  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3870  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3871  */
3872  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3873  __Pyx_GOTREF(__pyx_t_2);
3874  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
3875  __Pyx_GOTREF(__pyx_t_3);
3876  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3877  __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
3878  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3879  __Pyx_GOTREF(__pyx_t_2);
3880  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
3881  __Pyx_GOTREF(__pyx_t_5);
3882  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3883  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L1_error)
3884  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3885  if (!__pyx_t_4) {
3886  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3887  __PYX_ERR(0, 42, __pyx_L1_error)
3888  }
3889  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
3890  __Pyx_GOTREF(__pyx_t_2);
3891  __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
3892  __Pyx_GOTREF(__pyx_t_5);
3893  __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(int), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_4);
3894  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error)
3895  __Pyx_GOTREF(__pyx_t_7);
3896  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3897  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3898  __pyx_t_2 = NULL;
3899  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3900  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3901  if (likely(__pyx_t_2)) {
3902  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3903  __Pyx_INCREF(__pyx_t_2);
3904  __Pyx_INCREF(function);
3905  __Pyx_DECREF_SET(__pyx_t_3, function);
3906  }
3907  }
3908  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
3909  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3910  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3911  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
3912  __Pyx_GOTREF(__pyx_t_1);
3913  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3914 
3915  /* "cpartitioning.pyx":43
3916  * return (
3917  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3918  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
3919  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
3920  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3921  */
3922  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
3923  __Pyx_GOTREF(__pyx_t_2);
3924  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 43, __pyx_L1_error)
3925  __Pyx_GOTREF(__pyx_t_5);
3926  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3927  __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
3928  if (!__pyx_t_4) {
3929  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3930  __PYX_ERR(0, 43, __pyx_L1_error)
3931  }
3932  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error)
3933  __Pyx_GOTREF(__pyx_t_8);
3934  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
3935  __Pyx_GOTREF(__pyx_t_2);
3936  __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3937  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error)
3938  __Pyx_GOTREF(__pyx_t_7);
3939  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3940  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3941  __pyx_t_8 = NULL;
3942  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3943  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
3944  if (likely(__pyx_t_8)) {
3945  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3946  __Pyx_INCREF(__pyx_t_8);
3947  __Pyx_INCREF(function);
3948  __Pyx_DECREF_SET(__pyx_t_5, function);
3949  }
3950  }
3951  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
3952  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3953  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
3954  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
3955  __Pyx_GOTREF(__pyx_t_3);
3956  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3957 
3958  /* "cpartitioning.pyx":44
3959  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
3960  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
3961  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
3962  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
3963  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
3964  */
3965  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
3966  __Pyx_GOTREF(__pyx_t_8);
3967  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
3968  __Pyx_GOTREF(__pyx_t_2);
3969  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3970  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
3971  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
3972  __Pyx_GOTREF(__pyx_t_8);
3973  __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error)
3974  __Pyx_GOTREF(__pyx_t_9);
3975  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3976  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error)
3977  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3978  if (!__pyx_t_4) {
3979  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3980  __PYX_ERR(0, 44, __pyx_L1_error)
3981  }
3982  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
3983  __Pyx_GOTREF(__pyx_t_8);
3984  __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error)
3985  __Pyx_GOTREF(__pyx_t_9);
3986  __pyx_t_7 = __pyx_array_new(__pyx_t_9, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
3987  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 44, __pyx_L1_error)
3988  __Pyx_GOTREF(__pyx_t_7);
3989  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3990  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3991  __pyx_t_8 = NULL;
3992  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3993  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
3994  if (likely(__pyx_t_8)) {
3995  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3996  __Pyx_INCREF(__pyx_t_8);
3997  __Pyx_INCREF(function);
3998  __Pyx_DECREF_SET(__pyx_t_2, function);
3999  }
4000  }
4001  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
4002  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4003  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4004  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 44, __pyx_L1_error)
4005  __Pyx_GOTREF(__pyx_t_5);
4006  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4007 
4008  /* "cpartitioning.pyx":45
4009  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4010  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4011  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
4012  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4013  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4014  */
4015  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error)
4016  __Pyx_GOTREF(__pyx_t_8);
4017  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 45, __pyx_L1_error)
4018  __Pyx_GOTREF(__pyx_t_9);
4019  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4020  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
4021  if (!__pyx_t_4) {
4022  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4023  __PYX_ERR(0, 45, __pyx_L1_error)
4024  }
4025  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 45, __pyx_L1_error)
4026  __Pyx_GOTREF(__pyx_t_10);
4027  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error)
4028  __Pyx_GOTREF(__pyx_t_8);
4029  __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
4030  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error)
4031  __Pyx_GOTREF(__pyx_t_7);
4032  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4033  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4034  __pyx_t_10 = NULL;
4035  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
4036  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
4037  if (likely(__pyx_t_10)) {
4038  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
4039  __Pyx_INCREF(__pyx_t_10);
4040  __Pyx_INCREF(function);
4041  __Pyx_DECREF_SET(__pyx_t_9, function);
4042  }
4043  }
4044  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
4045  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4046  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4047  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
4048  __Pyx_GOTREF(__pyx_t_2);
4049  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4050 
4051  /* "cpartitioning.pyx":46
4052  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4053  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4054  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4055  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4056  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4057  */
4058  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
4059  __Pyx_GOTREF(__pyx_t_10);
4060  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L1_error)
4061  __Pyx_GOTREF(__pyx_t_8);
4062  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4063  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
4064  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
4065  __Pyx_GOTREF(__pyx_t_10);
4066  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 46, __pyx_L1_error)
4067  __Pyx_GOTREF(__pyx_t_11);
4068  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4069  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error)
4070  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4071  if (!__pyx_t_4) {
4072  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4073  __PYX_ERR(0, 46, __pyx_L1_error)
4074  }
4075  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 46, __pyx_L1_error)
4076  __Pyx_GOTREF(__pyx_t_10);
4077  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 46, __pyx_L1_error)
4078  __Pyx_GOTREF(__pyx_t_11);
4079  __pyx_t_7 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
4080  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 46, __pyx_L1_error)
4081  __Pyx_GOTREF(__pyx_t_7);
4082  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4083  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4084  __pyx_t_10 = NULL;
4085  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
4086  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
4087  if (likely(__pyx_t_10)) {
4088  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
4089  __Pyx_INCREF(__pyx_t_10);
4090  __Pyx_INCREF(function);
4091  __Pyx_DECREF_SET(__pyx_t_8, function);
4092  }
4093  }
4094  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
4095  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4096  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4097  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 46, __pyx_L1_error)
4098  __Pyx_GOTREF(__pyx_t_9);
4099  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4100 
4101  /* "cpartitioning.pyx":47
4102  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4103  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4104  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
4105  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4106  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4107  */
4108  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 47, __pyx_L1_error)
4109  __Pyx_GOTREF(__pyx_t_10);
4110  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 47, __pyx_L1_error)
4111  __Pyx_GOTREF(__pyx_t_11);
4112  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4113  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
4114  if (!__pyx_t_4) {
4115  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4116  __PYX_ERR(0, 47, __pyx_L1_error)
4117  }
4118  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 47, __pyx_L1_error)
4119  __Pyx_GOTREF(__pyx_t_12);
4120  __pyx_t_10 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 47, __pyx_L1_error)
4121  __Pyx_GOTREF(__pyx_t_10);
4122  __pyx_t_7 = __pyx_array_new(__pyx_t_10, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4123  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 47, __pyx_L1_error)
4124  __Pyx_GOTREF(__pyx_t_7);
4125  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4126  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4127  __pyx_t_12 = NULL;
4128  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
4129  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
4130  if (likely(__pyx_t_12)) {
4131  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
4132  __Pyx_INCREF(__pyx_t_12);
4133  __Pyx_INCREF(function);
4134  __Pyx_DECREF_SET(__pyx_t_11, function);
4135  }
4136  }
4137  __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
4138  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4139  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4140  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 47, __pyx_L1_error)
4141  __Pyx_GOTREF(__pyx_t_8);
4142  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4143 
4144  /* "cpartitioning.pyx":48
4145  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4146  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4147  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4148  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4149  * )
4150  */
4151  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error)
4152  __Pyx_GOTREF(__pyx_t_12);
4153  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 48, __pyx_L1_error)
4154  __Pyx_GOTREF(__pyx_t_10);
4155  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4156  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
4157  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error)
4158  __Pyx_GOTREF(__pyx_t_12);
4159  __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 48, __pyx_L1_error)
4160  __Pyx_GOTREF(__pyx_t_13);
4161  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4162  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L1_error)
4163  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4164  if (!__pyx_t_4) {
4165  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4166  __PYX_ERR(0, 48, __pyx_L1_error)
4167  }
4168  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error)
4169  __Pyx_GOTREF(__pyx_t_12);
4170  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 48, __pyx_L1_error)
4171  __Pyx_GOTREF(__pyx_t_13);
4172  __pyx_t_7 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4173  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 48, __pyx_L1_error)
4174  __Pyx_GOTREF(__pyx_t_7);
4175  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4176  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4177  __pyx_t_12 = NULL;
4178  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
4179  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
4180  if (likely(__pyx_t_12)) {
4181  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
4182  __Pyx_INCREF(__pyx_t_12);
4183  __Pyx_INCREF(function);
4184  __Pyx_DECREF_SET(__pyx_t_10, function);
4185  }
4186  }
4187  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
4188  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4189  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4190  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 48, __pyx_L1_error)
4191  __Pyx_GOTREF(__pyx_t_11);
4192  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4193 
4194  /* "cpartitioning.pyx":49
4195  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4196  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4197  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
4198  * )
4199  *
4200  */
4201  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 49, __pyx_L1_error)
4202  __Pyx_GOTREF(__pyx_t_12);
4203  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 49, __pyx_L1_error)
4204  __Pyx_GOTREF(__pyx_t_13);
4205  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4206  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
4207  if (!__pyx_t_4) {
4208  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4209  __PYX_ERR(0, 49, __pyx_L1_error)
4210  }
4211  __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 49, __pyx_L1_error)
4212  __Pyx_GOTREF(__pyx_t_14);
4213  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 49, __pyx_L1_error)
4214  __Pyx_GOTREF(__pyx_t_12);
4215  __pyx_t_7 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_t_4);
4216  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 49, __pyx_L1_error)
4217  __Pyx_GOTREF(__pyx_t_7);
4218  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4219  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4220  __pyx_t_14 = NULL;
4221  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
4222  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
4223  if (likely(__pyx_t_14)) {
4224  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
4225  __Pyx_INCREF(__pyx_t_14);
4226  __Pyx_INCREF(function);
4227  __Pyx_DECREF_SET(__pyx_t_13, function);
4228  }
4229  }
4230  __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
4231  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4232  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4233  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 49, __pyx_L1_error)
4234  __Pyx_GOTREF(__pyx_t_10);
4235  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4236 
4237  /* "cpartitioning.pyx":42
4238  * nLayersOfOverlap)
4239  * return (
4240  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4241  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4242  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4243  */
4244  __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 42, __pyx_L1_error)
4245  __Pyx_GOTREF(__pyx_t_13);
4246  __Pyx_GIVEREF(__pyx_t_1);
4247  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
4248  __Pyx_GIVEREF(__pyx_t_3);
4249  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
4250  __Pyx_GIVEREF(__pyx_t_5);
4251  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
4252  __Pyx_GIVEREF(__pyx_t_2);
4253  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
4254  __Pyx_GIVEREF(__pyx_t_9);
4255  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
4256  __Pyx_GIVEREF(__pyx_t_8);
4257  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
4258  __Pyx_GIVEREF(__pyx_t_11);
4259  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
4260  __Pyx_GIVEREF(__pyx_t_10);
4261  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
4262  __pyx_t_1 = 0;
4263  __pyx_t_3 = 0;
4264  __pyx_t_5 = 0;
4265  __pyx_t_2 = 0;
4266  __pyx_t_9 = 0;
4267  __pyx_t_8 = 0;
4268  __pyx_t_11 = 0;
4269  __pyx_t_10 = 0;
4270  __pyx_r = __pyx_t_13;
4271  __pyx_t_13 = 0;
4272  goto __pyx_L0;
4273 
4274  /* "cpartitioning.pyx":36
4275  * )
4276  *
4277  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4278  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4279  * c_partitionNodes(comm.ob_mpi,
4280  */
4281 
4282  /* function exit code */
4283  __pyx_L1_error:;
4284  __Pyx_XDECREF(__pyx_t_1);
4285  __Pyx_XDECREF(__pyx_t_2);
4286  __Pyx_XDECREF(__pyx_t_3);
4287  __Pyx_XDECREF(__pyx_t_5);
4288  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
4289  __Pyx_XDECREF(__pyx_t_8);
4290  __Pyx_XDECREF(__pyx_t_9);
4291  __Pyx_XDECREF(__pyx_t_10);
4292  __Pyx_XDECREF(__pyx_t_11);
4293  __Pyx_XDECREF(__pyx_t_12);
4294  __Pyx_XDECREF(__pyx_t_13);
4295  __Pyx_XDECREF(__pyx_t_14);
4296  __Pyx_AddTraceback("cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
4297  __pyx_r = NULL;
4298  __pyx_L0:;
4299  __Pyx_XGIVEREF(__pyx_r);
4300  __Pyx_RefNannyFinishContext();
4301  return __pyx_r;
4302 }
4303 
4304 /* "cpartitioning.pyx":52
4305  * )
4306  *
4307  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4308  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4309  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4310  */
4311 
4312 /* Python wrapper */
4313 static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4314 static PyMethodDef __pyx_mdef_13cpartitioning_5convertPUMIPartitionToPython = {"convertPUMIPartitionToPython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython, METH_VARARGS|METH_KEYWORDS, 0};
4315 static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4316  CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm = 0;
4317  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
4318  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
4319  int __pyx_lineno = 0;
4320  const char *__pyx_filename = NULL;
4321  int __pyx_clineno = 0;
4322  PyObject *__pyx_r = 0;
4323  __Pyx_RefNannyDeclarations
4324  __Pyx_RefNannySetupContext("convertPUMIPartitionToPython (wrapper)", 0);
4325  {
4326  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
4327  PyObject* values[3] = {0,0,0};
4328  if (unlikely(__pyx_kwds)) {
4329  Py_ssize_t kw_args;
4330  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4331  switch (pos_args) {
4332  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4333  CYTHON_FALLTHROUGH;
4334  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4335  CYTHON_FALLTHROUGH;
4336  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4337  CYTHON_FALLTHROUGH;
4338  case 0: break;
4339  default: goto __pyx_L5_argtuple_error;
4340  }
4341  kw_args = PyDict_Size(__pyx_kwds);
4342  switch (pos_args) {
4343  case 0:
4344  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
4345  else goto __pyx_L5_argtuple_error;
4346  CYTHON_FALLTHROUGH;
4347  case 1:
4348  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4349  else {
4350  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, 1); __PYX_ERR(0, 52, __pyx_L3_error)
4351  }
4352  CYTHON_FALLTHROUGH;
4353  case 2:
4354  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4355  else {
4356  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, 2); __PYX_ERR(0, 52, __pyx_L3_error)
4357  }
4358  }
4359  if (unlikely(kw_args > 0)) {
4360  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convertPUMIPartitionToPython") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
4361  }
4362  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4363  goto __pyx_L5_argtuple_error;
4364  } else {
4365  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4366  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4367  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4368  }
4369  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
4370  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[1]);
4371  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
4372  }
4373  goto __pyx_L4_argument_unpacking_done;
4374  __pyx_L5_argtuple_error:;
4375  __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
4376  __pyx_L3_error:;
4377  __Pyx_AddTraceback("cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4378  __Pyx_RefNannyFinishContext();
4379  return NULL;
4380  __pyx_L4_argument_unpacking_done:;
4381  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 52, __pyx_L1_error)
4382  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 52, __pyx_L1_error)
4383  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 52, __pyx_L1_error)
4384  __pyx_r = __pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(__pyx_self, __pyx_v_comm, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
4385 
4386  /* function exit code */
4387  goto __pyx_L0;
4388  __pyx_L1_error:;
4389  __pyx_r = NULL;
4390  __pyx_L0:;
4391  __Pyx_RefNannyFinishContext();
4392  return __pyx_r;
4393 }
4394 
4395 static PyObject *__pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
4396  PyObject *__pyx_r = NULL;
4397  __Pyx_RefNannyDeclarations
4398  PyObject *__pyx_t_1 = NULL;
4399  PyObject *__pyx_t_2 = NULL;
4400  PyObject *__pyx_t_3 = NULL;
4401  int *__pyx_t_4;
4402  PyObject *__pyx_t_5 = NULL;
4403  Py_ssize_t __pyx_t_6;
4404  struct __pyx_array_obj *__pyx_t_7 = NULL;
4405  PyObject *__pyx_t_8 = NULL;
4406  PyObject *__pyx_t_9 = NULL;
4407  PyObject *__pyx_t_10 = NULL;
4408  PyObject *__pyx_t_11 = NULL;
4409  PyObject *__pyx_t_12 = NULL;
4410  PyObject *__pyx_t_13 = NULL;
4411  PyObject *__pyx_t_14 = NULL;
4412  int __pyx_lineno = 0;
4413  const char *__pyx_filename = NULL;
4414  int __pyx_clineno = 0;
4415  __Pyx_RefNannySetupContext("convertPUMIPartitionToPython", 0);
4416 
4417  /* "cpartitioning.pyx":54
4418  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
4419  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4420  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
4421  * return (
4422  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4423  */
4424  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
4425 
4426  /* "cpartitioning.pyx":55
4427  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4428  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4429  * return ( # <<<<<<<<<<<<<<
4430  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4431  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4432  */
4433  __Pyx_XDECREF(__pyx_r);
4434 
4435  /* "cpartitioning.pyx":56
4436  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4437  * return (
4438  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4439  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4440  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4441  */
4442  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
4443  __Pyx_GOTREF(__pyx_t_2);
4444  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
4445  __Pyx_GOTREF(__pyx_t_3);
4446  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4447  __pyx_t_4 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
4448  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
4449  __Pyx_GOTREF(__pyx_t_2);
4450  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
4451  __Pyx_GOTREF(__pyx_t_5);
4452  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4453  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error)
4454  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4455  if (!__pyx_t_4) {
4456  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4457  __PYX_ERR(0, 56, __pyx_L1_error)
4458  }
4459  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
4460  __Pyx_GOTREF(__pyx_t_2);
4461  __pyx_t_5 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
4462  __Pyx_GOTREF(__pyx_t_5);
4463  __pyx_t_7 = __pyx_array_new(__pyx_t_5, sizeof(int), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_4);
4464  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L1_error)
4465  __Pyx_GOTREF(__pyx_t_7);
4466  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4467  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4468  __pyx_t_2 = NULL;
4469  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4470  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
4471  if (likely(__pyx_t_2)) {
4472  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4473  __Pyx_INCREF(__pyx_t_2);
4474  __Pyx_INCREF(function);
4475  __Pyx_DECREF_SET(__pyx_t_3, function);
4476  }
4477  }
4478  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_7));
4479  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4480  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4481  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
4482  __Pyx_GOTREF(__pyx_t_1);
4483  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4484 
4485  /* "cpartitioning.pyx":57
4486  * return (
4487  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4488  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
4489  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4490  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4491  */
4492  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
4493  __Pyx_GOTREF(__pyx_t_2);
4494  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
4495  __Pyx_GOTREF(__pyx_t_5);
4496  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4497  __pyx_t_4 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
4498  if (!__pyx_t_4) {
4499  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4500  __PYX_ERR(0, 57, __pyx_L1_error)
4501  }
4502  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 57, __pyx_L1_error)
4503  __Pyx_GOTREF(__pyx_t_8);
4504  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
4505  __Pyx_GOTREF(__pyx_t_2);
4506  __pyx_t_7 = __pyx_array_new(__pyx_t_2, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
4507  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 57, __pyx_L1_error)
4508  __Pyx_GOTREF(__pyx_t_7);
4509  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4510  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4511  __pyx_t_8 = NULL;
4512  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
4513  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
4514  if (likely(__pyx_t_8)) {
4515  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
4516  __Pyx_INCREF(__pyx_t_8);
4517  __Pyx_INCREF(function);
4518  __Pyx_DECREF_SET(__pyx_t_5, function);
4519  }
4520  }
4521  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_7));
4522  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4523  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4524  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error)
4525  __Pyx_GOTREF(__pyx_t_3);
4526  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4527 
4528  /* "cpartitioning.pyx":58
4529  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
4530  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4531  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4532  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4533  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4534  */
4535  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
4536  __Pyx_GOTREF(__pyx_t_8);
4537  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
4538  __Pyx_GOTREF(__pyx_t_2);
4539  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4540  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
4541  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
4542  __Pyx_GOTREF(__pyx_t_8);
4543  __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 58, __pyx_L1_error)
4544  __Pyx_GOTREF(__pyx_t_9);
4545  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4546  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error)
4547  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4548  if (!__pyx_t_4) {
4549  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4550  __PYX_ERR(0, 58, __pyx_L1_error)
4551  }
4552  __pyx_t_8 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
4553  __Pyx_GOTREF(__pyx_t_8);
4554  __pyx_t_9 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 58, __pyx_L1_error)
4555  __Pyx_GOTREF(__pyx_t_9);
4556  __pyx_t_7 = __pyx_array_new(__pyx_t_9, sizeof(int), PyBytes_AS_STRING(__pyx_t_8), (char *) "c", (char *) __pyx_t_4);
4557  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 58, __pyx_L1_error)
4558  __Pyx_GOTREF(__pyx_t_7);
4559  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4560  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4561  __pyx_t_8 = NULL;
4562  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4563  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
4564  if (likely(__pyx_t_8)) {
4565  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4566  __Pyx_INCREF(__pyx_t_8);
4567  __Pyx_INCREF(function);
4568  __Pyx_DECREF_SET(__pyx_t_2, function);
4569  }
4570  }
4571  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_7));
4572  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4573  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4574  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error)
4575  __Pyx_GOTREF(__pyx_t_5);
4576  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4577 
4578  /* "cpartitioning.pyx":59
4579  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4580  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4581  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
4582  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4583  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4584  */
4585  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error)
4586  __Pyx_GOTREF(__pyx_t_8);
4587  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 59, __pyx_L1_error)
4588  __Pyx_GOTREF(__pyx_t_9);
4589  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4590  __pyx_t_4 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
4591  if (!__pyx_t_4) {
4592  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4593  __PYX_ERR(0, 59, __pyx_L1_error)
4594  }
4595  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 59, __pyx_L1_error)
4596  __Pyx_GOTREF(__pyx_t_10);
4597  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error)
4598  __Pyx_GOTREF(__pyx_t_8);
4599  __pyx_t_7 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
4600  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 59, __pyx_L1_error)
4601  __Pyx_GOTREF(__pyx_t_7);
4602  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4603  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4604  __pyx_t_10 = NULL;
4605  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
4606  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
4607  if (likely(__pyx_t_10)) {
4608  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
4609  __Pyx_INCREF(__pyx_t_10);
4610  __Pyx_INCREF(function);
4611  __Pyx_DECREF_SET(__pyx_t_9, function);
4612  }
4613  }
4614  __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_t_7));
4615  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4616  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4617  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
4618  __Pyx_GOTREF(__pyx_t_2);
4619  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4620 
4621  /* "cpartitioning.pyx":60
4622  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4623  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4624  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4625  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4626  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4627  */
4628  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
4629  __Pyx_GOTREF(__pyx_t_10);
4630  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L1_error)
4631  __Pyx_GOTREF(__pyx_t_8);
4632  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4633  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
4634  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
4635  __Pyx_GOTREF(__pyx_t_10);
4636  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L1_error)
4637  __Pyx_GOTREF(__pyx_t_11);
4638  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4639  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_11); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
4640  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4641  if (!__pyx_t_4) {
4642  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4643  __PYX_ERR(0, 60, __pyx_L1_error)
4644  }
4645  __pyx_t_10 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 60, __pyx_L1_error)
4646  __Pyx_GOTREF(__pyx_t_10);
4647  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L1_error)
4648  __Pyx_GOTREF(__pyx_t_11);
4649  __pyx_t_7 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_10), (char *) "c", (char *) __pyx_t_4);
4650  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error)
4651  __Pyx_GOTREF(__pyx_t_7);
4652  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4653  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4654  __pyx_t_10 = NULL;
4655  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
4656  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
4657  if (likely(__pyx_t_10)) {
4658  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
4659  __Pyx_INCREF(__pyx_t_10);
4660  __Pyx_INCREF(function);
4661  __Pyx_DECREF_SET(__pyx_t_8, function);
4662  }
4663  }
4664  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_7));
4665  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4666  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4667  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L1_error)
4668  __Pyx_GOTREF(__pyx_t_9);
4669  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4670 
4671  /* "cpartitioning.pyx":61
4672  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
4673  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4674  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
4675  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4676  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4677  */
4678  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error)
4679  __Pyx_GOTREF(__pyx_t_10);
4680  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 61, __pyx_L1_error)
4681  __Pyx_GOTREF(__pyx_t_11);
4682  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4683  __pyx_t_4 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
4684  if (!__pyx_t_4) {
4685  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4686  __PYX_ERR(0, 61, __pyx_L1_error)
4687  }
4688  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 61, __pyx_L1_error)
4689  __Pyx_GOTREF(__pyx_t_12);
4690  __pyx_t_10 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 61, __pyx_L1_error)
4691  __Pyx_GOTREF(__pyx_t_10);
4692  __pyx_t_7 = __pyx_array_new(__pyx_t_10, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4693  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error)
4694  __Pyx_GOTREF(__pyx_t_7);
4695  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4696  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4697  __pyx_t_12 = NULL;
4698  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
4699  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
4700  if (likely(__pyx_t_12)) {
4701  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
4702  __Pyx_INCREF(__pyx_t_12);
4703  __Pyx_INCREF(function);
4704  __Pyx_DECREF_SET(__pyx_t_11, function);
4705  }
4706  }
4707  __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_7));
4708  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4709  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4710  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 61, __pyx_L1_error)
4711  __Pyx_GOTREF(__pyx_t_8);
4712  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4713 
4714  /* "cpartitioning.pyx":62
4715  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
4716  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4717  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4718  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
4719  * )
4720  */
4721  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
4722  __Pyx_GOTREF(__pyx_t_12);
4723  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 62, __pyx_L1_error)
4724  __Pyx_GOTREF(__pyx_t_10);
4725  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4726  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
4727  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
4728  __Pyx_GOTREF(__pyx_t_12);
4729  __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_t_12, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error)
4730  __Pyx_GOTREF(__pyx_t_13);
4731  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4732  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error)
4733  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4734  if (!__pyx_t_4) {
4735  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4736  __PYX_ERR(0, 62, __pyx_L1_error)
4737  }
4738  __pyx_t_12 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
4739  __Pyx_GOTREF(__pyx_t_12);
4740  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_6)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error)
4741  __Pyx_GOTREF(__pyx_t_13);
4742  __pyx_t_7 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_12), (char *) "c", (char *) __pyx_t_4);
4743  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 62, __pyx_L1_error)
4744  __Pyx_GOTREF(__pyx_t_7);
4745  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4746  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4747  __pyx_t_12 = NULL;
4748  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
4749  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
4750  if (likely(__pyx_t_12)) {
4751  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
4752  __Pyx_INCREF(__pyx_t_12);
4753  __Pyx_INCREF(function);
4754  __Pyx_DECREF_SET(__pyx_t_10, function);
4755  }
4756  }
4757  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_t_7));
4758  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4759  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4760  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 62, __pyx_L1_error)
4761  __Pyx_GOTREF(__pyx_t_11);
4762  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4763 
4764  /* "cpartitioning.pyx":63
4765  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
4766  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
4767  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
4768  * )
4769  *
4770  */
4771  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 63, __pyx_L1_error)
4772  __Pyx_GOTREF(__pyx_t_12);
4773  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 63, __pyx_L1_error)
4774  __Pyx_GOTREF(__pyx_t_13);
4775  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4776  __pyx_t_4 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
4777  if (!__pyx_t_4) {
4778  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4779  __PYX_ERR(0, 63, __pyx_L1_error)
4780  }
4781  __pyx_t_14 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 63, __pyx_L1_error)
4782  __Pyx_GOTREF(__pyx_t_14);
4783  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 63, __pyx_L1_error)
4784  __Pyx_GOTREF(__pyx_t_12);
4785  __pyx_t_7 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_14), (char *) "c", (char *) __pyx_t_4);
4786  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 63, __pyx_L1_error)
4787  __Pyx_GOTREF(__pyx_t_7);
4788  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4789  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4790  __pyx_t_14 = NULL;
4791  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
4792  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
4793  if (likely(__pyx_t_14)) {
4794  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
4795  __Pyx_INCREF(__pyx_t_14);
4796  __Pyx_INCREF(function);
4797  __Pyx_DECREF_SET(__pyx_t_13, function);
4798  }
4799  }
4800  __pyx_t_10 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_14, ((PyObject *)__pyx_t_7)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_7));
4801  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4802  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
4803  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 63, __pyx_L1_error)
4804  __Pyx_GOTREF(__pyx_t_10);
4805  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4806 
4807  /* "cpartitioning.pyx":56
4808  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4809  * return (
4810  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
4811  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
4812  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
4813  */
4814  __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 56, __pyx_L1_error)
4815  __Pyx_GOTREF(__pyx_t_13);
4816  __Pyx_GIVEREF(__pyx_t_1);
4817  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
4818  __Pyx_GIVEREF(__pyx_t_3);
4819  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3);
4820  __Pyx_GIVEREF(__pyx_t_5);
4821  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
4822  __Pyx_GIVEREF(__pyx_t_2);
4823  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_2);
4824  __Pyx_GIVEREF(__pyx_t_9);
4825  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
4826  __Pyx_GIVEREF(__pyx_t_8);
4827  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
4828  __Pyx_GIVEREF(__pyx_t_11);
4829  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_11);
4830  __Pyx_GIVEREF(__pyx_t_10);
4831  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10);
4832  __pyx_t_1 = 0;
4833  __pyx_t_3 = 0;
4834  __pyx_t_5 = 0;
4835  __pyx_t_2 = 0;
4836  __pyx_t_9 = 0;
4837  __pyx_t_8 = 0;
4838  __pyx_t_11 = 0;
4839  __pyx_t_10 = 0;
4840  __pyx_r = __pyx_t_13;
4841  __pyx_t_13 = 0;
4842  goto __pyx_L0;
4843 
4844  /* "cpartitioning.pyx":52
4845  * )
4846  *
4847  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4848  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
4849  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4850  */
4851 
4852  /* function exit code */
4853  __pyx_L1_error:;
4854  __Pyx_XDECREF(__pyx_t_1);
4855  __Pyx_XDECREF(__pyx_t_2);
4856  __Pyx_XDECREF(__pyx_t_3);
4857  __Pyx_XDECREF(__pyx_t_5);
4858  __Pyx_XDECREF(((PyObject *)__pyx_t_7));
4859  __Pyx_XDECREF(__pyx_t_8);
4860  __Pyx_XDECREF(__pyx_t_9);
4861  __Pyx_XDECREF(__pyx_t_10);
4862  __Pyx_XDECREF(__pyx_t_11);
4863  __Pyx_XDECREF(__pyx_t_12);
4864  __Pyx_XDECREF(__pyx_t_13);
4865  __Pyx_XDECREF(__pyx_t_14);
4866  __Pyx_AddTraceback("cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4867  __pyx_r = NULL;
4868  __pyx_L0:;
4869  __Pyx_XGIVEREF(__pyx_r);
4870  __Pyx_RefNannyFinishContext();
4871  return __pyx_r;
4872 }
4873 
4874 /* "cpartitioning.pyx":66
4875  * )
4876  *
4877  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
4878  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
4879  * if not isinstance(filebase, bytes):
4880  */
4881 
4882 /* Python wrapper */
4883 static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4884 static PyMethodDef __pyx_mdef_13cpartitioning_7partitionNodesFromTetgenFiles = {"partitionNodesFromTetgenFiles", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles, METH_VARARGS|METH_KEYWORDS, 0};
4885 static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4886  struct PyMPICommObject *__pyx_v_comm = 0;
4887  PyObject *__pyx_v_filebase = 0;
4888  int __pyx_v_indexBase;
4889  int __pyx_v_nLayersOfOverlap;
4890  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
4891  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
4892  int __pyx_lineno = 0;
4893  const char *__pyx_filename = NULL;
4894  int __pyx_clineno = 0;
4895  PyObject *__pyx_r = 0;
4896  __Pyx_RefNannyDeclarations
4897  __Pyx_RefNannySetupContext("partitionNodesFromTetgenFiles (wrapper)", 0);
4898  {
4899  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_filebase,&__pyx_n_s_indexBase,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
4900  PyObject* values[6] = {0,0,0,0,0,0};
4901  if (unlikely(__pyx_kwds)) {
4902  Py_ssize_t kw_args;
4903  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4904  switch (pos_args) {
4905  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4906  CYTHON_FALLTHROUGH;
4907  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4908  CYTHON_FALLTHROUGH;
4909  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4910  CYTHON_FALLTHROUGH;
4911  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4912  CYTHON_FALLTHROUGH;
4913  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4914  CYTHON_FALLTHROUGH;
4915  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4916  CYTHON_FALLTHROUGH;
4917  case 0: break;
4918  default: goto __pyx_L5_argtuple_error;
4919  }
4920  kw_args = PyDict_Size(__pyx_kwds);
4921  switch (pos_args) {
4922  case 0:
4923  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
4924  else goto __pyx_L5_argtuple_error;
4925  CYTHON_FALLTHROUGH;
4926  case 1:
4927  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filebase)) != 0)) kw_args--;
4928  else {
4929  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 1); __PYX_ERR(0, 66, __pyx_L3_error)
4930  }
4931  CYTHON_FALLTHROUGH;
4932  case 2:
4933  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indexBase)) != 0)) kw_args--;
4934  else {
4935  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 2); __PYX_ERR(0, 66, __pyx_L3_error)
4936  }
4937  CYTHON_FALLTHROUGH;
4938  case 3:
4939  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
4940  else {
4941  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 3); __PYX_ERR(0, 66, __pyx_L3_error)
4942  }
4943  CYTHON_FALLTHROUGH;
4944  case 4:
4945  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
4946  else {
4947  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 4); __PYX_ERR(0, 66, __pyx_L3_error)
4948  }
4949  CYTHON_FALLTHROUGH;
4950  case 5:
4951  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
4952  else {
4953  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, 5); __PYX_ERR(0, 66, __pyx_L3_error)
4954  }
4955  }
4956  if (unlikely(kw_args > 0)) {
4957  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionNodesFromTetgenFiles") < 0)) __PYX_ERR(0, 66, __pyx_L3_error)
4958  }
4959  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4960  goto __pyx_L5_argtuple_error;
4961  } else {
4962  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4963  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4964  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4965  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4966  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4967  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4968  }
4969  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
4970  __pyx_v_filebase = values[1];
4971  __pyx_v_indexBase = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_indexBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error)
4972  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error)
4973  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[4]);
4974  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[5]);
4975  }
4976  goto __pyx_L4_argument_unpacking_done;
4977  __pyx_L5_argtuple_error:;
4978  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 66, __pyx_L3_error)
4979  __pyx_L3_error:;
4980  __Pyx_AddTraceback("cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
4981  __Pyx_RefNannyFinishContext();
4982  return NULL;
4983  __pyx_L4_argument_unpacking_done:;
4984  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 66, __pyx_L1_error)
4985  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 66, __pyx_L1_error)
4986  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 66, __pyx_L1_error)
4987  __pyx_r = __pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(__pyx_self, __pyx_v_comm, __pyx_v_filebase, __pyx_v_indexBase, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
4988 
4989  /* function exit code */
4990  goto __pyx_L0;
4991  __pyx_L1_error:;
4992  __pyx_r = NULL;
4993  __pyx_L0:;
4994  __Pyx_RefNannyFinishContext();
4995  return __pyx_r;
4996 }
4997 
4998 static PyObject *__pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
4999  PyObject *__pyx_r = NULL;
5000  __Pyx_RefNannyDeclarations
5001  int __pyx_t_1;
5002  int __pyx_t_2;
5003  PyObject *__pyx_t_3 = NULL;
5004  PyObject *__pyx_t_4 = NULL;
5005  PyObject *__pyx_t_5 = NULL;
5006  char *__pyx_t_6;
5007  int *__pyx_t_7;
5008  PyObject *__pyx_t_8 = NULL;
5009  Py_ssize_t __pyx_t_9;
5010  struct __pyx_array_obj *__pyx_t_10 = NULL;
5011  PyObject *__pyx_t_11 = NULL;
5012  PyObject *__pyx_t_12 = NULL;
5013  PyObject *__pyx_t_13 = NULL;
5014  PyObject *__pyx_t_14 = NULL;
5015  PyObject *__pyx_t_15 = NULL;
5016  PyObject *__pyx_t_16 = NULL;
5017  PyObject *__pyx_t_17 = NULL;
5018  int __pyx_lineno = 0;
5019  const char *__pyx_filename = NULL;
5020  int __pyx_clineno = 0;
5021  __Pyx_RefNannySetupContext("partitionNodesFromTetgenFiles", 0);
5022  __Pyx_INCREF(__pyx_v_filebase);
5023 
5024  /* "cpartitioning.pyx":67
5025  *
5026  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
5027  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
5028  * if not isinstance(filebase, bytes):
5029  * filebase = filebase.encode()
5030  */
5031  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
5032 
5033  /* "cpartitioning.pyx":68
5034  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
5035  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5036  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
5037  * filebase = filebase.encode()
5038  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
5039  */
5040  __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
5041  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
5042  if (__pyx_t_2) {
5043 
5044  /* "cpartitioning.pyx":69
5045  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5046  * if not isinstance(filebase, bytes):
5047  * filebase = filebase.encode() # <<<<<<<<<<<<<<
5048  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
5049  * <const char*>(<char*>filebase),
5050  */
5051  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filebase, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error)
5052  __Pyx_GOTREF(__pyx_t_4);
5053  __pyx_t_5 = NULL;
5054  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
5055  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
5056  if (likely(__pyx_t_5)) {
5057  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5058  __Pyx_INCREF(__pyx_t_5);
5059  __Pyx_INCREF(function);
5060  __Pyx_DECREF_SET(__pyx_t_4, function);
5061  }
5062  }
5063  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
5064  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5065  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error)
5066  __Pyx_GOTREF(__pyx_t_3);
5067  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5068  __Pyx_DECREF_SET(__pyx_v_filebase, __pyx_t_3);
5069  __pyx_t_3 = 0;
5070 
5071  /* "cpartitioning.pyx":68
5072  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
5073  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5074  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
5075  * filebase = filebase.encode()
5076  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
5077  */
5078  }
5079 
5080  /* "cpartitioning.pyx":71
5081  * filebase = filebase.encode()
5082  * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
5083  * <const char*>(<char*>filebase), # <<<<<<<<<<<<<<
5084  * indexBase,
5085  * cmesh.mesh,
5086  */
5087  __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
5088 
5089  /* "cpartitioning.pyx":70
5090  * if not isinstance(filebase, bytes):
5091  * filebase = filebase.encode()
5092  * c_partitionNodesFromTetgenFiles(comm.ob_mpi, # <<<<<<<<<<<<<<
5093  * <const char*>(<char*>filebase),
5094  * indexBase,
5095  */
5096  (void)(proteus::partitionNodesFromTetgenFiles(__pyx_v_comm->ob_mpi, ((char const *)((char *)__pyx_t_6)), __pyx_v_indexBase, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
5097 
5098  /* "cpartitioning.pyx":75
5099  * cmesh.mesh,
5100  * nLayersOfOverlap)
5101  * return ( # <<<<<<<<<<<<<<
5102  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5103  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5104  */
5105  __Pyx_XDECREF(__pyx_r);
5106 
5107  /* "cpartitioning.pyx":76
5108  * nLayersOfOverlap)
5109  * return (
5110  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5111  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5112  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5113  */
5114  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
5115  __Pyx_GOTREF(__pyx_t_4);
5116  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L1_error)
5117  __Pyx_GOTREF(__pyx_t_5);
5118  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5119  __pyx_t_7 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
5120  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
5121  __Pyx_GOTREF(__pyx_t_4);
5122  __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 76, __pyx_L1_error)
5123  __Pyx_GOTREF(__pyx_t_8);
5124  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5125  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L1_error)
5126  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5127  if (!__pyx_t_7) {
5128  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5129  __PYX_ERR(0, 76, __pyx_L1_error)
5130  }
5131  __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
5132  __Pyx_GOTREF(__pyx_t_4);
5133  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 76, __pyx_L1_error)
5134  __Pyx_GOTREF(__pyx_t_8);
5135  __pyx_t_10 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_4), (char *) "c", (char *) __pyx_t_7);
5136  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 76, __pyx_L1_error)
5137  __Pyx_GOTREF(__pyx_t_10);
5138  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5139  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5140  __pyx_t_4 = NULL;
5141  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5142  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
5143  if (likely(__pyx_t_4)) {
5144  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5145  __Pyx_INCREF(__pyx_t_4);
5146  __Pyx_INCREF(function);
5147  __Pyx_DECREF_SET(__pyx_t_5, function);
5148  }
5149  }
5150  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_10));
5151  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5152  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5153  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
5154  __Pyx_GOTREF(__pyx_t_3);
5155  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5156 
5157  /* "cpartitioning.pyx":77
5158  * return (
5159  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5160  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
5161  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5162  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5163  */
5164  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
5165  __Pyx_GOTREF(__pyx_t_4);
5166  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 77, __pyx_L1_error)
5167  __Pyx_GOTREF(__pyx_t_8);
5168  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5169  __pyx_t_7 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
5170  if (!__pyx_t_7) {
5171  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5172  __PYX_ERR(0, 77, __pyx_L1_error)
5173  }
5174  __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L1_error)
5175  __Pyx_GOTREF(__pyx_t_11);
5176  __pyx_t_4 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
5177  __Pyx_GOTREF(__pyx_t_4);
5178  __pyx_t_10 = __pyx_array_new(__pyx_t_4, sizeof(int), PyBytes_AS_STRING(__pyx_t_11), (char *) "c", (char *) __pyx_t_7);
5179  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 77, __pyx_L1_error)
5180  __Pyx_GOTREF(__pyx_t_10);
5181  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5182  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5183  __pyx_t_11 = NULL;
5184  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
5185  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
5186  if (likely(__pyx_t_11)) {
5187  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
5188  __Pyx_INCREF(__pyx_t_11);
5189  __Pyx_INCREF(function);
5190  __Pyx_DECREF_SET(__pyx_t_8, function);
5191  }
5192  }
5193  __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_10));
5194  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5195  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5196  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
5197  __Pyx_GOTREF(__pyx_t_5);
5198  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5199 
5200  /* "cpartitioning.pyx":78
5201  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5202  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5203  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5204  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5205  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5206  */
5207  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5208  __Pyx_GOTREF(__pyx_t_11);
5209  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error)
5210  __Pyx_GOTREF(__pyx_t_4);
5211  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5212  __pyx_t_7 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
5213  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5214  __Pyx_GOTREF(__pyx_t_11);
5215  __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_t_11, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 78, __pyx_L1_error)
5216  __Pyx_GOTREF(__pyx_t_12);
5217  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5218  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error)
5219  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5220  if (!__pyx_t_7) {
5221  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5222  __PYX_ERR(0, 78, __pyx_L1_error)
5223  }
5224  __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5225  __Pyx_GOTREF(__pyx_t_11);
5226  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 78, __pyx_L1_error)
5227  __Pyx_GOTREF(__pyx_t_12);
5228  __pyx_t_10 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_11), (char *) "c", (char *) __pyx_t_7);
5229  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 78, __pyx_L1_error)
5230  __Pyx_GOTREF(__pyx_t_10);
5231  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5232  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5233  __pyx_t_11 = NULL;
5234  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5235  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
5236  if (likely(__pyx_t_11)) {
5237  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5238  __Pyx_INCREF(__pyx_t_11);
5239  __Pyx_INCREF(function);
5240  __Pyx_DECREF_SET(__pyx_t_4, function);
5241  }
5242  }
5243  __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_t_10));
5244  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5245  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5246  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 78, __pyx_L1_error)
5247  __Pyx_GOTREF(__pyx_t_8);
5248  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5249 
5250  /* "cpartitioning.pyx":79
5251  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5252  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5253  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
5254  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5255  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5256  */
5257  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 79, __pyx_L1_error)
5258  __Pyx_GOTREF(__pyx_t_11);
5259  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 79, __pyx_L1_error)
5260  __Pyx_GOTREF(__pyx_t_12);
5261  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5262  __pyx_t_7 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
5263  if (!__pyx_t_7) {
5264  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5265  __PYX_ERR(0, 79, __pyx_L1_error)
5266  }
5267  __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 79, __pyx_L1_error)
5268  __Pyx_GOTREF(__pyx_t_13);
5269  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 79, __pyx_L1_error)
5270  __Pyx_GOTREF(__pyx_t_11);
5271  __pyx_t_10 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_13), (char *) "c", (char *) __pyx_t_7);
5272  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 79, __pyx_L1_error)
5273  __Pyx_GOTREF(__pyx_t_10);
5274  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5275  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5276  __pyx_t_13 = NULL;
5277  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
5278  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
5279  if (likely(__pyx_t_13)) {
5280  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
5281  __Pyx_INCREF(__pyx_t_13);
5282  __Pyx_INCREF(function);
5283  __Pyx_DECREF_SET(__pyx_t_12, function);
5284  }
5285  }
5286  __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_12, ((PyObject *)__pyx_t_10));
5287  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5288  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5289  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
5290  __Pyx_GOTREF(__pyx_t_4);
5291  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5292 
5293  /* "cpartitioning.pyx":80
5294  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5295  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5296  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5297  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5298  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5299  */
5300  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 80, __pyx_L1_error)
5301  __Pyx_GOTREF(__pyx_t_13);
5302  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 80, __pyx_L1_error)
5303  __Pyx_GOTREF(__pyx_t_11);
5304  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5305  __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
5306  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 80, __pyx_L1_error)
5307  __Pyx_GOTREF(__pyx_t_13);
5308  __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_t_13, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 80, __pyx_L1_error)
5309  __Pyx_GOTREF(__pyx_t_14);
5310  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5311  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
5312  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5313  if (!__pyx_t_7) {
5314  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5315  __PYX_ERR(0, 80, __pyx_L1_error)
5316  }
5317  __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 80, __pyx_L1_error)
5318  __Pyx_GOTREF(__pyx_t_13);
5319  __pyx_t_14 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 80, __pyx_L1_error)
5320  __Pyx_GOTREF(__pyx_t_14);
5321  __pyx_t_10 = __pyx_array_new(__pyx_t_14, sizeof(int), PyBytes_AS_STRING(__pyx_t_13), (char *) "c", (char *) __pyx_t_7);
5322  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 80, __pyx_L1_error)
5323  __Pyx_GOTREF(__pyx_t_10);
5324  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5325  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5326  __pyx_t_13 = NULL;
5327  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
5328  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
5329  if (likely(__pyx_t_13)) {
5330  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
5331  __Pyx_INCREF(__pyx_t_13);
5332  __Pyx_INCREF(function);
5333  __Pyx_DECREF_SET(__pyx_t_11, function);
5334  }
5335  }
5336  __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_10));
5337  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5338  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5339  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 80, __pyx_L1_error)
5340  __Pyx_GOTREF(__pyx_t_12);
5341  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5342 
5343  /* "cpartitioning.pyx":81
5344  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5345  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5346  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
5347  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5348  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
5349  */
5350  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 81, __pyx_L1_error)
5351  __Pyx_GOTREF(__pyx_t_13);
5352  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 81, __pyx_L1_error)
5353  __Pyx_GOTREF(__pyx_t_14);
5354  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5355  __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
5356  if (!__pyx_t_7) {
5357  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5358  __PYX_ERR(0, 81, __pyx_L1_error)
5359  }
5360  __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 81, __pyx_L1_error)
5361  __Pyx_GOTREF(__pyx_t_15);
5362  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 81, __pyx_L1_error)
5363  __Pyx_GOTREF(__pyx_t_13);
5364  __pyx_t_10 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_15), (char *) "c", (char *) __pyx_t_7);
5365  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 81, __pyx_L1_error)
5366  __Pyx_GOTREF(__pyx_t_10);
5367  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5368  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5369  __pyx_t_15 = NULL;
5370  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
5371  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
5372  if (likely(__pyx_t_15)) {
5373  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
5374  __Pyx_INCREF(__pyx_t_15);
5375  __Pyx_INCREF(function);
5376  __Pyx_DECREF_SET(__pyx_t_14, function);
5377  }
5378  }
5379  __pyx_t_11 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_14, ((PyObject *)__pyx_t_10));
5380  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5381  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5382  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 81, __pyx_L1_error)
5383  __Pyx_GOTREF(__pyx_t_11);
5384  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5385 
5386  /* "cpartitioning.pyx":82
5387  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5388  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5389  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5390  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
5391  * )
5392  */
5393  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 82, __pyx_L1_error)
5394  __Pyx_GOTREF(__pyx_t_15);
5395  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 82, __pyx_L1_error)
5396  __Pyx_GOTREF(__pyx_t_13);
5397  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5398  __pyx_t_7 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
5399  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 82, __pyx_L1_error)
5400  __Pyx_GOTREF(__pyx_t_15);
5401  __pyx_t_16 = __Pyx_PyInt_AddObjC(__pyx_t_15, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 82, __pyx_L1_error)
5402  __Pyx_GOTREF(__pyx_t_16);
5403  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5404  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error)
5405  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5406  if (!__pyx_t_7) {
5407  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5408  __PYX_ERR(0, 82, __pyx_L1_error)
5409  }
5410  __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 82, __pyx_L1_error)
5411  __Pyx_GOTREF(__pyx_t_15);
5412  __pyx_t_16 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 82, __pyx_L1_error)
5413  __Pyx_GOTREF(__pyx_t_16);
5414  __pyx_t_10 = __pyx_array_new(__pyx_t_16, sizeof(int), PyBytes_AS_STRING(__pyx_t_15), (char *) "c", (char *) __pyx_t_7);
5415  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 82, __pyx_L1_error)
5416  __Pyx_GOTREF(__pyx_t_10);
5417  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5418  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5419  __pyx_t_15 = NULL;
5420  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
5421  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13);
5422  if (likely(__pyx_t_15)) {
5423  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
5424  __Pyx_INCREF(__pyx_t_15);
5425  __Pyx_INCREF(function);
5426  __Pyx_DECREF_SET(__pyx_t_13, function);
5427  }
5428  }
5429  __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_10));
5430  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5431  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5432  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 82, __pyx_L1_error)
5433  __Pyx_GOTREF(__pyx_t_14);
5434  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5435 
5436  /* "cpartitioning.pyx":83
5437  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5438  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5439  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
5440  * )
5441  *
5442  */
5443  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 83, __pyx_L1_error)
5444  __Pyx_GOTREF(__pyx_t_15);
5445  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 83, __pyx_L1_error)
5446  __Pyx_GOTREF(__pyx_t_16);
5447  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5448  __pyx_t_7 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
5449  if (!__pyx_t_7) {
5450  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5451  __PYX_ERR(0, 83, __pyx_L1_error)
5452  }
5453  __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 83, __pyx_L1_error)
5454  __Pyx_GOTREF(__pyx_t_17);
5455  __pyx_t_15 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 83, __pyx_L1_error)
5456  __Pyx_GOTREF(__pyx_t_15);
5457  __pyx_t_10 = __pyx_array_new(__pyx_t_15, sizeof(int), PyBytes_AS_STRING(__pyx_t_17), (char *) "c", (char *) __pyx_t_7);
5458  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 83, __pyx_L1_error)
5459  __Pyx_GOTREF(__pyx_t_10);
5460  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5461  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5462  __pyx_t_17 = NULL;
5463  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
5464  __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
5465  if (likely(__pyx_t_17)) {
5466  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
5467  __Pyx_INCREF(__pyx_t_17);
5468  __Pyx_INCREF(function);
5469  __Pyx_DECREF_SET(__pyx_t_16, function);
5470  }
5471  }
5472  __pyx_t_13 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_17, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_16, ((PyObject *)__pyx_t_10));
5473  __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
5474  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5475  if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 83, __pyx_L1_error)
5476  __Pyx_GOTREF(__pyx_t_13);
5477  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5478 
5479  /* "cpartitioning.pyx":76
5480  * nLayersOfOverlap)
5481  * return (
5482  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5483  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5484  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5485  */
5486  __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 76, __pyx_L1_error)
5487  __Pyx_GOTREF(__pyx_t_16);
5488  __Pyx_GIVEREF(__pyx_t_3);
5489  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3);
5490  __Pyx_GIVEREF(__pyx_t_5);
5491  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_5);
5492  __Pyx_GIVEREF(__pyx_t_8);
5493  PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_8);
5494  __Pyx_GIVEREF(__pyx_t_4);
5495  PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_4);
5496  __Pyx_GIVEREF(__pyx_t_12);
5497  PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_12);
5498  __Pyx_GIVEREF(__pyx_t_11);
5499  PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_11);
5500  __Pyx_GIVEREF(__pyx_t_14);
5501  PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_14);
5502  __Pyx_GIVEREF(__pyx_t_13);
5503  PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_13);
5504  __pyx_t_3 = 0;
5505  __pyx_t_5 = 0;
5506  __pyx_t_8 = 0;
5507  __pyx_t_4 = 0;
5508  __pyx_t_12 = 0;
5509  __pyx_t_11 = 0;
5510  __pyx_t_14 = 0;
5511  __pyx_t_13 = 0;
5512  __pyx_r = __pyx_t_16;
5513  __pyx_t_16 = 0;
5514  goto __pyx_L0;
5515 
5516  /* "cpartitioning.pyx":66
5517  * )
5518  *
5519  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
5520  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5521  * if not isinstance(filebase, bytes):
5522  */
5523 
5524  /* function exit code */
5525  __pyx_L1_error:;
5526  __Pyx_XDECREF(__pyx_t_3);
5527  __Pyx_XDECREF(__pyx_t_4);
5528  __Pyx_XDECREF(__pyx_t_5);
5529  __Pyx_XDECREF(__pyx_t_8);
5530  __Pyx_XDECREF(((PyObject *)__pyx_t_10));
5531  __Pyx_XDECREF(__pyx_t_11);
5532  __Pyx_XDECREF(__pyx_t_12);
5533  __Pyx_XDECREF(__pyx_t_13);
5534  __Pyx_XDECREF(__pyx_t_14);
5535  __Pyx_XDECREF(__pyx_t_15);
5536  __Pyx_XDECREF(__pyx_t_16);
5537  __Pyx_XDECREF(__pyx_t_17);
5538  __Pyx_AddTraceback("cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
5539  __pyx_r = NULL;
5540  __pyx_L0:;
5541  __Pyx_XDECREF(__pyx_v_filebase);
5542  __Pyx_XGIVEREF(__pyx_r);
5543  __Pyx_RefNannyFinishContext();
5544  return __pyx_r;
5545 }
5546 
5547 /* "cpartitioning.pyx":86
5548  * )
5549  *
5550  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
5551  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5552  * if not isinstance(filebase, bytes):
5553  */
5554 
5555 /* Python wrapper */
5556 static PyObject *__pyx_pw_13cpartitioning_9partitionNodesFromTriangleFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5557 static PyMethodDef __pyx_mdef_13cpartitioning_9partitionNodesFromTriangleFiles = {"partitionNodesFromTriangleFiles", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_9partitionNodesFromTriangleFiles, METH_VARARGS|METH_KEYWORDS, 0};
5558 static PyObject *__pyx_pw_13cpartitioning_9partitionNodesFromTriangleFiles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5559  struct PyMPICommObject *__pyx_v_comm = 0;
5560  PyObject *__pyx_v_filebase = 0;
5561  int __pyx_v_indexBase;
5562  int __pyx_v_nLayersOfOverlap;
5563  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
5564  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
5565  int __pyx_lineno = 0;
5566  const char *__pyx_filename = NULL;
5567  int __pyx_clineno = 0;
5568  PyObject *__pyx_r = 0;
5569  __Pyx_RefNannyDeclarations
5570  __Pyx_RefNannySetupContext("partitionNodesFromTriangleFiles (wrapper)", 0);
5571  {
5572  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_filebase,&__pyx_n_s_indexBase,&__pyx_n_s_nLayersOfOverlap,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,0};
5573  PyObject* values[6] = {0,0,0,0,0,0};
5574  if (unlikely(__pyx_kwds)) {
5575  Py_ssize_t kw_args;
5576  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5577  switch (pos_args) {
5578  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5579  CYTHON_FALLTHROUGH;
5580  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5581  CYTHON_FALLTHROUGH;
5582  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5583  CYTHON_FALLTHROUGH;
5584  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5585  CYTHON_FALLTHROUGH;
5586  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5587  CYTHON_FALLTHROUGH;
5588  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5589  CYTHON_FALLTHROUGH;
5590  case 0: break;
5591  default: goto __pyx_L5_argtuple_error;
5592  }
5593  kw_args = PyDict_Size(__pyx_kwds);
5594  switch (pos_args) {
5595  case 0:
5596  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
5597  else goto __pyx_L5_argtuple_error;
5598  CYTHON_FALLTHROUGH;
5599  case 1:
5600  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filebase)) != 0)) kw_args--;
5601  else {
5602  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, 1); __PYX_ERR(0, 86, __pyx_L3_error)
5603  }
5604  CYTHON_FALLTHROUGH;
5605  case 2:
5606  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indexBase)) != 0)) kw_args--;
5607  else {
5608  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, 2); __PYX_ERR(0, 86, __pyx_L3_error)
5609  }
5610  CYTHON_FALLTHROUGH;
5611  case 3:
5612  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nLayersOfOverlap)) != 0)) kw_args--;
5613  else {
5614  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, 3); __PYX_ERR(0, 86, __pyx_L3_error)
5615  }
5616  CYTHON_FALLTHROUGH;
5617  case 4:
5618  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
5619  else {
5620  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, 4); __PYX_ERR(0, 86, __pyx_L3_error)
5621  }
5622  CYTHON_FALLTHROUGH;
5623  case 5:
5624  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
5625  else {
5626  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, 5); __PYX_ERR(0, 86, __pyx_L3_error)
5627  }
5628  }
5629  if (unlikely(kw_args > 0)) {
5630  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partitionNodesFromTriangleFiles") < 0)) __PYX_ERR(0, 86, __pyx_L3_error)
5631  }
5632  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5633  goto __pyx_L5_argtuple_error;
5634  } else {
5635  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5636  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5637  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5638  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5639  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5640  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5641  }
5642  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
5643  __pyx_v_filebase = values[1];
5644  __pyx_v_indexBase = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_indexBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error)
5645  __pyx_v_nLayersOfOverlap = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error)
5646  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[4]);
5647  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[5]);
5648  }
5649  goto __pyx_L4_argument_unpacking_done;
5650  __pyx_L5_argtuple_error:;
5651  __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 86, __pyx_L3_error)
5652  __pyx_L3_error:;
5653  __Pyx_AddTraceback("cpartitioning.partitionNodesFromTriangleFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
5654  __Pyx_RefNannyFinishContext();
5655  return NULL;
5656  __pyx_L4_argument_unpacking_done:;
5657  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 86, __pyx_L1_error)
5658  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 86, __pyx_L1_error)
5659  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 86, __pyx_L1_error)
5660  __pyx_r = __pyx_pf_13cpartitioning_8partitionNodesFromTriangleFiles(__pyx_self, __pyx_v_comm, __pyx_v_filebase, __pyx_v_indexBase, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
5661 
5662  /* function exit code */
5663  goto __pyx_L0;
5664  __pyx_L1_error:;
5665  __pyx_r = NULL;
5666  __pyx_L0:;
5667  __Pyx_RefNannyFinishContext();
5668  return __pyx_r;
5669 }
5670 
5671 static PyObject *__pyx_pf_13cpartitioning_8partitionNodesFromTriangleFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
5672  PyObject *__pyx_r = NULL;
5673  __Pyx_RefNannyDeclarations
5674  int __pyx_t_1;
5675  int __pyx_t_2;
5676  PyObject *__pyx_t_3 = NULL;
5677  PyObject *__pyx_t_4 = NULL;
5678  PyObject *__pyx_t_5 = NULL;
5679  char *__pyx_t_6;
5680  int *__pyx_t_7;
5681  PyObject *__pyx_t_8 = NULL;
5682  Py_ssize_t __pyx_t_9;
5683  struct __pyx_array_obj *__pyx_t_10 = NULL;
5684  PyObject *__pyx_t_11 = NULL;
5685  PyObject *__pyx_t_12 = NULL;
5686  PyObject *__pyx_t_13 = NULL;
5687  PyObject *__pyx_t_14 = NULL;
5688  PyObject *__pyx_t_15 = NULL;
5689  PyObject *__pyx_t_16 = NULL;
5690  PyObject *__pyx_t_17 = NULL;
5691  int __pyx_lineno = 0;
5692  const char *__pyx_filename = NULL;
5693  int __pyx_clineno = 0;
5694  __Pyx_RefNannySetupContext("partitionNodesFromTriangleFiles", 0);
5695  __Pyx_INCREF(__pyx_v_filebase);
5696 
5697  /* "cpartitioning.pyx":87
5698  *
5699  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
5700  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
5701  * if not isinstance(filebase, bytes):
5702  * filebase = filebase.encode()
5703  */
5704  __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
5705 
5706  /* "cpartitioning.pyx":88
5707  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
5708  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5709  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
5710  * filebase = filebase.encode()
5711  * c_partitionNodesFromTriangleFiles(comm.ob_mpi,
5712  */
5713  __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
5714  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
5715  if (__pyx_t_2) {
5716 
5717  /* "cpartitioning.pyx":89
5718  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5719  * if not isinstance(filebase, bytes):
5720  * filebase = filebase.encode() # <<<<<<<<<<<<<<
5721  * c_partitionNodesFromTriangleFiles(comm.ob_mpi,
5722  * <const char*>(<char*>filebase),
5723  */
5724  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filebase, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
5725  __Pyx_GOTREF(__pyx_t_4);
5726  __pyx_t_5 = NULL;
5727  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
5728  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
5729  if (likely(__pyx_t_5)) {
5730  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5731  __Pyx_INCREF(__pyx_t_5);
5732  __Pyx_INCREF(function);
5733  __Pyx_DECREF_SET(__pyx_t_4, function);
5734  }
5735  }
5736  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
5737  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5738  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
5739  __Pyx_GOTREF(__pyx_t_3);
5740  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5741  __Pyx_DECREF_SET(__pyx_v_filebase, __pyx_t_3);
5742  __pyx_t_3 = 0;
5743 
5744  /* "cpartitioning.pyx":88
5745  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
5746  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
5747  * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
5748  * filebase = filebase.encode()
5749  * c_partitionNodesFromTriangleFiles(comm.ob_mpi,
5750  */
5751  }
5752 
5753  /* "cpartitioning.pyx":91
5754  * filebase = filebase.encode()
5755  * c_partitionNodesFromTriangleFiles(comm.ob_mpi,
5756  * <const char*>(<char*>filebase), # <<<<<<<<<<<<<<
5757  * indexBase,
5758  * cmesh.mesh,
5759  */
5760  __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error)
5761 
5762  /* "cpartitioning.pyx":90
5763  * if not isinstance(filebase, bytes):
5764  * filebase = filebase.encode()
5765  * c_partitionNodesFromTriangleFiles(comm.ob_mpi, # <<<<<<<<<<<<<<
5766  * <const char*>(<char*>filebase),
5767  * indexBase,
5768  */
5769  (void)(proteus::partitionNodesFromTriangleFiles(__pyx_v_comm->ob_mpi, ((char const *)((char *)__pyx_t_6)), __pyx_v_indexBase, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
5770 
5771  /* "cpartitioning.pyx":95
5772  * cmesh.mesh,
5773  * nLayersOfOverlap)
5774  * return ( # <<<<<<<<<<<<<<
5775  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5776  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5777  */
5778  __Pyx_XDECREF(__pyx_r);
5779 
5780  /* "cpartitioning.pyx":96
5781  * nLayersOfOverlap)
5782  * return (
5783  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5784  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5785  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5786  */
5787  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
5788  __Pyx_GOTREF(__pyx_t_4);
5789  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
5790  __Pyx_GOTREF(__pyx_t_5);
5791  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5792  __pyx_t_7 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
5793  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
5794  __Pyx_GOTREF(__pyx_t_4);
5795  __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error)
5796  __Pyx_GOTREF(__pyx_t_8);
5797  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5798  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
5799  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5800  if (!__pyx_t_7) {
5801  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5802  __PYX_ERR(0, 96, __pyx_L1_error)
5803  }
5804  __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
5805  __Pyx_GOTREF(__pyx_t_4);
5806  __pyx_t_8 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L1_error)
5807  __Pyx_GOTREF(__pyx_t_8);
5808  __pyx_t_10 = __pyx_array_new(__pyx_t_8, sizeof(int), PyBytes_AS_STRING(__pyx_t_4), (char *) "c", (char *) __pyx_t_7);
5809  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 96, __pyx_L1_error)
5810  __Pyx_GOTREF(__pyx_t_10);
5811  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5812  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5813  __pyx_t_4 = NULL;
5814  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5815  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
5816  if (likely(__pyx_t_4)) {
5817  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5818  __Pyx_INCREF(__pyx_t_4);
5819  __Pyx_INCREF(function);
5820  __Pyx_DECREF_SET(__pyx_t_5, function);
5821  }
5822  }
5823  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_t_10));
5824  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5825  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5826  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
5827  __Pyx_GOTREF(__pyx_t_3);
5828  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5829 
5830  /* "cpartitioning.pyx":97
5831  * return (
5832  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5833  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
5834  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5835  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5836  */
5837  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
5838  __Pyx_GOTREF(__pyx_t_4);
5839  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error)
5840  __Pyx_GOTREF(__pyx_t_8);
5841  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5842  __pyx_t_7 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
5843  if (!__pyx_t_7) {
5844  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5845  __PYX_ERR(0, 97, __pyx_L1_error)
5846  }
5847  __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 97, __pyx_L1_error)
5848  __Pyx_GOTREF(__pyx_t_11);
5849  __pyx_t_4 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
5850  __Pyx_GOTREF(__pyx_t_4);
5851  __pyx_t_10 = __pyx_array_new(__pyx_t_4, sizeof(int), PyBytes_AS_STRING(__pyx_t_11), (char *) "c", (char *) __pyx_t_7);
5852  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 97, __pyx_L1_error)
5853  __Pyx_GOTREF(__pyx_t_10);
5854  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5855  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5856  __pyx_t_11 = NULL;
5857  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
5858  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
5859  if (likely(__pyx_t_11)) {
5860  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
5861  __Pyx_INCREF(__pyx_t_11);
5862  __Pyx_INCREF(function);
5863  __Pyx_DECREF_SET(__pyx_t_8, function);
5864  }
5865  }
5866  __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, ((PyObject *)__pyx_t_10));
5867  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5868  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5869  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
5870  __Pyx_GOTREF(__pyx_t_5);
5871  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5872 
5873  /* "cpartitioning.pyx":98
5874  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
5875  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5876  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5877  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5878  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5879  */
5880  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L1_error)
5881  __Pyx_GOTREF(__pyx_t_11);
5882  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
5883  __Pyx_GOTREF(__pyx_t_4);
5884  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5885  __pyx_t_7 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
5886  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L1_error)
5887  __Pyx_GOTREF(__pyx_t_11);
5888  __pyx_t_12 = __Pyx_PyInt_AddObjC(__pyx_t_11, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L1_error)
5889  __Pyx_GOTREF(__pyx_t_12);
5890  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5891  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error)
5892  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5893  if (!__pyx_t_7) {
5894  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5895  __PYX_ERR(0, 98, __pyx_L1_error)
5896  }
5897  __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 98, __pyx_L1_error)
5898  __Pyx_GOTREF(__pyx_t_11);
5899  __pyx_t_12 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L1_error)
5900  __Pyx_GOTREF(__pyx_t_12);
5901  __pyx_t_10 = __pyx_array_new(__pyx_t_12, sizeof(int), PyBytes_AS_STRING(__pyx_t_11), (char *) "c", (char *) __pyx_t_7);
5902  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 98, __pyx_L1_error)
5903  __Pyx_GOTREF(__pyx_t_10);
5904  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5905  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5906  __pyx_t_11 = NULL;
5907  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5908  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
5909  if (likely(__pyx_t_11)) {
5910  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5911  __Pyx_INCREF(__pyx_t_11);
5912  __Pyx_INCREF(function);
5913  __Pyx_DECREF_SET(__pyx_t_4, function);
5914  }
5915  }
5916  __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_t_10));
5917  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5918  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5919  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L1_error)
5920  __Pyx_GOTREF(__pyx_t_8);
5921  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5922 
5923  /* "cpartitioning.pyx":99
5924  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
5925  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5926  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
5927  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
5928  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5929  */
5930  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 99, __pyx_L1_error)
5931  __Pyx_GOTREF(__pyx_t_11);
5932  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_asarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 99, __pyx_L1_error)
5933  __Pyx_GOTREF(__pyx_t_12);
5934  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5935  __pyx_t_7 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
5936  if (!__pyx_t_7) {
5937  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5938  __PYX_ERR(0, 99, __pyx_L1_error)
5939  }
5940  __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 99, __pyx_L1_error)
5941  __Pyx_GOTREF(__pyx_t_13);
5942  __pyx_t_11 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 99, __pyx_L1_error)
5943  __Pyx_GOTREF(__pyx_t_11);
5944  __pyx_t_10 = __pyx_array_new(__pyx_t_11, sizeof(int), PyBytes_AS_STRING(__pyx_t_13), (char *) "c", (char *) __pyx_t_7);
5945  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 99, __pyx_L1_error)
5946  __Pyx_GOTREF(__pyx_t_10);
5947  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5948  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5949  __pyx_t_13 = NULL;
5950  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
5951  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
5952  if (likely(__pyx_t_13)) {
5953  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
5954  __Pyx_INCREF(__pyx_t_13);
5955  __Pyx_INCREF(function);
5956  __Pyx_DECREF_SET(__pyx_t_12, function);
5957  }
5958  }
5959  __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_12, ((PyObject *)__pyx_t_10));
5960  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5961  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
5962  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
5963  __Pyx_GOTREF(__pyx_t_4);
5964  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5965 
5966  /* "cpartitioning.pyx":100
5967  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
5968  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
5969  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
5970  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
5971  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
5972  */
5973  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 100, __pyx_L1_error)
5974  __Pyx_GOTREF(__pyx_t_13);
5975  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 100, __pyx_L1_error)
5976  __Pyx_GOTREF(__pyx_t_11);
5977  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5978  __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
5979  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 100, __pyx_L1_error)
5980  __Pyx_GOTREF(__pyx_t_13);
5981  __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_t_13, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 100, __pyx_L1_error)
5982  __Pyx_GOTREF(__pyx_t_14);
5983  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5984  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
5985  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5986  if (!__pyx_t_7) {
5987  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5988  __PYX_ERR(0, 100, __pyx_L1_error)
5989  }
5990  __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 100, __pyx_L1_error)
5991  __Pyx_GOTREF(__pyx_t_13);
5992  __pyx_t_14 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 100, __pyx_L1_error)
5993  __Pyx_GOTREF(__pyx_t_14);
5994  __pyx_t_10 = __pyx_array_new(__pyx_t_14, sizeof(int), PyBytes_AS_STRING(__pyx_t_13), (char *) "c", (char *) __pyx_t_7);
5995  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 100, __pyx_L1_error)
5996  __Pyx_GOTREF(__pyx_t_10);
5997  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5998  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5999  __pyx_t_13 = NULL;
6000  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
6001  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
6002  if (likely(__pyx_t_13)) {
6003  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
6004  __Pyx_INCREF(__pyx_t_13);
6005  __Pyx_INCREF(function);
6006  __Pyx_DECREF_SET(__pyx_t_11, function);
6007  }
6008  }
6009  __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_13, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_t_10));
6010  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
6011  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
6012  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 100, __pyx_L1_error)
6013  __Pyx_GOTREF(__pyx_t_12);
6014  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
6015 
6016  /* "cpartitioning.pyx":101
6017  * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
6018  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
6019  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
6020  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
6021  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
6022  */
6023  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 101, __pyx_L1_error)
6024  __Pyx_GOTREF(__pyx_t_13);
6025  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_asarray); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 101, __pyx_L1_error)
6026  __Pyx_GOTREF(__pyx_t_14);
6027  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6028  __pyx_t_7 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
6029  if (!__pyx_t_7) {
6030  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
6031  __PYX_ERR(0, 101, __pyx_L1_error)
6032  }
6033  __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 101, __pyx_L1_error)
6034  __Pyx_GOTREF(__pyx_t_15);
6035  __pyx_t_13 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 101, __pyx_L1_error)
6036  __Pyx_GOTREF(__pyx_t_13);
6037  __pyx_t_10 = __pyx_array_new(__pyx_t_13, sizeof(int), PyBytes_AS_STRING(__pyx_t_15), (char *) "c", (char *) __pyx_t_7);
6038  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 101, __pyx_L1_error)
6039  __Pyx_GOTREF(__pyx_t_10);
6040  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6041  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6042  __pyx_t_15 = NULL;
6043  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
6044  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
6045  if (likely(__pyx_t_15)) {
6046  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
6047  __Pyx_INCREF(__pyx_t_15);
6048  __Pyx_INCREF(function);
6049  __Pyx_DECREF_SET(__pyx_t_14, function);
6050  }
6051  }
6052  __pyx_t_11 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_14, ((PyObject *)__pyx_t_10));
6053  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6054  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
6055  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 101, __pyx_L1_error)
6056  __Pyx_GOTREF(__pyx_t_11);
6057  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
6058 
6059  /* "cpartitioning.pyx":102
6060  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
6061  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
6062  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
6063  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
6064  * )
6065  */
6066  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 102, __pyx_L1_error)
6067  __Pyx_GOTREF(__pyx_t_15);
6068  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 102, __pyx_L1_error)
6069  __Pyx_GOTREF(__pyx_t_13);
6070  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6071  __pyx_t_7 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
6072  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_n_s_size); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 102, __pyx_L1_error)
6073  __Pyx_GOTREF(__pyx_t_15);
6074  __pyx_t_16 = __Pyx_PyInt_AddObjC(__pyx_t_15, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 102, __pyx_L1_error)
6075  __Pyx_GOTREF(__pyx_t_16);
6076  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6077  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error)
6078  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6079  if (!__pyx_t_7) {
6080  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
6081  __PYX_ERR(0, 102, __pyx_L1_error)
6082  }
6083  __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 102, __pyx_L1_error)
6084  __Pyx_GOTREF(__pyx_t_15);
6085  __pyx_t_16 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_9)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 102, __pyx_L1_error)
6086  __Pyx_GOTREF(__pyx_t_16);
6087  __pyx_t_10 = __pyx_array_new(__pyx_t_16, sizeof(int), PyBytes_AS_STRING(__pyx_t_15), (char *) "c", (char *) __pyx_t_7);
6088  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 102, __pyx_L1_error)
6089  __Pyx_GOTREF(__pyx_t_10);
6090  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6091  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6092  __pyx_t_15 = NULL;
6093  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
6094  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_13);
6095  if (likely(__pyx_t_15)) {
6096  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
6097  __Pyx_INCREF(__pyx_t_15);
6098  __Pyx_INCREF(function);
6099  __Pyx_DECREF_SET(__pyx_t_13, function);
6100  }
6101  }
6102  __pyx_t_14 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_15, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_13, ((PyObject *)__pyx_t_10));
6103  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
6104  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
6105  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 102, __pyx_L1_error)
6106  __Pyx_GOTREF(__pyx_t_14);
6107  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6108 
6109  /* "cpartitioning.pyx":103
6110  * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
6111  * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
6112  * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
6113  * )
6114  *
6115  */
6116  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L1_error)
6117  __Pyx_GOTREF(__pyx_t_15);
6118  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_asarray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 103, __pyx_L1_error)
6119  __Pyx_GOTREF(__pyx_t_16);
6120  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6121  __pyx_t_7 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
6122  if (!__pyx_t_7) {
6123  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
6124  __PYX_ERR(0, 103, __pyx_L1_error)
6125  }
6126  __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 103, __pyx_L1_error)
6127  __Pyx_GOTREF(__pyx_t_17);
6128  __pyx_t_15 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 103, __pyx_L1_error)
6129  __Pyx_GOTREF(__pyx_t_15);
6130  __pyx_t_10 = __pyx_array_new(__pyx_t_15, sizeof(int), PyBytes_AS_STRING(__pyx_t_17), (char *) "c", (char *) __pyx_t_7);
6131  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 103, __pyx_L1_error)
6132  __Pyx_GOTREF(__pyx_t_10);
6133  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6134  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6135  __pyx_t_17 = NULL;
6136  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_16))) {
6137  __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
6138  if (likely(__pyx_t_17)) {
6139  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
6140  __Pyx_INCREF(__pyx_t_17);
6141  __Pyx_INCREF(function);
6142  __Pyx_DECREF_SET(__pyx_t_16, function);
6143  }
6144  }
6145  __pyx_t_13 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_16, __pyx_t_17, ((PyObject *)__pyx_t_10)) : __Pyx_PyObject_CallOneArg(__pyx_t_16, ((PyObject *)__pyx_t_10));
6146  __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
6147  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
6148  if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 103, __pyx_L1_error)
6149  __Pyx_GOTREF(__pyx_t_13);
6150  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6151 
6152  /* "cpartitioning.pyx":96
6153  * nLayersOfOverlap)
6154  * return (
6155  * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
6156  * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
6157  * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
6158  */
6159  __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 96, __pyx_L1_error)
6160  __Pyx_GOTREF(__pyx_t_16);
6161  __Pyx_GIVEREF(__pyx_t_3);
6162  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3);
6163  __Pyx_GIVEREF(__pyx_t_5);
6164  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_5);
6165  __Pyx_GIVEREF(__pyx_t_8);
6166  PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_8);
6167  __Pyx_GIVEREF(__pyx_t_4);
6168  PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_4);
6169  __Pyx_GIVEREF(__pyx_t_12);
6170  PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_12);
6171  __Pyx_GIVEREF(__pyx_t_11);
6172  PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_11);
6173  __Pyx_GIVEREF(__pyx_t_14);
6174  PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_14);
6175  __Pyx_GIVEREF(__pyx_t_13);
6176  PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_13);
6177  __pyx_t_3 = 0;
6178  __pyx_t_5 = 0;
6179  __pyx_t_8 = 0;
6180  __pyx_t_4 = 0;
6181  __pyx_t_12 = 0;
6182  __pyx_t_11 = 0;
6183  __pyx_t_14 = 0;
6184  __pyx_t_13 = 0;
6185  __pyx_r = __pyx_t_16;
6186  __pyx_t_16 = 0;
6187  goto __pyx_L0;
6188 
6189  /* "cpartitioning.pyx":86
6190  * )
6191  *
6192  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
6193  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
6194  * if not isinstance(filebase, bytes):
6195  */
6196 
6197  /* function exit code */
6198  __pyx_L1_error:;
6199  __Pyx_XDECREF(__pyx_t_3);
6200  __Pyx_XDECREF(__pyx_t_4);
6201  __Pyx_XDECREF(__pyx_t_5);
6202  __Pyx_XDECREF(__pyx_t_8);
6203  __Pyx_XDECREF(((PyObject *)__pyx_t_10));
6204  __Pyx_XDECREF(__pyx_t_11);
6205  __Pyx_XDECREF(__pyx_t_12);
6206  __Pyx_XDECREF(__pyx_t_13);
6207  __Pyx_XDECREF(__pyx_t_14);
6208  __Pyx_XDECREF(__pyx_t_15);
6209  __Pyx_XDECREF(__pyx_t_16);
6210  __Pyx_XDECREF(__pyx_t_17);
6211  __Pyx_AddTraceback("cpartitioning.partitionNodesFromTriangleFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
6212  __pyx_r = NULL;
6213  __pyx_L0:;
6214  __Pyx_XDECREF(__pyx_v_filebase);
6215  __Pyx_XGIVEREF(__pyx_r);
6216  __Pyx_RefNannyFinishContext();
6217  return __pyx_r;
6218 }
6219 
6220 /* "cpartitioning.pyx":106
6221  * )
6222  *
6223  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6224  * int nSpace,
6225  * cmeshTools.CMesh cmesh,
6226  */
6227 
6228 /* Python wrapper */
6229 static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6230 static PyMethodDef __pyx_mdef_13cpartitioning_11buildQuadraticLocal2GlobalMappings = {"buildQuadraticLocal2GlobalMappings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_11buildQuadraticLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
6231 static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6232  struct PyMPICommObject *__pyx_v_comm = 0;
6233  int __pyx_v_nSpace;
6234  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
6235  CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
6236  PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
6237  PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned = 0;
6238  PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned = 0;
6239  PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned = 0;
6240  PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
6241  PyArrayObject *__pyx_v_nodeNumbering_subdomain2global = 0;
6242  PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global = 0;
6243  PyArrayObject *__pyx_v_edgeNumbering_subdomain2global = 0;
6244  PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned = 0;
6245  PyArrayObject *__pyx_v_quadratic_subdomain_l2g = 0;
6246  PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global = 0;
6247  PyArrayObject *__pyx_v_quadratic_lagrangeNodes = 0;
6248  int __pyx_lineno = 0;
6249  const char *__pyx_filename = NULL;
6250  int __pyx_clineno = 0;
6251  PyObject *__pyx_r = 0;
6252  __Pyx_RefNannyDeclarations
6253  __Pyx_RefNannySetupContext("buildQuadraticLocal2GlobalMappings (wrapper)", 0);
6254  {
6255  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nSpace,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_nodeOffsets_subdomain_owned,&__pyx_n_s_elementBoundaryOffsets_subdomain,&__pyx_n_s_edgeOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_nodeNumbering_subdomain2global,&__pyx_n_s_elementBoundaryNumbering_subdoma,&__pyx_n_s_edgeNumbering_subdomain2global,&__pyx_n_s_quadratic_dof_offsets_subdomain,&__pyx_n_s_quadratic_subdomain_l2g,&__pyx_n_s_quadraticNumbering_subdomain2glo,&__pyx_n_s_quadratic_lagrangeNodes,0};
6256  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
6257  if (unlikely(__pyx_kwds)) {
6258  Py_ssize_t kw_args;
6259  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6260  switch (pos_args) {
6261  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6262  CYTHON_FALLTHROUGH;
6263  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6264  CYTHON_FALLTHROUGH;
6265  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6266  CYTHON_FALLTHROUGH;
6267  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6268  CYTHON_FALLTHROUGH;
6269  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6270  CYTHON_FALLTHROUGH;
6271  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6272  CYTHON_FALLTHROUGH;
6273  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6274  CYTHON_FALLTHROUGH;
6275  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6276  CYTHON_FALLTHROUGH;
6277  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6278  CYTHON_FALLTHROUGH;
6279  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6280  CYTHON_FALLTHROUGH;
6281  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6282  CYTHON_FALLTHROUGH;
6283  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6284  CYTHON_FALLTHROUGH;
6285  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6286  CYTHON_FALLTHROUGH;
6287  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6288  CYTHON_FALLTHROUGH;
6289  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6290  CYTHON_FALLTHROUGH;
6291  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6292  CYTHON_FALLTHROUGH;
6293  case 0: break;
6294  default: goto __pyx_L5_argtuple_error;
6295  }
6296  kw_args = PyDict_Size(__pyx_kwds);
6297  switch (pos_args) {
6298  case 0:
6299  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
6300  else goto __pyx_L5_argtuple_error;
6301  CYTHON_FALLTHROUGH;
6302  case 1:
6303  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
6304  else {
6305  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 1); __PYX_ERR(0, 106, __pyx_L3_error)
6306  }
6307  CYTHON_FALLTHROUGH;
6308  case 2:
6309  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
6310  else {
6311  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 2); __PYX_ERR(0, 106, __pyx_L3_error)
6312  }
6313  CYTHON_FALLTHROUGH;
6314  case 3:
6315  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
6316  else {
6317  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 3); __PYX_ERR(0, 106, __pyx_L3_error)
6318  }
6319  CYTHON_FALLTHROUGH;
6320  case 4:
6321  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
6322  else {
6323  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 4); __PYX_ERR(0, 106, __pyx_L3_error)
6324  }
6325  CYTHON_FALLTHROUGH;
6326  case 5:
6327  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeOffsets_subdomain_owned)) != 0)) kw_args--;
6328  else {
6329  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 5); __PYX_ERR(0, 106, __pyx_L3_error)
6330  }
6331  CYTHON_FALLTHROUGH;
6332  case 6:
6333  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryOffsets_subdomain)) != 0)) kw_args--;
6334  else {
6335  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 6); __PYX_ERR(0, 106, __pyx_L3_error)
6336  }
6337  CYTHON_FALLTHROUGH;
6338  case 7:
6339  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeOffsets_subdomain_owned)) != 0)) kw_args--;
6340  else {
6341  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 7); __PYX_ERR(0, 106, __pyx_L3_error)
6342  }
6343  CYTHON_FALLTHROUGH;
6344  case 8:
6345  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
6346  else {
6347  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 8); __PYX_ERR(0, 106, __pyx_L3_error)
6348  }
6349  CYTHON_FALLTHROUGH;
6350  case 9:
6351  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeNumbering_subdomain2global)) != 0)) kw_args--;
6352  else {
6353  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 9); __PYX_ERR(0, 106, __pyx_L3_error)
6354  }
6355  CYTHON_FALLTHROUGH;
6356  case 10:
6357  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryNumbering_subdoma)) != 0)) kw_args--;
6358  else {
6359  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 10); __PYX_ERR(0, 106, __pyx_L3_error)
6360  }
6361  CYTHON_FALLTHROUGH;
6362  case 11:
6363  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeNumbering_subdomain2global)) != 0)) kw_args--;
6364  else {
6365  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 11); __PYX_ERR(0, 106, __pyx_L3_error)
6366  }
6367  CYTHON_FALLTHROUGH;
6368  case 12:
6369  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_dof_offsets_subdomain)) != 0)) kw_args--;
6370  else {
6371  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 12); __PYX_ERR(0, 106, __pyx_L3_error)
6372  }
6373  CYTHON_FALLTHROUGH;
6374  case 13:
6375  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_subdomain_l2g)) != 0)) kw_args--;
6376  else {
6377  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 13); __PYX_ERR(0, 106, __pyx_L3_error)
6378  }
6379  CYTHON_FALLTHROUGH;
6380  case 14:
6381  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadraticNumbering_subdomain2glo)) != 0)) kw_args--;
6382  else {
6383  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 14); __PYX_ERR(0, 106, __pyx_L3_error)
6384  }
6385  CYTHON_FALLTHROUGH;
6386  case 15:
6387  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_lagrangeNodes)) != 0)) kw_args--;
6388  else {
6389  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, 15); __PYX_ERR(0, 106, __pyx_L3_error)
6390  }
6391  }
6392  if (unlikely(kw_args > 0)) {
6393  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildQuadraticLocal2GlobalMappings") < 0)) __PYX_ERR(0, 106, __pyx_L3_error)
6394  }
6395  } else if (PyTuple_GET_SIZE(__pyx_args) != 16) {
6396  goto __pyx_L5_argtuple_error;
6397  } else {
6398  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6399  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6400  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6401  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6402  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6403  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6404  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6405  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6406  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6407  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6408  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6409  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6410  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6411  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6412  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6413  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6414  }
6415  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
6416  __pyx_v_nSpace = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L3_error)
6417  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
6418  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
6419  __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
6420  __pyx_v_nodeOffsets_subdomain_owned = ((PyArrayObject *)values[5]);
6421  __pyx_v_elementBoundaryOffsets_subdomain_owned = ((PyArrayObject *)values[6]);
6422  __pyx_v_edgeOffsets_subdomain_owned = ((PyArrayObject *)values[7]);
6423  __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[8]);
6424  __pyx_v_nodeNumbering_subdomain2global = ((PyArrayObject *)values[9]);
6425  __pyx_v_elementBoundaryNumbering_subdomain2global = ((PyArrayObject *)values[10]);
6426  __pyx_v_edgeNumbering_subdomain2global = ((PyArrayObject *)values[11]);
6427  __pyx_v_quadratic_dof_offsets_subdomain_owned = ((PyArrayObject *)values[12]);
6428  __pyx_v_quadratic_subdomain_l2g = ((PyArrayObject *)values[13]);
6429  __pyx_v_quadraticNumbering_subdomain2global = ((PyArrayObject *)values[14]);
6430  __pyx_v_quadratic_lagrangeNodes = ((PyArrayObject *)values[15]);
6431  }
6432  goto __pyx_L4_argument_unpacking_done;
6433  __pyx_L5_argtuple_error:;
6434  __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 106, __pyx_L3_error)
6435  __pyx_L3_error:;
6436  __Pyx_AddTraceback("cpartitioning.buildQuadraticLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6437  __Pyx_RefNannyFinishContext();
6438  return NULL;
6439  __pyx_L4_argument_unpacking_done:;
6440  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 106, __pyx_L1_error)
6441  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 108, __pyx_L1_error)
6442  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 109, __pyx_L1_error)
6443  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 110, __pyx_L1_error)
6444  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "nodeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 111, __pyx_L1_error)
6445  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryOffsets_subdomain_owned", 0))) __PYX_ERR(0, 112, __pyx_L1_error)
6446  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "edgeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 113, __pyx_L1_error)
6447  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 114, __pyx_L1_error)
6448  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "nodeNumbering_subdomain2global", 0))) __PYX_ERR(0, 115, __pyx_L1_error)
6449  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryNumbering_subdomain2global", 0))) __PYX_ERR(0, 116, __pyx_L1_error)
6450  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "edgeNumbering_subdomain2global", 0))) __PYX_ERR(0, 117, __pyx_L1_error)
6451  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "quadratic_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 118, __pyx_L1_error)
6452  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1, "quadratic_subdomain_l2g", 0))) __PYX_ERR(0, 119, __pyx_L1_error)
6453  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadraticNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "quadraticNumbering_subdomain2global", 0))) __PYX_ERR(0, 120, __pyx_L1_error)
6454  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_lagrangeNodes), __pyx_ptype_5numpy_ndarray, 1, "quadratic_lagrangeNodes", 0))) __PYX_ERR(0, 121, __pyx_L1_error)
6455  __pyx_r = __pyx_pf_13cpartitioning_10buildQuadraticLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nSpace, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_edgeOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_edgeNumbering_subdomain2global, __pyx_v_quadratic_dof_offsets_subdomain_owned, __pyx_v_quadratic_subdomain_l2g, __pyx_v_quadraticNumbering_subdomain2global, __pyx_v_quadratic_lagrangeNodes);
6456 
6457  /* function exit code */
6458  goto __pyx_L0;
6459  __pyx_L1_error:;
6460  __pyx_r = NULL;
6461  __pyx_L0:;
6462  __Pyx_RefNannyFinishContext();
6463  return __pyx_r;
6464 }
6465 
6466 static PyObject *__pyx_pf_13cpartitioning_10buildQuadraticLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes) {
6467  int __pyx_v_nDOF_all_processes;
6468  int __pyx_v_nDOF_subdomain;
6469  int __pyx_v_max_dof_neighbors;
6470  PyObject *__pyx_r = NULL;
6471  __Pyx_RefNannyDeclarations
6472  PyObject *__pyx_t_1 = NULL;
6473  PyObject *__pyx_t_2 = NULL;
6474  PyObject *__pyx_t_3 = NULL;
6475  PyObject *__pyx_t_4 = NULL;
6476  int __pyx_lineno = 0;
6477  const char *__pyx_filename = NULL;
6478  int __pyx_clineno = 0;
6479  __Pyx_RefNannySetupContext("buildQuadraticLocal2GlobalMappings", 0);
6480 
6481  /* "cpartitioning.pyx":122
6482  * np.ndarray quadraticNumbering_subdomain2global,
6483  * np.ndarray quadratic_lagrangeNodes):
6484  * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
6485  * cdef int nDOF_subdomain=0
6486  * cdef int max_dof_neighbors=0
6487  */
6488  __pyx_v_nDOF_all_processes = 0;
6489 
6490  /* "cpartitioning.pyx":123
6491  * np.ndarray quadratic_lagrangeNodes):
6492  * cdef int nDOF_all_processes=0
6493  * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
6494  * cdef int max_dof_neighbors=0
6495  * if nSpace == 1:
6496  */
6497  __pyx_v_nDOF_subdomain = 0;
6498 
6499  /* "cpartitioning.pyx":124
6500  * cdef int nDOF_all_processes=0
6501  * cdef int nDOF_subdomain=0
6502  * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
6503  * if nSpace == 1:
6504  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
6505  */
6506  __pyx_v_max_dof_neighbors = 0;
6507 
6508  /* "cpartitioning.pyx":125
6509  * cdef int nDOF_subdomain=0
6510  * cdef int max_dof_neighbors=0
6511  * if nSpace == 1: # <<<<<<<<<<<<<<
6512  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
6513  * cmesh.mesh,
6514  */
6515  switch (__pyx_v_nSpace) {
6516  case 1:
6517 
6518  /* "cpartitioning.pyx":126
6519  * cdef int max_dof_neighbors=0
6520  * if nSpace == 1:
6521  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi, # <<<<<<<<<<<<<<
6522  * cmesh.mesh,
6523  * <int*>(elementOffsets_subdomain_owned.data),
6524  */
6525  (void)(proteus::buildQuadraticSubdomain2GlobalMappings_1d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_elementOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_elementNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
6526 
6527  /* "cpartitioning.pyx":125
6528  * cdef int nDOF_subdomain=0
6529  * cdef int max_dof_neighbors=0
6530  * if nSpace == 1: # <<<<<<<<<<<<<<
6531  * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
6532  * cmesh.mesh,
6533  */
6534  break;
6535  case 2:
6536 
6537  /* "cpartitioning.pyx":140
6538  * <double*>(quadratic_lagrangeNodes.data));
6539  * elif nSpace == 2:
6540  * buildQuadraticSubdomain2GlobalMappings_2d(comm.ob_mpi, # <<<<<<<<<<<<<<
6541  * cmesh.mesh,
6542  * <int*>(elementBoundaryOffsets_subdomain_owned.data),
6543  */
6544  (void)(proteus::buildQuadraticSubdomain2GlobalMappings_2d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_elementBoundaryOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_elementBoundaryNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
6545 
6546  /* "cpartitioning.pyx":139
6547  * <int*>(quadraticNumbering_subdomain2global.data),
6548  * <double*>(quadratic_lagrangeNodes.data));
6549  * elif nSpace == 2: # <<<<<<<<<<<<<<
6550  * buildQuadraticSubdomain2GlobalMappings_2d(comm.ob_mpi,
6551  * cmesh.mesh,
6552  */
6553  break;
6554  default:
6555 
6556  /* "cpartitioning.pyx":154
6557  * <double*>(quadratic_lagrangeNodes.data))
6558  * else:
6559  * buildQuadraticSubdomain2GlobalMappings_3d(comm.ob_mpi, # <<<<<<<<<<<<<<
6560  * cmesh.mesh,
6561  * <int*>(edgeOffsets_subdomain_owned.data),
6562  */
6563  (void)(proteus::buildQuadraticSubdomain2GlobalMappings_3d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_edgeOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_edgeNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
6564  break;
6565  }
6566 
6567  /* "cpartitioning.pyx":167
6568  * <int*>(quadraticNumbering_subdomain2global.data),
6569  * <double*>(quadratic_lagrangeNodes.data))
6570  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6571  * nDOF_subdomain,
6572  * max_dof_neighbors)
6573  */
6574  __Pyx_XDECREF(__pyx_r);
6575  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
6576  __Pyx_GOTREF(__pyx_t_1);
6577 
6578  /* "cpartitioning.pyx":168
6579  * <double*>(quadratic_lagrangeNodes.data))
6580  * return (nDOF_all_processes,
6581  * nDOF_subdomain, # <<<<<<<<<<<<<<
6582  * max_dof_neighbors)
6583  *
6584  */
6585  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
6586  __Pyx_GOTREF(__pyx_t_2);
6587 
6588  /* "cpartitioning.pyx":169
6589  * return (nDOF_all_processes,
6590  * nDOF_subdomain,
6591  * max_dof_neighbors) # <<<<<<<<<<<<<<
6592  *
6593  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm,
6594  */
6595  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
6596  __Pyx_GOTREF(__pyx_t_3);
6597 
6598  /* "cpartitioning.pyx":167
6599  * <int*>(quadraticNumbering_subdomain2global.data),
6600  * <double*>(quadratic_lagrangeNodes.data))
6601  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
6602  * nDOF_subdomain,
6603  * max_dof_neighbors)
6604  */
6605  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
6606  __Pyx_GOTREF(__pyx_t_4);
6607  __Pyx_GIVEREF(__pyx_t_1);
6608  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6609  __Pyx_GIVEREF(__pyx_t_2);
6610  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
6611  __Pyx_GIVEREF(__pyx_t_3);
6612  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
6613  __pyx_t_1 = 0;
6614  __pyx_t_2 = 0;
6615  __pyx_t_3 = 0;
6616  __pyx_r = __pyx_t_4;
6617  __pyx_t_4 = 0;
6618  goto __pyx_L0;
6619 
6620  /* "cpartitioning.pyx":106
6621  * )
6622  *
6623  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6624  * int nSpace,
6625  * cmeshTools.CMesh cmesh,
6626  */
6627 
6628  /* function exit code */
6629  __pyx_L1_error:;
6630  __Pyx_XDECREF(__pyx_t_1);
6631  __Pyx_XDECREF(__pyx_t_2);
6632  __Pyx_XDECREF(__pyx_t_3);
6633  __Pyx_XDECREF(__pyx_t_4);
6634  __Pyx_AddTraceback("cpartitioning.buildQuadraticLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6635  __pyx_r = NULL;
6636  __pyx_L0:;
6637  __Pyx_XGIVEREF(__pyx_r);
6638  __Pyx_RefNannyFinishContext();
6639  return __pyx_r;
6640 }
6641 
6642 /* "cpartitioning.pyx":171
6643  * max_dof_neighbors)
6644  *
6645  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
6646  * int nSpace,
6647  * cmeshTools.CMesh cmesh,
6648  */
6649 
6650 /* Python wrapper */
6651 static PyObject *__pyx_pw_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6652 static PyMethodDef __pyx_mdef_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings = {"buildQuadraticCubeLocal2GlobalMappings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
6653 static PyObject *__pyx_pw_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6654  struct PyMPICommObject *__pyx_v_comm = 0;
6655  int __pyx_v_nSpace;
6656  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
6657  CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
6658  CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
6659  PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned = 0;
6660  CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned = 0;
6661  PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned = 0;
6662  CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
6663  PyArrayObject *__pyx_v_nodeNumbering_subdomain2global = 0;
6664  CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global = 0;
6665  PyArrayObject *__pyx_v_edgeNumbering_subdomain2global = 0;
6666  PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned = 0;
6667  PyArrayObject *__pyx_v_quadratic_subdomain_l2g = 0;
6668  PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global = 0;
6669  PyArrayObject *__pyx_v_quadratic_lagrangeNodes = 0;
6670  int __pyx_lineno = 0;
6671  const char *__pyx_filename = NULL;
6672  int __pyx_clineno = 0;
6673  PyObject *__pyx_r = 0;
6674  __Pyx_RefNannyDeclarations
6675  __Pyx_RefNannySetupContext("buildQuadraticCubeLocal2GlobalMappings (wrapper)", 0);
6676  {
6677  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nSpace,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_nodeOffsets_subdomain_owned,&__pyx_n_s_elementBoundaryOffsets_subdomain,&__pyx_n_s_edgeOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_nodeNumbering_subdomain2global,&__pyx_n_s_elementBoundaryNumbering_subdoma,&__pyx_n_s_edgeNumbering_subdomain2global,&__pyx_n_s_quadratic_dof_offsets_subdomain,&__pyx_n_s_quadratic_subdomain_l2g,&__pyx_n_s_quadraticNumbering_subdomain2glo,&__pyx_n_s_quadratic_lagrangeNodes,0};
6678  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
6679  if (unlikely(__pyx_kwds)) {
6680  Py_ssize_t kw_args;
6681  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6682  switch (pos_args) {
6683  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6684  CYTHON_FALLTHROUGH;
6685  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6686  CYTHON_FALLTHROUGH;
6687  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6688  CYTHON_FALLTHROUGH;
6689  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6690  CYTHON_FALLTHROUGH;
6691  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6692  CYTHON_FALLTHROUGH;
6693  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6694  CYTHON_FALLTHROUGH;
6695  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6696  CYTHON_FALLTHROUGH;
6697  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6698  CYTHON_FALLTHROUGH;
6699  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6700  CYTHON_FALLTHROUGH;
6701  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6702  CYTHON_FALLTHROUGH;
6703  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6704  CYTHON_FALLTHROUGH;
6705  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6706  CYTHON_FALLTHROUGH;
6707  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6708  CYTHON_FALLTHROUGH;
6709  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6710  CYTHON_FALLTHROUGH;
6711  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6712  CYTHON_FALLTHROUGH;
6713  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6714  CYTHON_FALLTHROUGH;
6715  case 0: break;
6716  default: goto __pyx_L5_argtuple_error;
6717  }
6718  kw_args = PyDict_Size(__pyx_kwds);
6719  switch (pos_args) {
6720  case 0:
6721  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
6722  else goto __pyx_L5_argtuple_error;
6723  CYTHON_FALLTHROUGH;
6724  case 1:
6725  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
6726  else {
6727  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 1); __PYX_ERR(0, 171, __pyx_L3_error)
6728  }
6729  CYTHON_FALLTHROUGH;
6730  case 2:
6731  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
6732  else {
6733  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 2); __PYX_ERR(0, 171, __pyx_L3_error)
6734  }
6735  CYTHON_FALLTHROUGH;
6736  case 3:
6737  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
6738  else {
6739  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 3); __PYX_ERR(0, 171, __pyx_L3_error)
6740  }
6741  CYTHON_FALLTHROUGH;
6742  case 4:
6743  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
6744  else {
6745  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 4); __PYX_ERR(0, 171, __pyx_L3_error)
6746  }
6747  CYTHON_FALLTHROUGH;
6748  case 5:
6749  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeOffsets_subdomain_owned)) != 0)) kw_args--;
6750  else {
6751  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 5); __PYX_ERR(0, 171, __pyx_L3_error)
6752  }
6753  CYTHON_FALLTHROUGH;
6754  case 6:
6755  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryOffsets_subdomain)) != 0)) kw_args--;
6756  else {
6757  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 6); __PYX_ERR(0, 171, __pyx_L3_error)
6758  }
6759  CYTHON_FALLTHROUGH;
6760  case 7:
6761  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeOffsets_subdomain_owned)) != 0)) kw_args--;
6762  else {
6763  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 7); __PYX_ERR(0, 171, __pyx_L3_error)
6764  }
6765  CYTHON_FALLTHROUGH;
6766  case 8:
6767  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
6768  else {
6769  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 8); __PYX_ERR(0, 171, __pyx_L3_error)
6770  }
6771  CYTHON_FALLTHROUGH;
6772  case 9:
6773  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodeNumbering_subdomain2global)) != 0)) kw_args--;
6774  else {
6775  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 9); __PYX_ERR(0, 171, __pyx_L3_error)
6776  }
6777  CYTHON_FALLTHROUGH;
6778  case 10:
6779  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementBoundaryNumbering_subdoma)) != 0)) kw_args--;
6780  else {
6781  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 10); __PYX_ERR(0, 171, __pyx_L3_error)
6782  }
6783  CYTHON_FALLTHROUGH;
6784  case 11:
6785  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edgeNumbering_subdomain2global)) != 0)) kw_args--;
6786  else {
6787  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 11); __PYX_ERR(0, 171, __pyx_L3_error)
6788  }
6789  CYTHON_FALLTHROUGH;
6790  case 12:
6791  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_dof_offsets_subdomain)) != 0)) kw_args--;
6792  else {
6793  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 12); __PYX_ERR(0, 171, __pyx_L3_error)
6794  }
6795  CYTHON_FALLTHROUGH;
6796  case 13:
6797  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_subdomain_l2g)) != 0)) kw_args--;
6798  else {
6799  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 13); __PYX_ERR(0, 171, __pyx_L3_error)
6800  }
6801  CYTHON_FALLTHROUGH;
6802  case 14:
6803  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadraticNumbering_subdomain2glo)) != 0)) kw_args--;
6804  else {
6805  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 14); __PYX_ERR(0, 171, __pyx_L3_error)
6806  }
6807  CYTHON_FALLTHROUGH;
6808  case 15:
6809  if (likely((values[15] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_quadratic_lagrangeNodes)) != 0)) kw_args--;
6810  else {
6811  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, 15); __PYX_ERR(0, 171, __pyx_L3_error)
6812  }
6813  }
6814  if (unlikely(kw_args > 0)) {
6815  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildQuadraticCubeLocal2GlobalMappings") < 0)) __PYX_ERR(0, 171, __pyx_L3_error)
6816  }
6817  } else if (PyTuple_GET_SIZE(__pyx_args) != 16) {
6818  goto __pyx_L5_argtuple_error;
6819  } else {
6820  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6821  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6822  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6823  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6824  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6825  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6826  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6827  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6828  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6829  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6830  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6831  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6832  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6833  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6834  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6835  values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
6836  }
6837  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
6838  __pyx_v_nSpace = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L3_error)
6839  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
6840  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
6841  __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
6842  __pyx_v_nodeOffsets_subdomain_owned = ((PyArrayObject *)values[5]);
6843  __pyx_v_elementBoundaryOffsets_subdomain_owned = ((PyArrayObject *)values[6]);
6844  __pyx_v_edgeOffsets_subdomain_owned = ((PyArrayObject *)values[7]);
6845  __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[8]);
6846  __pyx_v_nodeNumbering_subdomain2global = ((PyArrayObject *)values[9]);
6847  __pyx_v_elementBoundaryNumbering_subdomain2global = ((PyArrayObject *)values[10]);
6848  __pyx_v_edgeNumbering_subdomain2global = ((PyArrayObject *)values[11]);
6849  __pyx_v_quadratic_dof_offsets_subdomain_owned = ((PyArrayObject *)values[12]);
6850  __pyx_v_quadratic_subdomain_l2g = ((PyArrayObject *)values[13]);
6851  __pyx_v_quadraticNumbering_subdomain2global = ((PyArrayObject *)values[14]);
6852  __pyx_v_quadratic_lagrangeNodes = ((PyArrayObject *)values[15]);
6853  }
6854  goto __pyx_L4_argument_unpacking_done;
6855  __pyx_L5_argtuple_error:;
6856  __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 171, __pyx_L3_error)
6857  __pyx_L3_error:;
6858  __Pyx_AddTraceback("cpartitioning.buildQuadraticCubeLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
6859  __Pyx_RefNannyFinishContext();
6860  return NULL;
6861  __pyx_L4_argument_unpacking_done:;
6862  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 171, __pyx_L1_error)
6863  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 173, __pyx_L1_error)
6864  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 174, __pyx_L1_error)
6865  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 175, __pyx_L1_error)
6866  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "nodeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 176, __pyx_L1_error)
6867  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryOffsets_subdomain_owned", 0))) __PYX_ERR(0, 177, __pyx_L1_error)
6868  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "edgeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 178, __pyx_L1_error)
6869  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 179, __pyx_L1_error)
6870  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "nodeNumbering_subdomain2global", 0))) __PYX_ERR(0, 180, __pyx_L1_error)
6871  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementBoundaryNumbering_subdomain2global", 0))) __PYX_ERR(0, 181, __pyx_L1_error)
6872  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "edgeNumbering_subdomain2global", 0))) __PYX_ERR(0, 182, __pyx_L1_error)
6873  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "quadratic_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 183, __pyx_L1_error)
6874  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1, "quadratic_subdomain_l2g", 0))) __PYX_ERR(0, 184, __pyx_L1_error)
6875  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadraticNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "quadraticNumbering_subdomain2global", 0))) __PYX_ERR(0, 185, __pyx_L1_error)
6876  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_lagrangeNodes), __pyx_ptype_5numpy_ndarray, 1, "quadratic_lagrangeNodes", 0))) __PYX_ERR(0, 186, __pyx_L1_error)
6877  __pyx_r = __pyx_pf_13cpartitioning_12buildQuadraticCubeLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nSpace, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_edgeOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_edgeNumbering_subdomain2global, __pyx_v_quadratic_dof_offsets_subdomain_owned, __pyx_v_quadratic_subdomain_l2g, __pyx_v_quadraticNumbering_subdomain2global, __pyx_v_quadratic_lagrangeNodes);
6878 
6879  /* function exit code */
6880  goto __pyx_L0;
6881  __pyx_L1_error:;
6882  __pyx_r = NULL;
6883  __pyx_L0:;
6884  __Pyx_RefNannyFinishContext();
6885  return __pyx_r;
6886 }
6887 
6888 static PyObject *__pyx_pf_13cpartitioning_12buildQuadraticCubeLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes) {
6889  int __pyx_v_nDOF_all_processes;
6890  int __pyx_v_nDOF_subdomain;
6891  int __pyx_v_max_dof_neighbors;
6892  PyObject *__pyx_r = NULL;
6893  __Pyx_RefNannyDeclarations
6894  PyObject *__pyx_t_1 = NULL;
6895  PyObject *__pyx_t_2 = NULL;
6896  PyObject *__pyx_t_3 = NULL;
6897  PyObject *__pyx_t_4 = NULL;
6898  int __pyx_lineno = 0;
6899  const char *__pyx_filename = NULL;
6900  int __pyx_clineno = 0;
6901  __Pyx_RefNannySetupContext("buildQuadraticCubeLocal2GlobalMappings", 0);
6902 
6903  /* "cpartitioning.pyx":187
6904  * np.ndarray quadraticNumbering_subdomain2global,
6905  * np.ndarray quadratic_lagrangeNodes):
6906  * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
6907  * cdef int nDOF_subdomain=0
6908  * cdef int max_dof_neighbors=0
6909  */
6910  __pyx_v_nDOF_all_processes = 0;
6911 
6912  /* "cpartitioning.pyx":188
6913  * np.ndarray quadratic_lagrangeNodes):
6914  * cdef int nDOF_all_processes=0
6915  * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
6916  * cdef int max_dof_neighbors=0
6917  * if nSpace == 1:
6918  */
6919  __pyx_v_nDOF_subdomain = 0;
6920 
6921  /* "cpartitioning.pyx":189
6922  * cdef int nDOF_all_processes=0
6923  * cdef int nDOF_subdomain=0
6924  * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
6925  * if nSpace == 1:
6926  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6927  */
6928  __pyx_v_max_dof_neighbors = 0;
6929 
6930  /* "cpartitioning.pyx":190
6931  * cdef int nDOF_subdomain=0
6932  * cdef int max_dof_neighbors=0
6933  * if nSpace == 1: # <<<<<<<<<<<<<<
6934  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6935  * elif nSpace == 2:
6936  */
6937  switch (__pyx_v_nSpace) {
6938  case 1:
6939 
6940  /* "cpartitioning.pyx":191
6941  * cdef int max_dof_neighbors=0
6942  * if nSpace == 1:
6943  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!" # <<<<<<<<<<<<<<
6944  * elif nSpace == 2:
6945  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
6946  */
6947  #ifndef CYTHON_WITHOUT_ASSERTIONS
6948  if (unlikely(!Py_OptimizeFlag)) {
6949  if (unlikely(!0)) {
6950  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_buildQuadraticCubeSubdomain2Glob);
6951  __PYX_ERR(0, 191, __pyx_L1_error)
6952  }
6953  }
6954  #endif
6955 
6956  /* "cpartitioning.pyx":190
6957  * cdef int nDOF_subdomain=0
6958  * cdef int max_dof_neighbors=0
6959  * if nSpace == 1: # <<<<<<<<<<<<<<
6960  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6961  * elif nSpace == 2:
6962  */
6963  break;
6964  case 2:
6965 
6966  /* "cpartitioning.pyx":193
6967  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6968  * elif nSpace == 2:
6969  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!" # <<<<<<<<<<<<<<
6970  * else:
6971  * buildQuadraticCubeSubdomain2GlobalMappings_3d(comm.ob_mpi,
6972  */
6973  #ifndef CYTHON_WITHOUT_ASSERTIONS
6974  if (unlikely(!Py_OptimizeFlag)) {
6975  if (unlikely(!0)) {
6976  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2);
6977  __PYX_ERR(0, 193, __pyx_L1_error)
6978  }
6979  }
6980  #endif
6981 
6982  /* "cpartitioning.pyx":192
6983  * if nSpace == 1:
6984  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
6985  * elif nSpace == 2: # <<<<<<<<<<<<<<
6986  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
6987  * else:
6988  */
6989  break;
6990  default:
6991 
6992  /* "cpartitioning.pyx":195
6993  * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
6994  * else:
6995  * buildQuadraticCubeSubdomain2GlobalMappings_3d(comm.ob_mpi, # <<<<<<<<<<<<<<
6996  * cmesh.mesh,
6997  * <int*>(edgeOffsets_subdomain_owned.data),
6998  */
6999  (void)(proteus::buildQuadraticCubeSubdomain2GlobalMappings_3d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_edgeOffsets_subdomain_owned->data), ((int *)__pyx_v_nodeOffsets_subdomain_owned->data), ((int *)__pyx_v_edgeNumbering_subdomain2global->data), ((int *)__pyx_v_nodeNumbering_subdomain2global->data), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_quadratic_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_quadratic_subdomain_l2g->data), ((int *)__pyx_v_quadraticNumbering_subdomain2global->data), ((double *)__pyx_v_quadratic_lagrangeNodes->data)));
7000  break;
7001  }
7002 
7003  /* "cpartitioning.pyx":208
7004  * <int*>(quadraticNumbering_subdomain2global.data),
7005  * <double*>(quadratic_lagrangeNodes.data))
7006  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
7007  * nDOF_subdomain,
7008  * max_dof_neighbors)
7009  */
7010  __Pyx_XDECREF(__pyx_r);
7011  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
7012  __Pyx_GOTREF(__pyx_t_1);
7013 
7014  /* "cpartitioning.pyx":209
7015  * <double*>(quadratic_lagrangeNodes.data))
7016  * return (nDOF_all_processes,
7017  * nDOF_subdomain, # <<<<<<<<<<<<<<
7018  * max_dof_neighbors)
7019  *
7020  */
7021  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
7022  __Pyx_GOTREF(__pyx_t_2);
7023 
7024  /* "cpartitioning.pyx":210
7025  * return (nDOF_all_processes,
7026  * nDOF_subdomain,
7027  * max_dof_neighbors) # <<<<<<<<<<<<<<
7028  *
7029  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm,
7030  */
7031  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
7032  __Pyx_GOTREF(__pyx_t_3);
7033 
7034  /* "cpartitioning.pyx":208
7035  * <int*>(quadraticNumbering_subdomain2global.data),
7036  * <double*>(quadratic_lagrangeNodes.data))
7037  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
7038  * nDOF_subdomain,
7039  * max_dof_neighbors)
7040  */
7041  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
7042  __Pyx_GOTREF(__pyx_t_4);
7043  __Pyx_GIVEREF(__pyx_t_1);
7044  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7045  __Pyx_GIVEREF(__pyx_t_2);
7046  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
7047  __Pyx_GIVEREF(__pyx_t_3);
7048  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
7049  __pyx_t_1 = 0;
7050  __pyx_t_2 = 0;
7051  __pyx_t_3 = 0;
7052  __pyx_r = __pyx_t_4;
7053  __pyx_t_4 = 0;
7054  goto __pyx_L0;
7055 
7056  /* "cpartitioning.pyx":171
7057  * max_dof_neighbors)
7058  *
7059  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
7060  * int nSpace,
7061  * cmeshTools.CMesh cmesh,
7062  */
7063 
7064  /* function exit code */
7065  __pyx_L1_error:;
7066  __Pyx_XDECREF(__pyx_t_1);
7067  __Pyx_XDECREF(__pyx_t_2);
7068  __Pyx_XDECREF(__pyx_t_3);
7069  __Pyx_XDECREF(__pyx_t_4);
7070  __Pyx_AddTraceback("cpartitioning.buildQuadraticCubeLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
7071  __pyx_r = NULL;
7072  __pyx_L0:;
7073  __Pyx_XGIVEREF(__pyx_r);
7074  __Pyx_RefNannyFinishContext();
7075  return __pyx_r;
7076 }
7077 
7078 /* "cpartitioning.pyx":212
7079  * max_dof_neighbors)
7080  *
7081  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
7082  * int nDOF_element,
7083  * cmeshTools.CMesh cmesh,
7084  */
7085 
7086 /* Python wrapper */
7087 static PyObject *__pyx_pw_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7088 static PyMethodDef __pyx_mdef_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings = {"buildDiscontinuousGalerkinLocal2GlobalMappings", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings, METH_VARARGS|METH_KEYWORDS, 0};
7089 static PyObject *__pyx_pw_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7090  struct PyMPICommObject *__pyx_v_comm = 0;
7091  int __pyx_v_nDOF_element;
7092  struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
7093  CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
7094  PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
7095  PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
7096  PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned = 0;
7097  PyArrayObject *__pyx_v_dg_subdomain_l2g = 0;
7098  PyArrayObject *__pyx_v_dgNumbering_subdomain2global = 0;
7099  int __pyx_lineno = 0;
7100  const char *__pyx_filename = NULL;
7101  int __pyx_clineno = 0;
7102  PyObject *__pyx_r = 0;
7103  __Pyx_RefNannyDeclarations
7104  __Pyx_RefNannySetupContext("buildDiscontinuousGalerkinLocal2GlobalMappings (wrapper)", 0);
7105  {
7106  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_comm,&__pyx_n_s_nDOF_element,&__pyx_n_s_cmesh,&__pyx_n_s_subdomain_cmesh,&__pyx_n_s_elementOffsets_subdomain_owned,&__pyx_n_s_elementNumbering_subdomain2globa,&__pyx_n_s_dg_dof_offsets_subdomain_owned,&__pyx_n_s_dg_subdomain_l2g,&__pyx_n_s_dgNumbering_subdomain2global,0};
7107  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
7108  if (unlikely(__pyx_kwds)) {
7109  Py_ssize_t kw_args;
7110  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7111  switch (pos_args) {
7112  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7113  CYTHON_FALLTHROUGH;
7114  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7115  CYTHON_FALLTHROUGH;
7116  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7117  CYTHON_FALLTHROUGH;
7118  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7119  CYTHON_FALLTHROUGH;
7120  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7121  CYTHON_FALLTHROUGH;
7122  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7123  CYTHON_FALLTHROUGH;
7124  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7125  CYTHON_FALLTHROUGH;
7126  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7127  CYTHON_FALLTHROUGH;
7128  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7129  CYTHON_FALLTHROUGH;
7130  case 0: break;
7131  default: goto __pyx_L5_argtuple_error;
7132  }
7133  kw_args = PyDict_Size(__pyx_kwds);
7134  switch (pos_args) {
7135  case 0:
7136  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_comm)) != 0)) kw_args--;
7137  else goto __pyx_L5_argtuple_error;
7138  CYTHON_FALLTHROUGH;
7139  case 1:
7140  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nDOF_element)) != 0)) kw_args--;
7141  else {
7142  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 1); __PYX_ERR(0, 212, __pyx_L3_error)
7143  }
7144  CYTHON_FALLTHROUGH;
7145  case 2:
7146  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cmesh)) != 0)) kw_args--;
7147  else {
7148  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 2); __PYX_ERR(0, 212, __pyx_L3_error)
7149  }
7150  CYTHON_FALLTHROUGH;
7151  case 3:
7152  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdomain_cmesh)) != 0)) kw_args--;
7153  else {
7154  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 3); __PYX_ERR(0, 212, __pyx_L3_error)
7155  }
7156  CYTHON_FALLTHROUGH;
7157  case 4:
7158  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementOffsets_subdomain_owned)) != 0)) kw_args--;
7159  else {
7160  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 4); __PYX_ERR(0, 212, __pyx_L3_error)
7161  }
7162  CYTHON_FALLTHROUGH;
7163  case 5:
7164  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_elementNumbering_subdomain2globa)) != 0)) kw_args--;
7165  else {
7166  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 5); __PYX_ERR(0, 212, __pyx_L3_error)
7167  }
7168  CYTHON_FALLTHROUGH;
7169  case 6:
7170  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dg_dof_offsets_subdomain_owned)) != 0)) kw_args--;
7171  else {
7172  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 6); __PYX_ERR(0, 212, __pyx_L3_error)
7173  }
7174  CYTHON_FALLTHROUGH;
7175  case 7:
7176  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dg_subdomain_l2g)) != 0)) kw_args--;
7177  else {
7178  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 7); __PYX_ERR(0, 212, __pyx_L3_error)
7179  }
7180  CYTHON_FALLTHROUGH;
7181  case 8:
7182  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dgNumbering_subdomain2global)) != 0)) kw_args--;
7183  else {
7184  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, 8); __PYX_ERR(0, 212, __pyx_L3_error)
7185  }
7186  }
7187  if (unlikely(kw_args > 0)) {
7188  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "buildDiscontinuousGalerkinLocal2GlobalMappings") < 0)) __PYX_ERR(0, 212, __pyx_L3_error)
7189  }
7190  } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
7191  goto __pyx_L5_argtuple_error;
7192  } else {
7193  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7194  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7195  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7196  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7197  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7198  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7199  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7200  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7201  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7202  }
7203  __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
7204  __pyx_v_nDOF_element = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_nDOF_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L3_error)
7205  __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
7206  __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
7207  __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
7208  __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[5]);
7209  __pyx_v_dg_dof_offsets_subdomain_owned = ((PyArrayObject *)values[6]);
7210  __pyx_v_dg_subdomain_l2g = ((PyArrayObject *)values[7]);
7211  __pyx_v_dgNumbering_subdomain2global = ((PyArrayObject *)values[8]);
7212  }
7213  goto __pyx_L4_argument_unpacking_done;
7214  __pyx_L5_argtuple_error:;
7215  __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 212, __pyx_L3_error)
7216  __pyx_L3_error:;
7217  __Pyx_AddTraceback("cpartitioning.buildDiscontinuousGalerkinLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
7218  __Pyx_RefNannyFinishContext();
7219  return NULL;
7220  __pyx_L4_argument_unpacking_done:;
7221  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 212, __pyx_L1_error)
7222  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 214, __pyx_L1_error)
7223  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 215, __pyx_L1_error)
7224  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 216, __pyx_L1_error)
7225  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 217, __pyx_L1_error)
7226  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dg_dof_offsets_subdomain_owned), __pyx_ptype_5numpy_ndarray, 1, "dg_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 218, __pyx_L1_error)
7227  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dg_subdomain_l2g), __pyx_ptype_5numpy_ndarray, 1, "dg_subdomain_l2g", 0))) __PYX_ERR(0, 219, __pyx_L1_error)
7228  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dgNumbering_subdomain2global), __pyx_ptype_5numpy_ndarray, 1, "dgNumbering_subdomain2global", 0))) __PYX_ERR(0, 220, __pyx_L1_error)
7229  __pyx_r = __pyx_pf_13cpartitioning_14buildDiscontinuousGalerkinLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nDOF_element, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_dg_dof_offsets_subdomain_owned, __pyx_v_dg_subdomain_l2g, __pyx_v_dgNumbering_subdomain2global);
7230 
7231  /* function exit code */
7232  goto __pyx_L0;
7233  __pyx_L1_error:;
7234  __pyx_r = NULL;
7235  __pyx_L0:;
7236  __Pyx_RefNannyFinishContext();
7237  return __pyx_r;
7238 }
7239 
7240 static PyObject *__pyx_pf_13cpartitioning_14buildDiscontinuousGalerkinLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nDOF_element, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_dg_subdomain_l2g, PyArrayObject *__pyx_v_dgNumbering_subdomain2global) {
7241  int __pyx_v_nDOF_all_processes;
7242  int __pyx_v_nDOF_subdomain;
7243  int __pyx_v_max_dof_neighbors;
7244  PyObject *__pyx_r = NULL;
7245  __Pyx_RefNannyDeclarations
7246  PyObject *__pyx_t_1 = NULL;
7247  PyObject *__pyx_t_2 = NULL;
7248  PyObject *__pyx_t_3 = NULL;
7249  PyObject *__pyx_t_4 = NULL;
7250  int __pyx_lineno = 0;
7251  const char *__pyx_filename = NULL;
7252  int __pyx_clineno = 0;
7253  __Pyx_RefNannySetupContext("buildDiscontinuousGalerkinLocal2GlobalMappings", 0);
7254 
7255  /* "cpartitioning.pyx":221
7256  * np.ndarray dg_subdomain_l2g,
7257  * np.ndarray dgNumbering_subdomain2global):
7258  * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
7259  * cdef int nDOF_subdomain=0
7260  * cdef int max_dof_neighbors=0
7261  */
7262  __pyx_v_nDOF_all_processes = 0;
7263 
7264  /* "cpartitioning.pyx":222
7265  * np.ndarray dgNumbering_subdomain2global):
7266  * cdef int nDOF_all_processes=0
7267  * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
7268  * cdef int max_dof_neighbors=0
7269  * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi,
7270  */
7271  __pyx_v_nDOF_subdomain = 0;
7272 
7273  /* "cpartitioning.pyx":223
7274  * cdef int nDOF_all_processes=0
7275  * cdef int nDOF_subdomain=0
7276  * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
7277  * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi,
7278  * cmesh.mesh,
7279  */
7280  __pyx_v_max_dof_neighbors = 0;
7281 
7282  /* "cpartitioning.pyx":224
7283  * cdef int nDOF_subdomain=0
7284  * cdef int max_dof_neighbors=0
7285  * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi, # <<<<<<<<<<<<<<
7286  * cmesh.mesh,
7287  * <int*>(elementOffsets_subdomain_owned.data),
7288  */
7289  (void)(proteus::buildDiscontinuousGalerkinSubdomain2GlobalMappings(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_v_elementOffsets_subdomain_owned->data), ((int *)__pyx_v_elementNumbering_subdomain2global->data), __pyx_v_nDOF_element, __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_v_dg_dof_offsets_subdomain_owned->data), ((int *)__pyx_v_dg_subdomain_l2g->data), ((int *)__pyx_v_dgNumbering_subdomain2global->data)));
7290 
7291  /* "cpartitioning.pyx":235
7292  * <int*>(dg_subdomain_l2g.data),
7293  * <int*>(dgNumbering_subdomain2global.data))
7294  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
7295  * nDOF_subdomain,
7296  * max_dof_neighbors)
7297  */
7298  __Pyx_XDECREF(__pyx_r);
7299  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
7300  __Pyx_GOTREF(__pyx_t_1);
7301 
7302  /* "cpartitioning.pyx":236
7303  * <int*>(dgNumbering_subdomain2global.data))
7304  * return (nDOF_all_processes,
7305  * nDOF_subdomain, # <<<<<<<<<<<<<<
7306  * max_dof_neighbors)
7307  */
7308  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
7309  __Pyx_GOTREF(__pyx_t_2);
7310 
7311  /* "cpartitioning.pyx":237
7312  * return (nDOF_all_processes,
7313  * nDOF_subdomain,
7314  * max_dof_neighbors) # <<<<<<<<<<<<<<
7315  */
7316  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error)
7317  __Pyx_GOTREF(__pyx_t_3);
7318 
7319  /* "cpartitioning.pyx":235
7320  * <int*>(dg_subdomain_l2g.data),
7321  * <int*>(dgNumbering_subdomain2global.data))
7322  * return (nDOF_all_processes, # <<<<<<<<<<<<<<
7323  * nDOF_subdomain,
7324  * max_dof_neighbors)
7325  */
7326  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
7327  __Pyx_GOTREF(__pyx_t_4);
7328  __Pyx_GIVEREF(__pyx_t_1);
7329  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7330  __Pyx_GIVEREF(__pyx_t_2);
7331  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
7332  __Pyx_GIVEREF(__pyx_t_3);
7333  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
7334  __pyx_t_1 = 0;
7335  __pyx_t_2 = 0;
7336  __pyx_t_3 = 0;
7337  __pyx_r = __pyx_t_4;
7338  __pyx_t_4 = 0;
7339  goto __pyx_L0;
7340 
7341  /* "cpartitioning.pyx":212
7342  * max_dof_neighbors)
7343  *
7344  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
7345  * int nDOF_element,
7346  * cmeshTools.CMesh cmesh,
7347  */
7348 
7349  /* function exit code */
7350  __pyx_L1_error:;
7351  __Pyx_XDECREF(__pyx_t_1);
7352  __Pyx_XDECREF(__pyx_t_2);
7353  __Pyx_XDECREF(__pyx_t_3);
7354  __Pyx_XDECREF(__pyx_t_4);
7355  __Pyx_AddTraceback("cpartitioning.buildDiscontinuousGalerkinLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
7356  __pyx_r = NULL;
7357  __pyx_L0:;
7358  __Pyx_XGIVEREF(__pyx_r);
7359  __Pyx_RefNannyFinishContext();
7360  return __pyx_r;
7361 }
7362 
7363 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
7364  * ctypedef npy_cdouble complex_t
7365  *
7366  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7367  * return PyArray_MultiIterNew(1, <void*>a)
7368  *
7369  */
7370 
7371 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7372  PyObject *__pyx_r = NULL;
7373  __Pyx_RefNannyDeclarations
7374  PyObject *__pyx_t_1 = NULL;
7375  int __pyx_lineno = 0;
7376  const char *__pyx_filename = NULL;
7377  int __pyx_clineno = 0;
7378  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
7379 
7380  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":736
7381  *
7382  * cdef inline object PyArray_MultiIterNew1(a):
7383  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
7384  *
7385  * cdef inline object PyArray_MultiIterNew2(a, b):
7386  */
7387  __Pyx_XDECREF(__pyx_r);
7388  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
7389  __Pyx_GOTREF(__pyx_t_1);
7390  __pyx_r = __pyx_t_1;
7391  __pyx_t_1 = 0;
7392  goto __pyx_L0;
7393 
7394  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
7395  * ctypedef npy_cdouble complex_t
7396  *
7397  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7398  * return PyArray_MultiIterNew(1, <void*>a)
7399  *
7400  */
7401 
7402  /* function exit code */
7403  __pyx_L1_error:;
7404  __Pyx_XDECREF(__pyx_t_1);
7405  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7406  __pyx_r = 0;
7407  __pyx_L0:;
7408  __Pyx_XGIVEREF(__pyx_r);
7409  __Pyx_RefNannyFinishContext();
7410  return __pyx_r;
7411 }
7412 
7413 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
7414  * return PyArray_MultiIterNew(1, <void*>a)
7415  *
7416  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7417  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7418  *
7419  */
7420 
7421 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7422  PyObject *__pyx_r = NULL;
7423  __Pyx_RefNannyDeclarations
7424  PyObject *__pyx_t_1 = NULL;
7425  int __pyx_lineno = 0;
7426  const char *__pyx_filename = NULL;
7427  int __pyx_clineno = 0;
7428  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
7429 
7430  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":739
7431  *
7432  * cdef inline object PyArray_MultiIterNew2(a, b):
7433  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
7434  *
7435  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7436  */
7437  __Pyx_XDECREF(__pyx_r);
7438  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error)
7439  __Pyx_GOTREF(__pyx_t_1);
7440  __pyx_r = __pyx_t_1;
7441  __pyx_t_1 = 0;
7442  goto __pyx_L0;
7443 
7444  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
7445  * return PyArray_MultiIterNew(1, <void*>a)
7446  *
7447  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7448  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7449  *
7450  */
7451 
7452  /* function exit code */
7453  __pyx_L1_error:;
7454  __Pyx_XDECREF(__pyx_t_1);
7455  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7456  __pyx_r = 0;
7457  __pyx_L0:;
7458  __Pyx_XGIVEREF(__pyx_r);
7459  __Pyx_RefNannyFinishContext();
7460  return __pyx_r;
7461 }
7462 
7463 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
7464  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7465  *
7466  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7467  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7468  *
7469  */
7470 
7471 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7472  PyObject *__pyx_r = NULL;
7473  __Pyx_RefNannyDeclarations
7474  PyObject *__pyx_t_1 = NULL;
7475  int __pyx_lineno = 0;
7476  const char *__pyx_filename = NULL;
7477  int __pyx_clineno = 0;
7478  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
7479 
7480  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":742
7481  *
7482  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7483  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
7484  *
7485  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7486  */
7487  __Pyx_XDECREF(__pyx_r);
7488  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 742, __pyx_L1_error)
7489  __Pyx_GOTREF(__pyx_t_1);
7490  __pyx_r = __pyx_t_1;
7491  __pyx_t_1 = 0;
7492  goto __pyx_L0;
7493 
7494  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
7495  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7496  *
7497  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7498  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7499  *
7500  */
7501 
7502  /* function exit code */
7503  __pyx_L1_error:;
7504  __Pyx_XDECREF(__pyx_t_1);
7505  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7506  __pyx_r = 0;
7507  __pyx_L0:;
7508  __Pyx_XGIVEREF(__pyx_r);
7509  __Pyx_RefNannyFinishContext();
7510  return __pyx_r;
7511 }
7512 
7513 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
7514  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7515  *
7516  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7517  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7518  *
7519  */
7520 
7521 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) {
7522  PyObject *__pyx_r = NULL;
7523  __Pyx_RefNannyDeclarations
7524  PyObject *__pyx_t_1 = NULL;
7525  int __pyx_lineno = 0;
7526  const char *__pyx_filename = NULL;
7527  int __pyx_clineno = 0;
7528  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
7529 
7530  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":745
7531  *
7532  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7533  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
7534  *
7535  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7536  */
7537  __Pyx_XDECREF(__pyx_r);
7538  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
7539  __Pyx_GOTREF(__pyx_t_1);
7540  __pyx_r = __pyx_t_1;
7541  __pyx_t_1 = 0;
7542  goto __pyx_L0;
7543 
7544  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
7545  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7546  *
7547  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7548  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7549  *
7550  */
7551 
7552  /* function exit code */
7553  __pyx_L1_error:;
7554  __Pyx_XDECREF(__pyx_t_1);
7555  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7556  __pyx_r = 0;
7557  __pyx_L0:;
7558  __Pyx_XGIVEREF(__pyx_r);
7559  __Pyx_RefNannyFinishContext();
7560  return __pyx_r;
7561 }
7562 
7563 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
7564  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7565  *
7566  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7567  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7568  *
7569  */
7570 
7571 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) {
7572  PyObject *__pyx_r = NULL;
7573  __Pyx_RefNannyDeclarations
7574  PyObject *__pyx_t_1 = NULL;
7575  int __pyx_lineno = 0;
7576  const char *__pyx_filename = NULL;
7577  int __pyx_clineno = 0;
7578  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
7579 
7580  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":748
7581  *
7582  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7583  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
7584  *
7585  * cdef inline tuple PyDataType_SHAPE(dtype d):
7586  */
7587  __Pyx_XDECREF(__pyx_r);
7588  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
7589  __Pyx_GOTREF(__pyx_t_1);
7590  __pyx_r = __pyx_t_1;
7591  __pyx_t_1 = 0;
7592  goto __pyx_L0;
7593 
7594  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
7595  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7596  *
7597  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7598  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7599  *
7600  */
7601 
7602  /* function exit code */
7603  __pyx_L1_error:;
7604  __Pyx_XDECREF(__pyx_t_1);
7605  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7606  __pyx_r = 0;
7607  __pyx_L0:;
7608  __Pyx_XGIVEREF(__pyx_r);
7609  __Pyx_RefNannyFinishContext();
7610  return __pyx_r;
7611 }
7612 
7613 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
7614  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7615  *
7616  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7617  * if PyDataType_HASSUBARRAY(d):
7618  * return <tuple>d.subarray.shape
7619  */
7620 
7621 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7622  PyObject *__pyx_r = NULL;
7623  __Pyx_RefNannyDeclarations
7624  int __pyx_t_1;
7625  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
7626 
7627  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
7628  *
7629  * cdef inline tuple PyDataType_SHAPE(dtype d):
7630  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7631  * return <tuple>d.subarray.shape
7632  * else:
7633  */
7634  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7635  if (__pyx_t_1) {
7636 
7637  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":752
7638  * cdef inline tuple PyDataType_SHAPE(dtype d):
7639  * if PyDataType_HASSUBARRAY(d):
7640  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
7641  * else:
7642  * return ()
7643  */
7644  __Pyx_XDECREF(__pyx_r);
7645  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7646  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7647  goto __pyx_L0;
7648 
7649  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
7650  *
7651  * cdef inline tuple PyDataType_SHAPE(dtype d):
7652  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7653  * return <tuple>d.subarray.shape
7654  * else:
7655  */
7656  }
7657 
7658  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":754
7659  * return <tuple>d.subarray.shape
7660  * else:
7661  * return () # <<<<<<<<<<<<<<
7662  *
7663  *
7664  */
7665  /*else*/ {
7666  __Pyx_XDECREF(__pyx_r);
7667  __Pyx_INCREF(__pyx_empty_tuple);
7668  __pyx_r = __pyx_empty_tuple;
7669  goto __pyx_L0;
7670  }
7671 
7672  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
7673  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7674  *
7675  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7676  * if PyDataType_HASSUBARRAY(d):
7677  * return <tuple>d.subarray.shape
7678  */
7679 
7680  /* function exit code */
7681  __pyx_L0:;
7682  __Pyx_XGIVEREF(__pyx_r);
7683  __Pyx_RefNannyFinishContext();
7684  return __pyx_r;
7685 }
7686 
7687 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
7688  * int _import_umath() except -1
7689  *
7690  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7691  * Py_INCREF(base) # important to do this before stealing the reference below!
7692  * PyArray_SetBaseObject(arr, base)
7693  */
7694 
7695 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7696  __Pyx_RefNannyDeclarations
7697  __Pyx_RefNannySetupContext("set_array_base", 0);
7698 
7699  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":930
7700  *
7701  * cdef inline void set_array_base(ndarray arr, object base):
7702  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
7703  * PyArray_SetBaseObject(arr, base)
7704  *
7705  */
7706  Py_INCREF(__pyx_v_base);
7707 
7708  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":931
7709  * cdef inline void set_array_base(ndarray arr, object base):
7710  * Py_INCREF(base) # important to do this before stealing the reference below!
7711  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
7712  *
7713  * cdef inline object get_array_base(ndarray arr):
7714  */
7715  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
7716 
7717  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
7718  * int _import_umath() except -1
7719  *
7720  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7721  * Py_INCREF(base) # important to do this before stealing the reference below!
7722  * PyArray_SetBaseObject(arr, base)
7723  */
7724 
7725  /* function exit code */
7726  __Pyx_RefNannyFinishContext();
7727 }
7728 
7729 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
7730  * PyArray_SetBaseObject(arr, base)
7731  *
7732  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7733  * base = PyArray_BASE(arr)
7734  * if base is NULL:
7735  */
7736 
7737 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7738  PyObject *__pyx_v_base;
7739  PyObject *__pyx_r = NULL;
7740  __Pyx_RefNannyDeclarations
7741  int __pyx_t_1;
7742  __Pyx_RefNannySetupContext("get_array_base", 0);
7743 
7744  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":934
7745  *
7746  * cdef inline object get_array_base(ndarray arr):
7747  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
7748  * if base is NULL:
7749  * return None
7750  */
7751  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
7752 
7753  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
7754  * cdef inline object get_array_base(ndarray arr):
7755  * base = PyArray_BASE(arr)
7756  * if base is NULL: # <<<<<<<<<<<<<<
7757  * return None
7758  * return <object>base
7759  */
7760  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7761  if (__pyx_t_1) {
7762 
7763  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":936
7764  * base = PyArray_BASE(arr)
7765  * if base is NULL:
7766  * return None # <<<<<<<<<<<<<<
7767  * return <object>base
7768  *
7769  */
7770  __Pyx_XDECREF(__pyx_r);
7771  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7772  goto __pyx_L0;
7773 
7774  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
7775  * cdef inline object get_array_base(ndarray arr):
7776  * base = PyArray_BASE(arr)
7777  * if base is NULL: # <<<<<<<<<<<<<<
7778  * return None
7779  * return <object>base
7780  */
7781  }
7782 
7783  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":937
7784  * if base is NULL:
7785  * return None
7786  * return <object>base # <<<<<<<<<<<<<<
7787  *
7788  * # Versions of the import_* functions which are more suitable for
7789  */
7790  __Pyx_XDECREF(__pyx_r);
7791  __Pyx_INCREF(((PyObject *)__pyx_v_base));
7792  __pyx_r = ((PyObject *)__pyx_v_base);
7793  goto __pyx_L0;
7794 
7795  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
7796  * PyArray_SetBaseObject(arr, base)
7797  *
7798  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7799  * base = PyArray_BASE(arr)
7800  * if base is NULL:
7801  */
7802 
7803  /* function exit code */
7804  __pyx_L0:;
7805  __Pyx_XGIVEREF(__pyx_r);
7806  __Pyx_RefNannyFinishContext();
7807  return __pyx_r;
7808 }
7809 
7810 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
7811  * # Versions of the import_* functions which are more suitable for
7812  * # Cython code.
7813  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7814  * try:
7815  * __pyx_import_array()
7816  */
7817 
7818 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
7819  int __pyx_r;
7820  __Pyx_RefNannyDeclarations
7821  PyObject *__pyx_t_1 = NULL;
7822  PyObject *__pyx_t_2 = NULL;
7823  PyObject *__pyx_t_3 = NULL;
7824  int __pyx_t_4;
7825  PyObject *__pyx_t_5 = NULL;
7826  PyObject *__pyx_t_6 = NULL;
7827  PyObject *__pyx_t_7 = NULL;
7828  PyObject *__pyx_t_8 = NULL;
7829  int __pyx_lineno = 0;
7830  const char *__pyx_filename = NULL;
7831  int __pyx_clineno = 0;
7832  __Pyx_RefNannySetupContext("import_array", 0);
7833 
7834  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
7835  * # Cython code.
7836  * cdef inline int import_array() except -1:
7837  * try: # <<<<<<<<<<<<<<
7838  * __pyx_import_array()
7839  * except Exception:
7840  */
7841  {
7842  __Pyx_PyThreadState_declare
7843  __Pyx_PyThreadState_assign
7844  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7845  __Pyx_XGOTREF(__pyx_t_1);
7846  __Pyx_XGOTREF(__pyx_t_2);
7847  __Pyx_XGOTREF(__pyx_t_3);
7848  /*try:*/ {
7849 
7850  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":943
7851  * cdef inline int import_array() except -1:
7852  * try:
7853  * __pyx_import_array() # <<<<<<<<<<<<<<
7854  * except Exception:
7855  * raise ImportError("numpy.core.multiarray failed to import")
7856  */
7857  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L3_error)
7858 
7859  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
7860  * # Cython code.
7861  * cdef inline int import_array() except -1:
7862  * try: # <<<<<<<<<<<<<<
7863  * __pyx_import_array()
7864  * except Exception:
7865  */
7866  }
7867  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7868  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7869  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7870  goto __pyx_L8_try_end;
7871  __pyx_L3_error:;
7872 
7873  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":944
7874  * try:
7875  * __pyx_import_array()
7876  * except Exception: # <<<<<<<<<<<<<<
7877  * raise ImportError("numpy.core.multiarray failed to import")
7878  *
7879  */
7880  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7881  if (__pyx_t_4) {
7882  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7883  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 944, __pyx_L5_except_error)
7884  __Pyx_GOTREF(__pyx_t_5);
7885  __Pyx_GOTREF(__pyx_t_6);
7886  __Pyx_GOTREF(__pyx_t_7);
7887 
7888  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
7889  * __pyx_import_array()
7890  * except Exception:
7891  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
7892  *
7893  * cdef inline int import_umath() except -1:
7894  */
7895  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 945, __pyx_L5_except_error)
7896  __Pyx_GOTREF(__pyx_t_8);
7897  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7898  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7899  __PYX_ERR(1, 945, __pyx_L5_except_error)
7900  }
7901  goto __pyx_L5_except_error;
7902  __pyx_L5_except_error:;
7903 
7904  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
7905  * # Cython code.
7906  * cdef inline int import_array() except -1:
7907  * try: # <<<<<<<<<<<<<<
7908  * __pyx_import_array()
7909  * except Exception:
7910  */
7911  __Pyx_XGIVEREF(__pyx_t_1);
7912  __Pyx_XGIVEREF(__pyx_t_2);
7913  __Pyx_XGIVEREF(__pyx_t_3);
7914  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7915  goto __pyx_L1_error;
7916  __pyx_L8_try_end:;
7917  }
7918 
7919  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
7920  * # Versions of the import_* functions which are more suitable for
7921  * # Cython code.
7922  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7923  * try:
7924  * __pyx_import_array()
7925  */
7926 
7927  /* function exit code */
7928  __pyx_r = 0;
7929  goto __pyx_L0;
7930  __pyx_L1_error:;
7931  __Pyx_XDECREF(__pyx_t_5);
7932  __Pyx_XDECREF(__pyx_t_6);
7933  __Pyx_XDECREF(__pyx_t_7);
7934  __Pyx_XDECREF(__pyx_t_8);
7935  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7936  __pyx_r = -1;
7937  __pyx_L0:;
7938  __Pyx_RefNannyFinishContext();
7939  return __pyx_r;
7940 }
7941 
7942 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
7943  * raise ImportError("numpy.core.multiarray failed to import")
7944  *
7945  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7946  * try:
7947  * _import_umath()
7948  */
7949 
7950 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
7951  int __pyx_r;
7952  __Pyx_RefNannyDeclarations
7953  PyObject *__pyx_t_1 = NULL;
7954  PyObject *__pyx_t_2 = NULL;
7955  PyObject *__pyx_t_3 = NULL;
7956  int __pyx_t_4;
7957  PyObject *__pyx_t_5 = NULL;
7958  PyObject *__pyx_t_6 = NULL;
7959  PyObject *__pyx_t_7 = NULL;
7960  PyObject *__pyx_t_8 = NULL;
7961  int __pyx_lineno = 0;
7962  const char *__pyx_filename = NULL;
7963  int __pyx_clineno = 0;
7964  __Pyx_RefNannySetupContext("import_umath", 0);
7965 
7966  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
7967  *
7968  * cdef inline int import_umath() except -1:
7969  * try: # <<<<<<<<<<<<<<
7970  * _import_umath()
7971  * except Exception:
7972  */
7973  {
7974  __Pyx_PyThreadState_declare
7975  __Pyx_PyThreadState_assign
7976  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7977  __Pyx_XGOTREF(__pyx_t_1);
7978  __Pyx_XGOTREF(__pyx_t_2);
7979  __Pyx_XGOTREF(__pyx_t_3);
7980  /*try:*/ {
7981 
7982  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":949
7983  * cdef inline int import_umath() except -1:
7984  * try:
7985  * _import_umath() # <<<<<<<<<<<<<<
7986  * except Exception:
7987  * raise ImportError("numpy.core.umath failed to import")
7988  */
7989  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 949, __pyx_L3_error)
7990 
7991  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
7992  *
7993  * cdef inline int import_umath() except -1:
7994  * try: # <<<<<<<<<<<<<<
7995  * _import_umath()
7996  * except Exception:
7997  */
7998  }
7999  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8000  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8001  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8002  goto __pyx_L8_try_end;
8003  __pyx_L3_error:;
8004 
8005  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":950
8006  * try:
8007  * _import_umath()
8008  * except Exception: # <<<<<<<<<<<<<<
8009  * raise ImportError("numpy.core.umath failed to import")
8010  *
8011  */
8012  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8013  if (__pyx_t_4) {
8014  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8015  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 950, __pyx_L5_except_error)
8016  __Pyx_GOTREF(__pyx_t_5);
8017  __Pyx_GOTREF(__pyx_t_6);
8018  __Pyx_GOTREF(__pyx_t_7);
8019 
8020  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
8021  * _import_umath()
8022  * except Exception:
8023  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8024  *
8025  * cdef inline int import_ufunc() except -1:
8026  */
8027  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 951, __pyx_L5_except_error)
8028  __Pyx_GOTREF(__pyx_t_8);
8029  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8030  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8031  __PYX_ERR(1, 951, __pyx_L5_except_error)
8032  }
8033  goto __pyx_L5_except_error;
8034  __pyx_L5_except_error:;
8035 
8036  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
8037  *
8038  * cdef inline int import_umath() except -1:
8039  * try: # <<<<<<<<<<<<<<
8040  * _import_umath()
8041  * except Exception:
8042  */
8043  __Pyx_XGIVEREF(__pyx_t_1);
8044  __Pyx_XGIVEREF(__pyx_t_2);
8045  __Pyx_XGIVEREF(__pyx_t_3);
8046  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8047  goto __pyx_L1_error;
8048  __pyx_L8_try_end:;
8049  }
8050 
8051  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
8052  * raise ImportError("numpy.core.multiarray failed to import")
8053  *
8054  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
8055  * try:
8056  * _import_umath()
8057  */
8058 
8059  /* function exit code */
8060  __pyx_r = 0;
8061  goto __pyx_L0;
8062  __pyx_L1_error:;
8063  __Pyx_XDECREF(__pyx_t_5);
8064  __Pyx_XDECREF(__pyx_t_6);
8065  __Pyx_XDECREF(__pyx_t_7);
8066  __Pyx_XDECREF(__pyx_t_8);
8067  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8068  __pyx_r = -1;
8069  __pyx_L0:;
8070  __Pyx_RefNannyFinishContext();
8071  return __pyx_r;
8072 }
8073 
8074 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
8075  * raise ImportError("numpy.core.umath failed to import")
8076  *
8077  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8078  * try:
8079  * _import_umath()
8080  */
8081 
8082 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
8083  int __pyx_r;
8084  __Pyx_RefNannyDeclarations
8085  PyObject *__pyx_t_1 = NULL;
8086  PyObject *__pyx_t_2 = NULL;
8087  PyObject *__pyx_t_3 = NULL;
8088  int __pyx_t_4;
8089  PyObject *__pyx_t_5 = NULL;
8090  PyObject *__pyx_t_6 = NULL;
8091  PyObject *__pyx_t_7 = NULL;
8092  PyObject *__pyx_t_8 = NULL;
8093  int __pyx_lineno = 0;
8094  const char *__pyx_filename = NULL;
8095  int __pyx_clineno = 0;
8096  __Pyx_RefNannySetupContext("import_ufunc", 0);
8097 
8098  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
8099  *
8100  * cdef inline int import_ufunc() except -1:
8101  * try: # <<<<<<<<<<<<<<
8102  * _import_umath()
8103  * except Exception:
8104  */
8105  {
8106  __Pyx_PyThreadState_declare
8107  __Pyx_PyThreadState_assign
8108  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8109  __Pyx_XGOTREF(__pyx_t_1);
8110  __Pyx_XGOTREF(__pyx_t_2);
8111  __Pyx_XGOTREF(__pyx_t_3);
8112  /*try:*/ {
8113 
8114  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":955
8115  * cdef inline int import_ufunc() except -1:
8116  * try:
8117  * _import_umath() # <<<<<<<<<<<<<<
8118  * except Exception:
8119  * raise ImportError("numpy.core.umath failed to import")
8120  */
8121  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 955, __pyx_L3_error)
8122 
8123  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
8124  *
8125  * cdef inline int import_ufunc() except -1:
8126  * try: # <<<<<<<<<<<<<<
8127  * _import_umath()
8128  * except Exception:
8129  */
8130  }
8131  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8132  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8133  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8134  goto __pyx_L8_try_end;
8135  __pyx_L3_error:;
8136 
8137  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":956
8138  * try:
8139  * _import_umath()
8140  * except Exception: # <<<<<<<<<<<<<<
8141  * raise ImportError("numpy.core.umath failed to import")
8142  *
8143  */
8144  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8145  if (__pyx_t_4) {
8146  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8147  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 956, __pyx_L5_except_error)
8148  __Pyx_GOTREF(__pyx_t_5);
8149  __Pyx_GOTREF(__pyx_t_6);
8150  __Pyx_GOTREF(__pyx_t_7);
8151 
8152  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":957
8153  * _import_umath()
8154  * except Exception:
8155  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
8156  *
8157  * cdef extern from *:
8158  */
8159  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 957, __pyx_L5_except_error)
8160  __Pyx_GOTREF(__pyx_t_8);
8161  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8162  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8163  __PYX_ERR(1, 957, __pyx_L5_except_error)
8164  }
8165  goto __pyx_L5_except_error;
8166  __pyx_L5_except_error:;
8167 
8168  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
8169  *
8170  * cdef inline int import_ufunc() except -1:
8171  * try: # <<<<<<<<<<<<<<
8172  * _import_umath()
8173  * except Exception:
8174  */
8175  __Pyx_XGIVEREF(__pyx_t_1);
8176  __Pyx_XGIVEREF(__pyx_t_2);
8177  __Pyx_XGIVEREF(__pyx_t_3);
8178  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8179  goto __pyx_L1_error;
8180  __pyx_L8_try_end:;
8181  }
8182 
8183  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
8184  * raise ImportError("numpy.core.umath failed to import")
8185  *
8186  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
8187  * try:
8188  * _import_umath()
8189  */
8190 
8191  /* function exit code */
8192  __pyx_r = 0;
8193  goto __pyx_L0;
8194  __pyx_L1_error:;
8195  __Pyx_XDECREF(__pyx_t_5);
8196  __Pyx_XDECREF(__pyx_t_6);
8197  __Pyx_XDECREF(__pyx_t_7);
8198  __Pyx_XDECREF(__pyx_t_8);
8199  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8200  __pyx_r = -1;
8201  __pyx_L0:;
8202  __Pyx_RefNannyFinishContext();
8203  return __pyx_r;
8204 }
8205 
8206 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
8207  *
8208  *
8209  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
8210  * """
8211  * Cython equivalent of `isinstance(obj, np.timedelta64)`
8212  */
8213 
8214 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
8215  int __pyx_r;
8216  __Pyx_RefNannyDeclarations
8217  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
8218 
8219  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":979
8220  * bool
8221  * """
8222  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
8223  *
8224  *
8225  */
8226  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
8227  goto __pyx_L0;
8228 
8229  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
8230  *
8231  *
8232  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
8233  * """
8234  * Cython equivalent of `isinstance(obj, np.timedelta64)`
8235  */
8236 
8237  /* function exit code */
8238  __pyx_L0:;
8239  __Pyx_RefNannyFinishContext();
8240  return __pyx_r;
8241 }
8242 
8243 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
8244  *
8245  *
8246  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
8247  * """
8248  * Cython equivalent of `isinstance(obj, np.datetime64)`
8249  */
8250 
8251 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
8252  int __pyx_r;
8253  __Pyx_RefNannyDeclarations
8254  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
8255 
8256  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":994
8257  * bool
8258  * """
8259  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
8260  *
8261  *
8262  */
8263  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
8264  goto __pyx_L0;
8265 
8266  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
8267  *
8268  *
8269  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
8270  * """
8271  * Cython equivalent of `isinstance(obj, np.datetime64)`
8272  */
8273 
8274  /* function exit code */
8275  __pyx_L0:;
8276  __Pyx_RefNannyFinishContext();
8277  return __pyx_r;
8278 }
8279 
8280 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
8281  *
8282  *
8283  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
8284  * """
8285  * returns the int64 value underlying scalar numpy datetime64 object
8286  */
8287 
8288 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
8289  npy_datetime __pyx_r;
8290 
8291  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1004
8292  * also needed. That can be found using `get_datetime64_unit`.
8293  * """
8294  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
8295  *
8296  *
8297  */
8298  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
8299  goto __pyx_L0;
8300 
8301  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
8302  *
8303  *
8304  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
8305  * """
8306  * returns the int64 value underlying scalar numpy datetime64 object
8307  */
8308 
8309  /* function exit code */
8310  __pyx_L0:;
8311  return __pyx_r;
8312 }
8313 
8314 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
8315  *
8316  *
8317  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
8318  * """
8319  * returns the int64 value underlying scalar numpy timedelta64 object
8320  */
8321 
8322 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
8323  npy_timedelta __pyx_r;
8324 
8325  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1011
8326  * returns the int64 value underlying scalar numpy timedelta64 object
8327  * """
8328  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
8329  *
8330  *
8331  */
8332  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
8333  goto __pyx_L0;
8334 
8335  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
8336  *
8337  *
8338  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
8339  * """
8340  * returns the int64 value underlying scalar numpy timedelta64 object
8341  */
8342 
8343  /* function exit code */
8344  __pyx_L0:;
8345  return __pyx_r;
8346 }
8347 
8348 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
8349  *
8350  *
8351  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
8352  * """
8353  * returns the unit part of the dtype for a numpy datetime64 object.
8354  */
8355 
8356 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
8357  NPY_DATETIMEUNIT __pyx_r;
8358 
8359  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1018
8360  * returns the unit part of the dtype for a numpy datetime64 object.
8361  * """
8362  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
8363  */
8364  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
8365  goto __pyx_L0;
8366 
8367  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
8368  *
8369  *
8370  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
8371  * """
8372  * returns the unit part of the dtype for a numpy datetime64 object.
8373  */
8374 
8375  /* function exit code */
8376  __pyx_L0:;
8377  return __pyx_r;
8378 }
8379 
8380 /* "View.MemoryView":122
8381  * cdef bint dtype_is_object
8382  *
8383  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8384  * mode="c", bint allocate_buffer=True):
8385  *
8386  */
8387 
8388 /* Python wrapper */
8389 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8390 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8391  PyObject *__pyx_v_shape = 0;
8392  Py_ssize_t __pyx_v_itemsize;
8393  PyObject *__pyx_v_format = 0;
8394  PyObject *__pyx_v_mode = 0;
8395  int __pyx_v_allocate_buffer;
8396  int __pyx_lineno = 0;
8397  const char *__pyx_filename = NULL;
8398  int __pyx_clineno = 0;
8399  int __pyx_r;
8400  __Pyx_RefNannyDeclarations
8401  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8402  {
8403  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};
8404  PyObject* values[5] = {0,0,0,0,0};
8405  values[3] = ((PyObject *)__pyx_n_s_c);
8406  if (unlikely(__pyx_kwds)) {
8407  Py_ssize_t kw_args;
8408  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8409  switch (pos_args) {
8410  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8411  CYTHON_FALLTHROUGH;
8412  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8413  CYTHON_FALLTHROUGH;
8414  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8415  CYTHON_FALLTHROUGH;
8416  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8417  CYTHON_FALLTHROUGH;
8418  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8419  CYTHON_FALLTHROUGH;
8420  case 0: break;
8421  default: goto __pyx_L5_argtuple_error;
8422  }
8423  kw_args = PyDict_Size(__pyx_kwds);
8424  switch (pos_args) {
8425  case 0:
8426  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8427  else goto __pyx_L5_argtuple_error;
8428  CYTHON_FALLTHROUGH;
8429  case 1:
8430  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8431  else {
8432  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 122, __pyx_L3_error)
8433  }
8434  CYTHON_FALLTHROUGH;
8435  case 2:
8436  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8437  else {
8438  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 122, __pyx_L3_error)
8439  }
8440  CYTHON_FALLTHROUGH;
8441  case 3:
8442  if (kw_args > 0) {
8443  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8444  if (value) { values[3] = value; kw_args--; }
8445  }
8446  CYTHON_FALLTHROUGH;
8447  case 4:
8448  if (kw_args > 0) {
8449  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8450  if (value) { values[4] = value; kw_args--; }
8451  }
8452  }
8453  if (unlikely(kw_args > 0)) {
8454  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 122, __pyx_L3_error)
8455  }
8456  } else {
8457  switch (PyTuple_GET_SIZE(__pyx_args)) {
8458  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8459  CYTHON_FALLTHROUGH;
8460  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8461  CYTHON_FALLTHROUGH;
8462  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8463  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8464  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8465  break;
8466  default: goto __pyx_L5_argtuple_error;
8467  }
8468  }
8469  __pyx_v_shape = ((PyObject*)values[0]);
8470  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L3_error)
8471  __pyx_v_format = values[2];
8472  __pyx_v_mode = values[3];
8473  if (values[4]) {
8474  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L3_error)
8475  } else {
8476 
8477  /* "View.MemoryView":123
8478  *
8479  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
8480  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
8481  *
8482  * cdef int idx
8483  */
8484  __pyx_v_allocate_buffer = ((int)1);
8485  }
8486  }
8487  goto __pyx_L4_argument_unpacking_done;
8488  __pyx_L5_argtuple_error:;
8489  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 122, __pyx_L3_error)
8490  __pyx_L3_error:;
8491  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8492  __Pyx_RefNannyFinishContext();
8493  return -1;
8494  __pyx_L4_argument_unpacking_done:;
8495  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 122, __pyx_L1_error)
8496  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8497  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 122, __pyx_L1_error)
8498  }
8499  __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);
8500 
8501  /* "View.MemoryView":122
8502  * cdef bint dtype_is_object
8503  *
8504  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8505  * mode="c", bint allocate_buffer=True):
8506  *
8507  */
8508 
8509  /* function exit code */
8510  goto __pyx_L0;
8511  __pyx_L1_error:;
8512  __pyx_r = -1;
8513  __pyx_L0:;
8514  __Pyx_RefNannyFinishContext();
8515  return __pyx_r;
8516 }
8517 
8518 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) {
8519  int __pyx_v_idx;
8520  Py_ssize_t __pyx_v_i;
8521  Py_ssize_t __pyx_v_dim;
8522  PyObject **__pyx_v_p;
8523  char __pyx_v_order;
8524  int __pyx_r;
8525  __Pyx_RefNannyDeclarations
8526  Py_ssize_t __pyx_t_1;
8527  int __pyx_t_2;
8528  PyObject *__pyx_t_3 = NULL;
8529  int __pyx_t_4;
8530  PyObject *__pyx_t_5 = NULL;
8531  PyObject *__pyx_t_6 = NULL;
8532  char *__pyx_t_7;
8533  int __pyx_t_8;
8534  Py_ssize_t __pyx_t_9;
8535  PyObject *__pyx_t_10 = NULL;
8536  Py_ssize_t __pyx_t_11;
8537  int __pyx_lineno = 0;
8538  const char *__pyx_filename = NULL;
8539  int __pyx_clineno = 0;
8540  __Pyx_RefNannySetupContext("__cinit__", 0);
8541  __Pyx_INCREF(__pyx_v_format);
8542 
8543  /* "View.MemoryView":129
8544  * cdef PyObject **p
8545  *
8546  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
8547  * self.itemsize = itemsize
8548  *
8549  */
8550  if (unlikely(__pyx_v_shape == Py_None)) {
8551  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8552  __PYX_ERR(2, 129, __pyx_L1_error)
8553  }
8554  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 129, __pyx_L1_error)
8555  __pyx_v_self->ndim = ((int)__pyx_t_1);
8556 
8557  /* "View.MemoryView":130
8558  *
8559  * self.ndim = <int> len(shape)
8560  * self.itemsize = itemsize # <<<<<<<<<<<<<<
8561  *
8562  * if not self.ndim:
8563  */
8564  __pyx_v_self->itemsize = __pyx_v_itemsize;
8565 
8566  /* "View.MemoryView":132
8567  * self.itemsize = itemsize
8568  *
8569  * if not self.ndim: # <<<<<<<<<<<<<<
8570  * raise ValueError("Empty shape tuple for cython.array")
8571  *
8572  */
8573  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8574  if (unlikely(__pyx_t_2)) {
8575 
8576  /* "View.MemoryView":133
8577  *
8578  * if not self.ndim:
8579  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
8580  *
8581  * if itemsize <= 0:
8582  */
8583  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 133, __pyx_L1_error)
8584  __Pyx_GOTREF(__pyx_t_3);
8585  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8586  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8587  __PYX_ERR(2, 133, __pyx_L1_error)
8588 
8589  /* "View.MemoryView":132
8590  * self.itemsize = itemsize
8591  *
8592  * if not self.ndim: # <<<<<<<<<<<<<<
8593  * raise ValueError("Empty shape tuple for cython.array")
8594  *
8595  */
8596  }
8597 
8598  /* "View.MemoryView":135
8599  * raise ValueError("Empty shape tuple for cython.array")
8600  *
8601  * if itemsize <= 0: # <<<<<<<<<<<<<<
8602  * raise ValueError("itemsize <= 0 for cython.array")
8603  *
8604  */
8605  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8606  if (unlikely(__pyx_t_2)) {
8607 
8608  /* "View.MemoryView":136
8609  *
8610  * if itemsize <= 0:
8611  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
8612  *
8613  * if not isinstance(format, bytes):
8614  */
8615  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 136, __pyx_L1_error)
8616  __Pyx_GOTREF(__pyx_t_3);
8617  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8618  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8619  __PYX_ERR(2, 136, __pyx_L1_error)
8620 
8621  /* "View.MemoryView":135
8622  * raise ValueError("Empty shape tuple for cython.array")
8623  *
8624  * if itemsize <= 0: # <<<<<<<<<<<<<<
8625  * raise ValueError("itemsize <= 0 for cython.array")
8626  *
8627  */
8628  }
8629 
8630  /* "View.MemoryView":138
8631  * raise ValueError("itemsize <= 0 for cython.array")
8632  *
8633  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8634  * format = format.encode('ASCII')
8635  * self._format = format # keep a reference to the byte string
8636  */
8637  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8638  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8639  if (__pyx_t_4) {
8640 
8641  /* "View.MemoryView":139
8642  *
8643  * if not isinstance(format, bytes):
8644  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
8645  * self._format = format # keep a reference to the byte string
8646  * self.format = self._format
8647  */
8648  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 139, __pyx_L1_error)
8649  __Pyx_GOTREF(__pyx_t_5);
8650  __pyx_t_6 = NULL;
8651  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8652  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8653  if (likely(__pyx_t_6)) {
8654  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8655  __Pyx_INCREF(__pyx_t_6);
8656  __Pyx_INCREF(function);
8657  __Pyx_DECREF_SET(__pyx_t_5, function);
8658  }
8659  }
8660  __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);
8661  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8662  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 139, __pyx_L1_error)
8663  __Pyx_GOTREF(__pyx_t_3);
8664  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8665  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
8666  __pyx_t_3 = 0;
8667 
8668  /* "View.MemoryView":138
8669  * raise ValueError("itemsize <= 0 for cython.array")
8670  *
8671  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8672  * format = format.encode('ASCII')
8673  * self._format = format # keep a reference to the byte string
8674  */
8675  }
8676 
8677  /* "View.MemoryView":140
8678  * if not isinstance(format, bytes):
8679  * format = format.encode('ASCII')
8680  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
8681  * self.format = self._format
8682  *
8683  */
8684  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(2, 140, __pyx_L1_error)
8685  __pyx_t_3 = __pyx_v_format;
8686  __Pyx_INCREF(__pyx_t_3);
8687  __Pyx_GIVEREF(__pyx_t_3);
8688  __Pyx_GOTREF(__pyx_v_self->_format);
8689  __Pyx_DECREF(__pyx_v_self->_format);
8690  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
8691  __pyx_t_3 = 0;
8692 
8693  /* "View.MemoryView":141
8694  * format = format.encode('ASCII')
8695  * self._format = format # keep a reference to the byte string
8696  * self.format = self._format # <<<<<<<<<<<<<<
8697  *
8698  *
8699  */
8700  if (unlikely(__pyx_v_self->_format == Py_None)) {
8701  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
8702  __PYX_ERR(2, 141, __pyx_L1_error)
8703  }
8704  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(2, 141, __pyx_L1_error)
8705  __pyx_v_self->format = __pyx_t_7;
8706 
8707  /* "View.MemoryView":144
8708  *
8709  *
8710  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
8711  * self._strides = self._shape + self.ndim
8712  *
8713  */
8714  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8715 
8716  /* "View.MemoryView":145
8717  *
8718  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
8719  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
8720  *
8721  * if not self._shape:
8722  */
8723  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8724 
8725  /* "View.MemoryView":147
8726  * self._strides = self._shape + self.ndim
8727  *
8728  * if not self._shape: # <<<<<<<<<<<<<<
8729  * raise MemoryError("unable to allocate shape and strides.")
8730  *
8731  */
8732  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8733  if (unlikely(__pyx_t_4)) {
8734 
8735  /* "View.MemoryView":148
8736  *
8737  * if not self._shape:
8738  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
8739  *
8740  *
8741  */
8742  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error)
8743  __Pyx_GOTREF(__pyx_t_3);
8744  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8745  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8746  __PYX_ERR(2, 148, __pyx_L1_error)
8747 
8748  /* "View.MemoryView":147
8749  * self._strides = self._shape + self.ndim
8750  *
8751  * if not self._shape: # <<<<<<<<<<<<<<
8752  * raise MemoryError("unable to allocate shape and strides.")
8753  *
8754  */
8755  }
8756 
8757  /* "View.MemoryView":151
8758  *
8759  *
8760  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8761  * if dim <= 0:
8762  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8763  */
8764  __pyx_t_8 = 0;
8765  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8766  for (;;) {
8767  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
8768  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8769  __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(2, 151, __pyx_L1_error)
8770  #else
8771  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 151, __pyx_L1_error)
8772  __Pyx_GOTREF(__pyx_t_5);
8773  #endif
8774  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 151, __pyx_L1_error)
8775  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8776  __pyx_v_dim = __pyx_t_9;
8777  __pyx_v_idx = __pyx_t_8;
8778  __pyx_t_8 = (__pyx_t_8 + 1);
8779 
8780  /* "View.MemoryView":152
8781  *
8782  * for idx, dim in enumerate(shape):
8783  * if dim <= 0: # <<<<<<<<<<<<<<
8784  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8785  * self._shape[idx] = dim
8786  */
8787  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8788  if (unlikely(__pyx_t_4)) {
8789 
8790  /* "View.MemoryView":153
8791  * for idx, dim in enumerate(shape):
8792  * if dim <= 0:
8793  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
8794  * self._shape[idx] = dim
8795  *
8796  */
8797  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 153, __pyx_L1_error)
8798  __Pyx_GOTREF(__pyx_t_5);
8799  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 153, __pyx_L1_error)
8800  __Pyx_GOTREF(__pyx_t_6);
8801  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
8802  __Pyx_GOTREF(__pyx_t_10);
8803  __Pyx_GIVEREF(__pyx_t_5);
8804  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
8805  __Pyx_GIVEREF(__pyx_t_6);
8806  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
8807  __pyx_t_5 = 0;
8808  __pyx_t_6 = 0;
8809  __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(2, 153, __pyx_L1_error)
8810  __Pyx_GOTREF(__pyx_t_6);
8811  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8812  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 153, __pyx_L1_error)
8813  __Pyx_GOTREF(__pyx_t_10);
8814  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8815  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8816  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8817  __PYX_ERR(2, 153, __pyx_L1_error)
8818 
8819  /* "View.MemoryView":152
8820  *
8821  * for idx, dim in enumerate(shape):
8822  * if dim <= 0: # <<<<<<<<<<<<<<
8823  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8824  * self._shape[idx] = dim
8825  */
8826  }
8827 
8828  /* "View.MemoryView":154
8829  * if dim <= 0:
8830  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8831  * self._shape[idx] = dim # <<<<<<<<<<<<<<
8832  *
8833  * cdef char order
8834  */
8835  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8836 
8837  /* "View.MemoryView":151
8838  *
8839  *
8840  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8841  * if dim <= 0:
8842  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8843  */
8844  }
8845  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8846 
8847  /* "View.MemoryView":157
8848  *
8849  * cdef char order
8850  * if mode == 'fortran': # <<<<<<<<<<<<<<
8851  * order = b'F'
8852  * self.mode = u'fortran'
8853  */
8854  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 157, __pyx_L1_error)
8855  if (__pyx_t_4) {
8856 
8857  /* "View.MemoryView":158
8858  * cdef char order
8859  * if mode == 'fortran':
8860  * order = b'F' # <<<<<<<<<<<<<<
8861  * self.mode = u'fortran'
8862  * elif mode == 'c':
8863  */
8864  __pyx_v_order = 'F';
8865 
8866  /* "View.MemoryView":159
8867  * if mode == 'fortran':
8868  * order = b'F'
8869  * self.mode = u'fortran' # <<<<<<<<<<<<<<
8870  * elif mode == 'c':
8871  * order = b'C'
8872  */
8873  __Pyx_INCREF(__pyx_n_u_fortran);
8874  __Pyx_GIVEREF(__pyx_n_u_fortran);
8875  __Pyx_GOTREF(__pyx_v_self->mode);
8876  __Pyx_DECREF(__pyx_v_self->mode);
8877  __pyx_v_self->mode = __pyx_n_u_fortran;
8878 
8879  /* "View.MemoryView":157
8880  *
8881  * cdef char order
8882  * if mode == 'fortran': # <<<<<<<<<<<<<<
8883  * order = b'F'
8884  * self.mode = u'fortran'
8885  */
8886  goto __pyx_L10;
8887  }
8888 
8889  /* "View.MemoryView":160
8890  * order = b'F'
8891  * self.mode = u'fortran'
8892  * elif mode == 'c': # <<<<<<<<<<<<<<
8893  * order = b'C'
8894  * self.mode = u'c'
8895  */
8896  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 160, __pyx_L1_error)
8897  if (likely(__pyx_t_4)) {
8898 
8899  /* "View.MemoryView":161
8900  * self.mode = u'fortran'
8901  * elif mode == 'c':
8902  * order = b'C' # <<<<<<<<<<<<<<
8903  * self.mode = u'c'
8904  * else:
8905  */
8906  __pyx_v_order = 'C';
8907 
8908  /* "View.MemoryView":162
8909  * elif mode == 'c':
8910  * order = b'C'
8911  * self.mode = u'c' # <<<<<<<<<<<<<<
8912  * else:
8913  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8914  */
8915  __Pyx_INCREF(__pyx_n_u_c);
8916  __Pyx_GIVEREF(__pyx_n_u_c);
8917  __Pyx_GOTREF(__pyx_v_self->mode);
8918  __Pyx_DECREF(__pyx_v_self->mode);
8919  __pyx_v_self->mode = __pyx_n_u_c;
8920 
8921  /* "View.MemoryView":160
8922  * order = b'F'
8923  * self.mode = u'fortran'
8924  * elif mode == 'c': # <<<<<<<<<<<<<<
8925  * order = b'C'
8926  * self.mode = u'c'
8927  */
8928  goto __pyx_L10;
8929  }
8930 
8931  /* "View.MemoryView":164
8932  * self.mode = u'c'
8933  * else:
8934  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
8935  *
8936  * self.len = fill_contig_strides_array(self._shape, self._strides,
8937  */
8938  /*else*/ {
8939  __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(2, 164, __pyx_L1_error)
8940  __Pyx_GOTREF(__pyx_t_3);
8941  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 164, __pyx_L1_error)
8942  __Pyx_GOTREF(__pyx_t_10);
8943  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8944  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8945  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8946  __PYX_ERR(2, 164, __pyx_L1_error)
8947  }
8948  __pyx_L10:;
8949 
8950  /* "View.MemoryView":166
8951  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8952  *
8953  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
8954  * itemsize, self.ndim, order)
8955  *
8956  */
8957  __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);
8958 
8959  /* "View.MemoryView":169
8960  * itemsize, self.ndim, order)
8961  *
8962  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
8963  * self.dtype_is_object = format == b'O'
8964  * if allocate_buffer:
8965  */
8966  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8967 
8968  /* "View.MemoryView":170
8969  *
8970  * self.free_data = allocate_buffer
8971  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
8972  * if allocate_buffer:
8973  *
8974  */
8975  __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(2, 170, __pyx_L1_error)
8976  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 170, __pyx_L1_error)
8977  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8978  __pyx_v_self->dtype_is_object = __pyx_t_4;
8979 
8980  /* "View.MemoryView":171
8981  * self.free_data = allocate_buffer
8982  * self.dtype_is_object = format == b'O'
8983  * if allocate_buffer: # <<<<<<<<<<<<<<
8984  *
8985  *
8986  */
8987  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8988  if (__pyx_t_4) {
8989 
8990  /* "View.MemoryView":174
8991  *
8992  *
8993  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
8994  * if not self.data:
8995  * raise MemoryError("unable to allocate array data.")
8996  */
8997  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
8998 
8999  /* "View.MemoryView":175
9000  *
9001  * self.data = <char *>malloc(self.len)
9002  * if not self.data: # <<<<<<<<<<<<<<
9003  * raise MemoryError("unable to allocate array data.")
9004  *
9005  */
9006  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
9007  if (unlikely(__pyx_t_4)) {
9008 
9009  /* "View.MemoryView":176
9010  * self.data = <char *>malloc(self.len)
9011  * if not self.data:
9012  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
9013  *
9014  * if self.dtype_is_object:
9015  */
9016  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 176, __pyx_L1_error)
9017  __Pyx_GOTREF(__pyx_t_10);
9018  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
9019  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9020  __PYX_ERR(2, 176, __pyx_L1_error)
9021 
9022  /* "View.MemoryView":175
9023  *
9024  * self.data = <char *>malloc(self.len)
9025  * if not self.data: # <<<<<<<<<<<<<<
9026  * raise MemoryError("unable to allocate array data.")
9027  *
9028  */
9029  }
9030 
9031  /* "View.MemoryView":178
9032  * raise MemoryError("unable to allocate array data.")
9033  *
9034  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9035  * p = <PyObject **> self.data
9036  * for i in range(self.len / itemsize):
9037  */
9038  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
9039  if (__pyx_t_4) {
9040 
9041  /* "View.MemoryView":179
9042  *
9043  * if self.dtype_is_object:
9044  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
9045  * for i in range(self.len / itemsize):
9046  * p[i] = Py_None
9047  */
9048  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
9049 
9050  /* "View.MemoryView":180
9051  * if self.dtype_is_object:
9052  * p = <PyObject **> self.data
9053  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
9054  * p[i] = Py_None
9055  * Py_INCREF(Py_None)
9056  */
9057  if (unlikely(__pyx_v_itemsize == 0)) {
9058  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
9059  __PYX_ERR(2, 180, __pyx_L1_error)
9060  }
9061  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))) {
9062  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
9063  __PYX_ERR(2, 180, __pyx_L1_error)
9064  }
9065  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
9066  __pyx_t_9 = __pyx_t_1;
9067  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
9068  __pyx_v_i = __pyx_t_11;
9069 
9070  /* "View.MemoryView":181
9071  * p = <PyObject **> self.data
9072  * for i in range(self.len / itemsize):
9073  * p[i] = Py_None # <<<<<<<<<<<<<<
9074  * Py_INCREF(Py_None)
9075  *
9076  */
9077  (__pyx_v_p[__pyx_v_i]) = Py_None;
9078 
9079  /* "View.MemoryView":182
9080  * for i in range(self.len / itemsize):
9081  * p[i] = Py_None
9082  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
9083  *
9084  * @cname('getbuffer')
9085  */
9086  Py_INCREF(Py_None);
9087  }
9088 
9089  /* "View.MemoryView":178
9090  * raise MemoryError("unable to allocate array data.")
9091  *
9092  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9093  * p = <PyObject **> self.data
9094  * for i in range(self.len / itemsize):
9095  */
9096  }
9097 
9098  /* "View.MemoryView":171
9099  * self.free_data = allocate_buffer
9100  * self.dtype_is_object = format == b'O'
9101  * if allocate_buffer: # <<<<<<<<<<<<<<
9102  *
9103  *
9104  */
9105  }
9106 
9107  /* "View.MemoryView":122
9108  * cdef bint dtype_is_object
9109  *
9110  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9111  * mode="c", bint allocate_buffer=True):
9112  *
9113  */
9114 
9115  /* function exit code */
9116  __pyx_r = 0;
9117  goto __pyx_L0;
9118  __pyx_L1_error:;
9119  __Pyx_XDECREF(__pyx_t_3);
9120  __Pyx_XDECREF(__pyx_t_5);
9121  __Pyx_XDECREF(__pyx_t_6);
9122  __Pyx_XDECREF(__pyx_t_10);
9123  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9124  __pyx_r = -1;
9125  __pyx_L0:;
9126  __Pyx_XDECREF(__pyx_v_format);
9127  __Pyx_RefNannyFinishContext();
9128  return __pyx_r;
9129 }
9130 
9131 /* "View.MemoryView":185
9132  *
9133  * @cname('getbuffer')
9134  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9135  * cdef int bufmode = -1
9136  * if self.mode == u"c":
9137  */
9138 
9139 /* Python wrapper */
9140 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
9141 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9142  int __pyx_r;
9143  __Pyx_RefNannyDeclarations
9144  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9145  __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));
9146 
9147  /* function exit code */
9148  __Pyx_RefNannyFinishContext();
9149  return __pyx_r;
9150 }
9151 
9152 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) {
9153  int __pyx_v_bufmode;
9154  int __pyx_r;
9155  __Pyx_RefNannyDeclarations
9156  int __pyx_t_1;
9157  int __pyx_t_2;
9158  PyObject *__pyx_t_3 = NULL;
9159  char *__pyx_t_4;
9160  Py_ssize_t __pyx_t_5;
9161  int __pyx_t_6;
9162  Py_ssize_t *__pyx_t_7;
9163  int __pyx_lineno = 0;
9164  const char *__pyx_filename = NULL;
9165  int __pyx_clineno = 0;
9166  if (__pyx_v_info == NULL) {
9167  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
9168  return -1;
9169  }
9170  __Pyx_RefNannySetupContext("__getbuffer__", 0);
9171  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9172  __Pyx_GIVEREF(__pyx_v_info->obj);
9173 
9174  /* "View.MemoryView":186
9175  * @cname('getbuffer')
9176  * def __getbuffer__(self, Py_buffer *info, int flags):
9177  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
9178  * if self.mode == u"c":
9179  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9180  */
9181  __pyx_v_bufmode = -1;
9182 
9183  /* "View.MemoryView":187
9184  * def __getbuffer__(self, Py_buffer *info, int flags):
9185  * cdef int bufmode = -1
9186  * if self.mode == u"c": # <<<<<<<<<<<<<<
9187  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9188  * elif self.mode == u"fortran":
9189  */
9190  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 187, __pyx_L1_error)
9191  __pyx_t_2 = (__pyx_t_1 != 0);
9192  if (__pyx_t_2) {
9193 
9194  /* "View.MemoryView":188
9195  * cdef int bufmode = -1
9196  * if self.mode == u"c":
9197  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9198  * elif self.mode == u"fortran":
9199  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9200  */
9201  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9202 
9203  /* "View.MemoryView":187
9204  * def __getbuffer__(self, Py_buffer *info, int flags):
9205  * cdef int bufmode = -1
9206  * if self.mode == u"c": # <<<<<<<<<<<<<<
9207  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9208  * elif self.mode == u"fortran":
9209  */
9210  goto __pyx_L3;
9211  }
9212 
9213  /* "View.MemoryView":189
9214  * if self.mode == u"c":
9215  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9216  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9217  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9218  * if not (flags & bufmode):
9219  */
9220  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 189, __pyx_L1_error)
9221  __pyx_t_1 = (__pyx_t_2 != 0);
9222  if (__pyx_t_1) {
9223 
9224  /* "View.MemoryView":190
9225  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9226  * elif self.mode == u"fortran":
9227  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
9228  * if not (flags & bufmode):
9229  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9230  */
9231  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
9232 
9233  /* "View.MemoryView":189
9234  * if self.mode == u"c":
9235  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9236  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
9237  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9238  * if not (flags & bufmode):
9239  */
9240  }
9241  __pyx_L3:;
9242 
9243  /* "View.MemoryView":191
9244  * elif self.mode == u"fortran":
9245  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9246  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9247  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9248  * info.buf = self.data
9249  */
9250  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
9251  if (unlikely(__pyx_t_1)) {
9252 
9253  /* "View.MemoryView":192
9254  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9255  * if not (flags & bufmode):
9256  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
9257  * info.buf = self.data
9258  * info.len = self.len
9259  */
9260  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 192, __pyx_L1_error)
9261  __Pyx_GOTREF(__pyx_t_3);
9262  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9263  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9264  __PYX_ERR(2, 192, __pyx_L1_error)
9265 
9266  /* "View.MemoryView":191
9267  * elif self.mode == u"fortran":
9268  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9269  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9270  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9271  * info.buf = self.data
9272  */
9273  }
9274 
9275  /* "View.MemoryView":193
9276  * if not (flags & bufmode):
9277  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9278  * info.buf = self.data # <<<<<<<<<<<<<<
9279  * info.len = self.len
9280  * info.ndim = self.ndim
9281  */
9282  __pyx_t_4 = __pyx_v_self->data;
9283  __pyx_v_info->buf = __pyx_t_4;
9284 
9285  /* "View.MemoryView":194
9286  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9287  * info.buf = self.data
9288  * info.len = self.len # <<<<<<<<<<<<<<
9289  * info.ndim = self.ndim
9290  * info.shape = self._shape
9291  */
9292  __pyx_t_5 = __pyx_v_self->len;
9293  __pyx_v_info->len = __pyx_t_5;
9294 
9295  /* "View.MemoryView":195
9296  * info.buf = self.data
9297  * info.len = self.len
9298  * info.ndim = self.ndim # <<<<<<<<<<<<<<
9299  * info.shape = self._shape
9300  * info.strides = self._strides
9301  */
9302  __pyx_t_6 = __pyx_v_self->ndim;
9303  __pyx_v_info->ndim = __pyx_t_6;
9304 
9305  /* "View.MemoryView":196
9306  * info.len = self.len
9307  * info.ndim = self.ndim
9308  * info.shape = self._shape # <<<<<<<<<<<<<<
9309  * info.strides = self._strides
9310  * info.suboffsets = NULL
9311  */
9312  __pyx_t_7 = __pyx_v_self->_shape;
9313  __pyx_v_info->shape = __pyx_t_7;
9314 
9315  /* "View.MemoryView":197
9316  * info.ndim = self.ndim
9317  * info.shape = self._shape
9318  * info.strides = self._strides # <<<<<<<<<<<<<<
9319  * info.suboffsets = NULL
9320  * info.itemsize = self.itemsize
9321  */
9322  __pyx_t_7 = __pyx_v_self->_strides;
9323  __pyx_v_info->strides = __pyx_t_7;
9324 
9325  /* "View.MemoryView":198
9326  * info.shape = self._shape
9327  * info.strides = self._strides
9328  * info.suboffsets = NULL # <<<<<<<<<<<<<<
9329  * info.itemsize = self.itemsize
9330  * info.readonly = 0
9331  */
9332  __pyx_v_info->suboffsets = NULL;
9333 
9334  /* "View.MemoryView":199
9335  * info.strides = self._strides
9336  * info.suboffsets = NULL
9337  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
9338  * info.readonly = 0
9339  *
9340  */
9341  __pyx_t_5 = __pyx_v_self->itemsize;
9342  __pyx_v_info->itemsize = __pyx_t_5;
9343 
9344  /* "View.MemoryView":200
9345  * info.suboffsets = NULL
9346  * info.itemsize = self.itemsize
9347  * info.readonly = 0 # <<<<<<<<<<<<<<
9348  *
9349  * if flags & PyBUF_FORMAT:
9350  */
9351  __pyx_v_info->readonly = 0;
9352 
9353  /* "View.MemoryView":202
9354  * info.readonly = 0
9355  *
9356  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9357  * info.format = self.format
9358  * else:
9359  */
9360  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9361  if (__pyx_t_1) {
9362 
9363  /* "View.MemoryView":203
9364  *
9365  * if flags & PyBUF_FORMAT:
9366  * info.format = self.format # <<<<<<<<<<<<<<
9367  * else:
9368  * info.format = NULL
9369  */
9370  __pyx_t_4 = __pyx_v_self->format;
9371  __pyx_v_info->format = __pyx_t_4;
9372 
9373  /* "View.MemoryView":202
9374  * info.readonly = 0
9375  *
9376  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9377  * info.format = self.format
9378  * else:
9379  */
9380  goto __pyx_L5;
9381  }
9382 
9383  /* "View.MemoryView":205
9384  * info.format = self.format
9385  * else:
9386  * info.format = NULL # <<<<<<<<<<<<<<
9387  *
9388  * info.obj = self
9389  */
9390  /*else*/ {
9391  __pyx_v_info->format = NULL;
9392  }
9393  __pyx_L5:;
9394 
9395  /* "View.MemoryView":207
9396  * info.format = NULL
9397  *
9398  * info.obj = self # <<<<<<<<<<<<<<
9399  *
9400  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9401  */
9402  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9403  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9404  __Pyx_GOTREF(__pyx_v_info->obj);
9405  __Pyx_DECREF(__pyx_v_info->obj);
9406  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9407 
9408  /* "View.MemoryView":185
9409  *
9410  * @cname('getbuffer')
9411  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9412  * cdef int bufmode = -1
9413  * if self.mode == u"c":
9414  */
9415 
9416  /* function exit code */
9417  __pyx_r = 0;
9418  goto __pyx_L0;
9419  __pyx_L1_error:;
9420  __Pyx_XDECREF(__pyx_t_3);
9421  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9422  __pyx_r = -1;
9423  if (__pyx_v_info->obj != NULL) {
9424  __Pyx_GOTREF(__pyx_v_info->obj);
9425  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9426  }
9427  goto __pyx_L2;
9428  __pyx_L0:;
9429  if (__pyx_v_info->obj == Py_None) {
9430  __Pyx_GOTREF(__pyx_v_info->obj);
9431  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9432  }
9433  __pyx_L2:;
9434  __Pyx_RefNannyFinishContext();
9435  return __pyx_r;
9436 }
9437 
9438 /* "View.MemoryView":211
9439  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9440  *
9441  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9442  * if self.callback_free_data != NULL:
9443  * self.callback_free_data(self.data)
9444  */
9445 
9446 /* Python wrapper */
9447 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
9448 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9449  __Pyx_RefNannyDeclarations
9450  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9451  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
9452 
9453  /* function exit code */
9454  __Pyx_RefNannyFinishContext();
9455 }
9456 
9457 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
9458  __Pyx_RefNannyDeclarations
9459  int __pyx_t_1;
9460  __Pyx_RefNannySetupContext("__dealloc__", 0);
9461 
9462  /* "View.MemoryView":212
9463  *
9464  * def __dealloc__(array self):
9465  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9466  * self.callback_free_data(self.data)
9467  * elif self.free_data:
9468  */
9469  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9470  if (__pyx_t_1) {
9471 
9472  /* "View.MemoryView":213
9473  * def __dealloc__(array self):
9474  * if self.callback_free_data != NULL:
9475  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
9476  * elif self.free_data:
9477  * if self.dtype_is_object:
9478  */
9479  __pyx_v_self->callback_free_data(__pyx_v_self->data);
9480 
9481  /* "View.MemoryView":212
9482  *
9483  * def __dealloc__(array self):
9484  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9485  * self.callback_free_data(self.data)
9486  * elif self.free_data:
9487  */
9488  goto __pyx_L3;
9489  }
9490 
9491  /* "View.MemoryView":214
9492  * if self.callback_free_data != NULL:
9493  * self.callback_free_data(self.data)
9494  * elif self.free_data: # <<<<<<<<<<<<<<
9495  * if self.dtype_is_object:
9496  * refcount_objects_in_slice(self.data, self._shape,
9497  */
9498  __pyx_t_1 = (__pyx_v_self->free_data != 0);
9499  if (__pyx_t_1) {
9500 
9501  /* "View.MemoryView":215
9502  * self.callback_free_data(self.data)
9503  * elif self.free_data:
9504  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9505  * refcount_objects_in_slice(self.data, self._shape,
9506  * self._strides, self.ndim, False)
9507  */
9508  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9509  if (__pyx_t_1) {
9510 
9511  /* "View.MemoryView":216
9512  * elif self.free_data:
9513  * if self.dtype_is_object:
9514  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
9515  * self._strides, self.ndim, False)
9516  * free(self.data)
9517  */
9518  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9519 
9520  /* "View.MemoryView":215
9521  * self.callback_free_data(self.data)
9522  * elif self.free_data:
9523  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9524  * refcount_objects_in_slice(self.data, self._shape,
9525  * self._strides, self.ndim, False)
9526  */
9527  }
9528 
9529  /* "View.MemoryView":218
9530  * refcount_objects_in_slice(self.data, self._shape,
9531  * self._strides, self.ndim, False)
9532  * free(self.data) # <<<<<<<<<<<<<<
9533  * PyObject_Free(self._shape)
9534  *
9535  */
9536  free(__pyx_v_self->data);
9537 
9538  /* "View.MemoryView":214
9539  * if self.callback_free_data != NULL:
9540  * self.callback_free_data(self.data)
9541  * elif self.free_data: # <<<<<<<<<<<<<<
9542  * if self.dtype_is_object:
9543  * refcount_objects_in_slice(self.data, self._shape,
9544  */
9545  }
9546  __pyx_L3:;
9547 
9548  /* "View.MemoryView":219
9549  * self._strides, self.ndim, False)
9550  * free(self.data)
9551  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
9552  *
9553  * @property
9554  */
9555  PyObject_Free(__pyx_v_self->_shape);
9556 
9557  /* "View.MemoryView":211
9558  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9559  *
9560  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9561  * if self.callback_free_data != NULL:
9562  * self.callback_free_data(self.data)
9563  */
9564 
9565  /* function exit code */
9566  __Pyx_RefNannyFinishContext();
9567 }
9568 
9569 /* "View.MemoryView":222
9570  *
9571  * @property
9572  * def memview(self): # <<<<<<<<<<<<<<
9573  * return self.get_memview()
9574  *
9575  */
9576 
9577 /* Python wrapper */
9578 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
9579 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9580  PyObject *__pyx_r = 0;
9581  __Pyx_RefNannyDeclarations
9582  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9583  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
9584 
9585  /* function exit code */
9586  __Pyx_RefNannyFinishContext();
9587  return __pyx_r;
9588 }
9589 
9590 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
9591  PyObject *__pyx_r = NULL;
9592  __Pyx_RefNannyDeclarations
9593  PyObject *__pyx_t_1 = NULL;
9594  int __pyx_lineno = 0;
9595  const char *__pyx_filename = NULL;
9596  int __pyx_clineno = 0;
9597  __Pyx_RefNannySetupContext("__get__", 0);
9598 
9599  /* "View.MemoryView":223
9600  * @property
9601  * def memview(self):
9602  * return self.get_memview() # <<<<<<<<<<<<<<
9603  *
9604  * @cname('get_memview')
9605  */
9606  __Pyx_XDECREF(__pyx_r);
9607  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 223, __pyx_L1_error)
9608  __Pyx_GOTREF(__pyx_t_1);
9609  __pyx_r = __pyx_t_1;
9610  __pyx_t_1 = 0;
9611  goto __pyx_L0;
9612 
9613  /* "View.MemoryView":222
9614  *
9615  * @property
9616  * def memview(self): # <<<<<<<<<<<<<<
9617  * return self.get_memview()
9618  *
9619  */
9620 
9621  /* function exit code */
9622  __pyx_L1_error:;
9623  __Pyx_XDECREF(__pyx_t_1);
9624  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9625  __pyx_r = NULL;
9626  __pyx_L0:;
9627  __Pyx_XGIVEREF(__pyx_r);
9628  __Pyx_RefNannyFinishContext();
9629  return __pyx_r;
9630 }
9631 
9632 /* "View.MemoryView":226
9633  *
9634  * @cname('get_memview')
9635  * cdef get_memview(self): # <<<<<<<<<<<<<<
9636  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9637  * return memoryview(self, flags, self.dtype_is_object)
9638  */
9639 
9640 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
9641  int __pyx_v_flags;
9642  PyObject *__pyx_r = NULL;
9643  __Pyx_RefNannyDeclarations
9644  PyObject *__pyx_t_1 = NULL;
9645  PyObject *__pyx_t_2 = NULL;
9646  PyObject *__pyx_t_3 = NULL;
9647  int __pyx_lineno = 0;
9648  const char *__pyx_filename = NULL;
9649  int __pyx_clineno = 0;
9650  __Pyx_RefNannySetupContext("get_memview", 0);
9651 
9652  /* "View.MemoryView":227
9653  * @cname('get_memview')
9654  * cdef get_memview(self):
9655  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
9656  * return memoryview(self, flags, self.dtype_is_object)
9657  *
9658  */
9659  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9660 
9661  /* "View.MemoryView":228
9662  * cdef get_memview(self):
9663  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9664  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
9665  *
9666  * def __len__(self):
9667  */
9668  __Pyx_XDECREF(__pyx_r);
9669  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 228, __pyx_L1_error)
9670  __Pyx_GOTREF(__pyx_t_1);
9671  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
9672  __Pyx_GOTREF(__pyx_t_2);
9673  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 228, __pyx_L1_error)
9674  __Pyx_GOTREF(__pyx_t_3);
9675  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9676  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9677  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9678  __Pyx_GIVEREF(__pyx_t_1);
9679  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9680  __Pyx_GIVEREF(__pyx_t_2);
9681  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9682  __pyx_t_1 = 0;
9683  __pyx_t_2 = 0;
9684  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 228, __pyx_L1_error)
9685  __Pyx_GOTREF(__pyx_t_2);
9686  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9687  __pyx_r = __pyx_t_2;
9688  __pyx_t_2 = 0;
9689  goto __pyx_L0;
9690 
9691  /* "View.MemoryView":226
9692  *
9693  * @cname('get_memview')
9694  * cdef get_memview(self): # <<<<<<<<<<<<<<
9695  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9696  * return memoryview(self, flags, self.dtype_is_object)
9697  */
9698 
9699  /* function exit code */
9700  __pyx_L1_error:;
9701  __Pyx_XDECREF(__pyx_t_1);
9702  __Pyx_XDECREF(__pyx_t_2);
9703  __Pyx_XDECREF(__pyx_t_3);
9704  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9705  __pyx_r = 0;
9706  __pyx_L0:;
9707  __Pyx_XGIVEREF(__pyx_r);
9708  __Pyx_RefNannyFinishContext();
9709  return __pyx_r;
9710 }
9711 
9712 /* "View.MemoryView":230
9713  * return memoryview(self, flags, self.dtype_is_object)
9714  *
9715  * def __len__(self): # <<<<<<<<<<<<<<
9716  * return self._shape[0]
9717  *
9718  */
9719 
9720 /* Python wrapper */
9721 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
9722 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9723  Py_ssize_t __pyx_r;
9724  __Pyx_RefNannyDeclarations
9725  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
9726  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
9727 
9728  /* function exit code */
9729  __Pyx_RefNannyFinishContext();
9730  return __pyx_r;
9731 }
9732 
9733 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
9734  Py_ssize_t __pyx_r;
9735  __Pyx_RefNannyDeclarations
9736  __Pyx_RefNannySetupContext("__len__", 0);
9737 
9738  /* "View.MemoryView":231
9739  *
9740  * def __len__(self):
9741  * return self._shape[0] # <<<<<<<<<<<<<<
9742  *
9743  * def __getattr__(self, attr):
9744  */
9745  __pyx_r = (__pyx_v_self->_shape[0]);
9746  goto __pyx_L0;
9747 
9748  /* "View.MemoryView":230
9749  * return memoryview(self, flags, self.dtype_is_object)
9750  *
9751  * def __len__(self): # <<<<<<<<<<<<<<
9752  * return self._shape[0]
9753  *
9754  */
9755 
9756  /* function exit code */
9757  __pyx_L0:;
9758  __Pyx_RefNannyFinishContext();
9759  return __pyx_r;
9760 }
9761 
9762 /* "View.MemoryView":233
9763  * return self._shape[0]
9764  *
9765  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9766  * return getattr(self.memview, attr)
9767  *
9768  */
9769 
9770 /* Python wrapper */
9771 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
9772 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9773  PyObject *__pyx_r = 0;
9774  __Pyx_RefNannyDeclarations
9775  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
9776  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9777 
9778  /* function exit code */
9779  __Pyx_RefNannyFinishContext();
9780  return __pyx_r;
9781 }
9782 
9783 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9784  PyObject *__pyx_r = NULL;
9785  __Pyx_RefNannyDeclarations
9786  PyObject *__pyx_t_1 = NULL;
9787  PyObject *__pyx_t_2 = NULL;
9788  int __pyx_lineno = 0;
9789  const char *__pyx_filename = NULL;
9790  int __pyx_clineno = 0;
9791  __Pyx_RefNannySetupContext("__getattr__", 0);
9792 
9793  /* "View.MemoryView":234
9794  *
9795  * def __getattr__(self, attr):
9796  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
9797  *
9798  * def __getitem__(self, item):
9799  */
9800  __Pyx_XDECREF(__pyx_r);
9801  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 234, __pyx_L1_error)
9802  __Pyx_GOTREF(__pyx_t_1);
9803  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __pyx_L1_error)
9804  __Pyx_GOTREF(__pyx_t_2);
9805  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9806  __pyx_r = __pyx_t_2;
9807  __pyx_t_2 = 0;
9808  goto __pyx_L0;
9809 
9810  /* "View.MemoryView":233
9811  * return self._shape[0]
9812  *
9813  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9814  * return getattr(self.memview, attr)
9815  *
9816  */
9817 
9818  /* function exit code */
9819  __pyx_L1_error:;
9820  __Pyx_XDECREF(__pyx_t_1);
9821  __Pyx_XDECREF(__pyx_t_2);
9822  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9823  __pyx_r = NULL;
9824  __pyx_L0:;
9825  __Pyx_XGIVEREF(__pyx_r);
9826  __Pyx_RefNannyFinishContext();
9827  return __pyx_r;
9828 }
9829 
9830 /* "View.MemoryView":236
9831  * return getattr(self.memview, attr)
9832  *
9833  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9834  * return self.memview[item]
9835  *
9836  */
9837 
9838 /* Python wrapper */
9839 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
9840 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9841  PyObject *__pyx_r = 0;
9842  __Pyx_RefNannyDeclarations
9843  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9844  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9845 
9846  /* function exit code */
9847  __Pyx_RefNannyFinishContext();
9848  return __pyx_r;
9849 }
9850 
9851 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9852  PyObject *__pyx_r = NULL;
9853  __Pyx_RefNannyDeclarations
9854  PyObject *__pyx_t_1 = NULL;
9855  PyObject *__pyx_t_2 = NULL;
9856  int __pyx_lineno = 0;
9857  const char *__pyx_filename = NULL;
9858  int __pyx_clineno = 0;
9859  __Pyx_RefNannySetupContext("__getitem__", 0);
9860 
9861  /* "View.MemoryView":237
9862  *
9863  * def __getitem__(self, item):
9864  * return self.memview[item] # <<<<<<<<<<<<<<
9865  *
9866  * def __setitem__(self, item, value):
9867  */
9868  __Pyx_XDECREF(__pyx_r);
9869  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 237, __pyx_L1_error)
9870  __Pyx_GOTREF(__pyx_t_1);
9871  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 237, __pyx_L1_error)
9872  __Pyx_GOTREF(__pyx_t_2);
9873  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9874  __pyx_r = __pyx_t_2;
9875  __pyx_t_2 = 0;
9876  goto __pyx_L0;
9877 
9878  /* "View.MemoryView":236
9879  * return getattr(self.memview, attr)
9880  *
9881  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9882  * return self.memview[item]
9883  *
9884  */
9885 
9886  /* function exit code */
9887  __pyx_L1_error:;
9888  __Pyx_XDECREF(__pyx_t_1);
9889  __Pyx_XDECREF(__pyx_t_2);
9890  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9891  __pyx_r = NULL;
9892  __pyx_L0:;
9893  __Pyx_XGIVEREF(__pyx_r);
9894  __Pyx_RefNannyFinishContext();
9895  return __pyx_r;
9896 }
9897 
9898 /* "View.MemoryView":239
9899  * return self.memview[item]
9900  *
9901  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9902  * self.memview[item] = value
9903  *
9904  */
9905 
9906 /* Python wrapper */
9907 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
9908 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9909  int __pyx_r;
9910  __Pyx_RefNannyDeclarations
9911  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9912  __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));
9913 
9914  /* function exit code */
9915  __Pyx_RefNannyFinishContext();
9916  return __pyx_r;
9917 }
9918 
9919 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) {
9920  int __pyx_r;
9921  __Pyx_RefNannyDeclarations
9922  PyObject *__pyx_t_1 = NULL;
9923  int __pyx_lineno = 0;
9924  const char *__pyx_filename = NULL;
9925  int __pyx_clineno = 0;
9926  __Pyx_RefNannySetupContext("__setitem__", 0);
9927 
9928  /* "View.MemoryView":240
9929  *
9930  * def __setitem__(self, item, value):
9931  * self.memview[item] = value # <<<<<<<<<<<<<<
9932  *
9933  *
9934  */
9935  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 240, __pyx_L1_error)
9936  __Pyx_GOTREF(__pyx_t_1);
9937  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 240, __pyx_L1_error)
9938  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9939 
9940  /* "View.MemoryView":239
9941  * return self.memview[item]
9942  *
9943  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9944  * self.memview[item] = value
9945  *
9946  */
9947 
9948  /* function exit code */
9949  __pyx_r = 0;
9950  goto __pyx_L0;
9951  __pyx_L1_error:;
9952  __Pyx_XDECREF(__pyx_t_1);
9953  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9954  __pyx_r = -1;
9955  __pyx_L0:;
9956  __Pyx_RefNannyFinishContext();
9957  return __pyx_r;
9958 }
9959 
9960 /* "(tree fragment)":1
9961  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9962  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9963  * def __setstate_cython__(self, __pyx_state):
9964  */
9965 
9966 /* Python wrapper */
9967 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9968 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9969  PyObject *__pyx_r = 0;
9970  __Pyx_RefNannyDeclarations
9971  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9972  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
9973 
9974  /* function exit code */
9975  __Pyx_RefNannyFinishContext();
9976  return __pyx_r;
9977 }
9978 
9979 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
9980  PyObject *__pyx_r = NULL;
9981  __Pyx_RefNannyDeclarations
9982  PyObject *__pyx_t_1 = NULL;
9983  int __pyx_lineno = 0;
9984  const char *__pyx_filename = NULL;
9985  int __pyx_clineno = 0;
9986  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9987 
9988  /* "(tree fragment)":2
9989  * def __reduce_cython__(self):
9990  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9991  * def __setstate_cython__(self, __pyx_state):
9992  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9993  */
9994  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
9995  __Pyx_GOTREF(__pyx_t_1);
9996  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9997  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9998  __PYX_ERR(2, 2, __pyx_L1_error)
9999 
10000  /* "(tree fragment)":1
10001  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10002  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10003  * def __setstate_cython__(self, __pyx_state):
10004  */
10005 
10006  /* function exit code */
10007  __pyx_L1_error:;
10008  __Pyx_XDECREF(__pyx_t_1);
10009  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10010  __pyx_r = NULL;
10011  __Pyx_XGIVEREF(__pyx_r);
10012  __Pyx_RefNannyFinishContext();
10013  return __pyx_r;
10014 }
10015 
10016 /* "(tree fragment)":3
10017  * def __reduce_cython__(self):
10018  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10019  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10020  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10021  */
10022 
10023 /* Python wrapper */
10024 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10025 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10026  PyObject *__pyx_r = 0;
10027  __Pyx_RefNannyDeclarations
10028  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10029  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10030 
10031  /* function exit code */
10032  __Pyx_RefNannyFinishContext();
10033  return __pyx_r;
10034 }
10035 
10036 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) {
10037  PyObject *__pyx_r = NULL;
10038  __Pyx_RefNannyDeclarations
10039  PyObject *__pyx_t_1 = NULL;
10040  int __pyx_lineno = 0;
10041  const char *__pyx_filename = NULL;
10042  int __pyx_clineno = 0;
10043  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10044 
10045  /* "(tree fragment)":4
10046  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10047  * def __setstate_cython__(self, __pyx_state):
10048  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10049  */
10050  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
10051  __Pyx_GOTREF(__pyx_t_1);
10052  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10053  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10054  __PYX_ERR(2, 4, __pyx_L1_error)
10055 
10056  /* "(tree fragment)":3
10057  * def __reduce_cython__(self):
10058  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10059  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10060  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10061  */
10062 
10063  /* function exit code */
10064  __pyx_L1_error:;
10065  __Pyx_XDECREF(__pyx_t_1);
10066  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10067  __pyx_r = NULL;
10068  __Pyx_XGIVEREF(__pyx_r);
10069  __Pyx_RefNannyFinishContext();
10070  return __pyx_r;
10071 }
10072 
10073 /* "View.MemoryView":244
10074  *
10075  * @cname("__pyx_array_new")
10076  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10077  * char *mode, char *buf):
10078  * cdef array result
10079  */
10080 
10081 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) {
10082  struct __pyx_array_obj *__pyx_v_result = 0;
10083  struct __pyx_array_obj *__pyx_r = NULL;
10084  __Pyx_RefNannyDeclarations
10085  int __pyx_t_1;
10086  PyObject *__pyx_t_2 = NULL;
10087  PyObject *__pyx_t_3 = NULL;
10088  PyObject *__pyx_t_4 = NULL;
10089  PyObject *__pyx_t_5 = NULL;
10090  int __pyx_lineno = 0;
10091  const char *__pyx_filename = NULL;
10092  int __pyx_clineno = 0;
10093  __Pyx_RefNannySetupContext("array_cwrapper", 0);
10094 
10095  /* "View.MemoryView":248
10096  * cdef array result
10097  *
10098  * if buf == NULL: # <<<<<<<<<<<<<<
10099  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10100  * else:
10101  */
10102  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
10103  if (__pyx_t_1) {
10104 
10105  /* "View.MemoryView":249
10106  *
10107  * if buf == NULL:
10108  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
10109  * else:
10110  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10111  */
10112  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 249, __pyx_L1_error)
10113  __Pyx_GOTREF(__pyx_t_2);
10114  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 249, __pyx_L1_error)
10115  __Pyx_GOTREF(__pyx_t_3);
10116  __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(2, 249, __pyx_L1_error)
10117  __Pyx_GOTREF(__pyx_t_4);
10118  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 249, __pyx_L1_error)
10119  __Pyx_GOTREF(__pyx_t_5);
10120  __Pyx_INCREF(__pyx_v_shape);
10121  __Pyx_GIVEREF(__pyx_v_shape);
10122  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
10123  __Pyx_GIVEREF(__pyx_t_2);
10124  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
10125  __Pyx_GIVEREF(__pyx_t_3);
10126  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
10127  __Pyx_GIVEREF(__pyx_t_4);
10128  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
10129  __pyx_t_2 = 0;
10130  __pyx_t_3 = 0;
10131  __pyx_t_4 = 0;
10132  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 249, __pyx_L1_error)
10133  __Pyx_GOTREF(__pyx_t_4);
10134  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10135  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
10136  __pyx_t_4 = 0;
10137 
10138  /* "View.MemoryView":248
10139  * cdef array result
10140  *
10141  * if buf == NULL: # <<<<<<<<<<<<<<
10142  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10143  * else:
10144  */
10145  goto __pyx_L3;
10146  }
10147 
10148  /* "View.MemoryView":251
10149  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10150  * else:
10151  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10152  * allocate_buffer=False)
10153  * result.data = buf
10154  */
10155  /*else*/ {
10156  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 251, __pyx_L1_error)
10157  __Pyx_GOTREF(__pyx_t_4);
10158  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
10159  __Pyx_GOTREF(__pyx_t_5);
10160  __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(2, 251, __pyx_L1_error)
10161  __Pyx_GOTREF(__pyx_t_3);
10162  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 251, __pyx_L1_error)
10163  __Pyx_GOTREF(__pyx_t_2);
10164  __Pyx_INCREF(__pyx_v_shape);
10165  __Pyx_GIVEREF(__pyx_v_shape);
10166  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
10167  __Pyx_GIVEREF(__pyx_t_4);
10168  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
10169  __Pyx_GIVEREF(__pyx_t_5);
10170  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
10171  __Pyx_GIVEREF(__pyx_t_3);
10172  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
10173  __pyx_t_4 = 0;
10174  __pyx_t_5 = 0;
10175  __pyx_t_3 = 0;
10176 
10177  /* "View.MemoryView":252
10178  * else:
10179  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10180  * allocate_buffer=False) # <<<<<<<<<<<<<<
10181  * result.data = buf
10182  *
10183  */
10184  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 252, __pyx_L1_error)
10185  __Pyx_GOTREF(__pyx_t_3);
10186  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 252, __pyx_L1_error)
10187 
10188  /* "View.MemoryView":251
10189  * result = array(shape, itemsize, format, mode.decode('ASCII'))
10190  * else:
10191  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
10192  * allocate_buffer=False)
10193  * result.data = buf
10194  */
10195  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 251, __pyx_L1_error)
10196  __Pyx_GOTREF(__pyx_t_5);
10197  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10198  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10199  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
10200  __pyx_t_5 = 0;
10201 
10202  /* "View.MemoryView":253
10203  * result = array(shape, itemsize, format, mode.decode('ASCII'),
10204  * allocate_buffer=False)
10205  * result.data = buf # <<<<<<<<<<<<<<
10206  *
10207  * return result
10208  */
10209  __pyx_v_result->data = __pyx_v_buf;
10210  }
10211  __pyx_L3:;
10212 
10213  /* "View.MemoryView":255
10214  * result.data = buf
10215  *
10216  * return result # <<<<<<<<<<<<<<
10217  *
10218  *
10219  */
10220  __Pyx_XDECREF(((PyObject *)__pyx_r));
10221  __Pyx_INCREF(((PyObject *)__pyx_v_result));
10222  __pyx_r = __pyx_v_result;
10223  goto __pyx_L0;
10224 
10225  /* "View.MemoryView":244
10226  *
10227  * @cname("__pyx_array_new")
10228  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
10229  * char *mode, char *buf):
10230  * cdef array result
10231  */
10232 
10233  /* function exit code */
10234  __pyx_L1_error:;
10235  __Pyx_XDECREF(__pyx_t_2);
10236  __Pyx_XDECREF(__pyx_t_3);
10237  __Pyx_XDECREF(__pyx_t_4);
10238  __Pyx_XDECREF(__pyx_t_5);
10239  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
10240  __pyx_r = 0;
10241  __pyx_L0:;
10242  __Pyx_XDECREF((PyObject *)__pyx_v_result);
10243  __Pyx_XGIVEREF((PyObject *)__pyx_r);
10244  __Pyx_RefNannyFinishContext();
10245  return __pyx_r;
10246 }
10247 
10248 /* "View.MemoryView":281
10249  * cdef class Enum(object):
10250  * cdef object name
10251  * def __init__(self, name): # <<<<<<<<<<<<<<
10252  * self.name = name
10253  * def __repr__(self):
10254  */
10255 
10256 /* Python wrapper */
10257 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10258 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10259  PyObject *__pyx_v_name = 0;
10260  int __pyx_lineno = 0;
10261  const char *__pyx_filename = NULL;
10262  int __pyx_clineno = 0;
10263  int __pyx_r;
10264  __Pyx_RefNannyDeclarations
10265  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
10266  {
10267  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
10268  PyObject* values[1] = {0};
10269  if (unlikely(__pyx_kwds)) {
10270  Py_ssize_t kw_args;
10271  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10272  switch (pos_args) {
10273  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10274  CYTHON_FALLTHROUGH;
10275  case 0: break;
10276  default: goto __pyx_L5_argtuple_error;
10277  }
10278  kw_args = PyDict_Size(__pyx_kwds);
10279  switch (pos_args) {
10280  case 0:
10281  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10282  else goto __pyx_L5_argtuple_error;
10283  }
10284  if (unlikely(kw_args > 0)) {
10285  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 281, __pyx_L3_error)
10286  }
10287  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10288  goto __pyx_L5_argtuple_error;
10289  } else {
10290  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10291  }
10292  __pyx_v_name = values[0];
10293  }
10294  goto __pyx_L4_argument_unpacking_done;
10295  __pyx_L5_argtuple_error:;
10296  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 281, __pyx_L3_error)
10297  __pyx_L3_error:;
10298  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10299  __Pyx_RefNannyFinishContext();
10300  return -1;
10301  __pyx_L4_argument_unpacking_done:;
10302  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10303 
10304  /* function exit code */
10305  __Pyx_RefNannyFinishContext();
10306  return __pyx_r;
10307 }
10308 
10309 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10310  int __pyx_r;
10311  __Pyx_RefNannyDeclarations
10312  __Pyx_RefNannySetupContext("__init__", 0);
10313 
10314  /* "View.MemoryView":282
10315  * cdef object name
10316  * def __init__(self, name):
10317  * self.name = name # <<<<<<<<<<<<<<
10318  * def __repr__(self):
10319  * return self.name
10320  */
10321  __Pyx_INCREF(__pyx_v_name);
10322  __Pyx_GIVEREF(__pyx_v_name);
10323  __Pyx_GOTREF(__pyx_v_self->name);
10324  __Pyx_DECREF(__pyx_v_self->name);
10325  __pyx_v_self->name = __pyx_v_name;
10326 
10327  /* "View.MemoryView":281
10328  * cdef class Enum(object):
10329  * cdef object name
10330  * def __init__(self, name): # <<<<<<<<<<<<<<
10331  * self.name = name
10332  * def __repr__(self):
10333  */
10334 
10335  /* function exit code */
10336  __pyx_r = 0;
10337  __Pyx_RefNannyFinishContext();
10338  return __pyx_r;
10339 }
10340 
10341 /* "View.MemoryView":283
10342  * def __init__(self, name):
10343  * self.name = name
10344  * def __repr__(self): # <<<<<<<<<<<<<<
10345  * return self.name
10346  *
10347  */
10348 
10349 /* Python wrapper */
10350 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
10351 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10352  PyObject *__pyx_r = 0;
10353  __Pyx_RefNannyDeclarations
10354  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
10355  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10356 
10357  /* function exit code */
10358  __Pyx_RefNannyFinishContext();
10359  return __pyx_r;
10360 }
10361 
10362 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10363  PyObject *__pyx_r = NULL;
10364  __Pyx_RefNannyDeclarations
10365  __Pyx_RefNannySetupContext("__repr__", 0);
10366 
10367  /* "View.MemoryView":284
10368  * self.name = name
10369  * def __repr__(self):
10370  * return self.name # <<<<<<<<<<<<<<
10371  *
10372  * cdef generic = Enum("<strided and direct or indirect>")
10373  */
10374  __Pyx_XDECREF(__pyx_r);
10375  __Pyx_INCREF(__pyx_v_self->name);
10376  __pyx_r = __pyx_v_self->name;
10377  goto __pyx_L0;
10378 
10379  /* "View.MemoryView":283
10380  * def __init__(self, name):
10381  * self.name = name
10382  * def __repr__(self): # <<<<<<<<<<<<<<
10383  * return self.name
10384  *
10385  */
10386 
10387  /* function exit code */
10388  __pyx_L0:;
10389  __Pyx_XGIVEREF(__pyx_r);
10390  __Pyx_RefNannyFinishContext();
10391  return __pyx_r;
10392 }
10393 
10394 /* "(tree fragment)":1
10395  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10396  * cdef tuple state
10397  * cdef object _dict
10398  */
10399 
10400 /* Python wrapper */
10401 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10402 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10403  PyObject *__pyx_r = 0;
10404  __Pyx_RefNannyDeclarations
10405  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10406  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10407 
10408  /* function exit code */
10409  __Pyx_RefNannyFinishContext();
10410  return __pyx_r;
10411 }
10412 
10413 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10414  PyObject *__pyx_v_state = 0;
10415  PyObject *__pyx_v__dict = 0;
10416  int __pyx_v_use_setstate;
10417  PyObject *__pyx_r = NULL;
10418  __Pyx_RefNannyDeclarations
10419  PyObject *__pyx_t_1 = NULL;
10420  int __pyx_t_2;
10421  int __pyx_t_3;
10422  PyObject *__pyx_t_4 = NULL;
10423  PyObject *__pyx_t_5 = NULL;
10424  int __pyx_lineno = 0;
10425  const char *__pyx_filename = NULL;
10426  int __pyx_clineno = 0;
10427  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10428 
10429  /* "(tree fragment)":5
10430  * cdef object _dict
10431  * cdef bint use_setstate
10432  * state = (self.name,) # <<<<<<<<<<<<<<
10433  * _dict = getattr(self, '__dict__', None)
10434  * if _dict is not None:
10435  */
10436  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
10437  __Pyx_GOTREF(__pyx_t_1);
10438  __Pyx_INCREF(__pyx_v_self->name);
10439  __Pyx_GIVEREF(__pyx_v_self->name);
10440  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10441  __pyx_v_state = ((PyObject*)__pyx_t_1);
10442  __pyx_t_1 = 0;
10443 
10444  /* "(tree fragment)":6
10445  * cdef bint use_setstate
10446  * state = (self.name,)
10447  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
10448  * if _dict is not None:
10449  * state += (_dict,)
10450  */
10451  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
10452  __Pyx_GOTREF(__pyx_t_1);
10453  __pyx_v__dict = __pyx_t_1;
10454  __pyx_t_1 = 0;
10455 
10456  /* "(tree fragment)":7
10457  * state = (self.name,)
10458  * _dict = getattr(self, '__dict__', None)
10459  * if _dict is not None: # <<<<<<<<<<<<<<
10460  * state += (_dict,)
10461  * use_setstate = True
10462  */
10463  __pyx_t_2 = (__pyx_v__dict != Py_None);
10464  __pyx_t_3 = (__pyx_t_2 != 0);
10465  if (__pyx_t_3) {
10466 
10467  /* "(tree fragment)":8
10468  * _dict = getattr(self, '__dict__', None)
10469  * if _dict is not None:
10470  * state += (_dict,) # <<<<<<<<<<<<<<
10471  * use_setstate = True
10472  * else:
10473  */
10474  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
10475  __Pyx_GOTREF(__pyx_t_1);
10476  __Pyx_INCREF(__pyx_v__dict);
10477  __Pyx_GIVEREF(__pyx_v__dict);
10478  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10479  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
10480  __Pyx_GOTREF(__pyx_t_4);
10481  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10482  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10483  __pyx_t_4 = 0;
10484 
10485  /* "(tree fragment)":9
10486  * if _dict is not None:
10487  * state += (_dict,)
10488  * use_setstate = True # <<<<<<<<<<<<<<
10489  * else:
10490  * use_setstate = self.name is not None
10491  */
10492  __pyx_v_use_setstate = 1;
10493 
10494  /* "(tree fragment)":7
10495  * state = (self.name,)
10496  * _dict = getattr(self, '__dict__', None)
10497  * if _dict is not None: # <<<<<<<<<<<<<<
10498  * state += (_dict,)
10499  * use_setstate = True
10500  */
10501  goto __pyx_L3;
10502  }
10503 
10504  /* "(tree fragment)":11
10505  * use_setstate = True
10506  * else:
10507  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
10508  * if use_setstate:
10509  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10510  */
10511  /*else*/ {
10512  __pyx_t_3 = (__pyx_v_self->name != Py_None);
10513  __pyx_v_use_setstate = __pyx_t_3;
10514  }
10515  __pyx_L3:;
10516 
10517  /* "(tree fragment)":12
10518  * else:
10519  * use_setstate = self.name is not None
10520  * if use_setstate: # <<<<<<<<<<<<<<
10521  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10522  * else:
10523  */
10524  __pyx_t_3 = (__pyx_v_use_setstate != 0);
10525  if (__pyx_t_3) {
10526 
10527  /* "(tree fragment)":13
10528  * use_setstate = self.name is not None
10529  * if use_setstate:
10530  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
10531  * else:
10532  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10533  */
10534  __Pyx_XDECREF(__pyx_r);
10535  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
10536  __Pyx_GOTREF(__pyx_t_4);
10537  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
10538  __Pyx_GOTREF(__pyx_t_1);
10539  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10540  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10541  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10542  __Pyx_INCREF(__pyx_int_184977713);
10543  __Pyx_GIVEREF(__pyx_int_184977713);
10544  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10545  __Pyx_INCREF(Py_None);
10546  __Pyx_GIVEREF(Py_None);
10547  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10548  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
10549  __Pyx_GOTREF(__pyx_t_5);
10550  __Pyx_GIVEREF(__pyx_t_4);
10551  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10552  __Pyx_GIVEREF(__pyx_t_1);
10553  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10554  __Pyx_INCREF(__pyx_v_state);
10555  __Pyx_GIVEREF(__pyx_v_state);
10556  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10557  __pyx_t_4 = 0;
10558  __pyx_t_1 = 0;
10559  __pyx_r = __pyx_t_5;
10560  __pyx_t_5 = 0;
10561  goto __pyx_L0;
10562 
10563  /* "(tree fragment)":12
10564  * else:
10565  * use_setstate = self.name is not None
10566  * if use_setstate: # <<<<<<<<<<<<<<
10567  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10568  * else:
10569  */
10570  }
10571 
10572  /* "(tree fragment)":15
10573  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10574  * else:
10575  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
10576  * def __setstate_cython__(self, __pyx_state):
10577  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10578  */
10579  /*else*/ {
10580  __Pyx_XDECREF(__pyx_r);
10581  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
10582  __Pyx_GOTREF(__pyx_t_5);
10583  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
10584  __Pyx_GOTREF(__pyx_t_1);
10585  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10586  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10587  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10588  __Pyx_INCREF(__pyx_int_184977713);
10589  __Pyx_GIVEREF(__pyx_int_184977713);
10590  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10591  __Pyx_INCREF(__pyx_v_state);
10592  __Pyx_GIVEREF(__pyx_v_state);
10593  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10594  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
10595  __Pyx_GOTREF(__pyx_t_4);
10596  __Pyx_GIVEREF(__pyx_t_5);
10597  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10598  __Pyx_GIVEREF(__pyx_t_1);
10599  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10600  __pyx_t_5 = 0;
10601  __pyx_t_1 = 0;
10602  __pyx_r = __pyx_t_4;
10603  __pyx_t_4 = 0;
10604  goto __pyx_L0;
10605  }
10606 
10607  /* "(tree fragment)":1
10608  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10609  * cdef tuple state
10610  * cdef object _dict
10611  */
10612 
10613  /* function exit code */
10614  __pyx_L1_error:;
10615  __Pyx_XDECREF(__pyx_t_1);
10616  __Pyx_XDECREF(__pyx_t_4);
10617  __Pyx_XDECREF(__pyx_t_5);
10618  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10619  __pyx_r = NULL;
10620  __pyx_L0:;
10621  __Pyx_XDECREF(__pyx_v_state);
10622  __Pyx_XDECREF(__pyx_v__dict);
10623  __Pyx_XGIVEREF(__pyx_r);
10624  __Pyx_RefNannyFinishContext();
10625  return __pyx_r;
10626 }
10627 
10628 /* "(tree fragment)":16
10629  * else:
10630  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10631  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10632  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10633  */
10634 
10635 /* Python wrapper */
10636 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10637 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10638  PyObject *__pyx_r = 0;
10639  __Pyx_RefNannyDeclarations
10640  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10641  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10642 
10643  /* function exit code */
10644  __Pyx_RefNannyFinishContext();
10645  return __pyx_r;
10646 }
10647 
10648 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10649  PyObject *__pyx_r = NULL;
10650  __Pyx_RefNannyDeclarations
10651  PyObject *__pyx_t_1 = NULL;
10652  int __pyx_lineno = 0;
10653  const char *__pyx_filename = NULL;
10654  int __pyx_clineno = 0;
10655  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10656 
10657  /* "(tree fragment)":17
10658  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10659  * def __setstate_cython__(self, __pyx_state):
10660  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
10661  */
10662  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(2, 17, __pyx_L1_error)
10663  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
10664  __Pyx_GOTREF(__pyx_t_1);
10665  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10666 
10667  /* "(tree fragment)":16
10668  * else:
10669  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10670  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10671  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10672  */
10673 
10674  /* function exit code */
10675  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10676  goto __pyx_L0;
10677  __pyx_L1_error:;
10678  __Pyx_XDECREF(__pyx_t_1);
10679  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10680  __pyx_r = NULL;
10681  __pyx_L0:;
10682  __Pyx_XGIVEREF(__pyx_r);
10683  __Pyx_RefNannyFinishContext();
10684  return __pyx_r;
10685 }
10686 
10687 /* "View.MemoryView":298
10688  *
10689  * @cname('__pyx_align_pointer')
10690  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10691  * "Align pointer memory on a given boundary"
10692  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10693  */
10694 
10695 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
10696  Py_intptr_t __pyx_v_aligned_p;
10697  size_t __pyx_v_offset;
10698  void *__pyx_r;
10699  int __pyx_t_1;
10700 
10701  /* "View.MemoryView":300
10702  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
10703  * "Align pointer memory on a given boundary"
10704  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
10705  * cdef size_t offset
10706  *
10707  */
10708  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10709 
10710  /* "View.MemoryView":304
10711  *
10712  * with cython.cdivision(True):
10713  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
10714  *
10715  * if offset > 0:
10716  */
10717  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10718 
10719  /* "View.MemoryView":306
10720  * offset = aligned_p % alignment
10721  *
10722  * if offset > 0: # <<<<<<<<<<<<<<
10723  * aligned_p += alignment - offset
10724  *
10725  */
10726  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10727  if (__pyx_t_1) {
10728 
10729  /* "View.MemoryView":307
10730  *
10731  * if offset > 0:
10732  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
10733  *
10734  * return <void *> aligned_p
10735  */
10736  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10737 
10738  /* "View.MemoryView":306
10739  * offset = aligned_p % alignment
10740  *
10741  * if offset > 0: # <<<<<<<<<<<<<<
10742  * aligned_p += alignment - offset
10743  *
10744  */
10745  }
10746 
10747  /* "View.MemoryView":309
10748  * aligned_p += alignment - offset
10749  *
10750  * return <void *> aligned_p # <<<<<<<<<<<<<<
10751  *
10752  *
10753  */
10754  __pyx_r = ((void *)__pyx_v_aligned_p);
10755  goto __pyx_L0;
10756 
10757  /* "View.MemoryView":298
10758  *
10759  * @cname('__pyx_align_pointer')
10760  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10761  * "Align pointer memory on a given boundary"
10762  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10763  */
10764 
10765  /* function exit code */
10766  __pyx_L0:;
10767  return __pyx_r;
10768 }
10769 
10770 /* "View.MemoryView":345
10771  * cdef __Pyx_TypeInfo *typeinfo
10772  *
10773  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10774  * self.obj = obj
10775  * self.flags = flags
10776  */
10777 
10778 /* Python wrapper */
10779 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10780 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10781  PyObject *__pyx_v_obj = 0;
10782  int __pyx_v_flags;
10783  int __pyx_v_dtype_is_object;
10784  int __pyx_lineno = 0;
10785  const char *__pyx_filename = NULL;
10786  int __pyx_clineno = 0;
10787  int __pyx_r;
10788  __Pyx_RefNannyDeclarations
10789  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10790  {
10791  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10792  PyObject* values[3] = {0,0,0};
10793  if (unlikely(__pyx_kwds)) {
10794  Py_ssize_t kw_args;
10795  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10796  switch (pos_args) {
10797  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10798  CYTHON_FALLTHROUGH;
10799  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10800  CYTHON_FALLTHROUGH;
10801  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10802  CYTHON_FALLTHROUGH;
10803  case 0: break;
10804  default: goto __pyx_L5_argtuple_error;
10805  }
10806  kw_args = PyDict_Size(__pyx_kwds);
10807  switch (pos_args) {
10808  case 0:
10809  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10810  else goto __pyx_L5_argtuple_error;
10811  CYTHON_FALLTHROUGH;
10812  case 1:
10813  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10814  else {
10815  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 345, __pyx_L3_error)
10816  }
10817  CYTHON_FALLTHROUGH;
10818  case 2:
10819  if (kw_args > 0) {
10820  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10821  if (value) { values[2] = value; kw_args--; }
10822  }
10823  }
10824  if (unlikely(kw_args > 0)) {
10825  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 345, __pyx_L3_error)
10826  }
10827  } else {
10828  switch (PyTuple_GET_SIZE(__pyx_args)) {
10829  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10830  CYTHON_FALLTHROUGH;
10831  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10832  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10833  break;
10834  default: goto __pyx_L5_argtuple_error;
10835  }
10836  }
10837  __pyx_v_obj = values[0];
10838  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
10839  if (values[2]) {
10840  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 345, __pyx_L3_error)
10841  } else {
10842  __pyx_v_dtype_is_object = ((int)0);
10843  }
10844  }
10845  goto __pyx_L4_argument_unpacking_done;
10846  __pyx_L5_argtuple_error:;
10847  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 345, __pyx_L3_error)
10848  __pyx_L3_error:;
10849  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10850  __Pyx_RefNannyFinishContext();
10851  return -1;
10852  __pyx_L4_argument_unpacking_done:;
10853  __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);
10854 
10855  /* function exit code */
10856  __Pyx_RefNannyFinishContext();
10857  return __pyx_r;
10858 }
10859 
10860 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) {
10861  int __pyx_r;
10862  __Pyx_RefNannyDeclarations
10863  int __pyx_t_1;
10864  int __pyx_t_2;
10865  int __pyx_t_3;
10866  int __pyx_t_4;
10867  int __pyx_lineno = 0;
10868  const char *__pyx_filename = NULL;
10869  int __pyx_clineno = 0;
10870  __Pyx_RefNannySetupContext("__cinit__", 0);
10871 
10872  /* "View.MemoryView":346
10873  *
10874  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10875  * self.obj = obj # <<<<<<<<<<<<<<
10876  * self.flags = flags
10877  * if type(self) is memoryview or obj is not None:
10878  */
10879  __Pyx_INCREF(__pyx_v_obj);
10880  __Pyx_GIVEREF(__pyx_v_obj);
10881  __Pyx_GOTREF(__pyx_v_self->obj);
10882  __Pyx_DECREF(__pyx_v_self->obj);
10883  __pyx_v_self->obj = __pyx_v_obj;
10884 
10885  /* "View.MemoryView":347
10886  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10887  * self.obj = obj
10888  * self.flags = flags # <<<<<<<<<<<<<<
10889  * if type(self) is memoryview or obj is not None:
10890  * __Pyx_GetBuffer(obj, &self.view, flags)
10891  */
10892  __pyx_v_self->flags = __pyx_v_flags;
10893 
10894  /* "View.MemoryView":348
10895  * self.obj = obj
10896  * self.flags = flags
10897  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10898  * __Pyx_GetBuffer(obj, &self.view, flags)
10899  * if <PyObject *> self.view.obj == NULL:
10900  */
10901  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10902  __pyx_t_3 = (__pyx_t_2 != 0);
10903  if (!__pyx_t_3) {
10904  } else {
10905  __pyx_t_1 = __pyx_t_3;
10906  goto __pyx_L4_bool_binop_done;
10907  }
10908  __pyx_t_3 = (__pyx_v_obj != Py_None);
10909  __pyx_t_2 = (__pyx_t_3 != 0);
10910  __pyx_t_1 = __pyx_t_2;
10911  __pyx_L4_bool_binop_done:;
10912  if (__pyx_t_1) {
10913 
10914  /* "View.MemoryView":349
10915  * self.flags = flags
10916  * if type(self) is memoryview or obj is not None:
10917  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
10918  * if <PyObject *> self.view.obj == NULL:
10919  * (<__pyx_buffer *> &self.view).obj = Py_None
10920  */
10921  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 349, __pyx_L1_error)
10922 
10923  /* "View.MemoryView":350
10924  * if type(self) is memoryview or obj is not None:
10925  * __Pyx_GetBuffer(obj, &self.view, flags)
10926  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10927  * (<__pyx_buffer *> &self.view).obj = Py_None
10928  * Py_INCREF(Py_None)
10929  */
10930  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10931  if (__pyx_t_1) {
10932 
10933  /* "View.MemoryView":351
10934  * __Pyx_GetBuffer(obj, &self.view, flags)
10935  * if <PyObject *> self.view.obj == NULL:
10936  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
10937  * Py_INCREF(Py_None)
10938  *
10939  */
10940  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10941 
10942  /* "View.MemoryView":352
10943  * if <PyObject *> self.view.obj == NULL:
10944  * (<__pyx_buffer *> &self.view).obj = Py_None
10945  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
10946  *
10947  * global __pyx_memoryview_thread_locks_used
10948  */
10949  Py_INCREF(Py_None);
10950 
10951  /* "View.MemoryView":350
10952  * if type(self) is memoryview or obj is not None:
10953  * __Pyx_GetBuffer(obj, &self.view, flags)
10954  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10955  * (<__pyx_buffer *> &self.view).obj = Py_None
10956  * Py_INCREF(Py_None)
10957  */
10958  }
10959 
10960  /* "View.MemoryView":348
10961  * self.obj = obj
10962  * self.flags = flags
10963  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10964  * __Pyx_GetBuffer(obj, &self.view, flags)
10965  * if <PyObject *> self.view.obj == NULL:
10966  */
10967  }
10968 
10969  /* "View.MemoryView":355
10970  *
10971  * global __pyx_memoryview_thread_locks_used
10972  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10973  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10974  * __pyx_memoryview_thread_locks_used += 1
10975  */
10976  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10977  if (__pyx_t_1) {
10978 
10979  /* "View.MemoryView":356
10980  * global __pyx_memoryview_thread_locks_used
10981  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10982  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
10983  * __pyx_memoryview_thread_locks_used += 1
10984  * if self.lock is NULL:
10985  */
10986  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10987 
10988  /* "View.MemoryView":357
10989  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10990  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10991  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
10992  * if self.lock is NULL:
10993  * self.lock = PyThread_allocate_lock()
10994  */
10995  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10996 
10997  /* "View.MemoryView":355
10998  *
10999  * global __pyx_memoryview_thread_locks_used
11000  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
11001  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11002  * __pyx_memoryview_thread_locks_used += 1
11003  */
11004  }
11005 
11006  /* "View.MemoryView":358
11007  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11008  * __pyx_memoryview_thread_locks_used += 1
11009  * if self.lock is NULL: # <<<<<<<<<<<<<<
11010  * self.lock = PyThread_allocate_lock()
11011  * if self.lock is NULL:
11012  */
11013  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11014  if (__pyx_t_1) {
11015 
11016  /* "View.MemoryView":359
11017  * __pyx_memoryview_thread_locks_used += 1
11018  * if self.lock is NULL:
11019  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
11020  * if self.lock is NULL:
11021  * raise MemoryError
11022  */
11023  __pyx_v_self->lock = PyThread_allocate_lock();
11024 
11025  /* "View.MemoryView":360
11026  * if self.lock is NULL:
11027  * self.lock = PyThread_allocate_lock()
11028  * if self.lock is NULL: # <<<<<<<<<<<<<<
11029  * raise MemoryError
11030  *
11031  */
11032  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
11033  if (unlikely(__pyx_t_1)) {
11034 
11035  /* "View.MemoryView":361
11036  * self.lock = PyThread_allocate_lock()
11037  * if self.lock is NULL:
11038  * raise MemoryError # <<<<<<<<<<<<<<
11039  *
11040  * if flags & PyBUF_FORMAT:
11041  */
11042  PyErr_NoMemory(); __PYX_ERR(2, 361, __pyx_L1_error)
11043 
11044  /* "View.MemoryView":360
11045  * if self.lock is NULL:
11046  * self.lock = PyThread_allocate_lock()
11047  * if self.lock is NULL: # <<<<<<<<<<<<<<
11048  * raise MemoryError
11049  *
11050  */
11051  }
11052 
11053  /* "View.MemoryView":358
11054  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
11055  * __pyx_memoryview_thread_locks_used += 1
11056  * if self.lock is NULL: # <<<<<<<<<<<<<<
11057  * self.lock = PyThread_allocate_lock()
11058  * if self.lock is NULL:
11059  */
11060  }
11061 
11062  /* "View.MemoryView":363
11063  * raise MemoryError
11064  *
11065  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11066  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11067  * else:
11068  */
11069  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11070  if (__pyx_t_1) {
11071 
11072  /* "View.MemoryView":364
11073  *
11074  * if flags & PyBUF_FORMAT:
11075  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
11076  * else:
11077  * self.dtype_is_object = dtype_is_object
11078  */
11079  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
11080  if (__pyx_t_2) {
11081  } else {
11082  __pyx_t_1 = __pyx_t_2;
11083  goto __pyx_L11_bool_binop_done;
11084  }
11085  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
11086  __pyx_t_1 = __pyx_t_2;
11087  __pyx_L11_bool_binop_done:;
11088  __pyx_v_self->dtype_is_object = __pyx_t_1;
11089 
11090  /* "View.MemoryView":363
11091  * raise MemoryError
11092  *
11093  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11094  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11095  * else:
11096  */
11097  goto __pyx_L10;
11098  }
11099 
11100  /* "View.MemoryView":366
11101  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
11102  * else:
11103  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
11104  *
11105  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11106  */
11107  /*else*/ {
11108  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
11109  }
11110  __pyx_L10:;
11111 
11112  /* "View.MemoryView":368
11113  * self.dtype_is_object = dtype_is_object
11114  *
11115  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
11116  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11117  * self.typeinfo = NULL
11118  */
11119  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
11120 
11121  /* "View.MemoryView":370
11122  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
11123  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
11124  * self.typeinfo = NULL # <<<<<<<<<<<<<<
11125  *
11126  * def __dealloc__(memoryview self):
11127  */
11128  __pyx_v_self->typeinfo = NULL;
11129 
11130  /* "View.MemoryView":345
11131  * cdef __Pyx_TypeInfo *typeinfo
11132  *
11133  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
11134  * self.obj = obj
11135  * self.flags = flags
11136  */
11137 
11138  /* function exit code */
11139  __pyx_r = 0;
11140  goto __pyx_L0;
11141  __pyx_L1_error:;
11142  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11143  __pyx_r = -1;
11144  __pyx_L0:;
11145  __Pyx_RefNannyFinishContext();
11146  return __pyx_r;
11147 }
11148 
11149 /* "View.MemoryView":372
11150  * self.typeinfo = NULL
11151  *
11152  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11153  * if self.obj is not None:
11154  * __Pyx_ReleaseBuffer(&self.view)
11155  */
11156 
11157 /* Python wrapper */
11158 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
11159 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
11160  __Pyx_RefNannyDeclarations
11161  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
11162  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11163 
11164  /* function exit code */
11165  __Pyx_RefNannyFinishContext();
11166 }
11167 
11168 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
11169  int __pyx_v_i;
11170  __Pyx_RefNannyDeclarations
11171  int __pyx_t_1;
11172  int __pyx_t_2;
11173  int __pyx_t_3;
11174  int __pyx_t_4;
11175  int __pyx_t_5;
11176  PyThread_type_lock __pyx_t_6;
11177  PyThread_type_lock __pyx_t_7;
11178  __Pyx_RefNannySetupContext("__dealloc__", 0);
11179 
11180  /* "View.MemoryView":373
11181  *
11182  * def __dealloc__(memoryview self):
11183  * if self.obj is not None: # <<<<<<<<<<<<<<
11184  * __Pyx_ReleaseBuffer(&self.view)
11185  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11186  */
11187  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
11188  __pyx_t_2 = (__pyx_t_1 != 0);
11189  if (__pyx_t_2) {
11190 
11191  /* "View.MemoryView":374
11192  * def __dealloc__(memoryview self):
11193  * if self.obj is not None:
11194  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
11195  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11196  *
11197  */
11198  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
11199 
11200  /* "View.MemoryView":373
11201  *
11202  * def __dealloc__(memoryview self):
11203  * if self.obj is not None: # <<<<<<<<<<<<<<
11204  * __Pyx_ReleaseBuffer(&self.view)
11205  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11206  */
11207  goto __pyx_L3;
11208  }
11209 
11210  /* "View.MemoryView":375
11211  * if self.obj is not None:
11212  * __Pyx_ReleaseBuffer(&self.view)
11213  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
11214  *
11215  * (<__pyx_buffer *> &self.view).obj = NULL
11216  */
11217  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
11218  if (__pyx_t_2) {
11219 
11220  /* "View.MemoryView":377
11221  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
11222  *
11223  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
11224  * Py_DECREF(Py_None)
11225  *
11226  */
11227  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
11228 
11229  /* "View.MemoryView":378
11230  *
11231  * (<__pyx_buffer *> &self.view).obj = NULL
11232  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
11233  *
11234  * cdef int i
11235  */
11236  Py_DECREF(Py_None);
11237 
11238  /* "View.MemoryView":375
11239  * if self.obj is not None:
11240  * __Pyx_ReleaseBuffer(&self.view)
11241  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
11242  *
11243  * (<__pyx_buffer *> &self.view).obj = NULL
11244  */
11245  }
11246  __pyx_L3:;
11247 
11248  /* "View.MemoryView":382
11249  * cdef int i
11250  * global __pyx_memoryview_thread_locks_used
11251  * if self.lock != NULL: # <<<<<<<<<<<<<<
11252  * for i in range(__pyx_memoryview_thread_locks_used):
11253  * if __pyx_memoryview_thread_locks[i] is self.lock:
11254  */
11255  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
11256  if (__pyx_t_2) {
11257 
11258  /* "View.MemoryView":383
11259  * global __pyx_memoryview_thread_locks_used
11260  * if self.lock != NULL:
11261  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
11262  * if __pyx_memoryview_thread_locks[i] is self.lock:
11263  * __pyx_memoryview_thread_locks_used -= 1
11264  */
11265  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
11266  __pyx_t_4 = __pyx_t_3;
11267  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
11268  __pyx_v_i = __pyx_t_5;
11269 
11270  /* "View.MemoryView":384
11271  * if self.lock != NULL:
11272  * for i in range(__pyx_memoryview_thread_locks_used):
11273  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11274  * __pyx_memoryview_thread_locks_used -= 1
11275  * if i != __pyx_memoryview_thread_locks_used:
11276  */
11277  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11278  if (__pyx_t_2) {
11279 
11280  /* "View.MemoryView":385
11281  * for i in range(__pyx_memoryview_thread_locks_used):
11282  * if __pyx_memoryview_thread_locks[i] is self.lock:
11283  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
11284  * if i != __pyx_memoryview_thread_locks_used:
11285  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11286  */
11287  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11288 
11289  /* "View.MemoryView":386
11290  * if __pyx_memoryview_thread_locks[i] is self.lock:
11291  * __pyx_memoryview_thread_locks_used -= 1
11292  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11293  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11294  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11295  */
11296  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11297  if (__pyx_t_2) {
11298 
11299  /* "View.MemoryView":388
11300  * if i != __pyx_memoryview_thread_locks_used:
11301  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11302  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
11303  * break
11304  * else:
11305  */
11306  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11307  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11308 
11309  /* "View.MemoryView":387
11310  * __pyx_memoryview_thread_locks_used -= 1
11311  * if i != __pyx_memoryview_thread_locks_used:
11312  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
11313  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11314  * break
11315  */
11316  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11317  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11318 
11319  /* "View.MemoryView":386
11320  * if __pyx_memoryview_thread_locks[i] is self.lock:
11321  * __pyx_memoryview_thread_locks_used -= 1
11322  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11323  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11324  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11325  */
11326  }
11327 
11328  /* "View.MemoryView":389
11329  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11330  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11331  * break # <<<<<<<<<<<<<<
11332  * else:
11333  * PyThread_free_lock(self.lock)
11334  */
11335  goto __pyx_L6_break;
11336 
11337  /* "View.MemoryView":384
11338  * if self.lock != NULL:
11339  * for i in range(__pyx_memoryview_thread_locks_used):
11340  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11341  * __pyx_memoryview_thread_locks_used -= 1
11342  * if i != __pyx_memoryview_thread_locks_used:
11343  */
11344  }
11345  }
11346  /*else*/ {
11347 
11348  /* "View.MemoryView":391
11349  * break
11350  * else:
11351  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
11352  *
11353  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11354  */
11355  PyThread_free_lock(__pyx_v_self->lock);
11356  }
11357  __pyx_L6_break:;
11358 
11359  /* "View.MemoryView":382
11360  * cdef int i
11361  * global __pyx_memoryview_thread_locks_used
11362  * if self.lock != NULL: # <<<<<<<<<<<<<<
11363  * for i in range(__pyx_memoryview_thread_locks_used):
11364  * if __pyx_memoryview_thread_locks[i] is self.lock:
11365  */
11366  }
11367 
11368  /* "View.MemoryView":372
11369  * self.typeinfo = NULL
11370  *
11371  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11372  * if self.obj is not None:
11373  * __Pyx_ReleaseBuffer(&self.view)
11374  */
11375 
11376  /* function exit code */
11377  __Pyx_RefNannyFinishContext();
11378 }
11379 
11380 /* "View.MemoryView":393
11381  * PyThread_free_lock(self.lock)
11382  *
11383  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11384  * cdef Py_ssize_t dim
11385  * cdef char *itemp = <char *> self.view.buf
11386  */
11387 
11388 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11389  Py_ssize_t __pyx_v_dim;
11390  char *__pyx_v_itemp;
11391  PyObject *__pyx_v_idx = NULL;
11392  char *__pyx_r;
11393  __Pyx_RefNannyDeclarations
11394  Py_ssize_t __pyx_t_1;
11395  PyObject *__pyx_t_2 = NULL;
11396  Py_ssize_t __pyx_t_3;
11397  PyObject *(*__pyx_t_4)(PyObject *);
11398  PyObject *__pyx_t_5 = NULL;
11399  Py_ssize_t __pyx_t_6;
11400  char *__pyx_t_7;
11401  int __pyx_lineno = 0;
11402  const char *__pyx_filename = NULL;
11403  int __pyx_clineno = 0;
11404  __Pyx_RefNannySetupContext("get_item_pointer", 0);
11405 
11406  /* "View.MemoryView":395
11407  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11408  * cdef Py_ssize_t dim
11409  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
11410  *
11411  * for dim, idx in enumerate(index):
11412  */
11413  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
11414 
11415  /* "View.MemoryView":397
11416  * cdef char *itemp = <char *> self.view.buf
11417  *
11418  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11419  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11420  *
11421  */
11422  __pyx_t_1 = 0;
11423  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11424  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11425  __pyx_t_4 = NULL;
11426  } else {
11427  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 397, __pyx_L1_error)
11428  __Pyx_GOTREF(__pyx_t_2);
11429  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 397, __pyx_L1_error)
11430  }
11431  for (;;) {
11432  if (likely(!__pyx_t_4)) {
11433  if (likely(PyList_CheckExact(__pyx_t_2))) {
11434  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
11435  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11436  __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(2, 397, __pyx_L1_error)
11437  #else
11438  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
11439  __Pyx_GOTREF(__pyx_t_5);
11440  #endif
11441  } else {
11442  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11443  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11444  __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(2, 397, __pyx_L1_error)
11445  #else
11446  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 397, __pyx_L1_error)
11447  __Pyx_GOTREF(__pyx_t_5);
11448  #endif
11449  }
11450  } else {
11451  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11452  if (unlikely(!__pyx_t_5)) {
11453  PyObject* exc_type = PyErr_Occurred();
11454  if (exc_type) {
11455  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11456  else __PYX_ERR(2, 397, __pyx_L1_error)
11457  }
11458  break;
11459  }
11460  __Pyx_GOTREF(__pyx_t_5);
11461  }
11462  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11463  __pyx_t_5 = 0;
11464  __pyx_v_dim = __pyx_t_1;
11465  __pyx_t_1 = (__pyx_t_1 + 1);
11466 
11467  /* "View.MemoryView":398
11468  *
11469  * for dim, idx in enumerate(index):
11470  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
11471  *
11472  * return itemp
11473  */
11474  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 398, __pyx_L1_error)
11475  __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(2, 398, __pyx_L1_error)
11476  __pyx_v_itemp = __pyx_t_7;
11477 
11478  /* "View.MemoryView":397
11479  * cdef char *itemp = <char *> self.view.buf
11480  *
11481  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11482  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11483  *
11484  */
11485  }
11486  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11487 
11488  /* "View.MemoryView":400
11489  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11490  *
11491  * return itemp # <<<<<<<<<<<<<<
11492  *
11493  *
11494  */
11495  __pyx_r = __pyx_v_itemp;
11496  goto __pyx_L0;
11497 
11498  /* "View.MemoryView":393
11499  * PyThread_free_lock(self.lock)
11500  *
11501  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11502  * cdef Py_ssize_t dim
11503  * cdef char *itemp = <char *> self.view.buf
11504  */
11505 
11506  /* function exit code */
11507  __pyx_L1_error:;
11508  __Pyx_XDECREF(__pyx_t_2);
11509  __Pyx_XDECREF(__pyx_t_5);
11510  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11511  __pyx_r = NULL;
11512  __pyx_L0:;
11513  __Pyx_XDECREF(__pyx_v_idx);
11514  __Pyx_RefNannyFinishContext();
11515  return __pyx_r;
11516 }
11517 
11518 /* "View.MemoryView":403
11519  *
11520  *
11521  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11522  * if index is Ellipsis:
11523  * return self
11524  */
11525 
11526 /* Python wrapper */
11527 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
11528 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11529  PyObject *__pyx_r = 0;
11530  __Pyx_RefNannyDeclarations
11531  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
11532  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11533 
11534  /* function exit code */
11535  __Pyx_RefNannyFinishContext();
11536  return __pyx_r;
11537 }
11538 
11539 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11540  PyObject *__pyx_v_have_slices = NULL;
11541  PyObject *__pyx_v_indices = NULL;
11542  char *__pyx_v_itemp;
11543  PyObject *__pyx_r = NULL;
11544  __Pyx_RefNannyDeclarations
11545  int __pyx_t_1;
11546  int __pyx_t_2;
11547  PyObject *__pyx_t_3 = NULL;
11548  PyObject *__pyx_t_4 = NULL;
11549  PyObject *__pyx_t_5 = NULL;
11550  char *__pyx_t_6;
11551  int __pyx_lineno = 0;
11552  const char *__pyx_filename = NULL;
11553  int __pyx_clineno = 0;
11554  __Pyx_RefNannySetupContext("__getitem__", 0);
11555 
11556  /* "View.MemoryView":404
11557  *
11558  * def __getitem__(memoryview self, object index):
11559  * if index is Ellipsis: # <<<<<<<<<<<<<<
11560  * return self
11561  *
11562  */
11563  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11564  __pyx_t_2 = (__pyx_t_1 != 0);
11565  if (__pyx_t_2) {
11566 
11567  /* "View.MemoryView":405
11568  * def __getitem__(memoryview self, object index):
11569  * if index is Ellipsis:
11570  * return self # <<<<<<<<<<<<<<
11571  *
11572  * have_slices, indices = _unellipsify(index, self.view.ndim)
11573  */
11574  __Pyx_XDECREF(__pyx_r);
11575  __Pyx_INCREF(((PyObject *)__pyx_v_self));
11576  __pyx_r = ((PyObject *)__pyx_v_self);
11577  goto __pyx_L0;
11578 
11579  /* "View.MemoryView":404
11580  *
11581  * def __getitem__(memoryview self, object index):
11582  * if index is Ellipsis: # <<<<<<<<<<<<<<
11583  * return self
11584  *
11585  */
11586  }
11587 
11588  /* "View.MemoryView":407
11589  * return self
11590  *
11591  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11592  *
11593  * cdef char *itemp
11594  */
11595  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 407, __pyx_L1_error)
11596  __Pyx_GOTREF(__pyx_t_3);
11597  if (likely(__pyx_t_3 != Py_None)) {
11598  PyObject* sequence = __pyx_t_3;
11599  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11600  if (unlikely(size != 2)) {
11601  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11602  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11603  __PYX_ERR(2, 407, __pyx_L1_error)
11604  }
11605  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11606  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11607  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11608  __Pyx_INCREF(__pyx_t_4);
11609  __Pyx_INCREF(__pyx_t_5);
11610  #else
11611  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 407, __pyx_L1_error)
11612  __Pyx_GOTREF(__pyx_t_4);
11613  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 407, __pyx_L1_error)
11614  __Pyx_GOTREF(__pyx_t_5);
11615  #endif
11616  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11617  } else {
11618  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 407, __pyx_L1_error)
11619  }
11620  __pyx_v_have_slices = __pyx_t_4;
11621  __pyx_t_4 = 0;
11622  __pyx_v_indices = __pyx_t_5;
11623  __pyx_t_5 = 0;
11624 
11625  /* "View.MemoryView":410
11626  *
11627  * cdef char *itemp
11628  * if have_slices: # <<<<<<<<<<<<<<
11629  * return memview_slice(self, indices)
11630  * else:
11631  */
11632  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 410, __pyx_L1_error)
11633  if (__pyx_t_2) {
11634 
11635  /* "View.MemoryView":411
11636  * cdef char *itemp
11637  * if have_slices:
11638  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
11639  * else:
11640  * itemp = self.get_item_pointer(indices)
11641  */
11642  __Pyx_XDECREF(__pyx_r);
11643  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 411, __pyx_L1_error)
11644  __Pyx_GOTREF(__pyx_t_3);
11645  __pyx_r = __pyx_t_3;
11646  __pyx_t_3 = 0;
11647  goto __pyx_L0;
11648 
11649  /* "View.MemoryView":410
11650  *
11651  * cdef char *itemp
11652  * if have_slices: # <<<<<<<<<<<<<<
11653  * return memview_slice(self, indices)
11654  * else:
11655  */
11656  }
11657 
11658  /* "View.MemoryView":413
11659  * return memview_slice(self, indices)
11660  * else:
11661  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
11662  * return self.convert_item_to_object(itemp)
11663  *
11664  */
11665  /*else*/ {
11666  __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(2, 413, __pyx_L1_error)
11667  __pyx_v_itemp = __pyx_t_6;
11668 
11669  /* "View.MemoryView":414
11670  * else:
11671  * itemp = self.get_item_pointer(indices)
11672  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
11673  *
11674  * def __setitem__(memoryview self, object index, object value):
11675  */
11676  __Pyx_XDECREF(__pyx_r);
11677  __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(2, 414, __pyx_L1_error)
11678  __Pyx_GOTREF(__pyx_t_3);
11679  __pyx_r = __pyx_t_3;
11680  __pyx_t_3 = 0;
11681  goto __pyx_L0;
11682  }
11683 
11684  /* "View.MemoryView":403
11685  *
11686  *
11687  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11688  * if index is Ellipsis:
11689  * return self
11690  */
11691 
11692  /* function exit code */
11693  __pyx_L1_error:;
11694  __Pyx_XDECREF(__pyx_t_3);
11695  __Pyx_XDECREF(__pyx_t_4);
11696  __Pyx_XDECREF(__pyx_t_5);
11697  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11698  __pyx_r = NULL;
11699  __pyx_L0:;
11700  __Pyx_XDECREF(__pyx_v_have_slices);
11701  __Pyx_XDECREF(__pyx_v_indices);
11702  __Pyx_XGIVEREF(__pyx_r);
11703  __Pyx_RefNannyFinishContext();
11704  return __pyx_r;
11705 }
11706 
11707 /* "View.MemoryView":416
11708  * return self.convert_item_to_object(itemp)
11709  *
11710  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11711  * if self.view.readonly:
11712  * raise TypeError("Cannot assign to read-only memoryview")
11713  */
11714 
11715 /* Python wrapper */
11716 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
11717 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11718  int __pyx_r;
11719  __Pyx_RefNannyDeclarations
11720  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
11721  __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));
11722 
11723  /* function exit code */
11724  __Pyx_RefNannyFinishContext();
11725  return __pyx_r;
11726 }
11727 
11728 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) {
11729  PyObject *__pyx_v_have_slices = NULL;
11730  PyObject *__pyx_v_obj = NULL;
11731  int __pyx_r;
11732  __Pyx_RefNannyDeclarations
11733  int __pyx_t_1;
11734  PyObject *__pyx_t_2 = NULL;
11735  PyObject *__pyx_t_3 = NULL;
11736  PyObject *__pyx_t_4 = NULL;
11737  int __pyx_lineno = 0;
11738  const char *__pyx_filename = NULL;
11739  int __pyx_clineno = 0;
11740  __Pyx_RefNannySetupContext("__setitem__", 0);
11741  __Pyx_INCREF(__pyx_v_index);
11742 
11743  /* "View.MemoryView":417
11744  *
11745  * def __setitem__(memoryview self, object index, object value):
11746  * if self.view.readonly: # <<<<<<<<<<<<<<
11747  * raise TypeError("Cannot assign to read-only memoryview")
11748  *
11749  */
11750  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11751  if (unlikely(__pyx_t_1)) {
11752 
11753  /* "View.MemoryView":418
11754  * def __setitem__(memoryview self, object index, object value):
11755  * if self.view.readonly:
11756  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
11757  *
11758  * have_slices, index = _unellipsify(index, self.view.ndim)
11759  */
11760  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error)
11761  __Pyx_GOTREF(__pyx_t_2);
11762  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11763  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11764  __PYX_ERR(2, 418, __pyx_L1_error)
11765 
11766  /* "View.MemoryView":417
11767  *
11768  * def __setitem__(memoryview self, object index, object value):
11769  * if self.view.readonly: # <<<<<<<<<<<<<<
11770  * raise TypeError("Cannot assign to read-only memoryview")
11771  *
11772  */
11773  }
11774 
11775  /* "View.MemoryView":420
11776  * raise TypeError("Cannot assign to read-only memoryview")
11777  *
11778  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11779  *
11780  * if have_slices:
11781  */
11782  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error)
11783  __Pyx_GOTREF(__pyx_t_2);
11784  if (likely(__pyx_t_2 != Py_None)) {
11785  PyObject* sequence = __pyx_t_2;
11786  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11787  if (unlikely(size != 2)) {
11788  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11789  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11790  __PYX_ERR(2, 420, __pyx_L1_error)
11791  }
11792  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11793  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11794  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11795  __Pyx_INCREF(__pyx_t_3);
11796  __Pyx_INCREF(__pyx_t_4);
11797  #else
11798  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 420, __pyx_L1_error)
11799  __Pyx_GOTREF(__pyx_t_3);
11800  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 420, __pyx_L1_error)
11801  __Pyx_GOTREF(__pyx_t_4);
11802  #endif
11803  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11804  } else {
11805  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 420, __pyx_L1_error)
11806  }
11807  __pyx_v_have_slices = __pyx_t_3;
11808  __pyx_t_3 = 0;
11809  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11810  __pyx_t_4 = 0;
11811 
11812  /* "View.MemoryView":422
11813  * have_slices, index = _unellipsify(index, self.view.ndim)
11814  *
11815  * if have_slices: # <<<<<<<<<<<<<<
11816  * obj = self.is_slice(value)
11817  * if obj:
11818  */
11819  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 422, __pyx_L1_error)
11820  if (__pyx_t_1) {
11821 
11822  /* "View.MemoryView":423
11823  *
11824  * if have_slices:
11825  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
11826  * if obj:
11827  * self.setitem_slice_assignment(self[index], obj)
11828  */
11829  __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(2, 423, __pyx_L1_error)
11830  __Pyx_GOTREF(__pyx_t_2);
11831  __pyx_v_obj = __pyx_t_2;
11832  __pyx_t_2 = 0;
11833 
11834  /* "View.MemoryView":424
11835  * if have_slices:
11836  * obj = self.is_slice(value)
11837  * if obj: # <<<<<<<<<<<<<<
11838  * self.setitem_slice_assignment(self[index], obj)
11839  * else:
11840  */
11841  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 424, __pyx_L1_error)
11842  if (__pyx_t_1) {
11843 
11844  /* "View.MemoryView":425
11845  * obj = self.is_slice(value)
11846  * if obj:
11847  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
11848  * else:
11849  * self.setitem_slice_assign_scalar(self[index], value)
11850  */
11851  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 425, __pyx_L1_error)
11852  __Pyx_GOTREF(__pyx_t_2);
11853  __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(2, 425, __pyx_L1_error)
11854  __Pyx_GOTREF(__pyx_t_4);
11855  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11856  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11857 
11858  /* "View.MemoryView":424
11859  * if have_slices:
11860  * obj = self.is_slice(value)
11861  * if obj: # <<<<<<<<<<<<<<
11862  * self.setitem_slice_assignment(self[index], obj)
11863  * else:
11864  */
11865  goto __pyx_L5;
11866  }
11867 
11868  /* "View.MemoryView":427
11869  * self.setitem_slice_assignment(self[index], obj)
11870  * else:
11871  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
11872  * else:
11873  * self.setitem_indexed(index, value)
11874  */
11875  /*else*/ {
11876  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 427, __pyx_L1_error)
11877  __Pyx_GOTREF(__pyx_t_4);
11878  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 427, __pyx_L1_error)
11879  __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(2, 427, __pyx_L1_error)
11880  __Pyx_GOTREF(__pyx_t_2);
11881  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11882  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11883  }
11884  __pyx_L5:;
11885 
11886  /* "View.MemoryView":422
11887  * have_slices, index = _unellipsify(index, self.view.ndim)
11888  *
11889  * if have_slices: # <<<<<<<<<<<<<<
11890  * obj = self.is_slice(value)
11891  * if obj:
11892  */
11893  goto __pyx_L4;
11894  }
11895 
11896  /* "View.MemoryView":429
11897  * self.setitem_slice_assign_scalar(self[index], value)
11898  * else:
11899  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
11900  *
11901  * cdef is_slice(self, obj):
11902  */
11903  /*else*/ {
11904  __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(2, 429, __pyx_L1_error)
11905  __Pyx_GOTREF(__pyx_t_2);
11906  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11907  }
11908  __pyx_L4:;
11909 
11910  /* "View.MemoryView":416
11911  * return self.convert_item_to_object(itemp)
11912  *
11913  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11914  * if self.view.readonly:
11915  * raise TypeError("Cannot assign to read-only memoryview")
11916  */
11917 
11918  /* function exit code */
11919  __pyx_r = 0;
11920  goto __pyx_L0;
11921  __pyx_L1_error:;
11922  __Pyx_XDECREF(__pyx_t_2);
11923  __Pyx_XDECREF(__pyx_t_3);
11924  __Pyx_XDECREF(__pyx_t_4);
11925  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11926  __pyx_r = -1;
11927  __pyx_L0:;
11928  __Pyx_XDECREF(__pyx_v_have_slices);
11929  __Pyx_XDECREF(__pyx_v_obj);
11930  __Pyx_XDECREF(__pyx_v_index);
11931  __Pyx_RefNannyFinishContext();
11932  return __pyx_r;
11933 }
11934 
11935 /* "View.MemoryView":431
11936  * self.setitem_indexed(index, value)
11937  *
11938  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11939  * if not isinstance(obj, memoryview):
11940  * try:
11941  */
11942 
11943 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11944  PyObject *__pyx_r = NULL;
11945  __Pyx_RefNannyDeclarations
11946  int __pyx_t_1;
11947  int __pyx_t_2;
11948  PyObject *__pyx_t_3 = NULL;
11949  PyObject *__pyx_t_4 = NULL;
11950  PyObject *__pyx_t_5 = NULL;
11951  PyObject *__pyx_t_6 = NULL;
11952  PyObject *__pyx_t_7 = NULL;
11953  PyObject *__pyx_t_8 = NULL;
11954  int __pyx_t_9;
11955  int __pyx_lineno = 0;
11956  const char *__pyx_filename = NULL;
11957  int __pyx_clineno = 0;
11958  __Pyx_RefNannySetupContext("is_slice", 0);
11959  __Pyx_INCREF(__pyx_v_obj);
11960 
11961  /* "View.MemoryView":432
11962  *
11963  * cdef is_slice(self, obj):
11964  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11965  * try:
11966  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11967  */
11968  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11969  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11970  if (__pyx_t_2) {
11971 
11972  /* "View.MemoryView":433
11973  * cdef is_slice(self, obj):
11974  * if not isinstance(obj, memoryview):
11975  * try: # <<<<<<<<<<<<<<
11976  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11977  * self.dtype_is_object)
11978  */
11979  {
11980  __Pyx_PyThreadState_declare
11981  __Pyx_PyThreadState_assign
11982  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11983  __Pyx_XGOTREF(__pyx_t_3);
11984  __Pyx_XGOTREF(__pyx_t_4);
11985  __Pyx_XGOTREF(__pyx_t_5);
11986  /*try:*/ {
11987 
11988  /* "View.MemoryView":434
11989  * if not isinstance(obj, memoryview):
11990  * try:
11991  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11992  * self.dtype_is_object)
11993  * except TypeError:
11994  */
11995  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 434, __pyx_L4_error)
11996  __Pyx_GOTREF(__pyx_t_6);
11997 
11998  /* "View.MemoryView":435
11999  * try:
12000  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12001  * self.dtype_is_object) # <<<<<<<<<<<<<<
12002  * except TypeError:
12003  * return None
12004  */
12005  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 435, __pyx_L4_error)
12006  __Pyx_GOTREF(__pyx_t_7);
12007 
12008  /* "View.MemoryView":434
12009  * if not isinstance(obj, memoryview):
12010  * try:
12011  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
12012  * self.dtype_is_object)
12013  * except TypeError:
12014  */
12015  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 434, __pyx_L4_error)
12016  __Pyx_GOTREF(__pyx_t_8);
12017  __Pyx_INCREF(__pyx_v_obj);
12018  __Pyx_GIVEREF(__pyx_v_obj);
12019  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
12020  __Pyx_GIVEREF(__pyx_t_6);
12021  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
12022  __Pyx_GIVEREF(__pyx_t_7);
12023  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
12024  __pyx_t_6 = 0;
12025  __pyx_t_7 = 0;
12026  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 434, __pyx_L4_error)
12027  __Pyx_GOTREF(__pyx_t_7);
12028  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12029  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
12030  __pyx_t_7 = 0;
12031 
12032  /* "View.MemoryView":433
12033  * cdef is_slice(self, obj):
12034  * if not isinstance(obj, memoryview):
12035  * try: # <<<<<<<<<<<<<<
12036  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12037  * self.dtype_is_object)
12038  */
12039  }
12040  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12041  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12042  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12043  goto __pyx_L9_try_end;
12044  __pyx_L4_error:;
12045  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12046  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12047  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12048 
12049  /* "View.MemoryView":436
12050  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12051  * self.dtype_is_object)
12052  * except TypeError: # <<<<<<<<<<<<<<
12053  * return None
12054  *
12055  */
12056  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
12057  if (__pyx_t_9) {
12058  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12059  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 436, __pyx_L6_except_error)
12060  __Pyx_GOTREF(__pyx_t_7);
12061  __Pyx_GOTREF(__pyx_t_8);
12062  __Pyx_GOTREF(__pyx_t_6);
12063 
12064  /* "View.MemoryView":437
12065  * self.dtype_is_object)
12066  * except TypeError:
12067  * return None # <<<<<<<<<<<<<<
12068  *
12069  * return obj
12070  */
12071  __Pyx_XDECREF(__pyx_r);
12072  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12073  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12074  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12075  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12076  goto __pyx_L7_except_return;
12077  }
12078  goto __pyx_L6_except_error;
12079  __pyx_L6_except_error:;
12080 
12081  /* "View.MemoryView":433
12082  * cdef is_slice(self, obj):
12083  * if not isinstance(obj, memoryview):
12084  * try: # <<<<<<<<<<<<<<
12085  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12086  * self.dtype_is_object)
12087  */
12088  __Pyx_XGIVEREF(__pyx_t_3);
12089  __Pyx_XGIVEREF(__pyx_t_4);
12090  __Pyx_XGIVEREF(__pyx_t_5);
12091  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12092  goto __pyx_L1_error;
12093  __pyx_L7_except_return:;
12094  __Pyx_XGIVEREF(__pyx_t_3);
12095  __Pyx_XGIVEREF(__pyx_t_4);
12096  __Pyx_XGIVEREF(__pyx_t_5);
12097  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12098  goto __pyx_L0;
12099  __pyx_L9_try_end:;
12100  }
12101 
12102  /* "View.MemoryView":432
12103  *
12104  * cdef is_slice(self, obj):
12105  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
12106  * try:
12107  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
12108  */
12109  }
12110 
12111  /* "View.MemoryView":439
12112  * return None
12113  *
12114  * return obj # <<<<<<<<<<<<<<
12115  *
12116  * cdef setitem_slice_assignment(self, dst, src):
12117  */
12118  __Pyx_XDECREF(__pyx_r);
12119  __Pyx_INCREF(__pyx_v_obj);
12120  __pyx_r = __pyx_v_obj;
12121  goto __pyx_L0;
12122 
12123  /* "View.MemoryView":431
12124  * self.setitem_indexed(index, value)
12125  *
12126  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
12127  * if not isinstance(obj, memoryview):
12128  * try:
12129  */
12130 
12131  /* function exit code */
12132  __pyx_L1_error:;
12133  __Pyx_XDECREF(__pyx_t_6);
12134  __Pyx_XDECREF(__pyx_t_7);
12135  __Pyx_XDECREF(__pyx_t_8);
12136  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
12137  __pyx_r = 0;
12138  __pyx_L0:;
12139  __Pyx_XDECREF(__pyx_v_obj);
12140  __Pyx_XGIVEREF(__pyx_r);
12141  __Pyx_RefNannyFinishContext();
12142  return __pyx_r;
12143 }
12144 
12145 /* "View.MemoryView":441
12146  * return obj
12147  *
12148  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12149  * cdef __Pyx_memviewslice dst_slice
12150  * cdef __Pyx_memviewslice src_slice
12151  */
12152 
12153 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
12154  __Pyx_memviewslice __pyx_v_dst_slice;
12155  __Pyx_memviewslice __pyx_v_src_slice;
12156  PyObject *__pyx_r = NULL;
12157  __Pyx_RefNannyDeclarations
12158  __Pyx_memviewslice *__pyx_t_1;
12159  __Pyx_memviewslice *__pyx_t_2;
12160  PyObject *__pyx_t_3 = NULL;
12161  int __pyx_t_4;
12162  int __pyx_t_5;
12163  int __pyx_t_6;
12164  int __pyx_lineno = 0;
12165  const char *__pyx_filename = NULL;
12166  int __pyx_clineno = 0;
12167  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
12168 
12169  /* "View.MemoryView":445
12170  * cdef __Pyx_memviewslice src_slice
12171  *
12172  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12173  * get_slice_from_memview(dst, &dst_slice)[0],
12174  * src.ndim, dst.ndim, self.dtype_is_object)
12175  */
12176  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 445, __pyx_L1_error)
12177  __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(2, 445, __pyx_L1_error)
12178 
12179  /* "View.MemoryView":446
12180  *
12181  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12182  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
12183  * src.ndim, dst.ndim, self.dtype_is_object)
12184  *
12185  */
12186  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 446, __pyx_L1_error)
12187  __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(2, 446, __pyx_L1_error)
12188 
12189  /* "View.MemoryView":447
12190  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
12191  * get_slice_from_memview(dst, &dst_slice)[0],
12192  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
12193  *
12194  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12195  */
12196  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
12197  __Pyx_GOTREF(__pyx_t_3);
12198  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
12199  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12200  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 447, __pyx_L1_error)
12201  __Pyx_GOTREF(__pyx_t_3);
12202  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 447, __pyx_L1_error)
12203  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12204 
12205  /* "View.MemoryView":445
12206  * cdef __Pyx_memviewslice src_slice
12207  *
12208  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
12209  * get_slice_from_memview(dst, &dst_slice)[0],
12210  * src.ndim, dst.ndim, self.dtype_is_object)
12211  */
12212  __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(2, 445, __pyx_L1_error)
12213 
12214  /* "View.MemoryView":441
12215  * return obj
12216  *
12217  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
12218  * cdef __Pyx_memviewslice dst_slice
12219  * cdef __Pyx_memviewslice src_slice
12220  */
12221 
12222  /* function exit code */
12223  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12224  goto __pyx_L0;
12225  __pyx_L1_error:;
12226  __Pyx_XDECREF(__pyx_t_3);
12227  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
12228  __pyx_r = 0;
12229  __pyx_L0:;
12230  __Pyx_XGIVEREF(__pyx_r);
12231  __Pyx_RefNannyFinishContext();
12232  return __pyx_r;
12233 }
12234 
12235 /* "View.MemoryView":449
12236  * src.ndim, dst.ndim, self.dtype_is_object)
12237  *
12238  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12239  * cdef int array[128]
12240  * cdef void *tmp = NULL
12241  */
12242 
12243 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) {
12244  int __pyx_v_array[0x80];
12245  void *__pyx_v_tmp;
12246  void *__pyx_v_item;
12247  __Pyx_memviewslice *__pyx_v_dst_slice;
12248  __Pyx_memviewslice __pyx_v_tmp_slice;
12249  PyObject *__pyx_r = NULL;
12250  __Pyx_RefNannyDeclarations
12251  __Pyx_memviewslice *__pyx_t_1;
12252  int __pyx_t_2;
12253  PyObject *__pyx_t_3 = NULL;
12254  int __pyx_t_4;
12255  int __pyx_t_5;
12256  char const *__pyx_t_6;
12257  PyObject *__pyx_t_7 = NULL;
12258  PyObject *__pyx_t_8 = NULL;
12259  PyObject *__pyx_t_9 = NULL;
12260  PyObject *__pyx_t_10 = NULL;
12261  PyObject *__pyx_t_11 = NULL;
12262  PyObject *__pyx_t_12 = NULL;
12263  int __pyx_lineno = 0;
12264  const char *__pyx_filename = NULL;
12265  int __pyx_clineno = 0;
12266  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
12267 
12268  /* "View.MemoryView":451
12269  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12270  * cdef int array[128]
12271  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
12272  * cdef void *item
12273  *
12274  */
12275  __pyx_v_tmp = NULL;
12276 
12277  /* "View.MemoryView":456
12278  * cdef __Pyx_memviewslice *dst_slice
12279  * cdef __Pyx_memviewslice tmp_slice
12280  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
12281  *
12282  * if <size_t>self.view.itemsize > sizeof(array):
12283  */
12284  __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(2, 456, __pyx_L1_error)
12285  __pyx_v_dst_slice = __pyx_t_1;
12286 
12287  /* "View.MemoryView":458
12288  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12289  *
12290  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12291  * tmp = PyMem_Malloc(self.view.itemsize)
12292  * if tmp == NULL:
12293  */
12294  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
12295  if (__pyx_t_2) {
12296 
12297  /* "View.MemoryView":459
12298  *
12299  * if <size_t>self.view.itemsize > sizeof(array):
12300  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
12301  * if tmp == NULL:
12302  * raise MemoryError
12303  */
12304  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12305 
12306  /* "View.MemoryView":460
12307  * if <size_t>self.view.itemsize > sizeof(array):
12308  * tmp = PyMem_Malloc(self.view.itemsize)
12309  * if tmp == NULL: # <<<<<<<<<<<<<<
12310  * raise MemoryError
12311  * item = tmp
12312  */
12313  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
12314  if (unlikely(__pyx_t_2)) {
12315 
12316  /* "View.MemoryView":461
12317  * tmp = PyMem_Malloc(self.view.itemsize)
12318  * if tmp == NULL:
12319  * raise MemoryError # <<<<<<<<<<<<<<
12320  * item = tmp
12321  * else:
12322  */
12323  PyErr_NoMemory(); __PYX_ERR(2, 461, __pyx_L1_error)
12324 
12325  /* "View.MemoryView":460
12326  * if <size_t>self.view.itemsize > sizeof(array):
12327  * tmp = PyMem_Malloc(self.view.itemsize)
12328  * if tmp == NULL: # <<<<<<<<<<<<<<
12329  * raise MemoryError
12330  * item = tmp
12331  */
12332  }
12333 
12334  /* "View.MemoryView":462
12335  * if tmp == NULL:
12336  * raise MemoryError
12337  * item = tmp # <<<<<<<<<<<<<<
12338  * else:
12339  * item = <void *> array
12340  */
12341  __pyx_v_item = __pyx_v_tmp;
12342 
12343  /* "View.MemoryView":458
12344  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12345  *
12346  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12347  * tmp = PyMem_Malloc(self.view.itemsize)
12348  * if tmp == NULL:
12349  */
12350  goto __pyx_L3;
12351  }
12352 
12353  /* "View.MemoryView":464
12354  * item = tmp
12355  * else:
12356  * item = <void *> array # <<<<<<<<<<<<<<
12357  *
12358  * try:
12359  */
12360  /*else*/ {
12361  __pyx_v_item = ((void *)__pyx_v_array);
12362  }
12363  __pyx_L3:;
12364 
12365  /* "View.MemoryView":466
12366  * item = <void *> array
12367  *
12368  * try: # <<<<<<<<<<<<<<
12369  * if self.dtype_is_object:
12370  * (<PyObject **> item)[0] = <PyObject *> value
12371  */
12372  /*try:*/ {
12373 
12374  /* "View.MemoryView":467
12375  *
12376  * try:
12377  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12378  * (<PyObject **> item)[0] = <PyObject *> value
12379  * else:
12380  */
12381  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
12382  if (__pyx_t_2) {
12383 
12384  /* "View.MemoryView":468
12385  * try:
12386  * if self.dtype_is_object:
12387  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
12388  * else:
12389  * self.assign_item_from_object(<char *> item, value)
12390  */
12391  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12392 
12393  /* "View.MemoryView":467
12394  *
12395  * try:
12396  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12397  * (<PyObject **> item)[0] = <PyObject *> value
12398  * else:
12399  */
12400  goto __pyx_L8;
12401  }
12402 
12403  /* "View.MemoryView":470
12404  * (<PyObject **> item)[0] = <PyObject *> value
12405  * else:
12406  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
12407  *
12408  *
12409  */
12410  /*else*/ {
12411  __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(2, 470, __pyx_L6_error)
12412  __Pyx_GOTREF(__pyx_t_3);
12413  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12414  }
12415  __pyx_L8:;
12416 
12417  /* "View.MemoryView":474
12418  *
12419  *
12420  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12421  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12422  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12423  */
12424  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12425  if (__pyx_t_2) {
12426 
12427  /* "View.MemoryView":475
12428  *
12429  * if self.view.suboffsets != NULL:
12430  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
12431  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12432  * item, self.dtype_is_object)
12433  */
12434  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 475, __pyx_L6_error)
12435  __Pyx_GOTREF(__pyx_t_3);
12436  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12437 
12438  /* "View.MemoryView":474
12439  *
12440  *
12441  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12442  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12443  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12444  */
12445  }
12446 
12447  /* "View.MemoryView":476
12448  * if self.view.suboffsets != NULL:
12449  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12450  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
12451  * item, self.dtype_is_object)
12452  * finally:
12453  */
12454  __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);
12455  }
12456 
12457  /* "View.MemoryView":479
12458  * item, self.dtype_is_object)
12459  * finally:
12460  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
12461  *
12462  * cdef setitem_indexed(self, index, value):
12463  */
12464  /*finally:*/ {
12465  /*normal exit:*/{
12466  PyMem_Free(__pyx_v_tmp);
12467  goto __pyx_L7;
12468  }
12469  __pyx_L6_error:;
12470  /*exception exit:*/{
12471  __Pyx_PyThreadState_declare
12472  __Pyx_PyThreadState_assign
12473  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12474  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12475  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
12476  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);
12477  __Pyx_XGOTREF(__pyx_t_7);
12478  __Pyx_XGOTREF(__pyx_t_8);
12479  __Pyx_XGOTREF(__pyx_t_9);
12480  __Pyx_XGOTREF(__pyx_t_10);
12481  __Pyx_XGOTREF(__pyx_t_11);
12482  __Pyx_XGOTREF(__pyx_t_12);
12483  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
12484  {
12485  PyMem_Free(__pyx_v_tmp);
12486  }
12487  if (PY_MAJOR_VERSION >= 3) {
12488  __Pyx_XGIVEREF(__pyx_t_10);
12489  __Pyx_XGIVEREF(__pyx_t_11);
12490  __Pyx_XGIVEREF(__pyx_t_12);
12491  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
12492  }
12493  __Pyx_XGIVEREF(__pyx_t_7);
12494  __Pyx_XGIVEREF(__pyx_t_8);
12495  __Pyx_XGIVEREF(__pyx_t_9);
12496  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
12497  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12498  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
12499  goto __pyx_L1_error;
12500  }
12501  __pyx_L7:;
12502  }
12503 
12504  /* "View.MemoryView":449
12505  * src.ndim, dst.ndim, self.dtype_is_object)
12506  *
12507  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12508  * cdef int array[128]
12509  * cdef void *tmp = NULL
12510  */
12511 
12512  /* function exit code */
12513  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12514  goto __pyx_L0;
12515  __pyx_L1_error:;
12516  __Pyx_XDECREF(__pyx_t_3);
12517  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12518  __pyx_r = 0;
12519  __pyx_L0:;
12520  __Pyx_XGIVEREF(__pyx_r);
12521  __Pyx_RefNannyFinishContext();
12522  return __pyx_r;
12523 }
12524 
12525 /* "View.MemoryView":481
12526  * PyMem_Free(tmp)
12527  *
12528  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12529  * cdef char *itemp = self.get_item_pointer(index)
12530  * self.assign_item_from_object(itemp, value)
12531  */
12532 
12533 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12534  char *__pyx_v_itemp;
12535  PyObject *__pyx_r = NULL;
12536  __Pyx_RefNannyDeclarations
12537  char *__pyx_t_1;
12538  PyObject *__pyx_t_2 = NULL;
12539  int __pyx_lineno = 0;
12540  const char *__pyx_filename = NULL;
12541  int __pyx_clineno = 0;
12542  __Pyx_RefNannySetupContext("setitem_indexed", 0);
12543 
12544  /* "View.MemoryView":482
12545  *
12546  * cdef setitem_indexed(self, index, value):
12547  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
12548  * self.assign_item_from_object(itemp, value)
12549  *
12550  */
12551  __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(2, 482, __pyx_L1_error)
12552  __pyx_v_itemp = __pyx_t_1;
12553 
12554  /* "View.MemoryView":483
12555  * cdef setitem_indexed(self, index, value):
12556  * cdef char *itemp = self.get_item_pointer(index)
12557  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
12558  *
12559  * cdef convert_item_to_object(self, char *itemp):
12560  */
12561  __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(2, 483, __pyx_L1_error)
12562  __Pyx_GOTREF(__pyx_t_2);
12563  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12564 
12565  /* "View.MemoryView":481
12566  * PyMem_Free(tmp)
12567  *
12568  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12569  * cdef char *itemp = self.get_item_pointer(index)
12570  * self.assign_item_from_object(itemp, value)
12571  */
12572 
12573  /* function exit code */
12574  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12575  goto __pyx_L0;
12576  __pyx_L1_error:;
12577  __Pyx_XDECREF(__pyx_t_2);
12578  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12579  __pyx_r = 0;
12580  __pyx_L0:;
12581  __Pyx_XGIVEREF(__pyx_r);
12582  __Pyx_RefNannyFinishContext();
12583  return __pyx_r;
12584 }
12585 
12586 /* "View.MemoryView":485
12587  * self.assign_item_from_object(itemp, value)
12588  *
12589  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12590  * """Only used if instantiated manually by the user, or if Cython doesn't
12591  * know how to convert the type"""
12592  */
12593 
12594 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
12595  PyObject *__pyx_v_struct = NULL;
12596  PyObject *__pyx_v_bytesitem = 0;
12597  PyObject *__pyx_v_result = NULL;
12598  PyObject *__pyx_r = NULL;
12599  __Pyx_RefNannyDeclarations
12600  PyObject *__pyx_t_1 = NULL;
12601  PyObject *__pyx_t_2 = NULL;
12602  PyObject *__pyx_t_3 = NULL;
12603  PyObject *__pyx_t_4 = NULL;
12604  PyObject *__pyx_t_5 = NULL;
12605  PyObject *__pyx_t_6 = NULL;
12606  PyObject *__pyx_t_7 = NULL;
12607  int __pyx_t_8;
12608  PyObject *__pyx_t_9 = NULL;
12609  size_t __pyx_t_10;
12610  int __pyx_t_11;
12611  int __pyx_lineno = 0;
12612  const char *__pyx_filename = NULL;
12613  int __pyx_clineno = 0;
12614  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
12615 
12616  /* "View.MemoryView":488
12617  * """Only used if instantiated manually by the user, or if Cython doesn't
12618  * know how to convert the type"""
12619  * import struct # <<<<<<<<<<<<<<
12620  * cdef bytes bytesitem
12621  *
12622  */
12623  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L1_error)
12624  __Pyx_GOTREF(__pyx_t_1);
12625  __pyx_v_struct = __pyx_t_1;
12626  __pyx_t_1 = 0;
12627 
12628  /* "View.MemoryView":491
12629  * cdef bytes bytesitem
12630  *
12631  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
12632  * try:
12633  * result = struct.unpack(self.view.format, bytesitem)
12634  */
12635  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 491, __pyx_L1_error)
12636  __Pyx_GOTREF(__pyx_t_1);
12637  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12638  __pyx_t_1 = 0;
12639 
12640  /* "View.MemoryView":492
12641  *
12642  * bytesitem = itemp[:self.view.itemsize]
12643  * try: # <<<<<<<<<<<<<<
12644  * result = struct.unpack(self.view.format, bytesitem)
12645  * except struct.error:
12646  */
12647  {
12648  __Pyx_PyThreadState_declare
12649  __Pyx_PyThreadState_assign
12650  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12651  __Pyx_XGOTREF(__pyx_t_2);
12652  __Pyx_XGOTREF(__pyx_t_3);
12653  __Pyx_XGOTREF(__pyx_t_4);
12654  /*try:*/ {
12655 
12656  /* "View.MemoryView":493
12657  * bytesitem = itemp[:self.view.itemsize]
12658  * try:
12659  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
12660  * except struct.error:
12661  * raise ValueError("Unable to convert item to object")
12662  */
12663  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 493, __pyx_L3_error)
12664  __Pyx_GOTREF(__pyx_t_5);
12665  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 493, __pyx_L3_error)
12666  __Pyx_GOTREF(__pyx_t_6);
12667  __pyx_t_7 = NULL;
12668  __pyx_t_8 = 0;
12669  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12670  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12671  if (likely(__pyx_t_7)) {
12672  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
12673  __Pyx_INCREF(__pyx_t_7);
12674  __Pyx_INCREF(function);
12675  __Pyx_DECREF_SET(__pyx_t_5, function);
12676  __pyx_t_8 = 1;
12677  }
12678  }
12679  #if CYTHON_FAST_PYCALL
12680  if (PyFunction_Check(__pyx_t_5)) {
12681  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12682  __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(2, 493, __pyx_L3_error)
12683  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12684  __Pyx_GOTREF(__pyx_t_1);
12685  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12686  } else
12687  #endif
12688  #if CYTHON_FAST_PYCCALL
12689  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12690  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12691  __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(2, 493, __pyx_L3_error)
12692  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12693  __Pyx_GOTREF(__pyx_t_1);
12694  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12695  } else
12696  #endif
12697  {
12698  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 493, __pyx_L3_error)
12699  __Pyx_GOTREF(__pyx_t_9);
12700  if (__pyx_t_7) {
12701  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12702  }
12703  __Pyx_GIVEREF(__pyx_t_6);
12704  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12705  __Pyx_INCREF(__pyx_v_bytesitem);
12706  __Pyx_GIVEREF(__pyx_v_bytesitem);
12707  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12708  __pyx_t_6 = 0;
12709  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L3_error)
12710  __Pyx_GOTREF(__pyx_t_1);
12711  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12712  }
12713  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12714  __pyx_v_result = __pyx_t_1;
12715  __pyx_t_1 = 0;
12716 
12717  /* "View.MemoryView":492
12718  *
12719  * bytesitem = itemp[:self.view.itemsize]
12720  * try: # <<<<<<<<<<<<<<
12721  * result = struct.unpack(self.view.format, bytesitem)
12722  * except struct.error:
12723  */
12724  }
12725 
12726  /* "View.MemoryView":497
12727  * raise ValueError("Unable to convert item to object")
12728  * else:
12729  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12730  * return result[0]
12731  * return result
12732  */
12733  /*else:*/ {
12734  __pyx_t_10 = strlen(__pyx_v_self->view.format);
12735  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12736  if (__pyx_t_11) {
12737 
12738  /* "View.MemoryView":498
12739  * else:
12740  * if len(self.view.format) == 1:
12741  * return result[0] # <<<<<<<<<<<<<<
12742  * return result
12743  *
12744  */
12745  __Pyx_XDECREF(__pyx_r);
12746  __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(2, 498, __pyx_L5_except_error)
12747  __Pyx_GOTREF(__pyx_t_1);
12748  __pyx_r = __pyx_t_1;
12749  __pyx_t_1 = 0;
12750  goto __pyx_L6_except_return;
12751 
12752  /* "View.MemoryView":497
12753  * raise ValueError("Unable to convert item to object")
12754  * else:
12755  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12756  * return result[0]
12757  * return result
12758  */
12759  }
12760 
12761  /* "View.MemoryView":499
12762  * if len(self.view.format) == 1:
12763  * return result[0]
12764  * return result # <<<<<<<<<<<<<<
12765  *
12766  * cdef assign_item_from_object(self, char *itemp, object value):
12767  */
12768  __Pyx_XDECREF(__pyx_r);
12769  __Pyx_INCREF(__pyx_v_result);
12770  __pyx_r = __pyx_v_result;
12771  goto __pyx_L6_except_return;
12772  }
12773  __pyx_L3_error:;
12774  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12775  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12776  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12777  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12778  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12779 
12780  /* "View.MemoryView":494
12781  * try:
12782  * result = struct.unpack(self.view.format, bytesitem)
12783  * except struct.error: # <<<<<<<<<<<<<<
12784  * raise ValueError("Unable to convert item to object")
12785  * else:
12786  */
12787  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12788  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 494, __pyx_L5_except_error)
12789  __Pyx_GOTREF(__pyx_t_6);
12790  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12791  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12792  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12793  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12794  if (__pyx_t_8) {
12795  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12796  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 494, __pyx_L5_except_error)
12797  __Pyx_GOTREF(__pyx_t_9);
12798  __Pyx_GOTREF(__pyx_t_5);
12799  __Pyx_GOTREF(__pyx_t_1);
12800 
12801  /* "View.MemoryView":495
12802  * result = struct.unpack(self.view.format, bytesitem)
12803  * except struct.error:
12804  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
12805  * else:
12806  * if len(self.view.format) == 1:
12807  */
12808  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 495, __pyx_L5_except_error)
12809  __Pyx_GOTREF(__pyx_t_6);
12810  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12811  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12812  __PYX_ERR(2, 495, __pyx_L5_except_error)
12813  }
12814  goto __pyx_L5_except_error;
12815  __pyx_L5_except_error:;
12816 
12817  /* "View.MemoryView":492
12818  *
12819  * bytesitem = itemp[:self.view.itemsize]
12820  * try: # <<<<<<<<<<<<<<
12821  * result = struct.unpack(self.view.format, bytesitem)
12822  * except struct.error:
12823  */
12824  __Pyx_XGIVEREF(__pyx_t_2);
12825  __Pyx_XGIVEREF(__pyx_t_3);
12826  __Pyx_XGIVEREF(__pyx_t_4);
12827  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12828  goto __pyx_L1_error;
12829  __pyx_L6_except_return:;
12830  __Pyx_XGIVEREF(__pyx_t_2);
12831  __Pyx_XGIVEREF(__pyx_t_3);
12832  __Pyx_XGIVEREF(__pyx_t_4);
12833  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12834  goto __pyx_L0;
12835  }
12836 
12837  /* "View.MemoryView":485
12838  * self.assign_item_from_object(itemp, value)
12839  *
12840  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12841  * """Only used if instantiated manually by the user, or if Cython doesn't
12842  * know how to convert the type"""
12843  */
12844 
12845  /* function exit code */
12846  __pyx_L1_error:;
12847  __Pyx_XDECREF(__pyx_t_1);
12848  __Pyx_XDECREF(__pyx_t_5);
12849  __Pyx_XDECREF(__pyx_t_6);
12850  __Pyx_XDECREF(__pyx_t_7);
12851  __Pyx_XDECREF(__pyx_t_9);
12852  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12853  __pyx_r = 0;
12854  __pyx_L0:;
12855  __Pyx_XDECREF(__pyx_v_struct);
12856  __Pyx_XDECREF(__pyx_v_bytesitem);
12857  __Pyx_XDECREF(__pyx_v_result);
12858  __Pyx_XGIVEREF(__pyx_r);
12859  __Pyx_RefNannyFinishContext();
12860  return __pyx_r;
12861 }
12862 
12863 /* "View.MemoryView":501
12864  * return result
12865  *
12866  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12867  * """Only used if instantiated manually by the user, or if Cython doesn't
12868  * know how to convert the type"""
12869  */
12870 
12871 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12872  PyObject *__pyx_v_struct = NULL;
12873  char __pyx_v_c;
12874  PyObject *__pyx_v_bytesvalue = 0;
12875  Py_ssize_t __pyx_v_i;
12876  PyObject *__pyx_r = NULL;
12877  __Pyx_RefNannyDeclarations
12878  PyObject *__pyx_t_1 = NULL;
12879  int __pyx_t_2;
12880  int __pyx_t_3;
12881  PyObject *__pyx_t_4 = NULL;
12882  PyObject *__pyx_t_5 = NULL;
12883  PyObject *__pyx_t_6 = NULL;
12884  int __pyx_t_7;
12885  PyObject *__pyx_t_8 = NULL;
12886  Py_ssize_t __pyx_t_9;
12887  PyObject *__pyx_t_10 = NULL;
12888  char *__pyx_t_11;
12889  char *__pyx_t_12;
12890  char *__pyx_t_13;
12891  char *__pyx_t_14;
12892  int __pyx_lineno = 0;
12893  const char *__pyx_filename = NULL;
12894  int __pyx_clineno = 0;
12895  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
12896 
12897  /* "View.MemoryView":504
12898  * """Only used if instantiated manually by the user, or if Cython doesn't
12899  * know how to convert the type"""
12900  * import struct # <<<<<<<<<<<<<<
12901  * cdef char c
12902  * cdef bytes bytesvalue
12903  */
12904  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 504, __pyx_L1_error)
12905  __Pyx_GOTREF(__pyx_t_1);
12906  __pyx_v_struct = __pyx_t_1;
12907  __pyx_t_1 = 0;
12908 
12909  /* "View.MemoryView":509
12910  * cdef Py_ssize_t i
12911  *
12912  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12913  * bytesvalue = struct.pack(self.view.format, *value)
12914  * else:
12915  */
12916  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12917  __pyx_t_3 = (__pyx_t_2 != 0);
12918  if (__pyx_t_3) {
12919 
12920  /* "View.MemoryView":510
12921  *
12922  * if isinstance(value, tuple):
12923  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
12924  * else:
12925  * bytesvalue = struct.pack(self.view.format, value)
12926  */
12927  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 510, __pyx_L1_error)
12928  __Pyx_GOTREF(__pyx_t_1);
12929  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
12930  __Pyx_GOTREF(__pyx_t_4);
12931  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 510, __pyx_L1_error)
12932  __Pyx_GOTREF(__pyx_t_5);
12933  __Pyx_GIVEREF(__pyx_t_4);
12934  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12935  __pyx_t_4 = 0;
12936  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
12937  __Pyx_GOTREF(__pyx_t_4);
12938  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 510, __pyx_L1_error)
12939  __Pyx_GOTREF(__pyx_t_6);
12940  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12941  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12942  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 510, __pyx_L1_error)
12943  __Pyx_GOTREF(__pyx_t_4);
12944  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12945  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12946  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(2, 510, __pyx_L1_error)
12947  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12948  __pyx_t_4 = 0;
12949 
12950  /* "View.MemoryView":509
12951  * cdef Py_ssize_t i
12952  *
12953  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12954  * bytesvalue = struct.pack(self.view.format, *value)
12955  * else:
12956  */
12957  goto __pyx_L3;
12958  }
12959 
12960  /* "View.MemoryView":512
12961  * bytesvalue = struct.pack(self.view.format, *value)
12962  * else:
12963  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
12964  *
12965  * for i, c in enumerate(bytesvalue):
12966  */
12967  /*else*/ {
12968  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 512, __pyx_L1_error)
12969  __Pyx_GOTREF(__pyx_t_6);
12970  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 512, __pyx_L1_error)
12971  __Pyx_GOTREF(__pyx_t_1);
12972  __pyx_t_5 = NULL;
12973  __pyx_t_7 = 0;
12974  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12975  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12976  if (likely(__pyx_t_5)) {
12977  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12978  __Pyx_INCREF(__pyx_t_5);
12979  __Pyx_INCREF(function);
12980  __Pyx_DECREF_SET(__pyx_t_6, function);
12981  __pyx_t_7 = 1;
12982  }
12983  }
12984  #if CYTHON_FAST_PYCALL
12985  if (PyFunction_Check(__pyx_t_6)) {
12986  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12987  __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(2, 512, __pyx_L1_error)
12988  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12989  __Pyx_GOTREF(__pyx_t_4);
12990  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12991  } else
12992  #endif
12993  #if CYTHON_FAST_PYCCALL
12994  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12995  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12996  __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(2, 512, __pyx_L1_error)
12997  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12998  __Pyx_GOTREF(__pyx_t_4);
12999  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13000  } else
13001  #endif
13002  {
13003  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 512, __pyx_L1_error)
13004  __Pyx_GOTREF(__pyx_t_8);
13005  if (__pyx_t_5) {
13006  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
13007  }
13008  __Pyx_GIVEREF(__pyx_t_1);
13009  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
13010  __Pyx_INCREF(__pyx_v_value);
13011  __Pyx_GIVEREF(__pyx_v_value);
13012  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
13013  __pyx_t_1 = 0;
13014  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 512, __pyx_L1_error)
13015  __Pyx_GOTREF(__pyx_t_4);
13016  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13017  }
13018  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13019  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(2, 512, __pyx_L1_error)
13020  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
13021  __pyx_t_4 = 0;
13022  }
13023  __pyx_L3:;
13024 
13025  /* "View.MemoryView":514
13026  * bytesvalue = struct.pack(self.view.format, value)
13027  *
13028  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
13029  * itemp[i] = c
13030  *
13031  */
13032  __pyx_t_9 = 0;
13033  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
13034  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
13035  __PYX_ERR(2, 514, __pyx_L1_error)
13036  }
13037  __Pyx_INCREF(__pyx_v_bytesvalue);
13038  __pyx_t_10 = __pyx_v_bytesvalue;
13039  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
13040  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
13041  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
13042  __pyx_t_11 = __pyx_t_14;
13043  __pyx_v_c = (__pyx_t_11[0]);
13044 
13045  /* "View.MemoryView":515
13046  *
13047  * for i, c in enumerate(bytesvalue):
13048  * itemp[i] = c # <<<<<<<<<<<<<<
13049  *
13050  * @cname('getbuffer')
13051  */
13052  __pyx_v_i = __pyx_t_9;
13053 
13054  /* "View.MemoryView":514
13055  * bytesvalue = struct.pack(self.view.format, value)
13056  *
13057  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
13058  * itemp[i] = c
13059  *
13060  */
13061  __pyx_t_9 = (__pyx_t_9 + 1);
13062 
13063  /* "View.MemoryView":515
13064  *
13065  * for i, c in enumerate(bytesvalue):
13066  * itemp[i] = c # <<<<<<<<<<<<<<
13067  *
13068  * @cname('getbuffer')
13069  */
13070  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
13071  }
13072  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13073 
13074  /* "View.MemoryView":501
13075  * return result
13076  *
13077  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
13078  * """Only used if instantiated manually by the user, or if Cython doesn't
13079  * know how to convert the type"""
13080  */
13081 
13082  /* function exit code */
13083  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13084  goto __pyx_L0;
13085  __pyx_L1_error:;
13086  __Pyx_XDECREF(__pyx_t_1);
13087  __Pyx_XDECREF(__pyx_t_4);
13088  __Pyx_XDECREF(__pyx_t_5);
13089  __Pyx_XDECREF(__pyx_t_6);
13090  __Pyx_XDECREF(__pyx_t_8);
13091  __Pyx_XDECREF(__pyx_t_10);
13092  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
13093  __pyx_r = 0;
13094  __pyx_L0:;
13095  __Pyx_XDECREF(__pyx_v_struct);
13096  __Pyx_XDECREF(__pyx_v_bytesvalue);
13097  __Pyx_XGIVEREF(__pyx_r);
13098  __Pyx_RefNannyFinishContext();
13099  return __pyx_r;
13100 }
13101 
13102 /* "View.MemoryView":518
13103  *
13104  * @cname('getbuffer')
13105  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13106  * if flags & PyBUF_WRITABLE and self.view.readonly:
13107  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13108  */
13109 
13110 /* Python wrapper */
13111 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
13112 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13113  int __pyx_r;
13114  __Pyx_RefNannyDeclarations
13115  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
13116  __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));
13117 
13118  /* function exit code */
13119  __Pyx_RefNannyFinishContext();
13120  return __pyx_r;
13121 }
13122 
13123 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) {
13124  int __pyx_r;
13125  __Pyx_RefNannyDeclarations
13126  int __pyx_t_1;
13127  int __pyx_t_2;
13128  PyObject *__pyx_t_3 = NULL;
13129  Py_ssize_t *__pyx_t_4;
13130  char *__pyx_t_5;
13131  void *__pyx_t_6;
13132  int __pyx_t_7;
13133  Py_ssize_t __pyx_t_8;
13134  int __pyx_lineno = 0;
13135  const char *__pyx_filename = NULL;
13136  int __pyx_clineno = 0;
13137  if (__pyx_v_info == NULL) {
13138  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
13139  return -1;
13140  }
13141  __Pyx_RefNannySetupContext("__getbuffer__", 0);
13142  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13143  __Pyx_GIVEREF(__pyx_v_info->obj);
13144 
13145  /* "View.MemoryView":519
13146  * @cname('getbuffer')
13147  * def __getbuffer__(self, Py_buffer *info, int flags):
13148  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13149  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13150  *
13151  */
13152  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
13153  if (__pyx_t_2) {
13154  } else {
13155  __pyx_t_1 = __pyx_t_2;
13156  goto __pyx_L4_bool_binop_done;
13157  }
13158  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
13159  __pyx_t_1 = __pyx_t_2;
13160  __pyx_L4_bool_binop_done:;
13161  if (unlikely(__pyx_t_1)) {
13162 
13163  /* "View.MemoryView":520
13164  * def __getbuffer__(self, Py_buffer *info, int flags):
13165  * if flags & PyBUF_WRITABLE and self.view.readonly:
13166  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
13167  *
13168  * if flags & PyBUF_ND:
13169  */
13170  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 520, __pyx_L1_error)
13171  __Pyx_GOTREF(__pyx_t_3);
13172  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13173  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13174  __PYX_ERR(2, 520, __pyx_L1_error)
13175 
13176  /* "View.MemoryView":519
13177  * @cname('getbuffer')
13178  * def __getbuffer__(self, Py_buffer *info, int flags):
13179  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
13180  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13181  *
13182  */
13183  }
13184 
13185  /* "View.MemoryView":522
13186  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13187  *
13188  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13189  * info.shape = self.view.shape
13190  * else:
13191  */
13192  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
13193  if (__pyx_t_1) {
13194 
13195  /* "View.MemoryView":523
13196  *
13197  * if flags & PyBUF_ND:
13198  * info.shape = self.view.shape # <<<<<<<<<<<<<<
13199  * else:
13200  * info.shape = NULL
13201  */
13202  __pyx_t_4 = __pyx_v_self->view.shape;
13203  __pyx_v_info->shape = __pyx_t_4;
13204 
13205  /* "View.MemoryView":522
13206  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13207  *
13208  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
13209  * info.shape = self.view.shape
13210  * else:
13211  */
13212  goto __pyx_L6;
13213  }
13214 
13215  /* "View.MemoryView":525
13216  * info.shape = self.view.shape
13217  * else:
13218  * info.shape = NULL # <<<<<<<<<<<<<<
13219  *
13220  * if flags & PyBUF_STRIDES:
13221  */
13222  /*else*/ {
13223  __pyx_v_info->shape = NULL;
13224  }
13225  __pyx_L6:;
13226 
13227  /* "View.MemoryView":527
13228  * info.shape = NULL
13229  *
13230  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13231  * info.strides = self.view.strides
13232  * else:
13233  */
13234  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
13235  if (__pyx_t_1) {
13236 
13237  /* "View.MemoryView":528
13238  *
13239  * if flags & PyBUF_STRIDES:
13240  * info.strides = self.view.strides # <<<<<<<<<<<<<<
13241  * else:
13242  * info.strides = NULL
13243  */
13244  __pyx_t_4 = __pyx_v_self->view.strides;
13245  __pyx_v_info->strides = __pyx_t_4;
13246 
13247  /* "View.MemoryView":527
13248  * info.shape = NULL
13249  *
13250  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
13251  * info.strides = self.view.strides
13252  * else:
13253  */
13254  goto __pyx_L7;
13255  }
13256 
13257  /* "View.MemoryView":530
13258  * info.strides = self.view.strides
13259  * else:
13260  * info.strides = NULL # <<<<<<<<<<<<<<
13261  *
13262  * if flags & PyBUF_INDIRECT:
13263  */
13264  /*else*/ {
13265  __pyx_v_info->strides = NULL;
13266  }
13267  __pyx_L7:;
13268 
13269  /* "View.MemoryView":532
13270  * info.strides = NULL
13271  *
13272  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13273  * info.suboffsets = self.view.suboffsets
13274  * else:
13275  */
13276  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13277  if (__pyx_t_1) {
13278 
13279  /* "View.MemoryView":533
13280  *
13281  * if flags & PyBUF_INDIRECT:
13282  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
13283  * else:
13284  * info.suboffsets = NULL
13285  */
13286  __pyx_t_4 = __pyx_v_self->view.suboffsets;
13287  __pyx_v_info->suboffsets = __pyx_t_4;
13288 
13289  /* "View.MemoryView":532
13290  * info.strides = NULL
13291  *
13292  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13293  * info.suboffsets = self.view.suboffsets
13294  * else:
13295  */
13296  goto __pyx_L8;
13297  }
13298 
13299  /* "View.MemoryView":535
13300  * info.suboffsets = self.view.suboffsets
13301  * else:
13302  * info.suboffsets = NULL # <<<<<<<<<<<<<<
13303  *
13304  * if flags & PyBUF_FORMAT:
13305  */
13306  /*else*/ {
13307  __pyx_v_info->suboffsets = NULL;
13308  }
13309  __pyx_L8:;
13310 
13311  /* "View.MemoryView":537
13312  * info.suboffsets = NULL
13313  *
13314  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13315  * info.format = self.view.format
13316  * else:
13317  */
13318  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13319  if (__pyx_t_1) {
13320 
13321  /* "View.MemoryView":538
13322  *
13323  * if flags & PyBUF_FORMAT:
13324  * info.format = self.view.format # <<<<<<<<<<<<<<
13325  * else:
13326  * info.format = NULL
13327  */
13328  __pyx_t_5 = __pyx_v_self->view.format;
13329  __pyx_v_info->format = __pyx_t_5;
13330 
13331  /* "View.MemoryView":537
13332  * info.suboffsets = NULL
13333  *
13334  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13335  * info.format = self.view.format
13336  * else:
13337  */
13338  goto __pyx_L9;
13339  }
13340 
13341  /* "View.MemoryView":540
13342  * info.format = self.view.format
13343  * else:
13344  * info.format = NULL # <<<<<<<<<<<<<<
13345  *
13346  * info.buf = self.view.buf
13347  */
13348  /*else*/ {
13349  __pyx_v_info->format = NULL;
13350  }
13351  __pyx_L9:;
13352 
13353  /* "View.MemoryView":542
13354  * info.format = NULL
13355  *
13356  * info.buf = self.view.buf # <<<<<<<<<<<<<<
13357  * info.ndim = self.view.ndim
13358  * info.itemsize = self.view.itemsize
13359  */
13360  __pyx_t_6 = __pyx_v_self->view.buf;
13361  __pyx_v_info->buf = __pyx_t_6;
13362 
13363  /* "View.MemoryView":543
13364  *
13365  * info.buf = self.view.buf
13366  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
13367  * info.itemsize = self.view.itemsize
13368  * info.len = self.view.len
13369  */
13370  __pyx_t_7 = __pyx_v_self->view.ndim;
13371  __pyx_v_info->ndim = __pyx_t_7;
13372 
13373  /* "View.MemoryView":544
13374  * info.buf = self.view.buf
13375  * info.ndim = self.view.ndim
13376  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
13377  * info.len = self.view.len
13378  * info.readonly = self.view.readonly
13379  */
13380  __pyx_t_8 = __pyx_v_self->view.itemsize;
13381  __pyx_v_info->itemsize = __pyx_t_8;
13382 
13383  /* "View.MemoryView":545
13384  * info.ndim = self.view.ndim
13385  * info.itemsize = self.view.itemsize
13386  * info.len = self.view.len # <<<<<<<<<<<<<<
13387  * info.readonly = self.view.readonly
13388  * info.obj = self
13389  */
13390  __pyx_t_8 = __pyx_v_self->view.len;
13391  __pyx_v_info->len = __pyx_t_8;
13392 
13393  /* "View.MemoryView":546
13394  * info.itemsize = self.view.itemsize
13395  * info.len = self.view.len
13396  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
13397  * info.obj = self
13398  *
13399  */
13400  __pyx_t_1 = __pyx_v_self->view.readonly;
13401  __pyx_v_info->readonly = __pyx_t_1;
13402 
13403  /* "View.MemoryView":547
13404  * info.len = self.view.len
13405  * info.readonly = self.view.readonly
13406  * info.obj = self # <<<<<<<<<<<<<<
13407  *
13408  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
13409  */
13410  __Pyx_INCREF(((PyObject *)__pyx_v_self));
13411  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13412  __Pyx_GOTREF(__pyx_v_info->obj);
13413  __Pyx_DECREF(__pyx_v_info->obj);
13414  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13415 
13416  /* "View.MemoryView":518
13417  *
13418  * @cname('getbuffer')
13419  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13420  * if flags & PyBUF_WRITABLE and self.view.readonly:
13421  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13422  */
13423 
13424  /* function exit code */
13425  __pyx_r = 0;
13426  goto __pyx_L0;
13427  __pyx_L1_error:;
13428  __Pyx_XDECREF(__pyx_t_3);
13429  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13430  __pyx_r = -1;
13431  if (__pyx_v_info->obj != NULL) {
13432  __Pyx_GOTREF(__pyx_v_info->obj);
13433  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13434  }
13435  goto __pyx_L2;
13436  __pyx_L0:;
13437  if (__pyx_v_info->obj == Py_None) {
13438  __Pyx_GOTREF(__pyx_v_info->obj);
13439  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13440  }
13441  __pyx_L2:;
13442  __Pyx_RefNannyFinishContext();
13443  return __pyx_r;
13444 }
13445 
13446 /* "View.MemoryView":553
13447  *
13448  * @property
13449  * def T(self): # <<<<<<<<<<<<<<
13450  * cdef _memoryviewslice result = memoryview_copy(self)
13451  * transpose_memslice(&result.from_slice)
13452  */
13453 
13454 /* Python wrapper */
13455 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
13456 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13457  PyObject *__pyx_r = 0;
13458  __Pyx_RefNannyDeclarations
13459  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13460  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13461 
13462  /* function exit code */
13463  __Pyx_RefNannyFinishContext();
13464  return __pyx_r;
13465 }
13466 
13467 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13468  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13469  PyObject *__pyx_r = NULL;
13470  __Pyx_RefNannyDeclarations
13471  PyObject *__pyx_t_1 = NULL;
13472  int __pyx_t_2;
13473  int __pyx_lineno = 0;
13474  const char *__pyx_filename = NULL;
13475  int __pyx_clineno = 0;
13476  __Pyx_RefNannySetupContext("__get__", 0);
13477 
13478  /* "View.MemoryView":554
13479  * @property
13480  * def T(self):
13481  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
13482  * transpose_memslice(&result.from_slice)
13483  * return result
13484  */
13485  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 554, __pyx_L1_error)
13486  __Pyx_GOTREF(__pyx_t_1);
13487  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 554, __pyx_L1_error)
13488  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13489  __pyx_t_1 = 0;
13490 
13491  /* "View.MemoryView":555
13492  * def T(self):
13493  * cdef _memoryviewslice result = memoryview_copy(self)
13494  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
13495  * return result
13496  *
13497  */
13498  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 555, __pyx_L1_error)
13499 
13500  /* "View.MemoryView":556
13501  * cdef _memoryviewslice result = memoryview_copy(self)
13502  * transpose_memslice(&result.from_slice)
13503  * return result # <<<<<<<<<<<<<<
13504  *
13505  * @property
13506  */
13507  __Pyx_XDECREF(__pyx_r);
13508  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13509  __pyx_r = ((PyObject *)__pyx_v_result);
13510  goto __pyx_L0;
13511 
13512  /* "View.MemoryView":553
13513  *
13514  * @property
13515  * def T(self): # <<<<<<<<<<<<<<
13516  * cdef _memoryviewslice result = memoryview_copy(self)
13517  * transpose_memslice(&result.from_slice)
13518  */
13519 
13520  /* function exit code */
13521  __pyx_L1_error:;
13522  __Pyx_XDECREF(__pyx_t_1);
13523  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13524  __pyx_r = NULL;
13525  __pyx_L0:;
13526  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13527  __Pyx_XGIVEREF(__pyx_r);
13528  __Pyx_RefNannyFinishContext();
13529  return __pyx_r;
13530 }
13531 
13532 /* "View.MemoryView":559
13533  *
13534  * @property
13535  * def base(self): # <<<<<<<<<<<<<<
13536  * return self.obj
13537  *
13538  */
13539 
13540 /* Python wrapper */
13541 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
13542 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13543  PyObject *__pyx_r = 0;
13544  __Pyx_RefNannyDeclarations
13545  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13546  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13547 
13548  /* function exit code */
13549  __Pyx_RefNannyFinishContext();
13550  return __pyx_r;
13551 }
13552 
13553 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13554  PyObject *__pyx_r = NULL;
13555  __Pyx_RefNannyDeclarations
13556  __Pyx_RefNannySetupContext("__get__", 0);
13557 
13558  /* "View.MemoryView":560
13559  * @property
13560  * def base(self):
13561  * return self.obj # <<<<<<<<<<<<<<
13562  *
13563  * @property
13564  */
13565  __Pyx_XDECREF(__pyx_r);
13566  __Pyx_INCREF(__pyx_v_self->obj);
13567  __pyx_r = __pyx_v_self->obj;
13568  goto __pyx_L0;
13569 
13570  /* "View.MemoryView":559
13571  *
13572  * @property
13573  * def base(self): # <<<<<<<<<<<<<<
13574  * return self.obj
13575  *
13576  */
13577 
13578  /* function exit code */
13579  __pyx_L0:;
13580  __Pyx_XGIVEREF(__pyx_r);
13581  __Pyx_RefNannyFinishContext();
13582  return __pyx_r;
13583 }
13584 
13585 /* "View.MemoryView":563
13586  *
13587  * @property
13588  * def shape(self): # <<<<<<<<<<<<<<
13589  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13590  *
13591  */
13592 
13593 /* Python wrapper */
13594 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
13595 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13596  PyObject *__pyx_r = 0;
13597  __Pyx_RefNannyDeclarations
13598  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13599  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13600 
13601  /* function exit code */
13602  __Pyx_RefNannyFinishContext();
13603  return __pyx_r;
13604 }
13605 
13606 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13607  Py_ssize_t __pyx_v_length;
13608  PyObject *__pyx_r = NULL;
13609  __Pyx_RefNannyDeclarations
13610  PyObject *__pyx_t_1 = NULL;
13611  Py_ssize_t *__pyx_t_2;
13612  Py_ssize_t *__pyx_t_3;
13613  Py_ssize_t *__pyx_t_4;
13614  PyObject *__pyx_t_5 = NULL;
13615  int __pyx_lineno = 0;
13616  const char *__pyx_filename = NULL;
13617  int __pyx_clineno = 0;
13618  __Pyx_RefNannySetupContext("__get__", 0);
13619 
13620  /* "View.MemoryView":564
13621  * @property
13622  * def shape(self):
13623  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
13624  *
13625  * @property
13626  */
13627  __Pyx_XDECREF(__pyx_r);
13628  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 564, __pyx_L1_error)
13629  __Pyx_GOTREF(__pyx_t_1);
13630  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13631  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13632  __pyx_t_2 = __pyx_t_4;
13633  __pyx_v_length = (__pyx_t_2[0]);
13634  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
13635  __Pyx_GOTREF(__pyx_t_5);
13636  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 564, __pyx_L1_error)
13637  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13638  }
13639  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 564, __pyx_L1_error)
13640  __Pyx_GOTREF(__pyx_t_5);
13641  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13642  __pyx_r = __pyx_t_5;
13643  __pyx_t_5 = 0;
13644  goto __pyx_L0;
13645 
13646  /* "View.MemoryView":563
13647  *
13648  * @property
13649  * def shape(self): # <<<<<<<<<<<<<<
13650  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13651  *
13652  */
13653 
13654  /* function exit code */
13655  __pyx_L1_error:;
13656  __Pyx_XDECREF(__pyx_t_1);
13657  __Pyx_XDECREF(__pyx_t_5);
13658  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13659  __pyx_r = NULL;
13660  __pyx_L0:;
13661  __Pyx_XGIVEREF(__pyx_r);
13662  __Pyx_RefNannyFinishContext();
13663  return __pyx_r;
13664 }
13665 
13666 /* "View.MemoryView":567
13667  *
13668  * @property
13669  * def strides(self): # <<<<<<<<<<<<<<
13670  * if self.view.strides == NULL:
13671  *
13672  */
13673 
13674 /* Python wrapper */
13675 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
13676 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13677  PyObject *__pyx_r = 0;
13678  __Pyx_RefNannyDeclarations
13679  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13680  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13681 
13682  /* function exit code */
13683  __Pyx_RefNannyFinishContext();
13684  return __pyx_r;
13685 }
13686 
13687 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13688  Py_ssize_t __pyx_v_stride;
13689  PyObject *__pyx_r = NULL;
13690  __Pyx_RefNannyDeclarations
13691  int __pyx_t_1;
13692  PyObject *__pyx_t_2 = NULL;
13693  Py_ssize_t *__pyx_t_3;
13694  Py_ssize_t *__pyx_t_4;
13695  Py_ssize_t *__pyx_t_5;
13696  PyObject *__pyx_t_6 = NULL;
13697  int __pyx_lineno = 0;
13698  const char *__pyx_filename = NULL;
13699  int __pyx_clineno = 0;
13700  __Pyx_RefNannySetupContext("__get__", 0);
13701 
13702  /* "View.MemoryView":568
13703  * @property
13704  * def strides(self):
13705  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13706  *
13707  * raise ValueError("Buffer view does not expose strides")
13708  */
13709  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13710  if (unlikely(__pyx_t_1)) {
13711 
13712  /* "View.MemoryView":570
13713  * if self.view.strides == NULL:
13714  *
13715  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
13716  *
13717  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
13718  */
13719  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 570, __pyx_L1_error)
13720  __Pyx_GOTREF(__pyx_t_2);
13721  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13722  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13723  __PYX_ERR(2, 570, __pyx_L1_error)
13724 
13725  /* "View.MemoryView":568
13726  * @property
13727  * def strides(self):
13728  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13729  *
13730  * raise ValueError("Buffer view does not expose strides")
13731  */
13732  }
13733 
13734  /* "View.MemoryView":572
13735  * raise ValueError("Buffer view does not expose strides")
13736  *
13737  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
13738  *
13739  * @property
13740  */
13741  __Pyx_XDECREF(__pyx_r);
13742  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error)
13743  __Pyx_GOTREF(__pyx_t_2);
13744  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13745  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13746  __pyx_t_3 = __pyx_t_5;
13747  __pyx_v_stride = (__pyx_t_3[0]);
13748  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
13749  __Pyx_GOTREF(__pyx_t_6);
13750  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 572, __pyx_L1_error)
13751  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13752  }
13753  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 572, __pyx_L1_error)
13754  __Pyx_GOTREF(__pyx_t_6);
13755  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13756  __pyx_r = __pyx_t_6;
13757  __pyx_t_6 = 0;
13758  goto __pyx_L0;
13759 
13760  /* "View.MemoryView":567
13761  *
13762  * @property
13763  * def strides(self): # <<<<<<<<<<<<<<
13764  * if self.view.strides == NULL:
13765  *
13766  */
13767 
13768  /* function exit code */
13769  __pyx_L1_error:;
13770  __Pyx_XDECREF(__pyx_t_2);
13771  __Pyx_XDECREF(__pyx_t_6);
13772  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13773  __pyx_r = NULL;
13774  __pyx_L0:;
13775  __Pyx_XGIVEREF(__pyx_r);
13776  __Pyx_RefNannyFinishContext();
13777  return __pyx_r;
13778 }
13779 
13780 /* "View.MemoryView":575
13781  *
13782  * @property
13783  * def suboffsets(self): # <<<<<<<<<<<<<<
13784  * if self.view.suboffsets == NULL:
13785  * return (-1,) * self.view.ndim
13786  */
13787 
13788 /* Python wrapper */
13789 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
13790 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13791  PyObject *__pyx_r = 0;
13792  __Pyx_RefNannyDeclarations
13793  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13794  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13795 
13796  /* function exit code */
13797  __Pyx_RefNannyFinishContext();
13798  return __pyx_r;
13799 }
13800 
13801 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13802  Py_ssize_t __pyx_v_suboffset;
13803  PyObject *__pyx_r = NULL;
13804  __Pyx_RefNannyDeclarations
13805  int __pyx_t_1;
13806  PyObject *__pyx_t_2 = NULL;
13807  PyObject *__pyx_t_3 = NULL;
13808  Py_ssize_t *__pyx_t_4;
13809  Py_ssize_t *__pyx_t_5;
13810  Py_ssize_t *__pyx_t_6;
13811  int __pyx_lineno = 0;
13812  const char *__pyx_filename = NULL;
13813  int __pyx_clineno = 0;
13814  __Pyx_RefNannySetupContext("__get__", 0);
13815 
13816  /* "View.MemoryView":576
13817  * @property
13818  * def suboffsets(self):
13819  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13820  * return (-1,) * self.view.ndim
13821  *
13822  */
13823  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13824  if (__pyx_t_1) {
13825 
13826  /* "View.MemoryView":577
13827  * def suboffsets(self):
13828  * if self.view.suboffsets == NULL:
13829  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
13830  *
13831  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
13832  */
13833  __Pyx_XDECREF(__pyx_r);
13834  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error)
13835  __Pyx_GOTREF(__pyx_t_2);
13836  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__14, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __pyx_L1_error)
13837  __Pyx_GOTREF(__pyx_t_3);
13838  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13839  __pyx_r = __pyx_t_3;
13840  __pyx_t_3 = 0;
13841  goto __pyx_L0;
13842 
13843  /* "View.MemoryView":576
13844  * @property
13845  * def suboffsets(self):
13846  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13847  * return (-1,) * self.view.ndim
13848  *
13849  */
13850  }
13851 
13852  /* "View.MemoryView":579
13853  * return (-1,) * self.view.ndim
13854  *
13855  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
13856  *
13857  * @property
13858  */
13859  __Pyx_XDECREF(__pyx_r);
13860  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 579, __pyx_L1_error)
13861  __Pyx_GOTREF(__pyx_t_3);
13862  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13863  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13864  __pyx_t_4 = __pyx_t_6;
13865  __pyx_v_suboffset = (__pyx_t_4[0]);
13866  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
13867  __Pyx_GOTREF(__pyx_t_2);
13868  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 579, __pyx_L1_error)
13869  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13870  }
13871  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 579, __pyx_L1_error)
13872  __Pyx_GOTREF(__pyx_t_2);
13873  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13874  __pyx_r = __pyx_t_2;
13875  __pyx_t_2 = 0;
13876  goto __pyx_L0;
13877 
13878  /* "View.MemoryView":575
13879  *
13880  * @property
13881  * def suboffsets(self): # <<<<<<<<<<<<<<
13882  * if self.view.suboffsets == NULL:
13883  * return (-1,) * self.view.ndim
13884  */
13885 
13886  /* function exit code */
13887  __pyx_L1_error:;
13888  __Pyx_XDECREF(__pyx_t_2);
13889  __Pyx_XDECREF(__pyx_t_3);
13890  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13891  __pyx_r = NULL;
13892  __pyx_L0:;
13893  __Pyx_XGIVEREF(__pyx_r);
13894  __Pyx_RefNannyFinishContext();
13895  return __pyx_r;
13896 }
13897 
13898 /* "View.MemoryView":582
13899  *
13900  * @property
13901  * def ndim(self): # <<<<<<<<<<<<<<
13902  * return self.view.ndim
13903  *
13904  */
13905 
13906 /* Python wrapper */
13907 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
13908 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13909  PyObject *__pyx_r = 0;
13910  __Pyx_RefNannyDeclarations
13911  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13912  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13913 
13914  /* function exit code */
13915  __Pyx_RefNannyFinishContext();
13916  return __pyx_r;
13917 }
13918 
13919 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13920  PyObject *__pyx_r = NULL;
13921  __Pyx_RefNannyDeclarations
13922  PyObject *__pyx_t_1 = NULL;
13923  int __pyx_lineno = 0;
13924  const char *__pyx_filename = NULL;
13925  int __pyx_clineno = 0;
13926  __Pyx_RefNannySetupContext("__get__", 0);
13927 
13928  /* "View.MemoryView":583
13929  * @property
13930  * def ndim(self):
13931  * return self.view.ndim # <<<<<<<<<<<<<<
13932  *
13933  * @property
13934  */
13935  __Pyx_XDECREF(__pyx_r);
13936  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 583, __pyx_L1_error)
13937  __Pyx_GOTREF(__pyx_t_1);
13938  __pyx_r = __pyx_t_1;
13939  __pyx_t_1 = 0;
13940  goto __pyx_L0;
13941 
13942  /* "View.MemoryView":582
13943  *
13944  * @property
13945  * def ndim(self): # <<<<<<<<<<<<<<
13946  * return self.view.ndim
13947  *
13948  */
13949 
13950  /* function exit code */
13951  __pyx_L1_error:;
13952  __Pyx_XDECREF(__pyx_t_1);
13953  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13954  __pyx_r = NULL;
13955  __pyx_L0:;
13956  __Pyx_XGIVEREF(__pyx_r);
13957  __Pyx_RefNannyFinishContext();
13958  return __pyx_r;
13959 }
13960 
13961 /* "View.MemoryView":586
13962  *
13963  * @property
13964  * def itemsize(self): # <<<<<<<<<<<<<<
13965  * return self.view.itemsize
13966  *
13967  */
13968 
13969 /* Python wrapper */
13970 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
13971 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13972  PyObject *__pyx_r = 0;
13973  __Pyx_RefNannyDeclarations
13974  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13975  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13976 
13977  /* function exit code */
13978  __Pyx_RefNannyFinishContext();
13979  return __pyx_r;
13980 }
13981 
13982 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13983  PyObject *__pyx_r = NULL;
13984  __Pyx_RefNannyDeclarations
13985  PyObject *__pyx_t_1 = NULL;
13986  int __pyx_lineno = 0;
13987  const char *__pyx_filename = NULL;
13988  int __pyx_clineno = 0;
13989  __Pyx_RefNannySetupContext("__get__", 0);
13990 
13991  /* "View.MemoryView":587
13992  * @property
13993  * def itemsize(self):
13994  * return self.view.itemsize # <<<<<<<<<<<<<<
13995  *
13996  * @property
13997  */
13998  __Pyx_XDECREF(__pyx_r);
13999  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 587, __pyx_L1_error)
14000  __Pyx_GOTREF(__pyx_t_1);
14001  __pyx_r = __pyx_t_1;
14002  __pyx_t_1 = 0;
14003  goto __pyx_L0;
14004 
14005  /* "View.MemoryView":586
14006  *
14007  * @property
14008  * def itemsize(self): # <<<<<<<<<<<<<<
14009  * return self.view.itemsize
14010  *
14011  */
14012 
14013  /* function exit code */
14014  __pyx_L1_error:;
14015  __Pyx_XDECREF(__pyx_t_1);
14016  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14017  __pyx_r = NULL;
14018  __pyx_L0:;
14019  __Pyx_XGIVEREF(__pyx_r);
14020  __Pyx_RefNannyFinishContext();
14021  return __pyx_r;
14022 }
14023 
14024 /* "View.MemoryView":590
14025  *
14026  * @property
14027  * def nbytes(self): # <<<<<<<<<<<<<<
14028  * return self.size * self.view.itemsize
14029  *
14030  */
14031 
14032 /* Python wrapper */
14033 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
14034 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
14035  PyObject *__pyx_r = 0;
14036  __Pyx_RefNannyDeclarations
14037  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14038  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14039 
14040  /* function exit code */
14041  __Pyx_RefNannyFinishContext();
14042  return __pyx_r;
14043 }
14044 
14045 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14046  PyObject *__pyx_r = NULL;
14047  __Pyx_RefNannyDeclarations
14048  PyObject *__pyx_t_1 = NULL;
14049  PyObject *__pyx_t_2 = NULL;
14050  PyObject *__pyx_t_3 = NULL;
14051  int __pyx_lineno = 0;
14052  const char *__pyx_filename = NULL;
14053  int __pyx_clineno = 0;
14054  __Pyx_RefNannySetupContext("__get__", 0);
14055 
14056  /* "View.MemoryView":591
14057  * @property
14058  * def nbytes(self):
14059  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
14060  *
14061  * @property
14062  */
14063  __Pyx_XDECREF(__pyx_r);
14064  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 591, __pyx_L1_error)
14065  __Pyx_GOTREF(__pyx_t_1);
14066  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 591, __pyx_L1_error)
14067  __Pyx_GOTREF(__pyx_t_2);
14068  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 591, __pyx_L1_error)
14069  __Pyx_GOTREF(__pyx_t_3);
14070  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14071  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14072  __pyx_r = __pyx_t_3;
14073  __pyx_t_3 = 0;
14074  goto __pyx_L0;
14075 
14076  /* "View.MemoryView":590
14077  *
14078  * @property
14079  * def nbytes(self): # <<<<<<<<<<<<<<
14080  * return self.size * self.view.itemsize
14081  *
14082  */
14083 
14084  /* function exit code */
14085  __pyx_L1_error:;
14086  __Pyx_XDECREF(__pyx_t_1);
14087  __Pyx_XDECREF(__pyx_t_2);
14088  __Pyx_XDECREF(__pyx_t_3);
14089  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14090  __pyx_r = NULL;
14091  __pyx_L0:;
14092  __Pyx_XGIVEREF(__pyx_r);
14093  __Pyx_RefNannyFinishContext();
14094  return __pyx_r;
14095 }
14096 
14097 /* "View.MemoryView":594
14098  *
14099  * @property
14100  * def size(self): # <<<<<<<<<<<<<<
14101  * if self._size is None:
14102  * result = 1
14103  */
14104 
14105 /* Python wrapper */
14106 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
14107 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
14108  PyObject *__pyx_r = 0;
14109  __Pyx_RefNannyDeclarations
14110  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14111  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14112 
14113  /* function exit code */
14114  __Pyx_RefNannyFinishContext();
14115  return __pyx_r;
14116 }
14117 
14118 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
14119  PyObject *__pyx_v_result = NULL;
14120  PyObject *__pyx_v_length = NULL;
14121  PyObject *__pyx_r = NULL;
14122  __Pyx_RefNannyDeclarations
14123  int __pyx_t_1;
14124  int __pyx_t_2;
14125  Py_ssize_t *__pyx_t_3;
14126  Py_ssize_t *__pyx_t_4;
14127  Py_ssize_t *__pyx_t_5;
14128  PyObject *__pyx_t_6 = NULL;
14129  int __pyx_lineno = 0;
14130  const char *__pyx_filename = NULL;
14131  int __pyx_clineno = 0;
14132  __Pyx_RefNannySetupContext("__get__", 0);
14133 
14134  /* "View.MemoryView":595
14135  * @property
14136  * def size(self):
14137  * if self._size is None: # <<<<<<<<<<<<<<
14138  * result = 1
14139  *
14140  */
14141  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
14142  __pyx_t_2 = (__pyx_t_1 != 0);
14143  if (__pyx_t_2) {
14144 
14145  /* "View.MemoryView":596
14146  * def size(self):
14147  * if self._size is None:
14148  * result = 1 # <<<<<<<<<<<<<<
14149  *
14150  * for length in self.view.shape[:self.view.ndim]:
14151  */
14152  __Pyx_INCREF(__pyx_int_1);
14153  __pyx_v_result = __pyx_int_1;
14154 
14155  /* "View.MemoryView":598
14156  * result = 1
14157  *
14158  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
14159  * result *= length
14160  *
14161  */
14162  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
14163  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
14164  __pyx_t_3 = __pyx_t_5;
14165  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 598, __pyx_L1_error)
14166  __Pyx_GOTREF(__pyx_t_6);
14167  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
14168  __pyx_t_6 = 0;
14169 
14170  /* "View.MemoryView":599
14171  *
14172  * for length in self.view.shape[:self.view.ndim]:
14173  * result *= length # <<<<<<<<<<<<<<
14174  *
14175  * self._size = result
14176  */
14177  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 599, __pyx_L1_error)
14178  __Pyx_GOTREF(__pyx_t_6);
14179  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
14180  __pyx_t_6 = 0;
14181  }
14182 
14183  /* "View.MemoryView":601
14184  * result *= length
14185  *
14186  * self._size = result # <<<<<<<<<<<<<<
14187  *
14188  * return self._size
14189  */
14190  __Pyx_INCREF(__pyx_v_result);
14191  __Pyx_GIVEREF(__pyx_v_result);
14192  __Pyx_GOTREF(__pyx_v_self->_size);
14193  __Pyx_DECREF(__pyx_v_self->_size);
14194  __pyx_v_self->_size = __pyx_v_result;
14195 
14196  /* "View.MemoryView":595
14197  * @property
14198  * def size(self):
14199  * if self._size is None: # <<<<<<<<<<<<<<
14200  * result = 1
14201  *
14202  */
14203  }
14204 
14205  /* "View.MemoryView":603
14206  * self._size = result
14207  *
14208  * return self._size # <<<<<<<<<<<<<<
14209  *
14210  * def __len__(self):
14211  */
14212  __Pyx_XDECREF(__pyx_r);
14213  __Pyx_INCREF(__pyx_v_self->_size);
14214  __pyx_r = __pyx_v_self->_size;
14215  goto __pyx_L0;
14216 
14217  /* "View.MemoryView":594
14218  *
14219  * @property
14220  * def size(self): # <<<<<<<<<<<<<<
14221  * if self._size is None:
14222  * result = 1
14223  */
14224 
14225  /* function exit code */
14226  __pyx_L1_error:;
14227  __Pyx_XDECREF(__pyx_t_6);
14228  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14229  __pyx_r = NULL;
14230  __pyx_L0:;
14231  __Pyx_XDECREF(__pyx_v_result);
14232  __Pyx_XDECREF(__pyx_v_length);
14233  __Pyx_XGIVEREF(__pyx_r);
14234  __Pyx_RefNannyFinishContext();
14235  return __pyx_r;
14236 }
14237 
14238 /* "View.MemoryView":605
14239  * return self._size
14240  *
14241  * def __len__(self): # <<<<<<<<<<<<<<
14242  * if self.view.ndim >= 1:
14243  * return self.view.shape[0]
14244  */
14245 
14246 /* Python wrapper */
14247 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
14248 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
14249  Py_ssize_t __pyx_r;
14250  __Pyx_RefNannyDeclarations
14251  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
14252  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14253 
14254  /* function exit code */
14255  __Pyx_RefNannyFinishContext();
14256  return __pyx_r;
14257 }
14258 
14259 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
14260  Py_ssize_t __pyx_r;
14261  __Pyx_RefNannyDeclarations
14262  int __pyx_t_1;
14263  __Pyx_RefNannySetupContext("__len__", 0);
14264 
14265  /* "View.MemoryView":606
14266  *
14267  * def __len__(self):
14268  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14269  * return self.view.shape[0]
14270  *
14271  */
14272  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14273  if (__pyx_t_1) {
14274 
14275  /* "View.MemoryView":607
14276  * def __len__(self):
14277  * if self.view.ndim >= 1:
14278  * return self.view.shape[0] # <<<<<<<<<<<<<<
14279  *
14280  * return 0
14281  */
14282  __pyx_r = (__pyx_v_self->view.shape[0]);
14283  goto __pyx_L0;
14284 
14285  /* "View.MemoryView":606
14286  *
14287  * def __len__(self):
14288  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14289  * return self.view.shape[0]
14290  *
14291  */
14292  }
14293 
14294  /* "View.MemoryView":609
14295  * return self.view.shape[0]
14296  *
14297  * return 0 # <<<<<<<<<<<<<<
14298  *
14299  * def __repr__(self):
14300  */
14301  __pyx_r = 0;
14302  goto __pyx_L0;
14303 
14304  /* "View.MemoryView":605
14305  * return self._size
14306  *
14307  * def __len__(self): # <<<<<<<<<<<<<<
14308  * if self.view.ndim >= 1:
14309  * return self.view.shape[0]
14310  */
14311 
14312  /* function exit code */
14313  __pyx_L0:;
14314  __Pyx_RefNannyFinishContext();
14315  return __pyx_r;
14316 }
14317 
14318 /* "View.MemoryView":611
14319  * return 0
14320  *
14321  * def __repr__(self): # <<<<<<<<<<<<<<
14322  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14323  * id(self))
14324  */
14325 
14326 /* Python wrapper */
14327 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
14328 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14329  PyObject *__pyx_r = 0;
14330  __Pyx_RefNannyDeclarations
14331  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
14332  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14333 
14334  /* function exit code */
14335  __Pyx_RefNannyFinishContext();
14336  return __pyx_r;
14337 }
14338 
14339 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
14340  PyObject *__pyx_r = NULL;
14341  __Pyx_RefNannyDeclarations
14342  PyObject *__pyx_t_1 = NULL;
14343  PyObject *__pyx_t_2 = NULL;
14344  PyObject *__pyx_t_3 = NULL;
14345  int __pyx_lineno = 0;
14346  const char *__pyx_filename = NULL;
14347  int __pyx_clineno = 0;
14348  __Pyx_RefNannySetupContext("__repr__", 0);
14349 
14350  /* "View.MemoryView":612
14351  *
14352  * def __repr__(self):
14353  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14354  * id(self))
14355  *
14356  */
14357  __Pyx_XDECREF(__pyx_r);
14358  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
14359  __Pyx_GOTREF(__pyx_t_1);
14360  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 612, __pyx_L1_error)
14361  __Pyx_GOTREF(__pyx_t_2);
14362  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14363  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 612, __pyx_L1_error)
14364  __Pyx_GOTREF(__pyx_t_1);
14365  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14366 
14367  /* "View.MemoryView":613
14368  * def __repr__(self):
14369  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14370  * id(self)) # <<<<<<<<<<<<<<
14371  *
14372  * def __str__(self):
14373  */
14374  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 613, __pyx_L1_error)
14375  __Pyx_GOTREF(__pyx_t_2);
14376 
14377  /* "View.MemoryView":612
14378  *
14379  * def __repr__(self):
14380  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14381  * id(self))
14382  *
14383  */
14384  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 612, __pyx_L1_error)
14385  __Pyx_GOTREF(__pyx_t_3);
14386  __Pyx_GIVEREF(__pyx_t_1);
14387  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14388  __Pyx_GIVEREF(__pyx_t_2);
14389  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14390  __pyx_t_1 = 0;
14391  __pyx_t_2 = 0;
14392  __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(2, 612, __pyx_L1_error)
14393  __Pyx_GOTREF(__pyx_t_2);
14394  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14395  __pyx_r = __pyx_t_2;
14396  __pyx_t_2 = 0;
14397  goto __pyx_L0;
14398 
14399  /* "View.MemoryView":611
14400  * return 0
14401  *
14402  * def __repr__(self): # <<<<<<<<<<<<<<
14403  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14404  * id(self))
14405  */
14406 
14407  /* function exit code */
14408  __pyx_L1_error:;
14409  __Pyx_XDECREF(__pyx_t_1);
14410  __Pyx_XDECREF(__pyx_t_2);
14411  __Pyx_XDECREF(__pyx_t_3);
14412  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14413  __pyx_r = NULL;
14414  __pyx_L0:;
14415  __Pyx_XGIVEREF(__pyx_r);
14416  __Pyx_RefNannyFinishContext();
14417  return __pyx_r;
14418 }
14419 
14420 /* "View.MemoryView":615
14421  * id(self))
14422  *
14423  * def __str__(self): # <<<<<<<<<<<<<<
14424  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14425  *
14426  */
14427 
14428 /* Python wrapper */
14429 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
14430 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14431  PyObject *__pyx_r = 0;
14432  __Pyx_RefNannyDeclarations
14433  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
14434  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14435 
14436  /* function exit code */
14437  __Pyx_RefNannyFinishContext();
14438  return __pyx_r;
14439 }
14440 
14441 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
14442  PyObject *__pyx_r = NULL;
14443  __Pyx_RefNannyDeclarations
14444  PyObject *__pyx_t_1 = NULL;
14445  PyObject *__pyx_t_2 = NULL;
14446  int __pyx_lineno = 0;
14447  const char *__pyx_filename = NULL;
14448  int __pyx_clineno = 0;
14449  __Pyx_RefNannySetupContext("__str__", 0);
14450 
14451  /* "View.MemoryView":616
14452  *
14453  * def __str__(self):
14454  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
14455  *
14456  *
14457  */
14458  __Pyx_XDECREF(__pyx_r);
14459  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
14460  __Pyx_GOTREF(__pyx_t_1);
14461  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
14462  __Pyx_GOTREF(__pyx_t_2);
14463  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14464  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
14465  __Pyx_GOTREF(__pyx_t_1);
14466  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14467  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 616, __pyx_L1_error)
14468  __Pyx_GOTREF(__pyx_t_2);
14469  __Pyx_GIVEREF(__pyx_t_1);
14470  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14471  __pyx_t_1 = 0;
14472  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 616, __pyx_L1_error)
14473  __Pyx_GOTREF(__pyx_t_1);
14474  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14475  __pyx_r = __pyx_t_1;
14476  __pyx_t_1 = 0;
14477  goto __pyx_L0;
14478 
14479  /* "View.MemoryView":615
14480  * id(self))
14481  *
14482  * def __str__(self): # <<<<<<<<<<<<<<
14483  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14484  *
14485  */
14486 
14487  /* function exit code */
14488  __pyx_L1_error:;
14489  __Pyx_XDECREF(__pyx_t_1);
14490  __Pyx_XDECREF(__pyx_t_2);
14491  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14492  __pyx_r = NULL;
14493  __pyx_L0:;
14494  __Pyx_XGIVEREF(__pyx_r);
14495  __Pyx_RefNannyFinishContext();
14496  return __pyx_r;
14497 }
14498 
14499 /* "View.MemoryView":619
14500  *
14501  *
14502  * def is_c_contig(self): # <<<<<<<<<<<<<<
14503  * cdef __Pyx_memviewslice *mslice
14504  * cdef __Pyx_memviewslice tmp
14505  */
14506 
14507 /* Python wrapper */
14508 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14509 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14510  PyObject *__pyx_r = 0;
14511  __Pyx_RefNannyDeclarations
14512  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
14513  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14514 
14515  /* function exit code */
14516  __Pyx_RefNannyFinishContext();
14517  return __pyx_r;
14518 }
14519 
14520 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14521  __Pyx_memviewslice *__pyx_v_mslice;
14522  __Pyx_memviewslice __pyx_v_tmp;
14523  PyObject *__pyx_r = NULL;
14524  __Pyx_RefNannyDeclarations
14525  __Pyx_memviewslice *__pyx_t_1;
14526  PyObject *__pyx_t_2 = NULL;
14527  int __pyx_lineno = 0;
14528  const char *__pyx_filename = NULL;
14529  int __pyx_clineno = 0;
14530  __Pyx_RefNannySetupContext("is_c_contig", 0);
14531 
14532  /* "View.MemoryView":622
14533  * cdef __Pyx_memviewslice *mslice
14534  * cdef __Pyx_memviewslice tmp
14535  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14536  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14537  *
14538  */
14539  __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(2, 622, __pyx_L1_error)
14540  __pyx_v_mslice = __pyx_t_1;
14541 
14542  /* "View.MemoryView":623
14543  * cdef __Pyx_memviewslice tmp
14544  * mslice = get_slice_from_memview(self, &tmp)
14545  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
14546  *
14547  * def is_f_contig(self):
14548  */
14549  __Pyx_XDECREF(__pyx_r);
14550  __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(2, 623, __pyx_L1_error)
14551  __Pyx_GOTREF(__pyx_t_2);
14552  __pyx_r = __pyx_t_2;
14553  __pyx_t_2 = 0;
14554  goto __pyx_L0;
14555 
14556  /* "View.MemoryView":619
14557  *
14558  *
14559  * def is_c_contig(self): # <<<<<<<<<<<<<<
14560  * cdef __Pyx_memviewslice *mslice
14561  * cdef __Pyx_memviewslice tmp
14562  */
14563 
14564  /* function exit code */
14565  __pyx_L1_error:;
14566  __Pyx_XDECREF(__pyx_t_2);
14567  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14568  __pyx_r = NULL;
14569  __pyx_L0:;
14570  __Pyx_XGIVEREF(__pyx_r);
14571  __Pyx_RefNannyFinishContext();
14572  return __pyx_r;
14573 }
14574 
14575 /* "View.MemoryView":625
14576  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14577  *
14578  * def is_f_contig(self): # <<<<<<<<<<<<<<
14579  * cdef __Pyx_memviewslice *mslice
14580  * cdef __Pyx_memviewslice tmp
14581  */
14582 
14583 /* Python wrapper */
14584 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14585 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14586  PyObject *__pyx_r = 0;
14587  __Pyx_RefNannyDeclarations
14588  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
14589  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14590 
14591  /* function exit code */
14592  __Pyx_RefNannyFinishContext();
14593  return __pyx_r;
14594 }
14595 
14596 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14597  __Pyx_memviewslice *__pyx_v_mslice;
14598  __Pyx_memviewslice __pyx_v_tmp;
14599  PyObject *__pyx_r = NULL;
14600  __Pyx_RefNannyDeclarations
14601  __Pyx_memviewslice *__pyx_t_1;
14602  PyObject *__pyx_t_2 = NULL;
14603  int __pyx_lineno = 0;
14604  const char *__pyx_filename = NULL;
14605  int __pyx_clineno = 0;
14606  __Pyx_RefNannySetupContext("is_f_contig", 0);
14607 
14608  /* "View.MemoryView":628
14609  * cdef __Pyx_memviewslice *mslice
14610  * cdef __Pyx_memviewslice tmp
14611  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14612  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14613  *
14614  */
14615  __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(2, 628, __pyx_L1_error)
14616  __pyx_v_mslice = __pyx_t_1;
14617 
14618  /* "View.MemoryView":629
14619  * cdef __Pyx_memviewslice tmp
14620  * mslice = get_slice_from_memview(self, &tmp)
14621  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
14622  *
14623  * def copy(self):
14624  */
14625  __Pyx_XDECREF(__pyx_r);
14626  __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(2, 629, __pyx_L1_error)
14627  __Pyx_GOTREF(__pyx_t_2);
14628  __pyx_r = __pyx_t_2;
14629  __pyx_t_2 = 0;
14630  goto __pyx_L0;
14631 
14632  /* "View.MemoryView":625
14633  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14634  *
14635  * def is_f_contig(self): # <<<<<<<<<<<<<<
14636  * cdef __Pyx_memviewslice *mslice
14637  * cdef __Pyx_memviewslice tmp
14638  */
14639 
14640  /* function exit code */
14641  __pyx_L1_error:;
14642  __Pyx_XDECREF(__pyx_t_2);
14643  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14644  __pyx_r = NULL;
14645  __pyx_L0:;
14646  __Pyx_XGIVEREF(__pyx_r);
14647  __Pyx_RefNannyFinishContext();
14648  return __pyx_r;
14649 }
14650 
14651 /* "View.MemoryView":631
14652  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14653  *
14654  * def copy(self): # <<<<<<<<<<<<<<
14655  * cdef __Pyx_memviewslice mslice
14656  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14657  */
14658 
14659 /* Python wrapper */
14660 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14661 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14662  PyObject *__pyx_r = 0;
14663  __Pyx_RefNannyDeclarations
14664  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
14665  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
14666 
14667  /* function exit code */
14668  __Pyx_RefNannyFinishContext();
14669  return __pyx_r;
14670 }
14671 
14672 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
14673  __Pyx_memviewslice __pyx_v_mslice;
14674  int __pyx_v_flags;
14675  PyObject *__pyx_r = NULL;
14676  __Pyx_RefNannyDeclarations
14677  __Pyx_memviewslice __pyx_t_1;
14678  PyObject *__pyx_t_2 = NULL;
14679  int __pyx_lineno = 0;
14680  const char *__pyx_filename = NULL;
14681  int __pyx_clineno = 0;
14682  __Pyx_RefNannySetupContext("copy", 0);
14683 
14684  /* "View.MemoryView":633
14685  * def copy(self):
14686  * cdef __Pyx_memviewslice mslice
14687  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
14688  *
14689  * slice_copy(self, &mslice)
14690  */
14691  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14692 
14693  /* "View.MemoryView":635
14694  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14695  *
14696  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
14697  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
14698  * self.view.itemsize,
14699  */
14700  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14701 
14702  /* "View.MemoryView":636
14703  *
14704  * slice_copy(self, &mslice)
14705  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
14706  * self.view.itemsize,
14707  * flags|PyBUF_C_CONTIGUOUS,
14708  */
14709  __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(2, 636, __pyx_L1_error)
14710  __pyx_v_mslice = __pyx_t_1;
14711 
14712  /* "View.MemoryView":641
14713  * self.dtype_is_object)
14714  *
14715  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
14716  *
14717  * def copy_fortran(self):
14718  */
14719  __Pyx_XDECREF(__pyx_r);
14720  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 641, __pyx_L1_error)
14721  __Pyx_GOTREF(__pyx_t_2);
14722  __pyx_r = __pyx_t_2;
14723  __pyx_t_2 = 0;
14724  goto __pyx_L0;
14725 
14726  /* "View.MemoryView":631
14727  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14728  *
14729  * def copy(self): # <<<<<<<<<<<<<<
14730  * cdef __Pyx_memviewslice mslice
14731  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14732  */
14733 
14734  /* function exit code */
14735  __pyx_L1_error:;
14736  __Pyx_XDECREF(__pyx_t_2);
14737  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14738  __pyx_r = NULL;
14739  __pyx_L0:;
14740  __Pyx_XGIVEREF(__pyx_r);
14741  __Pyx_RefNannyFinishContext();
14742  return __pyx_r;
14743 }
14744 
14745 /* "View.MemoryView":643
14746  * return memoryview_copy_from_slice(self, &mslice)
14747  *
14748  * def copy_fortran(self): # <<<<<<<<<<<<<<
14749  * cdef __Pyx_memviewslice src, dst
14750  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14751  */
14752 
14753 /* Python wrapper */
14754 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14755 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14756  PyObject *__pyx_r = 0;
14757  __Pyx_RefNannyDeclarations
14758  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
14759  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
14760 
14761  /* function exit code */
14762  __Pyx_RefNannyFinishContext();
14763  return __pyx_r;
14764 }
14765 
14766 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
14767  __Pyx_memviewslice __pyx_v_src;
14768  __Pyx_memviewslice __pyx_v_dst;
14769  int __pyx_v_flags;
14770  PyObject *__pyx_r = NULL;
14771  __Pyx_RefNannyDeclarations
14772  __Pyx_memviewslice __pyx_t_1;
14773  PyObject *__pyx_t_2 = NULL;
14774  int __pyx_lineno = 0;
14775  const char *__pyx_filename = NULL;
14776  int __pyx_clineno = 0;
14777  __Pyx_RefNannySetupContext("copy_fortran", 0);
14778 
14779  /* "View.MemoryView":645
14780  * def copy_fortran(self):
14781  * cdef __Pyx_memviewslice src, dst
14782  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
14783  *
14784  * slice_copy(self, &src)
14785  */
14786  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14787 
14788  /* "View.MemoryView":647
14789  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14790  *
14791  * slice_copy(self, &src) # <<<<<<<<<<<<<<
14792  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
14793  * self.view.itemsize,
14794  */
14795  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14796 
14797  /* "View.MemoryView":648
14798  *
14799  * slice_copy(self, &src)
14800  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
14801  * self.view.itemsize,
14802  * flags|PyBUF_F_CONTIGUOUS,
14803  */
14804  __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(2, 648, __pyx_L1_error)
14805  __pyx_v_dst = __pyx_t_1;
14806 
14807  /* "View.MemoryView":653
14808  * self.dtype_is_object)
14809  *
14810  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
14811  *
14812  *
14813  */
14814  __Pyx_XDECREF(__pyx_r);
14815  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error)
14816  __Pyx_GOTREF(__pyx_t_2);
14817  __pyx_r = __pyx_t_2;
14818  __pyx_t_2 = 0;
14819  goto __pyx_L0;
14820 
14821  /* "View.MemoryView":643
14822  * return memoryview_copy_from_slice(self, &mslice)
14823  *
14824  * def copy_fortran(self): # <<<<<<<<<<<<<<
14825  * cdef __Pyx_memviewslice src, dst
14826  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14827  */
14828 
14829  /* function exit code */
14830  __pyx_L1_error:;
14831  __Pyx_XDECREF(__pyx_t_2);
14832  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14833  __pyx_r = NULL;
14834  __pyx_L0:;
14835  __Pyx_XGIVEREF(__pyx_r);
14836  __Pyx_RefNannyFinishContext();
14837  return __pyx_r;
14838 }
14839 
14840 /* "(tree fragment)":1
14841  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14842  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14843  * def __setstate_cython__(self, __pyx_state):
14844  */
14845 
14846 /* Python wrapper */
14847 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14848 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14849  PyObject *__pyx_r = 0;
14850  __Pyx_RefNannyDeclarations
14851  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14852  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14853 
14854  /* function exit code */
14855  __Pyx_RefNannyFinishContext();
14856  return __pyx_r;
14857 }
14858 
14859 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
14860  PyObject *__pyx_r = NULL;
14861  __Pyx_RefNannyDeclarations
14862  PyObject *__pyx_t_1 = NULL;
14863  int __pyx_lineno = 0;
14864  const char *__pyx_filename = NULL;
14865  int __pyx_clineno = 0;
14866  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14867 
14868  /* "(tree fragment)":2
14869  * def __reduce_cython__(self):
14870  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14871  * def __setstate_cython__(self, __pyx_state):
14872  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14873  */
14874  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
14875  __Pyx_GOTREF(__pyx_t_1);
14876  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14877  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14878  __PYX_ERR(2, 2, __pyx_L1_error)
14879 
14880  /* "(tree fragment)":1
14881  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14882  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14883  * def __setstate_cython__(self, __pyx_state):
14884  */
14885 
14886  /* function exit code */
14887  __pyx_L1_error:;
14888  __Pyx_XDECREF(__pyx_t_1);
14889  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14890  __pyx_r = NULL;
14891  __Pyx_XGIVEREF(__pyx_r);
14892  __Pyx_RefNannyFinishContext();
14893  return __pyx_r;
14894 }
14895 
14896 /* "(tree fragment)":3
14897  * def __reduce_cython__(self):
14898  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14899  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14900  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14901  */
14902 
14903 /* Python wrapper */
14904 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
14905 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14906  PyObject *__pyx_r = 0;
14907  __Pyx_RefNannyDeclarations
14908  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14909  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14910 
14911  /* function exit code */
14912  __Pyx_RefNannyFinishContext();
14913  return __pyx_r;
14914 }
14915 
14916 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) {
14917  PyObject *__pyx_r = NULL;
14918  __Pyx_RefNannyDeclarations
14919  PyObject *__pyx_t_1 = NULL;
14920  int __pyx_lineno = 0;
14921  const char *__pyx_filename = NULL;
14922  int __pyx_clineno = 0;
14923  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14924 
14925  /* "(tree fragment)":4
14926  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14927  * def __setstate_cython__(self, __pyx_state):
14928  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14929  */
14930  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
14931  __Pyx_GOTREF(__pyx_t_1);
14932  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14933  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14934  __PYX_ERR(2, 4, __pyx_L1_error)
14935 
14936  /* "(tree fragment)":3
14937  * def __reduce_cython__(self):
14938  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14939  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14940  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14941  */
14942 
14943  /* function exit code */
14944  __pyx_L1_error:;
14945  __Pyx_XDECREF(__pyx_t_1);
14946  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14947  __pyx_r = NULL;
14948  __Pyx_XGIVEREF(__pyx_r);
14949  __Pyx_RefNannyFinishContext();
14950  return __pyx_r;
14951 }
14952 
14953 /* "View.MemoryView":657
14954  *
14955  * @cname('__pyx_memoryview_new')
14956  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14957  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14958  * result.typeinfo = typeinfo
14959  */
14960 
14961 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14962  struct __pyx_memoryview_obj *__pyx_v_result = 0;
14963  PyObject *__pyx_r = NULL;
14964  __Pyx_RefNannyDeclarations
14965  PyObject *__pyx_t_1 = NULL;
14966  PyObject *__pyx_t_2 = NULL;
14967  PyObject *__pyx_t_3 = NULL;
14968  int __pyx_lineno = 0;
14969  const char *__pyx_filename = NULL;
14970  int __pyx_clineno = 0;
14971  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
14972 
14973  /* "View.MemoryView":658
14974  * @cname('__pyx_memoryview_new')
14975  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14976  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
14977  * result.typeinfo = typeinfo
14978  * return result
14979  */
14980  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 658, __pyx_L1_error)
14981  __Pyx_GOTREF(__pyx_t_1);
14982  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
14983  __Pyx_GOTREF(__pyx_t_2);
14984  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __pyx_L1_error)
14985  __Pyx_GOTREF(__pyx_t_3);
14986  __Pyx_INCREF(__pyx_v_o);
14987  __Pyx_GIVEREF(__pyx_v_o);
14988  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14989  __Pyx_GIVEREF(__pyx_t_1);
14990  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14991  __Pyx_GIVEREF(__pyx_t_2);
14992  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14993  __pyx_t_1 = 0;
14994  __pyx_t_2 = 0;
14995  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
14996  __Pyx_GOTREF(__pyx_t_2);
14997  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14998  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14999  __pyx_t_2 = 0;
15000 
15001  /* "View.MemoryView":659
15002  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
15003  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15004  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
15005  * return result
15006  *
15007  */
15008  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
15009 
15010  /* "View.MemoryView":660
15011  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15012  * result.typeinfo = typeinfo
15013  * return result # <<<<<<<<<<<<<<
15014  *
15015  * @cname('__pyx_memoryview_check')
15016  */
15017  __Pyx_XDECREF(__pyx_r);
15018  __Pyx_INCREF(((PyObject *)__pyx_v_result));
15019  __pyx_r = ((PyObject *)__pyx_v_result);
15020  goto __pyx_L0;
15021 
15022  /* "View.MemoryView":657
15023  *
15024  * @cname('__pyx_memoryview_new')
15025  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
15026  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
15027  * result.typeinfo = typeinfo
15028  */
15029 
15030  /* function exit code */
15031  __pyx_L1_error:;
15032  __Pyx_XDECREF(__pyx_t_1);
15033  __Pyx_XDECREF(__pyx_t_2);
15034  __Pyx_XDECREF(__pyx_t_3);
15035  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
15036  __pyx_r = 0;
15037  __pyx_L0:;
15038  __Pyx_XDECREF((PyObject *)__pyx_v_result);
15039  __Pyx_XGIVEREF(__pyx_r);
15040  __Pyx_RefNannyFinishContext();
15041  return __pyx_r;
15042 }
15043 
15044 /* "View.MemoryView":663
15045  *
15046  * @cname('__pyx_memoryview_check')
15047  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
15048  * return isinstance(o, memoryview)
15049  *
15050  */
15051 
15052 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
15053  int __pyx_r;
15054  __Pyx_RefNannyDeclarations
15055  int __pyx_t_1;
15056  __Pyx_RefNannySetupContext("memoryview_check", 0);
15057 
15058  /* "View.MemoryView":664
15059  * @cname('__pyx_memoryview_check')
15060  * cdef inline bint memoryview_check(object o):
15061  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
15062  *
15063  * cdef tuple _unellipsify(object index, int ndim):
15064  */
15065  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
15066  __pyx_r = __pyx_t_1;
15067  goto __pyx_L0;
15068 
15069  /* "View.MemoryView":663
15070  *
15071  * @cname('__pyx_memoryview_check')
15072  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
15073  * return isinstance(o, memoryview)
15074  *
15075  */
15076 
15077  /* function exit code */
15078  __pyx_L0:;
15079  __Pyx_RefNannyFinishContext();
15080  return __pyx_r;
15081 }
15082 
15083 /* "View.MemoryView":666
15084  * return isinstance(o, memoryview)
15085  *
15086  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15087  * """
15088  * Replace all ellipses with full slices and fill incomplete indices with
15089  */
15090 
15091 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
15092  PyObject *__pyx_v_tup = NULL;
15093  PyObject *__pyx_v_result = NULL;
15094  int __pyx_v_have_slices;
15095  int __pyx_v_seen_ellipsis;
15096  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
15097  PyObject *__pyx_v_item = NULL;
15098  Py_ssize_t __pyx_v_nslices;
15099  PyObject *__pyx_r = NULL;
15100  __Pyx_RefNannyDeclarations
15101  int __pyx_t_1;
15102  int __pyx_t_2;
15103  PyObject *__pyx_t_3 = NULL;
15104  PyObject *__pyx_t_4 = NULL;
15105  Py_ssize_t __pyx_t_5;
15106  PyObject *(*__pyx_t_6)(PyObject *);
15107  PyObject *__pyx_t_7 = NULL;
15108  Py_ssize_t __pyx_t_8;
15109  int __pyx_t_9;
15110  int __pyx_t_10;
15111  PyObject *__pyx_t_11 = NULL;
15112  int __pyx_lineno = 0;
15113  const char *__pyx_filename = NULL;
15114  int __pyx_clineno = 0;
15115  __Pyx_RefNannySetupContext("_unellipsify", 0);
15116 
15117  /* "View.MemoryView":671
15118  * full slices.
15119  * """
15120  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15121  * tup = (index,)
15122  * else:
15123  */
15124  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
15125  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15126  if (__pyx_t_2) {
15127 
15128  /* "View.MemoryView":672
15129  * """
15130  * if not isinstance(index, tuple):
15131  * tup = (index,) # <<<<<<<<<<<<<<
15132  * else:
15133  * tup = index
15134  */
15135  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 672, __pyx_L1_error)
15136  __Pyx_GOTREF(__pyx_t_3);
15137  __Pyx_INCREF(__pyx_v_index);
15138  __Pyx_GIVEREF(__pyx_v_index);
15139  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
15140  __pyx_v_tup = __pyx_t_3;
15141  __pyx_t_3 = 0;
15142 
15143  /* "View.MemoryView":671
15144  * full slices.
15145  * """
15146  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
15147  * tup = (index,)
15148  * else:
15149  */
15150  goto __pyx_L3;
15151  }
15152 
15153  /* "View.MemoryView":674
15154  * tup = (index,)
15155  * else:
15156  * tup = index # <<<<<<<<<<<<<<
15157  *
15158  * result = []
15159  */
15160  /*else*/ {
15161  __Pyx_INCREF(__pyx_v_index);
15162  __pyx_v_tup = __pyx_v_index;
15163  }
15164  __pyx_L3:;
15165 
15166  /* "View.MemoryView":676
15167  * tup = index
15168  *
15169  * result = [] # <<<<<<<<<<<<<<
15170  * have_slices = False
15171  * seen_ellipsis = False
15172  */
15173  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 676, __pyx_L1_error)
15174  __Pyx_GOTREF(__pyx_t_3);
15175  __pyx_v_result = ((PyObject*)__pyx_t_3);
15176  __pyx_t_3 = 0;
15177 
15178  /* "View.MemoryView":677
15179  *
15180  * result = []
15181  * have_slices = False # <<<<<<<<<<<<<<
15182  * seen_ellipsis = False
15183  * for idx, item in enumerate(tup):
15184  */
15185  __pyx_v_have_slices = 0;
15186 
15187  /* "View.MemoryView":678
15188  * result = []
15189  * have_slices = False
15190  * seen_ellipsis = False # <<<<<<<<<<<<<<
15191  * for idx, item in enumerate(tup):
15192  * if item is Ellipsis:
15193  */
15194  __pyx_v_seen_ellipsis = 0;
15195 
15196  /* "View.MemoryView":679
15197  * have_slices = False
15198  * seen_ellipsis = False
15199  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15200  * if item is Ellipsis:
15201  * if not seen_ellipsis:
15202  */
15203  __Pyx_INCREF(__pyx_int_0);
15204  __pyx_t_3 = __pyx_int_0;
15205  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
15206  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
15207  __pyx_t_6 = NULL;
15208  } else {
15209  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 679, __pyx_L1_error)
15210  __Pyx_GOTREF(__pyx_t_4);
15211  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 679, __pyx_L1_error)
15212  }
15213  for (;;) {
15214  if (likely(!__pyx_t_6)) {
15215  if (likely(PyList_CheckExact(__pyx_t_4))) {
15216  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
15217  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15218  __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(2, 679, __pyx_L1_error)
15219  #else
15220  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
15221  __Pyx_GOTREF(__pyx_t_7);
15222  #endif
15223  } else {
15224  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
15225  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15226  __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(2, 679, __pyx_L1_error)
15227  #else
15228  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
15229  __Pyx_GOTREF(__pyx_t_7);
15230  #endif
15231  }
15232  } else {
15233  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
15234  if (unlikely(!__pyx_t_7)) {
15235  PyObject* exc_type = PyErr_Occurred();
15236  if (exc_type) {
15237  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15238  else __PYX_ERR(2, 679, __pyx_L1_error)
15239  }
15240  break;
15241  }
15242  __Pyx_GOTREF(__pyx_t_7);
15243  }
15244  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
15245  __pyx_t_7 = 0;
15246  __Pyx_INCREF(__pyx_t_3);
15247  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
15248  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 679, __pyx_L1_error)
15249  __Pyx_GOTREF(__pyx_t_7);
15250  __Pyx_DECREF(__pyx_t_3);
15251  __pyx_t_3 = __pyx_t_7;
15252  __pyx_t_7 = 0;
15253 
15254  /* "View.MemoryView":680
15255  * seen_ellipsis = False
15256  * for idx, item in enumerate(tup):
15257  * if item is Ellipsis: # <<<<<<<<<<<<<<
15258  * if not seen_ellipsis:
15259  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15260  */
15261  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
15262  __pyx_t_1 = (__pyx_t_2 != 0);
15263  if (__pyx_t_1) {
15264 
15265  /* "View.MemoryView":681
15266  * for idx, item in enumerate(tup):
15267  * if item is Ellipsis:
15268  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15269  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15270  * seen_ellipsis = True
15271  */
15272  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15273  if (__pyx_t_1) {
15274 
15275  /* "View.MemoryView":682
15276  * if item is Ellipsis:
15277  * if not seen_ellipsis:
15278  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
15279  * seen_ellipsis = True
15280  * else:
15281  */
15282  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
15283  __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(2, 682, __pyx_L1_error)
15284  __Pyx_GOTREF(__pyx_t_7);
15285  { Py_ssize_t __pyx_temp;
15286  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15287  __Pyx_INCREF(__pyx_slice__17);
15288  __Pyx_GIVEREF(__pyx_slice__17);
15289  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__17);
15290  }
15291  }
15292  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 682, __pyx_L1_error)
15293  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15294 
15295  /* "View.MemoryView":683
15296  * if not seen_ellipsis:
15297  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15298  * seen_ellipsis = True # <<<<<<<<<<<<<<
15299  * else:
15300  * result.append(slice(None))
15301  */
15302  __pyx_v_seen_ellipsis = 1;
15303 
15304  /* "View.MemoryView":681
15305  * for idx, item in enumerate(tup):
15306  * if item is Ellipsis:
15307  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15308  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15309  * seen_ellipsis = True
15310  */
15311  goto __pyx_L7;
15312  }
15313 
15314  /* "View.MemoryView":685
15315  * seen_ellipsis = True
15316  * else:
15317  * result.append(slice(None)) # <<<<<<<<<<<<<<
15318  * have_slices = True
15319  * else:
15320  */
15321  /*else*/ {
15322  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__17); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 685, __pyx_L1_error)
15323  }
15324  __pyx_L7:;
15325 
15326  /* "View.MemoryView":686
15327  * else:
15328  * result.append(slice(None))
15329  * have_slices = True # <<<<<<<<<<<<<<
15330  * else:
15331  * if not isinstance(item, slice) and not PyIndex_Check(item):
15332  */
15333  __pyx_v_have_slices = 1;
15334 
15335  /* "View.MemoryView":680
15336  * seen_ellipsis = False
15337  * for idx, item in enumerate(tup):
15338  * if item is Ellipsis: # <<<<<<<<<<<<<<
15339  * if not seen_ellipsis:
15340  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15341  */
15342  goto __pyx_L6;
15343  }
15344 
15345  /* "View.MemoryView":688
15346  * have_slices = True
15347  * else:
15348  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15349  * raise TypeError("Cannot index with type '%s'" % type(item))
15350  *
15351  */
15352  /*else*/ {
15353  __pyx_t_2 = PySlice_Check(__pyx_v_item);
15354  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15355  if (__pyx_t_10) {
15356  } else {
15357  __pyx_t_1 = __pyx_t_10;
15358  goto __pyx_L9_bool_binop_done;
15359  }
15360  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15361  __pyx_t_1 = __pyx_t_10;
15362  __pyx_L9_bool_binop_done:;
15363  if (unlikely(__pyx_t_1)) {
15364 
15365  /* "View.MemoryView":689
15366  * else:
15367  * if not isinstance(item, slice) and not PyIndex_Check(item):
15368  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
15369  *
15370  * have_slices = have_slices or isinstance(item, slice)
15371  */
15372  __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(2, 689, __pyx_L1_error)
15373  __Pyx_GOTREF(__pyx_t_7);
15374  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 689, __pyx_L1_error)
15375  __Pyx_GOTREF(__pyx_t_11);
15376  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15377  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15378  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15379  __PYX_ERR(2, 689, __pyx_L1_error)
15380 
15381  /* "View.MemoryView":688
15382  * have_slices = True
15383  * else:
15384  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15385  * raise TypeError("Cannot index with type '%s'" % type(item))
15386  *
15387  */
15388  }
15389 
15390  /* "View.MemoryView":691
15391  * raise TypeError("Cannot index with type '%s'" % type(item))
15392  *
15393  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
15394  * result.append(item)
15395  *
15396  */
15397  __pyx_t_10 = (__pyx_v_have_slices != 0);
15398  if (!__pyx_t_10) {
15399  } else {
15400  __pyx_t_1 = __pyx_t_10;
15401  goto __pyx_L11_bool_binop_done;
15402  }
15403  __pyx_t_10 = PySlice_Check(__pyx_v_item);
15404  __pyx_t_2 = (__pyx_t_10 != 0);
15405  __pyx_t_1 = __pyx_t_2;
15406  __pyx_L11_bool_binop_done:;
15407  __pyx_v_have_slices = __pyx_t_1;
15408 
15409  /* "View.MemoryView":692
15410  *
15411  * have_slices = have_slices or isinstance(item, slice)
15412  * result.append(item) # <<<<<<<<<<<<<<
15413  *
15414  * nslices = ndim - len(result)
15415  */
15416  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 692, __pyx_L1_error)
15417  }
15418  __pyx_L6:;
15419 
15420  /* "View.MemoryView":679
15421  * have_slices = False
15422  * seen_ellipsis = False
15423  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15424  * if item is Ellipsis:
15425  * if not seen_ellipsis:
15426  */
15427  }
15428  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15429  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15430 
15431  /* "View.MemoryView":694
15432  * result.append(item)
15433  *
15434  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
15435  * if nslices:
15436  * result.extend([slice(None)] * nslices)
15437  */
15438  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 694, __pyx_L1_error)
15439  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15440 
15441  /* "View.MemoryView":695
15442  *
15443  * nslices = ndim - len(result)
15444  * if nslices: # <<<<<<<<<<<<<<
15445  * result.extend([slice(None)] * nslices)
15446  *
15447  */
15448  __pyx_t_1 = (__pyx_v_nslices != 0);
15449  if (__pyx_t_1) {
15450 
15451  /* "View.MemoryView":696
15452  * nslices = ndim - len(result)
15453  * if nslices:
15454  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
15455  *
15456  * return have_slices or nslices, tuple(result)
15457  */
15458  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 696, __pyx_L1_error)
15459  __Pyx_GOTREF(__pyx_t_3);
15460  { Py_ssize_t __pyx_temp;
15461  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15462  __Pyx_INCREF(__pyx_slice__17);
15463  __Pyx_GIVEREF(__pyx_slice__17);
15464  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__17);
15465  }
15466  }
15467  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 696, __pyx_L1_error)
15468  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15469 
15470  /* "View.MemoryView":695
15471  *
15472  * nslices = ndim - len(result)
15473  * if nslices: # <<<<<<<<<<<<<<
15474  * result.extend([slice(None)] * nslices)
15475  *
15476  */
15477  }
15478 
15479  /* "View.MemoryView":698
15480  * result.extend([slice(None)] * nslices)
15481  *
15482  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
15483  *
15484  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15485  */
15486  __Pyx_XDECREF(__pyx_r);
15487  if (!__pyx_v_have_slices) {
15488  } else {
15489  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
15490  __Pyx_GOTREF(__pyx_t_4);
15491  __pyx_t_3 = __pyx_t_4;
15492  __pyx_t_4 = 0;
15493  goto __pyx_L14_bool_binop_done;
15494  }
15495  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
15496  __Pyx_GOTREF(__pyx_t_4);
15497  __pyx_t_3 = __pyx_t_4;
15498  __pyx_t_4 = 0;
15499  __pyx_L14_bool_binop_done:;
15500  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 698, __pyx_L1_error)
15501  __Pyx_GOTREF(__pyx_t_4);
15502  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 698, __pyx_L1_error)
15503  __Pyx_GOTREF(__pyx_t_11);
15504  __Pyx_GIVEREF(__pyx_t_3);
15505  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15506  __Pyx_GIVEREF(__pyx_t_4);
15507  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15508  __pyx_t_3 = 0;
15509  __pyx_t_4 = 0;
15510  __pyx_r = ((PyObject*)__pyx_t_11);
15511  __pyx_t_11 = 0;
15512  goto __pyx_L0;
15513 
15514  /* "View.MemoryView":666
15515  * return isinstance(o, memoryview)
15516  *
15517  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15518  * """
15519  * Replace all ellipses with full slices and fill incomplete indices with
15520  */
15521 
15522  /* function exit code */
15523  __pyx_L1_error:;
15524  __Pyx_XDECREF(__pyx_t_3);
15525  __Pyx_XDECREF(__pyx_t_4);
15526  __Pyx_XDECREF(__pyx_t_7);
15527  __Pyx_XDECREF(__pyx_t_11);
15528  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15529  __pyx_r = 0;
15530  __pyx_L0:;
15531  __Pyx_XDECREF(__pyx_v_tup);
15532  __Pyx_XDECREF(__pyx_v_result);
15533  __Pyx_XDECREF(__pyx_v_idx);
15534  __Pyx_XDECREF(__pyx_v_item);
15535  __Pyx_XGIVEREF(__pyx_r);
15536  __Pyx_RefNannyFinishContext();
15537  return __pyx_r;
15538 }
15539 
15540 /* "View.MemoryView":700
15541  * return have_slices or nslices, tuple(result)
15542  *
15543  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15544  * for suboffset in suboffsets[:ndim]:
15545  * if suboffset >= 0:
15546  */
15547 
15548 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
15549  Py_ssize_t __pyx_v_suboffset;
15550  PyObject *__pyx_r = NULL;
15551  __Pyx_RefNannyDeclarations
15552  Py_ssize_t *__pyx_t_1;
15553  Py_ssize_t *__pyx_t_2;
15554  Py_ssize_t *__pyx_t_3;
15555  int __pyx_t_4;
15556  PyObject *__pyx_t_5 = NULL;
15557  int __pyx_lineno = 0;
15558  const char *__pyx_filename = NULL;
15559  int __pyx_clineno = 0;
15560  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
15561 
15562  /* "View.MemoryView":701
15563  *
15564  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15565  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
15566  * if suboffset >= 0:
15567  * raise ValueError("Indirect dimensions not supported")
15568  */
15569  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15570  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15571  __pyx_t_1 = __pyx_t_3;
15572  __pyx_v_suboffset = (__pyx_t_1[0]);
15573 
15574  /* "View.MemoryView":702
15575  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15576  * for suboffset in suboffsets[:ndim]:
15577  * if suboffset >= 0: # <<<<<<<<<<<<<<
15578  * raise ValueError("Indirect dimensions not supported")
15579  *
15580  */
15581  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15582  if (unlikely(__pyx_t_4)) {
15583 
15584  /* "View.MemoryView":703
15585  * for suboffset in suboffsets[:ndim]:
15586  * if suboffset >= 0:
15587  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
15588  *
15589  *
15590  */
15591  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 703, __pyx_L1_error)
15592  __Pyx_GOTREF(__pyx_t_5);
15593  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15594  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15595  __PYX_ERR(2, 703, __pyx_L1_error)
15596 
15597  /* "View.MemoryView":702
15598  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15599  * for suboffset in suboffsets[:ndim]:
15600  * if suboffset >= 0: # <<<<<<<<<<<<<<
15601  * raise ValueError("Indirect dimensions not supported")
15602  *
15603  */
15604  }
15605  }
15606 
15607  /* "View.MemoryView":700
15608  * return have_slices or nslices, tuple(result)
15609  *
15610  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15611  * for suboffset in suboffsets[:ndim]:
15612  * if suboffset >= 0:
15613  */
15614 
15615  /* function exit code */
15616  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15617  goto __pyx_L0;
15618  __pyx_L1_error:;
15619  __Pyx_XDECREF(__pyx_t_5);
15620  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15621  __pyx_r = 0;
15622  __pyx_L0:;
15623  __Pyx_XGIVEREF(__pyx_r);
15624  __Pyx_RefNannyFinishContext();
15625  return __pyx_r;
15626 }
15627 
15628 /* "View.MemoryView":710
15629  *
15630  * @cname('__pyx_memview_slice')
15631  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15632  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15633  * cdef bint negative_step
15634  */
15635 
15636 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15637  int __pyx_v_new_ndim;
15638  int __pyx_v_suboffset_dim;
15639  int __pyx_v_dim;
15640  __Pyx_memviewslice __pyx_v_src;
15641  __Pyx_memviewslice __pyx_v_dst;
15642  __Pyx_memviewslice *__pyx_v_p_src;
15643  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15644  __Pyx_memviewslice *__pyx_v_p_dst;
15645  int *__pyx_v_p_suboffset_dim;
15646  Py_ssize_t __pyx_v_start;
15647  Py_ssize_t __pyx_v_stop;
15648  Py_ssize_t __pyx_v_step;
15649  int __pyx_v_have_start;
15650  int __pyx_v_have_stop;
15651  int __pyx_v_have_step;
15652  PyObject *__pyx_v_index = NULL;
15653  struct __pyx_memoryview_obj *__pyx_r = NULL;
15654  __Pyx_RefNannyDeclarations
15655  int __pyx_t_1;
15656  int __pyx_t_2;
15657  PyObject *__pyx_t_3 = NULL;
15658  struct __pyx_memoryview_obj *__pyx_t_4;
15659  char *__pyx_t_5;
15660  int __pyx_t_6;
15661  Py_ssize_t __pyx_t_7;
15662  PyObject *(*__pyx_t_8)(PyObject *);
15663  PyObject *__pyx_t_9 = NULL;
15664  Py_ssize_t __pyx_t_10;
15665  int __pyx_t_11;
15666  Py_ssize_t __pyx_t_12;
15667  int __pyx_lineno = 0;
15668  const char *__pyx_filename = NULL;
15669  int __pyx_clineno = 0;
15670  __Pyx_RefNannySetupContext("memview_slice", 0);
15671 
15672  /* "View.MemoryView":711
15673  * @cname('__pyx_memview_slice')
15674  * cdef memoryview memview_slice(memoryview memview, object indices):
15675  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
15676  * cdef bint negative_step
15677  * cdef __Pyx_memviewslice src, dst
15678  */
15679  __pyx_v_new_ndim = 0;
15680  __pyx_v_suboffset_dim = -1;
15681 
15682  /* "View.MemoryView":718
15683  *
15684  *
15685  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
15686  *
15687  * cdef _memoryviewslice memviewsliceobj
15688  */
15689  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
15690 
15691  /* "View.MemoryView":722
15692  * cdef _memoryviewslice memviewsliceobj
15693  *
15694  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
15695  *
15696  * if isinstance(memview, _memoryviewslice):
15697  */
15698  #ifndef CYTHON_WITHOUT_ASSERTIONS
15699  if (unlikely(!Py_OptimizeFlag)) {
15700  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15701  PyErr_SetNone(PyExc_AssertionError);
15702  __PYX_ERR(2, 722, __pyx_L1_error)
15703  }
15704  }
15705  #endif
15706 
15707  /* "View.MemoryView":724
15708  * assert memview.view.ndim > 0
15709  *
15710  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15711  * memviewsliceobj = memview
15712  * p_src = &memviewsliceobj.from_slice
15713  */
15714  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15715  __pyx_t_2 = (__pyx_t_1 != 0);
15716  if (__pyx_t_2) {
15717 
15718  /* "View.MemoryView":725
15719  *
15720  * if isinstance(memview, _memoryviewslice):
15721  * memviewsliceobj = memview # <<<<<<<<<<<<<<
15722  * p_src = &memviewsliceobj.from_slice
15723  * else:
15724  */
15725  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 725, __pyx_L1_error)
15726  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15727  __Pyx_INCREF(__pyx_t_3);
15728  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15729  __pyx_t_3 = 0;
15730 
15731  /* "View.MemoryView":726
15732  * if isinstance(memview, _memoryviewslice):
15733  * memviewsliceobj = memview
15734  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
15735  * else:
15736  * slice_copy(memview, &src)
15737  */
15738  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15739 
15740  /* "View.MemoryView":724
15741  * assert memview.view.ndim > 0
15742  *
15743  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15744  * memviewsliceobj = memview
15745  * p_src = &memviewsliceobj.from_slice
15746  */
15747  goto __pyx_L3;
15748  }
15749 
15750  /* "View.MemoryView":728
15751  * p_src = &memviewsliceobj.from_slice
15752  * else:
15753  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
15754  * p_src = &src
15755  *
15756  */
15757  /*else*/ {
15758  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15759 
15760  /* "View.MemoryView":729
15761  * else:
15762  * slice_copy(memview, &src)
15763  * p_src = &src # <<<<<<<<<<<<<<
15764  *
15765  *
15766  */
15767  __pyx_v_p_src = (&__pyx_v_src);
15768  }
15769  __pyx_L3:;
15770 
15771  /* "View.MemoryView":735
15772  *
15773  *
15774  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
15775  * dst.data = p_src.data
15776  *
15777  */
15778  __pyx_t_4 = __pyx_v_p_src->memview;
15779  __pyx_v_dst.memview = __pyx_t_4;
15780 
15781  /* "View.MemoryView":736
15782  *
15783  * dst.memview = p_src.memview
15784  * dst.data = p_src.data # <<<<<<<<<<<<<<
15785  *
15786  *
15787  */
15788  __pyx_t_5 = __pyx_v_p_src->data;
15789  __pyx_v_dst.data = __pyx_t_5;
15790 
15791  /* "View.MemoryView":741
15792  *
15793  *
15794  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
15795  * cdef int *p_suboffset_dim = &suboffset_dim
15796  * cdef Py_ssize_t start, stop, step
15797  */
15798  __pyx_v_p_dst = (&__pyx_v_dst);
15799 
15800  /* "View.MemoryView":742
15801  *
15802  * cdef __Pyx_memviewslice *p_dst = &dst
15803  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
15804  * cdef Py_ssize_t start, stop, step
15805  * cdef bint have_start, have_stop, have_step
15806  */
15807  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15808 
15809  /* "View.MemoryView":746
15810  * cdef bint have_start, have_stop, have_step
15811  *
15812  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15813  * if PyIndex_Check(index):
15814  * slice_memviewslice(
15815  */
15816  __pyx_t_6 = 0;
15817  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15818  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15819  __pyx_t_8 = NULL;
15820  } else {
15821  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 746, __pyx_L1_error)
15822  __Pyx_GOTREF(__pyx_t_3);
15823  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 746, __pyx_L1_error)
15824  }
15825  for (;;) {
15826  if (likely(!__pyx_t_8)) {
15827  if (likely(PyList_CheckExact(__pyx_t_3))) {
15828  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
15829  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15830  __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(2, 746, __pyx_L1_error)
15831  #else
15832  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
15833  __Pyx_GOTREF(__pyx_t_9);
15834  #endif
15835  } else {
15836  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
15837  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15838  __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(2, 746, __pyx_L1_error)
15839  #else
15840  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __pyx_L1_error)
15841  __Pyx_GOTREF(__pyx_t_9);
15842  #endif
15843  }
15844  } else {
15845  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15846  if (unlikely(!__pyx_t_9)) {
15847  PyObject* exc_type = PyErr_Occurred();
15848  if (exc_type) {
15849  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15850  else __PYX_ERR(2, 746, __pyx_L1_error)
15851  }
15852  break;
15853  }
15854  __Pyx_GOTREF(__pyx_t_9);
15855  }
15856  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15857  __pyx_t_9 = 0;
15858  __pyx_v_dim = __pyx_t_6;
15859  __pyx_t_6 = (__pyx_t_6 + 1);
15860 
15861  /* "View.MemoryView":747
15862  *
15863  * for dim, index in enumerate(indices):
15864  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15865  * slice_memviewslice(
15866  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15867  */
15868  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15869  if (__pyx_t_2) {
15870 
15871  /* "View.MemoryView":751
15872  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15873  * dim, new_ndim, p_suboffset_dim,
15874  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
15875  * 0, 0, 0, # have_{start,stop,step}
15876  * False)
15877  */
15878  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 751, __pyx_L1_error)
15879 
15880  /* "View.MemoryView":748
15881  * for dim, index in enumerate(indices):
15882  * if PyIndex_Check(index):
15883  * slice_memviewslice( # <<<<<<<<<<<<<<
15884  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15885  * dim, new_ndim, p_suboffset_dim,
15886  */
15887  __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(2, 748, __pyx_L1_error)
15888 
15889  /* "View.MemoryView":747
15890  *
15891  * for dim, index in enumerate(indices):
15892  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15893  * slice_memviewslice(
15894  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15895  */
15896  goto __pyx_L6;
15897  }
15898 
15899  /* "View.MemoryView":754
15900  * 0, 0, 0, # have_{start,stop,step}
15901  * False)
15902  * elif index is None: # <<<<<<<<<<<<<<
15903  * p_dst.shape[new_ndim] = 1
15904  * p_dst.strides[new_ndim] = 0
15905  */
15906  __pyx_t_2 = (__pyx_v_index == Py_None);
15907  __pyx_t_1 = (__pyx_t_2 != 0);
15908  if (__pyx_t_1) {
15909 
15910  /* "View.MemoryView":755
15911  * False)
15912  * elif index is None:
15913  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
15914  * p_dst.strides[new_ndim] = 0
15915  * p_dst.suboffsets[new_ndim] = -1
15916  */
15917  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15918 
15919  /* "View.MemoryView":756
15920  * elif index is None:
15921  * p_dst.shape[new_ndim] = 1
15922  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
15923  * p_dst.suboffsets[new_ndim] = -1
15924  * new_ndim += 1
15925  */
15926  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15927 
15928  /* "View.MemoryView":757
15929  * p_dst.shape[new_ndim] = 1
15930  * p_dst.strides[new_ndim] = 0
15931  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
15932  * new_ndim += 1
15933  * else:
15934  */
15935  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15936 
15937  /* "View.MemoryView":758
15938  * p_dst.strides[new_ndim] = 0
15939  * p_dst.suboffsets[new_ndim] = -1
15940  * new_ndim += 1 # <<<<<<<<<<<<<<
15941  * else:
15942  * start = index.start or 0
15943  */
15944  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15945 
15946  /* "View.MemoryView":754
15947  * 0, 0, 0, # have_{start,stop,step}
15948  * False)
15949  * elif index is None: # <<<<<<<<<<<<<<
15950  * p_dst.shape[new_ndim] = 1
15951  * p_dst.strides[new_ndim] = 0
15952  */
15953  goto __pyx_L6;
15954  }
15955 
15956  /* "View.MemoryView":760
15957  * new_ndim += 1
15958  * else:
15959  * start = index.start or 0 # <<<<<<<<<<<<<<
15960  * stop = index.stop or 0
15961  * step = index.step or 0
15962  */
15963  /*else*/ {
15964  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 760, __pyx_L1_error)
15965  __Pyx_GOTREF(__pyx_t_9);
15966  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 760, __pyx_L1_error)
15967  if (!__pyx_t_1) {
15968  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15969  } else {
15970  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 760, __pyx_L1_error)
15971  __pyx_t_10 = __pyx_t_12;
15972  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15973  goto __pyx_L7_bool_binop_done;
15974  }
15975  __pyx_t_10 = 0;
15976  __pyx_L7_bool_binop_done:;
15977  __pyx_v_start = __pyx_t_10;
15978 
15979  /* "View.MemoryView":761
15980  * else:
15981  * start = index.start or 0
15982  * stop = index.stop or 0 # <<<<<<<<<<<<<<
15983  * step = index.step or 0
15984  *
15985  */
15986  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 761, __pyx_L1_error)
15987  __Pyx_GOTREF(__pyx_t_9);
15988  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 761, __pyx_L1_error)
15989  if (!__pyx_t_1) {
15990  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15991  } else {
15992  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 761, __pyx_L1_error)
15993  __pyx_t_10 = __pyx_t_12;
15994  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15995  goto __pyx_L9_bool_binop_done;
15996  }
15997  __pyx_t_10 = 0;
15998  __pyx_L9_bool_binop_done:;
15999  __pyx_v_stop = __pyx_t_10;
16000 
16001  /* "View.MemoryView":762
16002  * start = index.start or 0
16003  * stop = index.stop or 0
16004  * step = index.step or 0 # <<<<<<<<<<<<<<
16005  *
16006  * have_start = index.start is not None
16007  */
16008  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 762, __pyx_L1_error)
16009  __Pyx_GOTREF(__pyx_t_9);
16010  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 762, __pyx_L1_error)
16011  if (!__pyx_t_1) {
16012  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16013  } else {
16014  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error)
16015  __pyx_t_10 = __pyx_t_12;
16016  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16017  goto __pyx_L11_bool_binop_done;
16018  }
16019  __pyx_t_10 = 0;
16020  __pyx_L11_bool_binop_done:;
16021  __pyx_v_step = __pyx_t_10;
16022 
16023  /* "View.MemoryView":764
16024  * step = index.step or 0
16025  *
16026  * have_start = index.start is not None # <<<<<<<<<<<<<<
16027  * have_stop = index.stop is not None
16028  * have_step = index.step is not None
16029  */
16030  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 764, __pyx_L1_error)
16031  __Pyx_GOTREF(__pyx_t_9);
16032  __pyx_t_1 = (__pyx_t_9 != Py_None);
16033  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16034  __pyx_v_have_start = __pyx_t_1;
16035 
16036  /* "View.MemoryView":765
16037  *
16038  * have_start = index.start is not None
16039  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
16040  * have_step = index.step is not None
16041  *
16042  */
16043  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 765, __pyx_L1_error)
16044  __Pyx_GOTREF(__pyx_t_9);
16045  __pyx_t_1 = (__pyx_t_9 != Py_None);
16046  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16047  __pyx_v_have_stop = __pyx_t_1;
16048 
16049  /* "View.MemoryView":766
16050  * have_start = index.start is not None
16051  * have_stop = index.stop is not None
16052  * have_step = index.step is not None # <<<<<<<<<<<<<<
16053  *
16054  * slice_memviewslice(
16055  */
16056  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 766, __pyx_L1_error)
16057  __Pyx_GOTREF(__pyx_t_9);
16058  __pyx_t_1 = (__pyx_t_9 != Py_None);
16059  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16060  __pyx_v_have_step = __pyx_t_1;
16061 
16062  /* "View.MemoryView":768
16063  * have_step = index.step is not None
16064  *
16065  * slice_memviewslice( # <<<<<<<<<<<<<<
16066  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
16067  * dim, new_ndim, p_suboffset_dim,
16068  */
16069  __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(2, 768, __pyx_L1_error)
16070 
16071  /* "View.MemoryView":774
16072  * have_start, have_stop, have_step,
16073  * True)
16074  * new_ndim += 1 # <<<<<<<<<<<<<<
16075  *
16076  * if isinstance(memview, _memoryviewslice):
16077  */
16078  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
16079  }
16080  __pyx_L6:;
16081 
16082  /* "View.MemoryView":746
16083  * cdef bint have_start, have_stop, have_step
16084  *
16085  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
16086  * if PyIndex_Check(index):
16087  * slice_memviewslice(
16088  */
16089  }
16090  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16091 
16092  /* "View.MemoryView":776
16093  * new_ndim += 1
16094  *
16095  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16096  * return memoryview_fromslice(dst, new_ndim,
16097  * memviewsliceobj.to_object_func,
16098  */
16099  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16100  __pyx_t_2 = (__pyx_t_1 != 0);
16101  if (__pyx_t_2) {
16102 
16103  /* "View.MemoryView":777
16104  *
16105  * if isinstance(memview, _memoryviewslice):
16106  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16107  * memviewsliceobj.to_object_func,
16108  * memviewsliceobj.to_dtype_func,
16109  */
16110  __Pyx_XDECREF(((PyObject *)__pyx_r));
16111 
16112  /* "View.MemoryView":778
16113  * if isinstance(memview, _memoryviewslice):
16114  * return memoryview_fromslice(dst, new_ndim,
16115  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
16116  * memviewsliceobj.to_dtype_func,
16117  * memview.dtype_is_object)
16118  */
16119  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 778, __pyx_L1_error) }
16120 
16121  /* "View.MemoryView":779
16122  * return memoryview_fromslice(dst, new_ndim,
16123  * memviewsliceobj.to_object_func,
16124  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
16125  * memview.dtype_is_object)
16126  * else:
16127  */
16128  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 779, __pyx_L1_error) }
16129 
16130  /* "View.MemoryView":777
16131  *
16132  * if isinstance(memview, _memoryviewslice):
16133  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
16134  * memviewsliceobj.to_object_func,
16135  * memviewsliceobj.to_dtype_func,
16136  */
16137  __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(2, 777, __pyx_L1_error)
16138  __Pyx_GOTREF(__pyx_t_3);
16139  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 777, __pyx_L1_error)
16140  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16141  __pyx_t_3 = 0;
16142  goto __pyx_L0;
16143 
16144  /* "View.MemoryView":776
16145  * new_ndim += 1
16146  *
16147  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16148  * return memoryview_fromslice(dst, new_ndim,
16149  * memviewsliceobj.to_object_func,
16150  */
16151  }
16152 
16153  /* "View.MemoryView":782
16154  * memview.dtype_is_object)
16155  * else:
16156  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16157  * memview.dtype_is_object)
16158  *
16159  */
16160  /*else*/ {
16161  __Pyx_XDECREF(((PyObject *)__pyx_r));
16162 
16163  /* "View.MemoryView":783
16164  * else:
16165  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
16166  * memview.dtype_is_object) # <<<<<<<<<<<<<<
16167  *
16168  *
16169  */
16170  __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(2, 782, __pyx_L1_error)
16171  __Pyx_GOTREF(__pyx_t_3);
16172 
16173  /* "View.MemoryView":782
16174  * memview.dtype_is_object)
16175  * else:
16176  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
16177  * memview.dtype_is_object)
16178  *
16179  */
16180  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 782, __pyx_L1_error)
16181  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
16182  __pyx_t_3 = 0;
16183  goto __pyx_L0;
16184  }
16185 
16186  /* "View.MemoryView":710
16187  *
16188  * @cname('__pyx_memview_slice')
16189  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
16190  * cdef int new_ndim = 0, suboffset_dim = -1, dim
16191  * cdef bint negative_step
16192  */
16193 
16194  /* function exit code */
16195  __pyx_L1_error:;
16196  __Pyx_XDECREF(__pyx_t_3);
16197  __Pyx_XDECREF(__pyx_t_9);
16198  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16199  __pyx_r = 0;
16200  __pyx_L0:;
16201  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
16202  __Pyx_XDECREF(__pyx_v_index);
16203  __Pyx_XGIVEREF((PyObject *)__pyx_r);
16204  __Pyx_RefNannyFinishContext();
16205  return __pyx_r;
16206 }
16207 
16208 /* "View.MemoryView":807
16209  *
16210  * @cname('__pyx_memoryview_slice_memviewslice')
16211  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16212  * __Pyx_memviewslice *dst,
16213  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16214  */
16215 
16216 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) {
16217  Py_ssize_t __pyx_v_new_shape;
16218  int __pyx_v_negative_step;
16219  int __pyx_r;
16220  int __pyx_t_1;
16221  int __pyx_t_2;
16222  int __pyx_t_3;
16223  int __pyx_lineno = 0;
16224  const char *__pyx_filename = NULL;
16225  int __pyx_clineno = 0;
16226 
16227  /* "View.MemoryView":827
16228  * cdef bint negative_step
16229  *
16230  * if not is_slice: # <<<<<<<<<<<<<<
16231  *
16232  * if start < 0:
16233  */
16234  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
16235  if (__pyx_t_1) {
16236 
16237  /* "View.MemoryView":829
16238  * if not is_slice:
16239  *
16240  * if start < 0: # <<<<<<<<<<<<<<
16241  * start += shape
16242  * if not 0 <= start < shape:
16243  */
16244  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
16245  if (__pyx_t_1) {
16246 
16247  /* "View.MemoryView":830
16248  *
16249  * if start < 0:
16250  * start += shape # <<<<<<<<<<<<<<
16251  * if not 0 <= start < shape:
16252  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16253  */
16254  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16255 
16256  /* "View.MemoryView":829
16257  * if not is_slice:
16258  *
16259  * if start < 0: # <<<<<<<<<<<<<<
16260  * start += shape
16261  * if not 0 <= start < shape:
16262  */
16263  }
16264 
16265  /* "View.MemoryView":831
16266  * if start < 0:
16267  * start += shape
16268  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16269  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16270  * else:
16271  */
16272  __pyx_t_1 = (0 <= __pyx_v_start);
16273  if (__pyx_t_1) {
16274  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16275  }
16276  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16277  if (__pyx_t_2) {
16278 
16279  /* "View.MemoryView":832
16280  * start += shape
16281  * if not 0 <= start < shape:
16282  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
16283  * else:
16284  *
16285  */
16286  __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(2, 832, __pyx_L1_error)
16287 
16288  /* "View.MemoryView":831
16289  * if start < 0:
16290  * start += shape
16291  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16292  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16293  * else:
16294  */
16295  }
16296 
16297  /* "View.MemoryView":827
16298  * cdef bint negative_step
16299  *
16300  * if not is_slice: # <<<<<<<<<<<<<<
16301  *
16302  * if start < 0:
16303  */
16304  goto __pyx_L3;
16305  }
16306 
16307  /* "View.MemoryView":835
16308  * else:
16309  *
16310  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
16311  *
16312  * if have_step and step == 0:
16313  */
16314  /*else*/ {
16315  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16316  if (__pyx_t_1) {
16317  } else {
16318  __pyx_t_2 = __pyx_t_1;
16319  goto __pyx_L6_bool_binop_done;
16320  }
16321  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16322  __pyx_t_2 = __pyx_t_1;
16323  __pyx_L6_bool_binop_done:;
16324  __pyx_v_negative_step = __pyx_t_2;
16325 
16326  /* "View.MemoryView":837
16327  * negative_step = have_step != 0 and step < 0
16328  *
16329  * if have_step and step == 0: # <<<<<<<<<<<<<<
16330  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16331  *
16332  */
16333  __pyx_t_1 = (__pyx_v_have_step != 0);
16334  if (__pyx_t_1) {
16335  } else {
16336  __pyx_t_2 = __pyx_t_1;
16337  goto __pyx_L9_bool_binop_done;
16338  }
16339  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16340  __pyx_t_2 = __pyx_t_1;
16341  __pyx_L9_bool_binop_done:;
16342  if (__pyx_t_2) {
16343 
16344  /* "View.MemoryView":838
16345  *
16346  * if have_step and step == 0:
16347  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
16348  *
16349  *
16350  */
16351  __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(2, 838, __pyx_L1_error)
16352 
16353  /* "View.MemoryView":837
16354  * negative_step = have_step != 0 and step < 0
16355  *
16356  * if have_step and step == 0: # <<<<<<<<<<<<<<
16357  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16358  *
16359  */
16360  }
16361 
16362  /* "View.MemoryView":841
16363  *
16364  *
16365  * if have_start: # <<<<<<<<<<<<<<
16366  * if start < 0:
16367  * start += shape
16368  */
16369  __pyx_t_2 = (__pyx_v_have_start != 0);
16370  if (__pyx_t_2) {
16371 
16372  /* "View.MemoryView":842
16373  *
16374  * if have_start:
16375  * if start < 0: # <<<<<<<<<<<<<<
16376  * start += shape
16377  * if start < 0:
16378  */
16379  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16380  if (__pyx_t_2) {
16381 
16382  /* "View.MemoryView":843
16383  * if have_start:
16384  * if start < 0:
16385  * start += shape # <<<<<<<<<<<<<<
16386  * if start < 0:
16387  * start = 0
16388  */
16389  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16390 
16391  /* "View.MemoryView":844
16392  * if start < 0:
16393  * start += shape
16394  * if start < 0: # <<<<<<<<<<<<<<
16395  * start = 0
16396  * elif start >= shape:
16397  */
16398  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16399  if (__pyx_t_2) {
16400 
16401  /* "View.MemoryView":845
16402  * start += shape
16403  * if start < 0:
16404  * start = 0 # <<<<<<<<<<<<<<
16405  * elif start >= shape:
16406  * if negative_step:
16407  */
16408  __pyx_v_start = 0;
16409 
16410  /* "View.MemoryView":844
16411  * if start < 0:
16412  * start += shape
16413  * if start < 0: # <<<<<<<<<<<<<<
16414  * start = 0
16415  * elif start >= shape:
16416  */
16417  }
16418 
16419  /* "View.MemoryView":842
16420  *
16421  * if have_start:
16422  * if start < 0: # <<<<<<<<<<<<<<
16423  * start += shape
16424  * if start < 0:
16425  */
16426  goto __pyx_L12;
16427  }
16428 
16429  /* "View.MemoryView":846
16430  * if start < 0:
16431  * start = 0
16432  * elif start >= shape: # <<<<<<<<<<<<<<
16433  * if negative_step:
16434  * start = shape - 1
16435  */
16436  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16437  if (__pyx_t_2) {
16438 
16439  /* "View.MemoryView":847
16440  * start = 0
16441  * elif start >= shape:
16442  * if negative_step: # <<<<<<<<<<<<<<
16443  * start = shape - 1
16444  * else:
16445  */
16446  __pyx_t_2 = (__pyx_v_negative_step != 0);
16447  if (__pyx_t_2) {
16448 
16449  /* "View.MemoryView":848
16450  * elif start >= shape:
16451  * if negative_step:
16452  * start = shape - 1 # <<<<<<<<<<<<<<
16453  * else:
16454  * start = shape
16455  */
16456  __pyx_v_start = (__pyx_v_shape - 1);
16457 
16458  /* "View.MemoryView":847
16459  * start = 0
16460  * elif start >= shape:
16461  * if negative_step: # <<<<<<<<<<<<<<
16462  * start = shape - 1
16463  * else:
16464  */
16465  goto __pyx_L14;
16466  }
16467 
16468  /* "View.MemoryView":850
16469  * start = shape - 1
16470  * else:
16471  * start = shape # <<<<<<<<<<<<<<
16472  * else:
16473  * if negative_step:
16474  */
16475  /*else*/ {
16476  __pyx_v_start = __pyx_v_shape;
16477  }
16478  __pyx_L14:;
16479 
16480  /* "View.MemoryView":846
16481  * if start < 0:
16482  * start = 0
16483  * elif start >= shape: # <<<<<<<<<<<<<<
16484  * if negative_step:
16485  * start = shape - 1
16486  */
16487  }
16488  __pyx_L12:;
16489 
16490  /* "View.MemoryView":841
16491  *
16492  *
16493  * if have_start: # <<<<<<<<<<<<<<
16494  * if start < 0:
16495  * start += shape
16496  */
16497  goto __pyx_L11;
16498  }
16499 
16500  /* "View.MemoryView":852
16501  * start = shape
16502  * else:
16503  * if negative_step: # <<<<<<<<<<<<<<
16504  * start = shape - 1
16505  * else:
16506  */
16507  /*else*/ {
16508  __pyx_t_2 = (__pyx_v_negative_step != 0);
16509  if (__pyx_t_2) {
16510 
16511  /* "View.MemoryView":853
16512  * else:
16513  * if negative_step:
16514  * start = shape - 1 # <<<<<<<<<<<<<<
16515  * else:
16516  * start = 0
16517  */
16518  __pyx_v_start = (__pyx_v_shape - 1);
16519 
16520  /* "View.MemoryView":852
16521  * start = shape
16522  * else:
16523  * if negative_step: # <<<<<<<<<<<<<<
16524  * start = shape - 1
16525  * else:
16526  */
16527  goto __pyx_L15;
16528  }
16529 
16530  /* "View.MemoryView":855
16531  * start = shape - 1
16532  * else:
16533  * start = 0 # <<<<<<<<<<<<<<
16534  *
16535  * if have_stop:
16536  */
16537  /*else*/ {
16538  __pyx_v_start = 0;
16539  }
16540  __pyx_L15:;
16541  }
16542  __pyx_L11:;
16543 
16544  /* "View.MemoryView":857
16545  * start = 0
16546  *
16547  * if have_stop: # <<<<<<<<<<<<<<
16548  * if stop < 0:
16549  * stop += shape
16550  */
16551  __pyx_t_2 = (__pyx_v_have_stop != 0);
16552  if (__pyx_t_2) {
16553 
16554  /* "View.MemoryView":858
16555  *
16556  * if have_stop:
16557  * if stop < 0: # <<<<<<<<<<<<<<
16558  * stop += shape
16559  * if stop < 0:
16560  */
16561  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16562  if (__pyx_t_2) {
16563 
16564  /* "View.MemoryView":859
16565  * if have_stop:
16566  * if stop < 0:
16567  * stop += shape # <<<<<<<<<<<<<<
16568  * if stop < 0:
16569  * stop = 0
16570  */
16571  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16572 
16573  /* "View.MemoryView":860
16574  * if stop < 0:
16575  * stop += shape
16576  * if stop < 0: # <<<<<<<<<<<<<<
16577  * stop = 0
16578  * elif stop > shape:
16579  */
16580  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16581  if (__pyx_t_2) {
16582 
16583  /* "View.MemoryView":861
16584  * stop += shape
16585  * if stop < 0:
16586  * stop = 0 # <<<<<<<<<<<<<<
16587  * elif stop > shape:
16588  * stop = shape
16589  */
16590  __pyx_v_stop = 0;
16591 
16592  /* "View.MemoryView":860
16593  * if stop < 0:
16594  * stop += shape
16595  * if stop < 0: # <<<<<<<<<<<<<<
16596  * stop = 0
16597  * elif stop > shape:
16598  */
16599  }
16600 
16601  /* "View.MemoryView":858
16602  *
16603  * if have_stop:
16604  * if stop < 0: # <<<<<<<<<<<<<<
16605  * stop += shape
16606  * if stop < 0:
16607  */
16608  goto __pyx_L17;
16609  }
16610 
16611  /* "View.MemoryView":862
16612  * if stop < 0:
16613  * stop = 0
16614  * elif stop > shape: # <<<<<<<<<<<<<<
16615  * stop = shape
16616  * else:
16617  */
16618  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16619  if (__pyx_t_2) {
16620 
16621  /* "View.MemoryView":863
16622  * stop = 0
16623  * elif stop > shape:
16624  * stop = shape # <<<<<<<<<<<<<<
16625  * else:
16626  * if negative_step:
16627  */
16628  __pyx_v_stop = __pyx_v_shape;
16629 
16630  /* "View.MemoryView":862
16631  * if stop < 0:
16632  * stop = 0
16633  * elif stop > shape: # <<<<<<<<<<<<<<
16634  * stop = shape
16635  * else:
16636  */
16637  }
16638  __pyx_L17:;
16639 
16640  /* "View.MemoryView":857
16641  * start = 0
16642  *
16643  * if have_stop: # <<<<<<<<<<<<<<
16644  * if stop < 0:
16645  * stop += shape
16646  */
16647  goto __pyx_L16;
16648  }
16649 
16650  /* "View.MemoryView":865
16651  * stop = shape
16652  * else:
16653  * if negative_step: # <<<<<<<<<<<<<<
16654  * stop = -1
16655  * else:
16656  */
16657  /*else*/ {
16658  __pyx_t_2 = (__pyx_v_negative_step != 0);
16659  if (__pyx_t_2) {
16660 
16661  /* "View.MemoryView":866
16662  * else:
16663  * if negative_step:
16664  * stop = -1 # <<<<<<<<<<<<<<
16665  * else:
16666  * stop = shape
16667  */
16668  __pyx_v_stop = -1L;
16669 
16670  /* "View.MemoryView":865
16671  * stop = shape
16672  * else:
16673  * if negative_step: # <<<<<<<<<<<<<<
16674  * stop = -1
16675  * else:
16676  */
16677  goto __pyx_L19;
16678  }
16679 
16680  /* "View.MemoryView":868
16681  * stop = -1
16682  * else:
16683  * stop = shape # <<<<<<<<<<<<<<
16684  *
16685  * if not have_step:
16686  */
16687  /*else*/ {
16688  __pyx_v_stop = __pyx_v_shape;
16689  }
16690  __pyx_L19:;
16691  }
16692  __pyx_L16:;
16693 
16694  /* "View.MemoryView":870
16695  * stop = shape
16696  *
16697  * if not have_step: # <<<<<<<<<<<<<<
16698  * step = 1
16699  *
16700  */
16701  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16702  if (__pyx_t_2) {
16703 
16704  /* "View.MemoryView":871
16705  *
16706  * if not have_step:
16707  * step = 1 # <<<<<<<<<<<<<<
16708  *
16709  *
16710  */
16711  __pyx_v_step = 1;
16712 
16713  /* "View.MemoryView":870
16714  * stop = shape
16715  *
16716  * if not have_step: # <<<<<<<<<<<<<<
16717  * step = 1
16718  *
16719  */
16720  }
16721 
16722  /* "View.MemoryView":875
16723  *
16724  * with cython.cdivision(True):
16725  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
16726  *
16727  * if (stop - start) - step * new_shape:
16728  */
16729  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16730 
16731  /* "View.MemoryView":877
16732  * new_shape = (stop - start) // step
16733  *
16734  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16735  * new_shape += 1
16736  *
16737  */
16738  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16739  if (__pyx_t_2) {
16740 
16741  /* "View.MemoryView":878
16742  *
16743  * if (stop - start) - step * new_shape:
16744  * new_shape += 1 # <<<<<<<<<<<<<<
16745  *
16746  * if new_shape < 0:
16747  */
16748  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16749 
16750  /* "View.MemoryView":877
16751  * new_shape = (stop - start) // step
16752  *
16753  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16754  * new_shape += 1
16755  *
16756  */
16757  }
16758 
16759  /* "View.MemoryView":880
16760  * new_shape += 1
16761  *
16762  * if new_shape < 0: # <<<<<<<<<<<<<<
16763  * new_shape = 0
16764  *
16765  */
16766  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16767  if (__pyx_t_2) {
16768 
16769  /* "View.MemoryView":881
16770  *
16771  * if new_shape < 0:
16772  * new_shape = 0 # <<<<<<<<<<<<<<
16773  *
16774  *
16775  */
16776  __pyx_v_new_shape = 0;
16777 
16778  /* "View.MemoryView":880
16779  * new_shape += 1
16780  *
16781  * if new_shape < 0: # <<<<<<<<<<<<<<
16782  * new_shape = 0
16783  *
16784  */
16785  }
16786 
16787  /* "View.MemoryView":884
16788  *
16789  *
16790  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
16791  * dst.shape[new_ndim] = new_shape
16792  * dst.suboffsets[new_ndim] = suboffset
16793  */
16794  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16795 
16796  /* "View.MemoryView":885
16797  *
16798  * dst.strides[new_ndim] = stride * step
16799  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
16800  * dst.suboffsets[new_ndim] = suboffset
16801  *
16802  */
16803  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16804 
16805  /* "View.MemoryView":886
16806  * dst.strides[new_ndim] = stride * step
16807  * dst.shape[new_ndim] = new_shape
16808  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
16809  *
16810  *
16811  */
16812  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16813  }
16814  __pyx_L3:;
16815 
16816  /* "View.MemoryView":889
16817  *
16818  *
16819  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16820  * dst.data += start * stride
16821  * else:
16822  */
16823  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16824  if (__pyx_t_2) {
16825 
16826  /* "View.MemoryView":890
16827  *
16828  * if suboffset_dim[0] < 0:
16829  * dst.data += start * stride # <<<<<<<<<<<<<<
16830  * else:
16831  * dst.suboffsets[suboffset_dim[0]] += start * stride
16832  */
16833  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16834 
16835  /* "View.MemoryView":889
16836  *
16837  *
16838  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16839  * dst.data += start * stride
16840  * else:
16841  */
16842  goto __pyx_L23;
16843  }
16844 
16845  /* "View.MemoryView":892
16846  * dst.data += start * stride
16847  * else:
16848  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
16849  *
16850  * if suboffset >= 0:
16851  */
16852  /*else*/ {
16853  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16854  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16855  }
16856  __pyx_L23:;
16857 
16858  /* "View.MemoryView":894
16859  * dst.suboffsets[suboffset_dim[0]] += start * stride
16860  *
16861  * if suboffset >= 0: # <<<<<<<<<<<<<<
16862  * if not is_slice:
16863  * if new_ndim == 0:
16864  */
16865  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16866  if (__pyx_t_2) {
16867 
16868  /* "View.MemoryView":895
16869  *
16870  * if suboffset >= 0:
16871  * if not is_slice: # <<<<<<<<<<<<<<
16872  * if new_ndim == 0:
16873  * dst.data = (<char **> dst.data)[0] + suboffset
16874  */
16875  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16876  if (__pyx_t_2) {
16877 
16878  /* "View.MemoryView":896
16879  * if suboffset >= 0:
16880  * if not is_slice:
16881  * if new_ndim == 0: # <<<<<<<<<<<<<<
16882  * dst.data = (<char **> dst.data)[0] + suboffset
16883  * else:
16884  */
16885  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16886  if (__pyx_t_2) {
16887 
16888  /* "View.MemoryView":897
16889  * if not is_slice:
16890  * if new_ndim == 0:
16891  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
16892  * else:
16893  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16894  */
16895  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16896 
16897  /* "View.MemoryView":896
16898  * if suboffset >= 0:
16899  * if not is_slice:
16900  * if new_ndim == 0: # <<<<<<<<<<<<<<
16901  * dst.data = (<char **> dst.data)[0] + suboffset
16902  * else:
16903  */
16904  goto __pyx_L26;
16905  }
16906 
16907  /* "View.MemoryView":899
16908  * dst.data = (<char **> dst.data)[0] + suboffset
16909  * else:
16910  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
16911  * "must be indexed and not sliced", dim)
16912  * else:
16913  */
16914  /*else*/ {
16915 
16916  /* "View.MemoryView":900
16917  * else:
16918  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16919  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
16920  * else:
16921  * suboffset_dim[0] = new_ndim
16922  */
16923  __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(2, 899, __pyx_L1_error)
16924  }
16925  __pyx_L26:;
16926 
16927  /* "View.MemoryView":895
16928  *
16929  * if suboffset >= 0:
16930  * if not is_slice: # <<<<<<<<<<<<<<
16931  * if new_ndim == 0:
16932  * dst.data = (<char **> dst.data)[0] + suboffset
16933  */
16934  goto __pyx_L25;
16935  }
16936 
16937  /* "View.MemoryView":902
16938  * "must be indexed and not sliced", dim)
16939  * else:
16940  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
16941  *
16942  * return 0
16943  */
16944  /*else*/ {
16945  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16946  }
16947  __pyx_L25:;
16948 
16949  /* "View.MemoryView":894
16950  * dst.suboffsets[suboffset_dim[0]] += start * stride
16951  *
16952  * if suboffset >= 0: # <<<<<<<<<<<<<<
16953  * if not is_slice:
16954  * if new_ndim == 0:
16955  */
16956  }
16957 
16958  /* "View.MemoryView":904
16959  * suboffset_dim[0] = new_ndim
16960  *
16961  * return 0 # <<<<<<<<<<<<<<
16962  *
16963  *
16964  */
16965  __pyx_r = 0;
16966  goto __pyx_L0;
16967 
16968  /* "View.MemoryView":807
16969  *
16970  * @cname('__pyx_memoryview_slice_memviewslice')
16971  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16972  * __Pyx_memviewslice *dst,
16973  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16974  */
16975 
16976  /* function exit code */
16977  __pyx_L1_error:;
16978  {
16979  #ifdef WITH_THREAD
16980  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16981  #endif
16982  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16983  #ifdef WITH_THREAD
16984  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16985  #endif
16986  }
16987  __pyx_r = -1;
16988  __pyx_L0:;
16989  return __pyx_r;
16990 }
16991 
16992 /* "View.MemoryView":910
16993  *
16994  * @cname('__pyx_pybuffer_index')
16995  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16996  * Py_ssize_t dim) except NULL:
16997  * cdef Py_ssize_t shape, stride, suboffset = -1
16998  */
16999 
17000 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) {
17001  Py_ssize_t __pyx_v_shape;
17002  Py_ssize_t __pyx_v_stride;
17003  Py_ssize_t __pyx_v_suboffset;
17004  Py_ssize_t __pyx_v_itemsize;
17005  char *__pyx_v_resultp;
17006  char *__pyx_r;
17007  __Pyx_RefNannyDeclarations
17008  Py_ssize_t __pyx_t_1;
17009  int __pyx_t_2;
17010  PyObject *__pyx_t_3 = NULL;
17011  PyObject *__pyx_t_4 = NULL;
17012  int __pyx_lineno = 0;
17013  const char *__pyx_filename = NULL;
17014  int __pyx_clineno = 0;
17015  __Pyx_RefNannySetupContext("pybuffer_index", 0);
17016 
17017  /* "View.MemoryView":912
17018  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
17019  * Py_ssize_t dim) except NULL:
17020  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
17021  * cdef Py_ssize_t itemsize = view.itemsize
17022  * cdef char *resultp
17023  */
17024  __pyx_v_suboffset = -1L;
17025 
17026  /* "View.MemoryView":913
17027  * Py_ssize_t dim) except NULL:
17028  * cdef Py_ssize_t shape, stride, suboffset = -1
17029  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
17030  * cdef char *resultp
17031  *
17032  */
17033  __pyx_t_1 = __pyx_v_view->itemsize;
17034  __pyx_v_itemsize = __pyx_t_1;
17035 
17036  /* "View.MemoryView":916
17037  * cdef char *resultp
17038  *
17039  * if view.ndim == 0: # <<<<<<<<<<<<<<
17040  * shape = view.len / itemsize
17041  * stride = itemsize
17042  */
17043  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
17044  if (__pyx_t_2) {
17045 
17046  /* "View.MemoryView":917
17047  *
17048  * if view.ndim == 0:
17049  * shape = view.len / itemsize # <<<<<<<<<<<<<<
17050  * stride = itemsize
17051  * else:
17052  */
17053  if (unlikely(__pyx_v_itemsize == 0)) {
17054  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
17055  __PYX_ERR(2, 917, __pyx_L1_error)
17056  }
17057  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))) {
17058  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
17059  __PYX_ERR(2, 917, __pyx_L1_error)
17060  }
17061  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
17062 
17063  /* "View.MemoryView":918
17064  * if view.ndim == 0:
17065  * shape = view.len / itemsize
17066  * stride = itemsize # <<<<<<<<<<<<<<
17067  * else:
17068  * shape = view.shape[dim]
17069  */
17070  __pyx_v_stride = __pyx_v_itemsize;
17071 
17072  /* "View.MemoryView":916
17073  * cdef char *resultp
17074  *
17075  * if view.ndim == 0: # <<<<<<<<<<<<<<
17076  * shape = view.len / itemsize
17077  * stride = itemsize
17078  */
17079  goto __pyx_L3;
17080  }
17081 
17082  /* "View.MemoryView":920
17083  * stride = itemsize
17084  * else:
17085  * shape = view.shape[dim] # <<<<<<<<<<<<<<
17086  * stride = view.strides[dim]
17087  * if view.suboffsets != NULL:
17088  */
17089  /*else*/ {
17090  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
17091 
17092  /* "View.MemoryView":921
17093  * else:
17094  * shape = view.shape[dim]
17095  * stride = view.strides[dim] # <<<<<<<<<<<<<<
17096  * if view.suboffsets != NULL:
17097  * suboffset = view.suboffsets[dim]
17098  */
17099  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
17100 
17101  /* "View.MemoryView":922
17102  * shape = view.shape[dim]
17103  * stride = view.strides[dim]
17104  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17105  * suboffset = view.suboffsets[dim]
17106  *
17107  */
17108  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
17109  if (__pyx_t_2) {
17110 
17111  /* "View.MemoryView":923
17112  * stride = view.strides[dim]
17113  * if view.suboffsets != NULL:
17114  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
17115  *
17116  * if index < 0:
17117  */
17118  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
17119 
17120  /* "View.MemoryView":922
17121  * shape = view.shape[dim]
17122  * stride = view.strides[dim]
17123  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
17124  * suboffset = view.suboffsets[dim]
17125  *
17126  */
17127  }
17128  }
17129  __pyx_L3:;
17130 
17131  /* "View.MemoryView":925
17132  * suboffset = view.suboffsets[dim]
17133  *
17134  * if index < 0: # <<<<<<<<<<<<<<
17135  * index += view.shape[dim]
17136  * if index < 0:
17137  */
17138  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17139  if (__pyx_t_2) {
17140 
17141  /* "View.MemoryView":926
17142  *
17143  * if index < 0:
17144  * index += view.shape[dim] # <<<<<<<<<<<<<<
17145  * if index < 0:
17146  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17147  */
17148  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
17149 
17150  /* "View.MemoryView":927
17151  * if index < 0:
17152  * index += view.shape[dim]
17153  * if index < 0: # <<<<<<<<<<<<<<
17154  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17155  *
17156  */
17157  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
17158  if (unlikely(__pyx_t_2)) {
17159 
17160  /* "View.MemoryView":928
17161  * index += view.shape[dim]
17162  * if index < 0:
17163  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17164  *
17165  * if index >= shape:
17166  */
17167  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
17168  __Pyx_GOTREF(__pyx_t_3);
17169  __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(2, 928, __pyx_L1_error)
17170  __Pyx_GOTREF(__pyx_t_4);
17171  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17172  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 928, __pyx_L1_error)
17173  __Pyx_GOTREF(__pyx_t_3);
17174  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17175  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17176  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17177  __PYX_ERR(2, 928, __pyx_L1_error)
17178 
17179  /* "View.MemoryView":927
17180  * if index < 0:
17181  * index += view.shape[dim]
17182  * if index < 0: # <<<<<<<<<<<<<<
17183  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17184  *
17185  */
17186  }
17187 
17188  /* "View.MemoryView":925
17189  * suboffset = view.suboffsets[dim]
17190  *
17191  * if index < 0: # <<<<<<<<<<<<<<
17192  * index += view.shape[dim]
17193  * if index < 0:
17194  */
17195  }
17196 
17197  /* "View.MemoryView":930
17198  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17199  *
17200  * if index >= shape: # <<<<<<<<<<<<<<
17201  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17202  *
17203  */
17204  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
17205  if (unlikely(__pyx_t_2)) {
17206 
17207  /* "View.MemoryView":931
17208  *
17209  * if index >= shape:
17210  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
17211  *
17212  * resultp = bufp + index * stride
17213  */
17214  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
17215  __Pyx_GOTREF(__pyx_t_3);
17216  __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(2, 931, __pyx_L1_error)
17217  __Pyx_GOTREF(__pyx_t_4);
17218  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17219  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 931, __pyx_L1_error)
17220  __Pyx_GOTREF(__pyx_t_3);
17221  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17222  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17223  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17224  __PYX_ERR(2, 931, __pyx_L1_error)
17225 
17226  /* "View.MemoryView":930
17227  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17228  *
17229  * if index >= shape: # <<<<<<<<<<<<<<
17230  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17231  *
17232  */
17233  }
17234 
17235  /* "View.MemoryView":933
17236  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
17237  *
17238  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
17239  * if suboffset >= 0:
17240  * resultp = (<char **> resultp)[0] + suboffset
17241  */
17242  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
17243 
17244  /* "View.MemoryView":934
17245  *
17246  * resultp = bufp + index * stride
17247  * if suboffset >= 0: # <<<<<<<<<<<<<<
17248  * resultp = (<char **> resultp)[0] + suboffset
17249  *
17250  */
17251  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
17252  if (__pyx_t_2) {
17253 
17254  /* "View.MemoryView":935
17255  * resultp = bufp + index * stride
17256  * if suboffset >= 0:
17257  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
17258  *
17259  * return resultp
17260  */
17261  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
17262 
17263  /* "View.MemoryView":934
17264  *
17265  * resultp = bufp + index * stride
17266  * if suboffset >= 0: # <<<<<<<<<<<<<<
17267  * resultp = (<char **> resultp)[0] + suboffset
17268  *
17269  */
17270  }
17271 
17272  /* "View.MemoryView":937
17273  * resultp = (<char **> resultp)[0] + suboffset
17274  *
17275  * return resultp # <<<<<<<<<<<<<<
17276  *
17277  *
17278  */
17279  __pyx_r = __pyx_v_resultp;
17280  goto __pyx_L0;
17281 
17282  /* "View.MemoryView":910
17283  *
17284  * @cname('__pyx_pybuffer_index')
17285  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17286  * Py_ssize_t dim) except NULL:
17287  * cdef Py_ssize_t shape, stride, suboffset = -1
17288  */
17289 
17290  /* function exit code */
17291  __pyx_L1_error:;
17292  __Pyx_XDECREF(__pyx_t_3);
17293  __Pyx_XDECREF(__pyx_t_4);
17294  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17295  __pyx_r = NULL;
17296  __pyx_L0:;
17297  __Pyx_RefNannyFinishContext();
17298  return __pyx_r;
17299 }
17300 
17301 /* "View.MemoryView":943
17302  *
17303  * @cname('__pyx_memslice_transpose')
17304  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17305  * cdef int ndim = memslice.memview.view.ndim
17306  *
17307  */
17308 
17309 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17310  int __pyx_v_ndim;
17311  Py_ssize_t *__pyx_v_shape;
17312  Py_ssize_t *__pyx_v_strides;
17313  int __pyx_v_i;
17314  int __pyx_v_j;
17315  int __pyx_r;
17316  int __pyx_t_1;
17317  Py_ssize_t *__pyx_t_2;
17318  long __pyx_t_3;
17319  long __pyx_t_4;
17320  Py_ssize_t __pyx_t_5;
17321  Py_ssize_t __pyx_t_6;
17322  int __pyx_t_7;
17323  int __pyx_t_8;
17324  int __pyx_t_9;
17325  int __pyx_lineno = 0;
17326  const char *__pyx_filename = NULL;
17327  int __pyx_clineno = 0;
17328 
17329  /* "View.MemoryView":944
17330  * @cname('__pyx_memslice_transpose')
17331  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
17332  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
17333  *
17334  * cdef Py_ssize_t *shape = memslice.shape
17335  */
17336  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17337  __pyx_v_ndim = __pyx_t_1;
17338 
17339  /* "View.MemoryView":946
17340  * cdef int ndim = memslice.memview.view.ndim
17341  *
17342  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
17343  * cdef Py_ssize_t *strides = memslice.strides
17344  *
17345  */
17346  __pyx_t_2 = __pyx_v_memslice->shape;
17347  __pyx_v_shape = __pyx_t_2;
17348 
17349  /* "View.MemoryView":947
17350  *
17351  * cdef Py_ssize_t *shape = memslice.shape
17352  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
17353  *
17354  *
17355  */
17356  __pyx_t_2 = __pyx_v_memslice->strides;
17357  __pyx_v_strides = __pyx_t_2;
17358 
17359  /* "View.MemoryView":951
17360  *
17361  * cdef int i, j
17362  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
17363  * j = ndim - 1 - i
17364  * strides[i], strides[j] = strides[j], strides[i]
17365  */
17366  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17367  __pyx_t_4 = __pyx_t_3;
17368  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17369  __pyx_v_i = __pyx_t_1;
17370 
17371  /* "View.MemoryView":952
17372  * cdef int i, j
17373  * for i in range(ndim / 2):
17374  * j = ndim - 1 - i # <<<<<<<<<<<<<<
17375  * strides[i], strides[j] = strides[j], strides[i]
17376  * shape[i], shape[j] = shape[j], shape[i]
17377  */
17378  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17379 
17380  /* "View.MemoryView":953
17381  * for i in range(ndim / 2):
17382  * j = ndim - 1 - i
17383  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
17384  * shape[i], shape[j] = shape[j], shape[i]
17385  *
17386  */
17387  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17388  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17389  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17390  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17391 
17392  /* "View.MemoryView":954
17393  * j = ndim - 1 - i
17394  * strides[i], strides[j] = strides[j], strides[i]
17395  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
17396  *
17397  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17398  */
17399  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17400  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17401  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17402  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17403 
17404  /* "View.MemoryView":956
17405  * shape[i], shape[j] = shape[j], shape[i]
17406  *
17407  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17408  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17409  *
17410  */
17411  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17412  if (!__pyx_t_8) {
17413  } else {
17414  __pyx_t_7 = __pyx_t_8;
17415  goto __pyx_L6_bool_binop_done;
17416  }
17417  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17418  __pyx_t_7 = __pyx_t_8;
17419  __pyx_L6_bool_binop_done:;
17420  if (__pyx_t_7) {
17421 
17422  /* "View.MemoryView":957
17423  *
17424  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17425  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
17426  *
17427  * return 1
17428  */
17429  __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(2, 957, __pyx_L1_error)
17430 
17431  /* "View.MemoryView":956
17432  * shape[i], shape[j] = shape[j], shape[i]
17433  *
17434  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17435  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17436  *
17437  */
17438  }
17439  }
17440 
17441  /* "View.MemoryView":959
17442  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17443  *
17444  * return 1 # <<<<<<<<<<<<<<
17445  *
17446  *
17447  */
17448  __pyx_r = 1;
17449  goto __pyx_L0;
17450 
17451  /* "View.MemoryView":943
17452  *
17453  * @cname('__pyx_memslice_transpose')
17454  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17455  * cdef int ndim = memslice.memview.view.ndim
17456  *
17457  */
17458 
17459  /* function exit code */
17460  __pyx_L1_error:;
17461  {
17462  #ifdef WITH_THREAD
17463  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17464  #endif
17465  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17466  #ifdef WITH_THREAD
17467  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17468  #endif
17469  }
17470  __pyx_r = 0;
17471  __pyx_L0:;
17472  return __pyx_r;
17473 }
17474 
17475 /* "View.MemoryView":976
17476  * cdef int (*to_dtype_func)(char *, object) except 0
17477  *
17478  * def __dealloc__(self): # <<<<<<<<<<<<<<
17479  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17480  *
17481  */
17482 
17483 /* Python wrapper */
17484 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
17485 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17486  __Pyx_RefNannyDeclarations
17487  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
17488  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17489 
17490  /* function exit code */
17491  __Pyx_RefNannyFinishContext();
17492 }
17493 
17494 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17495  __Pyx_RefNannyDeclarations
17496  __Pyx_RefNannySetupContext("__dealloc__", 0);
17497 
17498  /* "View.MemoryView":977
17499  *
17500  * def __dealloc__(self):
17501  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
17502  *
17503  * cdef convert_item_to_object(self, char *itemp):
17504  */
17505  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17506 
17507  /* "View.MemoryView":976
17508  * cdef int (*to_dtype_func)(char *, object) except 0
17509  *
17510  * def __dealloc__(self): # <<<<<<<<<<<<<<
17511  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17512  *
17513  */
17514 
17515  /* function exit code */
17516  __Pyx_RefNannyFinishContext();
17517 }
17518 
17519 /* "View.MemoryView":979
17520  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17521  *
17522  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17523  * if self.to_object_func != NULL:
17524  * return self.to_object_func(itemp)
17525  */
17526 
17527 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
17528  PyObject *__pyx_r = NULL;
17529  __Pyx_RefNannyDeclarations
17530  int __pyx_t_1;
17531  PyObject *__pyx_t_2 = NULL;
17532  int __pyx_lineno = 0;
17533  const char *__pyx_filename = NULL;
17534  int __pyx_clineno = 0;
17535  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
17536 
17537  /* "View.MemoryView":980
17538  *
17539  * cdef convert_item_to_object(self, char *itemp):
17540  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17541  * return self.to_object_func(itemp)
17542  * else:
17543  */
17544  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17545  if (__pyx_t_1) {
17546 
17547  /* "View.MemoryView":981
17548  * cdef convert_item_to_object(self, char *itemp):
17549  * if self.to_object_func != NULL:
17550  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
17551  * else:
17552  * return memoryview.convert_item_to_object(self, itemp)
17553  */
17554  __Pyx_XDECREF(__pyx_r);
17555  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 981, __pyx_L1_error)
17556  __Pyx_GOTREF(__pyx_t_2);
17557  __pyx_r = __pyx_t_2;
17558  __pyx_t_2 = 0;
17559  goto __pyx_L0;
17560 
17561  /* "View.MemoryView":980
17562  *
17563  * cdef convert_item_to_object(self, char *itemp):
17564  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17565  * return self.to_object_func(itemp)
17566  * else:
17567  */
17568  }
17569 
17570  /* "View.MemoryView":983
17571  * return self.to_object_func(itemp)
17572  * else:
17573  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
17574  *
17575  * cdef assign_item_from_object(self, char *itemp, object value):
17576  */
17577  /*else*/ {
17578  __Pyx_XDECREF(__pyx_r);
17579  __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(2, 983, __pyx_L1_error)
17580  __Pyx_GOTREF(__pyx_t_2);
17581  __pyx_r = __pyx_t_2;
17582  __pyx_t_2 = 0;
17583  goto __pyx_L0;
17584  }
17585 
17586  /* "View.MemoryView":979
17587  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17588  *
17589  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17590  * if self.to_object_func != NULL:
17591  * return self.to_object_func(itemp)
17592  */
17593 
17594  /* function exit code */
17595  __pyx_L1_error:;
17596  __Pyx_XDECREF(__pyx_t_2);
17597  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17598  __pyx_r = 0;
17599  __pyx_L0:;
17600  __Pyx_XGIVEREF(__pyx_r);
17601  __Pyx_RefNannyFinishContext();
17602  return __pyx_r;
17603 }
17604 
17605 /* "View.MemoryView":985
17606  * return memoryview.convert_item_to_object(self, itemp)
17607  *
17608  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17609  * if self.to_dtype_func != NULL:
17610  * self.to_dtype_func(itemp, value)
17611  */
17612 
17613 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17614  PyObject *__pyx_r = NULL;
17615  __Pyx_RefNannyDeclarations
17616  int __pyx_t_1;
17617  int __pyx_t_2;
17618  PyObject *__pyx_t_3 = NULL;
17619  int __pyx_lineno = 0;
17620  const char *__pyx_filename = NULL;
17621  int __pyx_clineno = 0;
17622  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
17623 
17624  /* "View.MemoryView":986
17625  *
17626  * cdef assign_item_from_object(self, char *itemp, object value):
17627  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17628  * self.to_dtype_func(itemp, value)
17629  * else:
17630  */
17631  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17632  if (__pyx_t_1) {
17633 
17634  /* "View.MemoryView":987
17635  * cdef assign_item_from_object(self, char *itemp, object value):
17636  * if self.to_dtype_func != NULL:
17637  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
17638  * else:
17639  * memoryview.assign_item_from_object(self, itemp, value)
17640  */
17641  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 987, __pyx_L1_error)
17642 
17643  /* "View.MemoryView":986
17644  *
17645  * cdef assign_item_from_object(self, char *itemp, object value):
17646  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17647  * self.to_dtype_func(itemp, value)
17648  * else:
17649  */
17650  goto __pyx_L3;
17651  }
17652 
17653  /* "View.MemoryView":989
17654  * self.to_dtype_func(itemp, value)
17655  * else:
17656  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
17657  *
17658  * @property
17659  */
17660  /*else*/ {
17661  __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(2, 989, __pyx_L1_error)
17662  __Pyx_GOTREF(__pyx_t_3);
17663  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17664  }
17665  __pyx_L3:;
17666 
17667  /* "View.MemoryView":985
17668  * return memoryview.convert_item_to_object(self, itemp)
17669  *
17670  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17671  * if self.to_dtype_func != NULL:
17672  * self.to_dtype_func(itemp, value)
17673  */
17674 
17675  /* function exit code */
17676  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17677  goto __pyx_L0;
17678  __pyx_L1_error:;
17679  __Pyx_XDECREF(__pyx_t_3);
17680  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17681  __pyx_r = 0;
17682  __pyx_L0:;
17683  __Pyx_XGIVEREF(__pyx_r);
17684  __Pyx_RefNannyFinishContext();
17685  return __pyx_r;
17686 }
17687 
17688 /* "View.MemoryView":992
17689  *
17690  * @property
17691  * def base(self): # <<<<<<<<<<<<<<
17692  * return self.from_object
17693  *
17694  */
17695 
17696 /* Python wrapper */
17697 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
17698 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17699  PyObject *__pyx_r = 0;
17700  __Pyx_RefNannyDeclarations
17701  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17702  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17703 
17704  /* function exit code */
17705  __Pyx_RefNannyFinishContext();
17706  return __pyx_r;
17707 }
17708 
17709 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17710  PyObject *__pyx_r = NULL;
17711  __Pyx_RefNannyDeclarations
17712  __Pyx_RefNannySetupContext("__get__", 0);
17713 
17714  /* "View.MemoryView":993
17715  * @property
17716  * def base(self):
17717  * return self.from_object # <<<<<<<<<<<<<<
17718  *
17719  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
17720  */
17721  __Pyx_XDECREF(__pyx_r);
17722  __Pyx_INCREF(__pyx_v_self->from_object);
17723  __pyx_r = __pyx_v_self->from_object;
17724  goto __pyx_L0;
17725 
17726  /* "View.MemoryView":992
17727  *
17728  * @property
17729  * def base(self): # <<<<<<<<<<<<<<
17730  * return self.from_object
17731  *
17732  */
17733 
17734  /* function exit code */
17735  __pyx_L0:;
17736  __Pyx_XGIVEREF(__pyx_r);
17737  __Pyx_RefNannyFinishContext();
17738  return __pyx_r;
17739 }
17740 
17741 /* "(tree fragment)":1
17742  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17743  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17744  * def __setstate_cython__(self, __pyx_state):
17745  */
17746 
17747 /* Python wrapper */
17748 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17749 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17750  PyObject *__pyx_r = 0;
17751  __Pyx_RefNannyDeclarations
17752  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17753  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17754 
17755  /* function exit code */
17756  __Pyx_RefNannyFinishContext();
17757  return __pyx_r;
17758 }
17759 
17760 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17761  PyObject *__pyx_r = NULL;
17762  __Pyx_RefNannyDeclarations
17763  PyObject *__pyx_t_1 = NULL;
17764  int __pyx_lineno = 0;
17765  const char *__pyx_filename = NULL;
17766  int __pyx_clineno = 0;
17767  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17768 
17769  /* "(tree fragment)":2
17770  * def __reduce_cython__(self):
17771  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17772  * def __setstate_cython__(self, __pyx_state):
17773  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17774  */
17775  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
17776  __Pyx_GOTREF(__pyx_t_1);
17777  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17778  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17779  __PYX_ERR(2, 2, __pyx_L1_error)
17780 
17781  /* "(tree fragment)":1
17782  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17783  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17784  * def __setstate_cython__(self, __pyx_state):
17785  */
17786 
17787  /* function exit code */
17788  __pyx_L1_error:;
17789  __Pyx_XDECREF(__pyx_t_1);
17790  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17791  __pyx_r = NULL;
17792  __Pyx_XGIVEREF(__pyx_r);
17793  __Pyx_RefNannyFinishContext();
17794  return __pyx_r;
17795 }
17796 
17797 /* "(tree fragment)":3
17798  * def __reduce_cython__(self):
17799  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17800  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17801  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17802  */
17803 
17804 /* Python wrapper */
17805 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
17806 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17807  PyObject *__pyx_r = 0;
17808  __Pyx_RefNannyDeclarations
17809  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17810  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17811 
17812  /* function exit code */
17813  __Pyx_RefNannyFinishContext();
17814  return __pyx_r;
17815 }
17816 
17817 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) {
17818  PyObject *__pyx_r = NULL;
17819  __Pyx_RefNannyDeclarations
17820  PyObject *__pyx_t_1 = NULL;
17821  int __pyx_lineno = 0;
17822  const char *__pyx_filename = NULL;
17823  int __pyx_clineno = 0;
17824  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17825 
17826  /* "(tree fragment)":4
17827  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17828  * def __setstate_cython__(self, __pyx_state):
17829  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17830  */
17831  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
17832  __Pyx_GOTREF(__pyx_t_1);
17833  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17834  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17835  __PYX_ERR(2, 4, __pyx_L1_error)
17836 
17837  /* "(tree fragment)":3
17838  * def __reduce_cython__(self):
17839  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17840  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17841  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17842  */
17843 
17844  /* function exit code */
17845  __pyx_L1_error:;
17846  __Pyx_XDECREF(__pyx_t_1);
17847  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17848  __pyx_r = NULL;
17849  __Pyx_XGIVEREF(__pyx_r);
17850  __Pyx_RefNannyFinishContext();
17851  return __pyx_r;
17852 }
17853 
17854 /* "View.MemoryView":999
17855  *
17856  * @cname('__pyx_memoryview_fromslice')
17857  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17858  * int ndim,
17859  * object (*to_object_func)(char *),
17860  */
17861 
17862 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) {
17863  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17864  Py_ssize_t __pyx_v_suboffset;
17865  PyObject *__pyx_v_length = NULL;
17866  PyObject *__pyx_r = NULL;
17867  __Pyx_RefNannyDeclarations
17868  int __pyx_t_1;
17869  PyObject *__pyx_t_2 = NULL;
17870  PyObject *__pyx_t_3 = NULL;
17871  __Pyx_TypeInfo *__pyx_t_4;
17872  Py_buffer __pyx_t_5;
17873  Py_ssize_t *__pyx_t_6;
17874  Py_ssize_t *__pyx_t_7;
17875  Py_ssize_t *__pyx_t_8;
17876  Py_ssize_t __pyx_t_9;
17877  int __pyx_lineno = 0;
17878  const char *__pyx_filename = NULL;
17879  int __pyx_clineno = 0;
17880  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
17881 
17882  /* "View.MemoryView":1007
17883  * cdef _memoryviewslice result
17884  *
17885  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17886  * return None
17887  *
17888  */
17889  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17890  if (__pyx_t_1) {
17891 
17892  /* "View.MemoryView":1008
17893  *
17894  * if <PyObject *> memviewslice.memview == Py_None:
17895  * return None # <<<<<<<<<<<<<<
17896  *
17897  *
17898  */
17899  __Pyx_XDECREF(__pyx_r);
17900  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17901  goto __pyx_L0;
17902 
17903  /* "View.MemoryView":1007
17904  * cdef _memoryviewslice result
17905  *
17906  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17907  * return None
17908  *
17909  */
17910  }
17911 
17912  /* "View.MemoryView":1013
17913  *
17914  *
17915  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
17916  *
17917  * result.from_slice = memviewslice
17918  */
17919  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
17920  __Pyx_GOTREF(__pyx_t_2);
17921  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1013, __pyx_L1_error)
17922  __Pyx_GOTREF(__pyx_t_3);
17923  __Pyx_INCREF(Py_None);
17924  __Pyx_GIVEREF(Py_None);
17925  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17926  __Pyx_INCREF(__pyx_int_0);
17927  __Pyx_GIVEREF(__pyx_int_0);
17928  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17929  __Pyx_GIVEREF(__pyx_t_2);
17930  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17931  __pyx_t_2 = 0;
17932  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
17933  __Pyx_GOTREF(__pyx_t_2);
17934  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17935  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17936  __pyx_t_2 = 0;
17937 
17938  /* "View.MemoryView":1015
17939  * result = _memoryviewslice(None, 0, dtype_is_object)
17940  *
17941  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
17942  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17943  *
17944  */
17945  __pyx_v_result->from_slice = __pyx_v_memviewslice;
17946 
17947  /* "View.MemoryView":1016
17948  *
17949  * result.from_slice = memviewslice
17950  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
17951  *
17952  * result.from_object = (<memoryview> memviewslice.memview).base
17953  */
17954  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17955 
17956  /* "View.MemoryView":1018
17957  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17958  *
17959  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
17960  * result.typeinfo = memviewslice.memview.typeinfo
17961  *
17962  */
17963  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1018, __pyx_L1_error)
17964  __Pyx_GOTREF(__pyx_t_2);
17965  __Pyx_GIVEREF(__pyx_t_2);
17966  __Pyx_GOTREF(__pyx_v_result->from_object);
17967  __Pyx_DECREF(__pyx_v_result->from_object);
17968  __pyx_v_result->from_object = __pyx_t_2;
17969  __pyx_t_2 = 0;
17970 
17971  /* "View.MemoryView":1019
17972  *
17973  * result.from_object = (<memoryview> memviewslice.memview).base
17974  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
17975  *
17976  * result.view = memviewslice.memview.view
17977  */
17978  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17979  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17980 
17981  /* "View.MemoryView":1021
17982  * result.typeinfo = memviewslice.memview.typeinfo
17983  *
17984  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
17985  * result.view.buf = <void *> memviewslice.data
17986  * result.view.ndim = ndim
17987  */
17988  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17989  __pyx_v_result->__pyx_base.view = __pyx_t_5;
17990 
17991  /* "View.MemoryView":1022
17992  *
17993  * result.view = memviewslice.memview.view
17994  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
17995  * result.view.ndim = ndim
17996  * (<__pyx_buffer *> &result.view).obj = Py_None
17997  */
17998  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
17999 
18000  /* "View.MemoryView":1023
18001  * result.view = memviewslice.memview.view
18002  * result.view.buf = <void *> memviewslice.data
18003  * result.view.ndim = ndim # <<<<<<<<<<<<<<
18004  * (<__pyx_buffer *> &result.view).obj = Py_None
18005  * Py_INCREF(Py_None)
18006  */
18007  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
18008 
18009  /* "View.MemoryView":1024
18010  * result.view.buf = <void *> memviewslice.data
18011  * result.view.ndim = ndim
18012  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
18013  * Py_INCREF(Py_None)
18014  *
18015  */
18016  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
18017 
18018  /* "View.MemoryView":1025
18019  * result.view.ndim = ndim
18020  * (<__pyx_buffer *> &result.view).obj = Py_None
18021  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
18022  *
18023  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
18024  */
18025  Py_INCREF(Py_None);
18026 
18027  /* "View.MemoryView":1027
18028  * Py_INCREF(Py_None)
18029  *
18030  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
18031  * result.flags = PyBUF_RECORDS
18032  * else:
18033  */
18034  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
18035  if (__pyx_t_1) {
18036 
18037  /* "View.MemoryView":1028
18038  *
18039  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
18040  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
18041  * else:
18042  * result.flags = PyBUF_RECORDS_RO
18043  */
18044  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
18045 
18046  /* "View.MemoryView":1027
18047  * Py_INCREF(Py_None)
18048  *
18049  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
18050  * result.flags = PyBUF_RECORDS
18051  * else:
18052  */
18053  goto __pyx_L4;
18054  }
18055 
18056  /* "View.MemoryView":1030
18057  * result.flags = PyBUF_RECORDS
18058  * else:
18059  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
18060  *
18061  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
18062  */
18063  /*else*/ {
18064  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
18065  }
18066  __pyx_L4:;
18067 
18068  /* "View.MemoryView":1032
18069  * result.flags = PyBUF_RECORDS_RO
18070  *
18071  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
18072  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
18073  *
18074  */
18075  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
18076 
18077  /* "View.MemoryView":1033
18078  *
18079  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
18080  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
18081  *
18082  *
18083  */
18084  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
18085 
18086  /* "View.MemoryView":1036
18087  *
18088  *
18089  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
18090  * for suboffset in result.from_slice.suboffsets[:ndim]:
18091  * if suboffset >= 0:
18092  */
18093  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
18094 
18095  /* "View.MemoryView":1037
18096  *
18097  * result.view.suboffsets = NULL
18098  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
18099  * if suboffset >= 0:
18100  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18101  */
18102  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
18103  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18104  __pyx_t_6 = __pyx_t_8;
18105  __pyx_v_suboffset = (__pyx_t_6[0]);
18106 
18107  /* "View.MemoryView":1038
18108  * result.view.suboffsets = NULL
18109  * for suboffset in result.from_slice.suboffsets[:ndim]:
18110  * if suboffset >= 0: # <<<<<<<<<<<<<<
18111  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18112  * break
18113  */
18114  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
18115  if (__pyx_t_1) {
18116 
18117  /* "View.MemoryView":1039
18118  * for suboffset in result.from_slice.suboffsets[:ndim]:
18119  * if suboffset >= 0:
18120  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
18121  * break
18122  *
18123  */
18124  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
18125 
18126  /* "View.MemoryView":1040
18127  * if suboffset >= 0:
18128  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18129  * break # <<<<<<<<<<<<<<
18130  *
18131  * result.view.len = result.view.itemsize
18132  */
18133  goto __pyx_L6_break;
18134 
18135  /* "View.MemoryView":1038
18136  * result.view.suboffsets = NULL
18137  * for suboffset in result.from_slice.suboffsets[:ndim]:
18138  * if suboffset >= 0: # <<<<<<<<<<<<<<
18139  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
18140  * break
18141  */
18142  }
18143  }
18144  __pyx_L6_break:;
18145 
18146  /* "View.MemoryView":1042
18147  * break
18148  *
18149  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
18150  * for length in result.view.shape[:ndim]:
18151  * result.view.len *= length
18152  */
18153  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
18154  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18155 
18156  /* "View.MemoryView":1043
18157  *
18158  * result.view.len = result.view.itemsize
18159  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
18160  * result.view.len *= length
18161  *
18162  */
18163  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
18164  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
18165  __pyx_t_6 = __pyx_t_8;
18166  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1043, __pyx_L1_error)
18167  __Pyx_GOTREF(__pyx_t_2);
18168  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
18169  __pyx_t_2 = 0;
18170 
18171  /* "View.MemoryView":1044
18172  * result.view.len = result.view.itemsize
18173  * for length in result.view.shape[:ndim]:
18174  * result.view.len *= length # <<<<<<<<<<<<<<
18175  *
18176  * result.to_object_func = to_object_func
18177  */
18178  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error)
18179  __Pyx_GOTREF(__pyx_t_2);
18180  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1044, __pyx_L1_error)
18181  __Pyx_GOTREF(__pyx_t_3);
18182  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18183  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1044, __pyx_L1_error)
18184  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18185  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
18186  }
18187 
18188  /* "View.MemoryView":1046
18189  * result.view.len *= length
18190  *
18191  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
18192  * result.to_dtype_func = to_dtype_func
18193  *
18194  */
18195  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
18196 
18197  /* "View.MemoryView":1047
18198  *
18199  * result.to_object_func = to_object_func
18200  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
18201  *
18202  * return result
18203  */
18204  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
18205 
18206  /* "View.MemoryView":1049
18207  * result.to_dtype_func = to_dtype_func
18208  *
18209  * return result # <<<<<<<<<<<<<<
18210  *
18211  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18212  */
18213  __Pyx_XDECREF(__pyx_r);
18214  __Pyx_INCREF(((PyObject *)__pyx_v_result));
18215  __pyx_r = ((PyObject *)__pyx_v_result);
18216  goto __pyx_L0;
18217 
18218  /* "View.MemoryView":999
18219  *
18220  * @cname('__pyx_memoryview_fromslice')
18221  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
18222  * int ndim,
18223  * object (*to_object_func)(char *),
18224  */
18225 
18226  /* function exit code */
18227  __pyx_L1_error:;
18228  __Pyx_XDECREF(__pyx_t_2);
18229  __Pyx_XDECREF(__pyx_t_3);
18230  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18231  __pyx_r = 0;
18232  __pyx_L0:;
18233  __Pyx_XDECREF((PyObject *)__pyx_v_result);
18234  __Pyx_XDECREF(__pyx_v_length);
18235  __Pyx_XGIVEREF(__pyx_r);
18236  __Pyx_RefNannyFinishContext();
18237  return __pyx_r;
18238 }
18239 
18240 /* "View.MemoryView":1052
18241  *
18242  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18243  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18244  * __Pyx_memviewslice *mslice) except NULL:
18245  * cdef _memoryviewslice obj
18246  */
18247 
18248 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
18249  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
18250  __Pyx_memviewslice *__pyx_r;
18251  __Pyx_RefNannyDeclarations
18252  int __pyx_t_1;
18253  int __pyx_t_2;
18254  PyObject *__pyx_t_3 = NULL;
18255  int __pyx_lineno = 0;
18256  const char *__pyx_filename = NULL;
18257  int __pyx_clineno = 0;
18258  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
18259 
18260  /* "View.MemoryView":1055
18261  * __Pyx_memviewslice *mslice) except NULL:
18262  * cdef _memoryviewslice obj
18263  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18264  * obj = memview
18265  * return &obj.from_slice
18266  */
18267  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18268  __pyx_t_2 = (__pyx_t_1 != 0);
18269  if (__pyx_t_2) {
18270 
18271  /* "View.MemoryView":1056
18272  * cdef _memoryviewslice obj
18273  * if isinstance(memview, _memoryviewslice):
18274  * obj = memview # <<<<<<<<<<<<<<
18275  * return &obj.from_slice
18276  * else:
18277  */
18278  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1056, __pyx_L1_error)
18279  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18280  __Pyx_INCREF(__pyx_t_3);
18281  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18282  __pyx_t_3 = 0;
18283 
18284  /* "View.MemoryView":1057
18285  * if isinstance(memview, _memoryviewslice):
18286  * obj = memview
18287  * return &obj.from_slice # <<<<<<<<<<<<<<
18288  * else:
18289  * slice_copy(memview, mslice)
18290  */
18291  __pyx_r = (&__pyx_v_obj->from_slice);
18292  goto __pyx_L0;
18293 
18294  /* "View.MemoryView":1055
18295  * __Pyx_memviewslice *mslice) except NULL:
18296  * cdef _memoryviewslice obj
18297  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18298  * obj = memview
18299  * return &obj.from_slice
18300  */
18301  }
18302 
18303  /* "View.MemoryView":1059
18304  * return &obj.from_slice
18305  * else:
18306  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
18307  * return mslice
18308  *
18309  */
18310  /*else*/ {
18311  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18312 
18313  /* "View.MemoryView":1060
18314  * else:
18315  * slice_copy(memview, mslice)
18316  * return mslice # <<<<<<<<<<<<<<
18317  *
18318  * @cname('__pyx_memoryview_slice_copy')
18319  */
18320  __pyx_r = __pyx_v_mslice;
18321  goto __pyx_L0;
18322  }
18323 
18324  /* "View.MemoryView":1052
18325  *
18326  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18327  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18328  * __Pyx_memviewslice *mslice) except NULL:
18329  * cdef _memoryviewslice obj
18330  */
18331 
18332  /* function exit code */
18333  __pyx_L1_error:;
18334  __Pyx_XDECREF(__pyx_t_3);
18335  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
18336  __pyx_r = NULL;
18337  __pyx_L0:;
18338  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18339  __Pyx_RefNannyFinishContext();
18340  return __pyx_r;
18341 }
18342 
18343 /* "View.MemoryView":1063
18344  *
18345  * @cname('__pyx_memoryview_slice_copy')
18346  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18347  * cdef int dim
18348  * cdef (Py_ssize_t*) shape, strides, suboffsets
18349  */
18350 
18351 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18352  int __pyx_v_dim;
18353  Py_ssize_t *__pyx_v_shape;
18354  Py_ssize_t *__pyx_v_strides;
18355  Py_ssize_t *__pyx_v_suboffsets;
18356  __Pyx_RefNannyDeclarations
18357  Py_ssize_t *__pyx_t_1;
18358  int __pyx_t_2;
18359  int __pyx_t_3;
18360  int __pyx_t_4;
18361  Py_ssize_t __pyx_t_5;
18362  __Pyx_RefNannySetupContext("slice_copy", 0);
18363 
18364  /* "View.MemoryView":1067
18365  * cdef (Py_ssize_t*) shape, strides, suboffsets
18366  *
18367  * shape = memview.view.shape # <<<<<<<<<<<<<<
18368  * strides = memview.view.strides
18369  * suboffsets = memview.view.suboffsets
18370  */
18371  __pyx_t_1 = __pyx_v_memview->view.shape;
18372  __pyx_v_shape = __pyx_t_1;
18373 
18374  /* "View.MemoryView":1068
18375  *
18376  * shape = memview.view.shape
18377  * strides = memview.view.strides # <<<<<<<<<<<<<<
18378  * suboffsets = memview.view.suboffsets
18379  *
18380  */
18381  __pyx_t_1 = __pyx_v_memview->view.strides;
18382  __pyx_v_strides = __pyx_t_1;
18383 
18384  /* "View.MemoryView":1069
18385  * shape = memview.view.shape
18386  * strides = memview.view.strides
18387  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
18388  *
18389  * dst.memview = <__pyx_memoryview *> memview
18390  */
18391  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18392  __pyx_v_suboffsets = __pyx_t_1;
18393 
18394  /* "View.MemoryView":1071
18395  * suboffsets = memview.view.suboffsets
18396  *
18397  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
18398  * dst.data = <char *> memview.view.buf
18399  *
18400  */
18401  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
18402 
18403  /* "View.MemoryView":1072
18404  *
18405  * dst.memview = <__pyx_memoryview *> memview
18406  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
18407  *
18408  * for dim in range(memview.view.ndim):
18409  */
18410  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
18411 
18412  /* "View.MemoryView":1074
18413  * dst.data = <char *> memview.view.buf
18414  *
18415  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
18416  * dst.shape[dim] = shape[dim]
18417  * dst.strides[dim] = strides[dim]
18418  */
18419  __pyx_t_2 = __pyx_v_memview->view.ndim;
18420  __pyx_t_3 = __pyx_t_2;
18421  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18422  __pyx_v_dim = __pyx_t_4;
18423 
18424  /* "View.MemoryView":1075
18425  *
18426  * for dim in range(memview.view.ndim):
18427  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
18428  * dst.strides[dim] = strides[dim]
18429  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18430  */
18431  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18432 
18433  /* "View.MemoryView":1076
18434  * for dim in range(memview.view.ndim):
18435  * dst.shape[dim] = shape[dim]
18436  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
18437  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18438  *
18439  */
18440  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18441 
18442  /* "View.MemoryView":1077
18443  * dst.shape[dim] = shape[dim]
18444  * dst.strides[dim] = strides[dim]
18445  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
18446  *
18447  * @cname('__pyx_memoryview_copy_object')
18448  */
18449  if ((__pyx_v_suboffsets != 0)) {
18450  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18451  } else {
18452  __pyx_t_5 = -1L;
18453  }
18454  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18455  }
18456 
18457  /* "View.MemoryView":1063
18458  *
18459  * @cname('__pyx_memoryview_slice_copy')
18460  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18461  * cdef int dim
18462  * cdef (Py_ssize_t*) shape, strides, suboffsets
18463  */
18464 
18465  /* function exit code */
18466  __Pyx_RefNannyFinishContext();
18467 }
18468 
18469 /* "View.MemoryView":1080
18470  *
18471  * @cname('__pyx_memoryview_copy_object')
18472  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18473  * "Create a new memoryview object"
18474  * cdef __Pyx_memviewslice memviewslice
18475  */
18476 
18477 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
18478  __Pyx_memviewslice __pyx_v_memviewslice;
18479  PyObject *__pyx_r = NULL;
18480  __Pyx_RefNannyDeclarations
18481  PyObject *__pyx_t_1 = NULL;
18482  int __pyx_lineno = 0;
18483  const char *__pyx_filename = NULL;
18484  int __pyx_clineno = 0;
18485  __Pyx_RefNannySetupContext("memoryview_copy", 0);
18486 
18487  /* "View.MemoryView":1083
18488  * "Create a new memoryview object"
18489  * cdef __Pyx_memviewslice memviewslice
18490  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
18491  * return memoryview_copy_from_slice(memview, &memviewslice)
18492  *
18493  */
18494  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18495 
18496  /* "View.MemoryView":1084
18497  * cdef __Pyx_memviewslice memviewslice
18498  * slice_copy(memview, &memviewslice)
18499  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
18500  *
18501  * @cname('__pyx_memoryview_copy_object_from_slice')
18502  */
18503  __Pyx_XDECREF(__pyx_r);
18504  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1084, __pyx_L1_error)
18505  __Pyx_GOTREF(__pyx_t_1);
18506  __pyx_r = __pyx_t_1;
18507  __pyx_t_1 = 0;
18508  goto __pyx_L0;
18509 
18510  /* "View.MemoryView":1080
18511  *
18512  * @cname('__pyx_memoryview_copy_object')
18513  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18514  * "Create a new memoryview object"
18515  * cdef __Pyx_memviewslice memviewslice
18516  */
18517 
18518  /* function exit code */
18519  __pyx_L1_error:;
18520  __Pyx_XDECREF(__pyx_t_1);
18521  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18522  __pyx_r = 0;
18523  __pyx_L0:;
18524  __Pyx_XGIVEREF(__pyx_r);
18525  __Pyx_RefNannyFinishContext();
18526  return __pyx_r;
18527 }
18528 
18529 /* "View.MemoryView":1087
18530  *
18531  * @cname('__pyx_memoryview_copy_object_from_slice')
18532  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18533  * """
18534  * Create a new memoryview object from a given memoryview object and slice.
18535  */
18536 
18537 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18538  PyObject *(*__pyx_v_to_object_func)(char *);
18539  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
18540  PyObject *__pyx_r = NULL;
18541  __Pyx_RefNannyDeclarations
18542  int __pyx_t_1;
18543  int __pyx_t_2;
18544  PyObject *(*__pyx_t_3)(char *);
18545  int (*__pyx_t_4)(char *, PyObject *);
18546  PyObject *__pyx_t_5 = NULL;
18547  int __pyx_lineno = 0;
18548  const char *__pyx_filename = NULL;
18549  int __pyx_clineno = 0;
18550  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
18551 
18552  /* "View.MemoryView":1094
18553  * cdef int (*to_dtype_func)(char *, object) except 0
18554  *
18555  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18556  * to_object_func = (<_memoryviewslice> memview).to_object_func
18557  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18558  */
18559  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18560  __pyx_t_2 = (__pyx_t_1 != 0);
18561  if (__pyx_t_2) {
18562 
18563  /* "View.MemoryView":1095
18564  *
18565  * if isinstance(memview, _memoryviewslice):
18566  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
18567  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18568  * else:
18569  */
18570  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18571  __pyx_v_to_object_func = __pyx_t_3;
18572 
18573  /* "View.MemoryView":1096
18574  * if isinstance(memview, _memoryviewslice):
18575  * to_object_func = (<_memoryviewslice> memview).to_object_func
18576  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
18577  * else:
18578  * to_object_func = NULL
18579  */
18580  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18581  __pyx_v_to_dtype_func = __pyx_t_4;
18582 
18583  /* "View.MemoryView":1094
18584  * cdef int (*to_dtype_func)(char *, object) except 0
18585  *
18586  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18587  * to_object_func = (<_memoryviewslice> memview).to_object_func
18588  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18589  */
18590  goto __pyx_L3;
18591  }
18592 
18593  /* "View.MemoryView":1098
18594  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18595  * else:
18596  * to_object_func = NULL # <<<<<<<<<<<<<<
18597  * to_dtype_func = NULL
18598  *
18599  */
18600  /*else*/ {
18601  __pyx_v_to_object_func = NULL;
18602 
18603  /* "View.MemoryView":1099
18604  * else:
18605  * to_object_func = NULL
18606  * to_dtype_func = NULL # <<<<<<<<<<<<<<
18607  *
18608  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18609  */
18610  __pyx_v_to_dtype_func = NULL;
18611  }
18612  __pyx_L3:;
18613 
18614  /* "View.MemoryView":1101
18615  * to_dtype_func = NULL
18616  *
18617  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
18618  * to_object_func, to_dtype_func,
18619  * memview.dtype_is_object)
18620  */
18621  __Pyx_XDECREF(__pyx_r);
18622 
18623  /* "View.MemoryView":1103
18624  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18625  * to_object_func, to_dtype_func,
18626  * memview.dtype_is_object) # <<<<<<<<<<<<<<
18627  *
18628  *
18629  */
18630  __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(2, 1101, __pyx_L1_error)
18631  __Pyx_GOTREF(__pyx_t_5);
18632  __pyx_r = __pyx_t_5;
18633  __pyx_t_5 = 0;
18634  goto __pyx_L0;
18635 
18636  /* "View.MemoryView":1087
18637  *
18638  * @cname('__pyx_memoryview_copy_object_from_slice')
18639  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18640  * """
18641  * Create a new memoryview object from a given memoryview object and slice.
18642  */
18643 
18644  /* function exit code */
18645  __pyx_L1_error:;
18646  __Pyx_XDECREF(__pyx_t_5);
18647  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18648  __pyx_r = 0;
18649  __pyx_L0:;
18650  __Pyx_XGIVEREF(__pyx_r);
18651  __Pyx_RefNannyFinishContext();
18652  return __pyx_r;
18653 }
18654 
18655 /* "View.MemoryView":1109
18656  *
18657  *
18658  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18659  * if arg < 0:
18660  * return -arg
18661  */
18662 
18663 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18664  Py_ssize_t __pyx_r;
18665  int __pyx_t_1;
18666 
18667  /* "View.MemoryView":1110
18668  *
18669  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18670  * if arg < 0: # <<<<<<<<<<<<<<
18671  * return -arg
18672  * else:
18673  */
18674  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18675  if (__pyx_t_1) {
18676 
18677  /* "View.MemoryView":1111
18678  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18679  * if arg < 0:
18680  * return -arg # <<<<<<<<<<<<<<
18681  * else:
18682  * return arg
18683  */
18684  __pyx_r = (-__pyx_v_arg);
18685  goto __pyx_L0;
18686 
18687  /* "View.MemoryView":1110
18688  *
18689  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18690  * if arg < 0: # <<<<<<<<<<<<<<
18691  * return -arg
18692  * else:
18693  */
18694  }
18695 
18696  /* "View.MemoryView":1113
18697  * return -arg
18698  * else:
18699  * return arg # <<<<<<<<<<<<<<
18700  *
18701  * @cname('__pyx_get_best_slice_order')
18702  */
18703  /*else*/ {
18704  __pyx_r = __pyx_v_arg;
18705  goto __pyx_L0;
18706  }
18707 
18708  /* "View.MemoryView":1109
18709  *
18710  *
18711  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18712  * if arg < 0:
18713  * return -arg
18714  */
18715 
18716  /* function exit code */
18717  __pyx_L0:;
18718  return __pyx_r;
18719 }
18720 
18721 /* "View.MemoryView":1116
18722  *
18723  * @cname('__pyx_get_best_slice_order')
18724  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18725  * """
18726  * Figure out the best memory access order for a given slice.
18727  */
18728 
18729 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
18730  int __pyx_v_i;
18731  Py_ssize_t __pyx_v_c_stride;
18732  Py_ssize_t __pyx_v_f_stride;
18733  char __pyx_r;
18734  int __pyx_t_1;
18735  int __pyx_t_2;
18736  int __pyx_t_3;
18737  int __pyx_t_4;
18738 
18739  /* "View.MemoryView":1121
18740  * """
18741  * cdef int i
18742  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
18743  * cdef Py_ssize_t f_stride = 0
18744  *
18745  */
18746  __pyx_v_c_stride = 0;
18747 
18748  /* "View.MemoryView":1122
18749  * cdef int i
18750  * cdef Py_ssize_t c_stride = 0
18751  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
18752  *
18753  * for i in range(ndim - 1, -1, -1):
18754  */
18755  __pyx_v_f_stride = 0;
18756 
18757  /* "View.MemoryView":1124
18758  * cdef Py_ssize_t f_stride = 0
18759  *
18760  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18761  * if mslice.shape[i] > 1:
18762  * c_stride = mslice.strides[i]
18763  */
18764  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18765  __pyx_v_i = __pyx_t_1;
18766 
18767  /* "View.MemoryView":1125
18768  *
18769  * for i in range(ndim - 1, -1, -1):
18770  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18771  * c_stride = mslice.strides[i]
18772  * break
18773  */
18774  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18775  if (__pyx_t_2) {
18776 
18777  /* "View.MemoryView":1126
18778  * for i in range(ndim - 1, -1, -1):
18779  * if mslice.shape[i] > 1:
18780  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18781  * break
18782  *
18783  */
18784  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18785 
18786  /* "View.MemoryView":1127
18787  * if mslice.shape[i] > 1:
18788  * c_stride = mslice.strides[i]
18789  * break # <<<<<<<<<<<<<<
18790  *
18791  * for i in range(ndim):
18792  */
18793  goto __pyx_L4_break;
18794 
18795  /* "View.MemoryView":1125
18796  *
18797  * for i in range(ndim - 1, -1, -1):
18798  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18799  * c_stride = mslice.strides[i]
18800  * break
18801  */
18802  }
18803  }
18804  __pyx_L4_break:;
18805 
18806  /* "View.MemoryView":1129
18807  * break
18808  *
18809  * for i in range(ndim): # <<<<<<<<<<<<<<
18810  * if mslice.shape[i] > 1:
18811  * f_stride = mslice.strides[i]
18812  */
18813  __pyx_t_1 = __pyx_v_ndim;
18814  __pyx_t_3 = __pyx_t_1;
18815  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18816  __pyx_v_i = __pyx_t_4;
18817 
18818  /* "View.MemoryView":1130
18819  *
18820  * for i in range(ndim):
18821  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18822  * f_stride = mslice.strides[i]
18823  * break
18824  */
18825  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18826  if (__pyx_t_2) {
18827 
18828  /* "View.MemoryView":1131
18829  * for i in range(ndim):
18830  * if mslice.shape[i] > 1:
18831  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18832  * break
18833  *
18834  */
18835  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18836 
18837  /* "View.MemoryView":1132
18838  * if mslice.shape[i] > 1:
18839  * f_stride = mslice.strides[i]
18840  * break # <<<<<<<<<<<<<<
18841  *
18842  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18843  */
18844  goto __pyx_L7_break;
18845 
18846  /* "View.MemoryView":1130
18847  *
18848  * for i in range(ndim):
18849  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18850  * f_stride = mslice.strides[i]
18851  * break
18852  */
18853  }
18854  }
18855  __pyx_L7_break:;
18856 
18857  /* "View.MemoryView":1134
18858  * break
18859  *
18860  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18861  * return 'C'
18862  * else:
18863  */
18864  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18865  if (__pyx_t_2) {
18866 
18867  /* "View.MemoryView":1135
18868  *
18869  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18870  * return 'C' # <<<<<<<<<<<<<<
18871  * else:
18872  * return 'F'
18873  */
18874  __pyx_r = 'C';
18875  goto __pyx_L0;
18876 
18877  /* "View.MemoryView":1134
18878  * break
18879  *
18880  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18881  * return 'C'
18882  * else:
18883  */
18884  }
18885 
18886  /* "View.MemoryView":1137
18887  * return 'C'
18888  * else:
18889  * return 'F' # <<<<<<<<<<<<<<
18890  *
18891  * @cython.cdivision(True)
18892  */
18893  /*else*/ {
18894  __pyx_r = 'F';
18895  goto __pyx_L0;
18896  }
18897 
18898  /* "View.MemoryView":1116
18899  *
18900  * @cname('__pyx_get_best_slice_order')
18901  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18902  * """
18903  * Figure out the best memory access order for a given slice.
18904  */
18905 
18906  /* function exit code */
18907  __pyx_L0:;
18908  return __pyx_r;
18909 }
18910 
18911 /* "View.MemoryView":1140
18912  *
18913  * @cython.cdivision(True)
18914  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18915  * char *dst_data, Py_ssize_t *dst_strides,
18916  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18917  */
18918 
18919 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) {
18920  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18921  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18922  Py_ssize_t __pyx_v_dst_extent;
18923  Py_ssize_t __pyx_v_src_stride;
18924  Py_ssize_t __pyx_v_dst_stride;
18925  int __pyx_t_1;
18926  int __pyx_t_2;
18927  int __pyx_t_3;
18928  Py_ssize_t __pyx_t_4;
18929  Py_ssize_t __pyx_t_5;
18930  Py_ssize_t __pyx_t_6;
18931 
18932  /* "View.MemoryView":1147
18933  *
18934  * cdef Py_ssize_t i
18935  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
18936  * cdef Py_ssize_t dst_extent = dst_shape[0]
18937  * cdef Py_ssize_t src_stride = src_strides[0]
18938  */
18939  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18940 
18941  /* "View.MemoryView":1148
18942  * cdef Py_ssize_t i
18943  * cdef Py_ssize_t src_extent = src_shape[0]
18944  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
18945  * cdef Py_ssize_t src_stride = src_strides[0]
18946  * cdef Py_ssize_t dst_stride = dst_strides[0]
18947  */
18948  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18949 
18950  /* "View.MemoryView":1149
18951  * cdef Py_ssize_t src_extent = src_shape[0]
18952  * cdef Py_ssize_t dst_extent = dst_shape[0]
18953  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
18954  * cdef Py_ssize_t dst_stride = dst_strides[0]
18955  *
18956  */
18957  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18958 
18959  /* "View.MemoryView":1150
18960  * cdef Py_ssize_t dst_extent = dst_shape[0]
18961  * cdef Py_ssize_t src_stride = src_strides[0]
18962  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
18963  *
18964  * if ndim == 1:
18965  */
18966  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18967 
18968  /* "View.MemoryView":1152
18969  * cdef Py_ssize_t dst_stride = dst_strides[0]
18970  *
18971  * if ndim == 1: # <<<<<<<<<<<<<<
18972  * if (src_stride > 0 and dst_stride > 0 and
18973  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18974  */
18975  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18976  if (__pyx_t_1) {
18977 
18978  /* "View.MemoryView":1153
18979  *
18980  * if ndim == 1:
18981  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18982  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18983  * memcpy(dst_data, src_data, itemsize * dst_extent)
18984  */
18985  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18986  if (__pyx_t_2) {
18987  } else {
18988  __pyx_t_1 = __pyx_t_2;
18989  goto __pyx_L5_bool_binop_done;
18990  }
18991  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18992  if (__pyx_t_2) {
18993  } else {
18994  __pyx_t_1 = __pyx_t_2;
18995  goto __pyx_L5_bool_binop_done;
18996  }
18997 
18998  /* "View.MemoryView":1154
18999  * if ndim == 1:
19000  * if (src_stride > 0 and dst_stride > 0 and
19001  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
19002  * memcpy(dst_data, src_data, itemsize * dst_extent)
19003  * else:
19004  */
19005  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
19006  if (__pyx_t_2) {
19007  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
19008  }
19009  __pyx_t_3 = (__pyx_t_2 != 0);
19010  __pyx_t_1 = __pyx_t_3;
19011  __pyx_L5_bool_binop_done:;
19012 
19013  /* "View.MemoryView":1153
19014  *
19015  * if ndim == 1:
19016  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19017  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19018  * memcpy(dst_data, src_data, itemsize * dst_extent)
19019  */
19020  if (__pyx_t_1) {
19021 
19022  /* "View.MemoryView":1155
19023  * if (src_stride > 0 and dst_stride > 0 and
19024  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19025  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
19026  * else:
19027  * for i in range(dst_extent):
19028  */
19029  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
19030 
19031  /* "View.MemoryView":1153
19032  *
19033  * if ndim == 1:
19034  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
19035  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19036  * memcpy(dst_data, src_data, itemsize * dst_extent)
19037  */
19038  goto __pyx_L4;
19039  }
19040 
19041  /* "View.MemoryView":1157
19042  * memcpy(dst_data, src_data, itemsize * dst_extent)
19043  * else:
19044  * for i in range(dst_extent): # <<<<<<<<<<<<<<
19045  * memcpy(dst_data, src_data, itemsize)
19046  * src_data += src_stride
19047  */
19048  /*else*/ {
19049  __pyx_t_4 = __pyx_v_dst_extent;
19050  __pyx_t_5 = __pyx_t_4;
19051  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19052  __pyx_v_i = __pyx_t_6;
19053 
19054  /* "View.MemoryView":1158
19055  * else:
19056  * for i in range(dst_extent):
19057  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
19058  * src_data += src_stride
19059  * dst_data += dst_stride
19060  */
19061  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
19062 
19063  /* "View.MemoryView":1159
19064  * for i in range(dst_extent):
19065  * memcpy(dst_data, src_data, itemsize)
19066  * src_data += src_stride # <<<<<<<<<<<<<<
19067  * dst_data += dst_stride
19068  * else:
19069  */
19070  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19071 
19072  /* "View.MemoryView":1160
19073  * memcpy(dst_data, src_data, itemsize)
19074  * src_data += src_stride
19075  * dst_data += dst_stride # <<<<<<<<<<<<<<
19076  * else:
19077  * for i in range(dst_extent):
19078  */
19079  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19080  }
19081  }
19082  __pyx_L4:;
19083 
19084  /* "View.MemoryView":1152
19085  * cdef Py_ssize_t dst_stride = dst_strides[0]
19086  *
19087  * if ndim == 1: # <<<<<<<<<<<<<<
19088  * if (src_stride > 0 and dst_stride > 0 and
19089  * <size_t> src_stride == itemsize == <size_t> dst_stride):
19090  */
19091  goto __pyx_L3;
19092  }
19093 
19094  /* "View.MemoryView":1162
19095  * dst_data += dst_stride
19096  * else:
19097  * for i in range(dst_extent): # <<<<<<<<<<<<<<
19098  * _copy_strided_to_strided(src_data, src_strides + 1,
19099  * dst_data, dst_strides + 1,
19100  */
19101  /*else*/ {
19102  __pyx_t_4 = __pyx_v_dst_extent;
19103  __pyx_t_5 = __pyx_t_4;
19104  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19105  __pyx_v_i = __pyx_t_6;
19106 
19107  /* "View.MemoryView":1163
19108  * else:
19109  * for i in range(dst_extent):
19110  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
19111  * dst_data, dst_strides + 1,
19112  * src_shape + 1, dst_shape + 1,
19113  */
19114  _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);
19115 
19116  /* "View.MemoryView":1167
19117  * src_shape + 1, dst_shape + 1,
19118  * ndim - 1, itemsize)
19119  * src_data += src_stride # <<<<<<<<<<<<<<
19120  * dst_data += dst_stride
19121  *
19122  */
19123  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
19124 
19125  /* "View.MemoryView":1168
19126  * ndim - 1, itemsize)
19127  * src_data += src_stride
19128  * dst_data += dst_stride # <<<<<<<<<<<<<<
19129  *
19130  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
19131  */
19132  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
19133  }
19134  }
19135  __pyx_L3:;
19136 
19137  /* "View.MemoryView":1140
19138  *
19139  * @cython.cdivision(True)
19140  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
19141  * char *dst_data, Py_ssize_t *dst_strides,
19142  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
19143  */
19144 
19145  /* function exit code */
19146 }
19147 
19148 /* "View.MemoryView":1170
19149  * dst_data += dst_stride
19150  *
19151  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19152  * __Pyx_memviewslice *dst,
19153  * int ndim, size_t itemsize) nogil:
19154  */
19155 
19156 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) {
19157 
19158  /* "View.MemoryView":1173
19159  * __Pyx_memviewslice *dst,
19160  * int ndim, size_t itemsize) nogil:
19161  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
19162  * src.shape, dst.shape, ndim, itemsize)
19163  *
19164  */
19165  _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);
19166 
19167  /* "View.MemoryView":1170
19168  * dst_data += dst_stride
19169  *
19170  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19171  * __Pyx_memviewslice *dst,
19172  * int ndim, size_t itemsize) nogil:
19173  */
19174 
19175  /* function exit code */
19176 }
19177 
19178 /* "View.MemoryView":1177
19179  *
19180  * @cname('__pyx_memoryview_slice_get_size')
19181  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19182  * "Return the size of the memory occupied by the slice in number of bytes"
19183  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19184  */
19185 
19186 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
19187  Py_ssize_t __pyx_v_shape;
19188  Py_ssize_t __pyx_v_size;
19189  Py_ssize_t __pyx_r;
19190  Py_ssize_t __pyx_t_1;
19191  Py_ssize_t *__pyx_t_2;
19192  Py_ssize_t *__pyx_t_3;
19193  Py_ssize_t *__pyx_t_4;
19194 
19195  /* "View.MemoryView":1179
19196  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
19197  * "Return the size of the memory occupied by the slice in number of bytes"
19198  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
19199  *
19200  * for shape in src.shape[:ndim]:
19201  */
19202  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19203  __pyx_v_size = __pyx_t_1;
19204 
19205  /* "View.MemoryView":1181
19206  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19207  *
19208  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
19209  * size *= shape
19210  *
19211  */
19212  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
19213  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
19214  __pyx_t_2 = __pyx_t_4;
19215  __pyx_v_shape = (__pyx_t_2[0]);
19216 
19217  /* "View.MemoryView":1182
19218  *
19219  * for shape in src.shape[:ndim]:
19220  * size *= shape # <<<<<<<<<<<<<<
19221  *
19222  * return size
19223  */
19224  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
19225  }
19226 
19227  /* "View.MemoryView":1184
19228  * size *= shape
19229  *
19230  * return size # <<<<<<<<<<<<<<
19231  *
19232  * @cname('__pyx_fill_contig_strides_array')
19233  */
19234  __pyx_r = __pyx_v_size;
19235  goto __pyx_L0;
19236 
19237  /* "View.MemoryView":1177
19238  *
19239  * @cname('__pyx_memoryview_slice_get_size')
19240  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
19241  * "Return the size of the memory occupied by the slice in number of bytes"
19242  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
19243  */
19244 
19245  /* function exit code */
19246  __pyx_L0:;
19247  return __pyx_r;
19248 }
19249 
19250 /* "View.MemoryView":1187
19251  *
19252  * @cname('__pyx_fill_contig_strides_array')
19253  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19254  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19255  * int ndim, char order) nogil:
19256  */
19257 
19258 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) {
19259  int __pyx_v_idx;
19260  Py_ssize_t __pyx_r;
19261  int __pyx_t_1;
19262  int __pyx_t_2;
19263  int __pyx_t_3;
19264  int __pyx_t_4;
19265 
19266  /* "View.MemoryView":1196
19267  * cdef int idx
19268  *
19269  * if order == 'F': # <<<<<<<<<<<<<<
19270  * for idx in range(ndim):
19271  * strides[idx] = stride
19272  */
19273  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
19274  if (__pyx_t_1) {
19275 
19276  /* "View.MemoryView":1197
19277  *
19278  * if order == 'F':
19279  * for idx in range(ndim): # <<<<<<<<<<<<<<
19280  * strides[idx] = stride
19281  * stride *= shape[idx]
19282  */
19283  __pyx_t_2 = __pyx_v_ndim;
19284  __pyx_t_3 = __pyx_t_2;
19285  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19286  __pyx_v_idx = __pyx_t_4;
19287 
19288  /* "View.MemoryView":1198
19289  * if order == 'F':
19290  * for idx in range(ndim):
19291  * strides[idx] = stride # <<<<<<<<<<<<<<
19292  * stride *= shape[idx]
19293  * else:
19294  */
19295  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19296 
19297  /* "View.MemoryView":1199
19298  * for idx in range(ndim):
19299  * strides[idx] = stride
19300  * stride *= shape[idx] # <<<<<<<<<<<<<<
19301  * else:
19302  * for idx in range(ndim - 1, -1, -1):
19303  */
19304  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19305  }
19306 
19307  /* "View.MemoryView":1196
19308  * cdef int idx
19309  *
19310  * if order == 'F': # <<<<<<<<<<<<<<
19311  * for idx in range(ndim):
19312  * strides[idx] = stride
19313  */
19314  goto __pyx_L3;
19315  }
19316 
19317  /* "View.MemoryView":1201
19318  * stride *= shape[idx]
19319  * else:
19320  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19321  * strides[idx] = stride
19322  * stride *= shape[idx]
19323  */
19324  /*else*/ {
19325  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19326  __pyx_v_idx = __pyx_t_2;
19327 
19328  /* "View.MemoryView":1202
19329  * else:
19330  * for idx in range(ndim - 1, -1, -1):
19331  * strides[idx] = stride # <<<<<<<<<<<<<<
19332  * stride *= shape[idx]
19333  *
19334  */
19335  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19336 
19337  /* "View.MemoryView":1203
19338  * for idx in range(ndim - 1, -1, -1):
19339  * strides[idx] = stride
19340  * stride *= shape[idx] # <<<<<<<<<<<<<<
19341  *
19342  * return stride
19343  */
19344  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19345  }
19346  }
19347  __pyx_L3:;
19348 
19349  /* "View.MemoryView":1205
19350  * stride *= shape[idx]
19351  *
19352  * return stride # <<<<<<<<<<<<<<
19353  *
19354  * @cname('__pyx_memoryview_copy_data_to_temp')
19355  */
19356  __pyx_r = __pyx_v_stride;
19357  goto __pyx_L0;
19358 
19359  /* "View.MemoryView":1187
19360  *
19361  * @cname('__pyx_fill_contig_strides_array')
19362  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19363  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19364  * int ndim, char order) nogil:
19365  */
19366 
19367  /* function exit code */
19368  __pyx_L0:;
19369  return __pyx_r;
19370 }
19371 
19372 /* "View.MemoryView":1208
19373  *
19374  * @cname('__pyx_memoryview_copy_data_to_temp')
19375  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19376  * __Pyx_memviewslice *tmpslice,
19377  * char order,
19378  */
19379 
19380 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) {
19381  int __pyx_v_i;
19382  void *__pyx_v_result;
19383  size_t __pyx_v_itemsize;
19384  size_t __pyx_v_size;
19385  void *__pyx_r;
19386  Py_ssize_t __pyx_t_1;
19387  int __pyx_t_2;
19388  int __pyx_t_3;
19389  struct __pyx_memoryview_obj *__pyx_t_4;
19390  int __pyx_t_5;
19391  int __pyx_t_6;
19392  int __pyx_lineno = 0;
19393  const char *__pyx_filename = NULL;
19394  int __pyx_clineno = 0;
19395 
19396  /* "View.MemoryView":1219
19397  * cdef void *result
19398  *
19399  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19400  * cdef size_t size = slice_get_size(src, ndim)
19401  *
19402  */
19403  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19404  __pyx_v_itemsize = __pyx_t_1;
19405 
19406  /* "View.MemoryView":1220
19407  *
19408  * cdef size_t itemsize = src.memview.view.itemsize
19409  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
19410  *
19411  * result = malloc(size)
19412  */
19413  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19414 
19415  /* "View.MemoryView":1222
19416  * cdef size_t size = slice_get_size(src, ndim)
19417  *
19418  * result = malloc(size) # <<<<<<<<<<<<<<
19419  * if not result:
19420  * _err(MemoryError, NULL)
19421  */
19422  __pyx_v_result = malloc(__pyx_v_size);
19423 
19424  /* "View.MemoryView":1223
19425  *
19426  * result = malloc(size)
19427  * if not result: # <<<<<<<<<<<<<<
19428  * _err(MemoryError, NULL)
19429  *
19430  */
19431  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19432  if (__pyx_t_2) {
19433 
19434  /* "View.MemoryView":1224
19435  * result = malloc(size)
19436  * if not result:
19437  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
19438  *
19439  *
19440  */
19441  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1224, __pyx_L1_error)
19442 
19443  /* "View.MemoryView":1223
19444  *
19445  * result = malloc(size)
19446  * if not result: # <<<<<<<<<<<<<<
19447  * _err(MemoryError, NULL)
19448  *
19449  */
19450  }
19451 
19452  /* "View.MemoryView":1227
19453  *
19454  *
19455  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
19456  * tmpslice.memview = src.memview
19457  * for i in range(ndim):
19458  */
19459  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
19460 
19461  /* "View.MemoryView":1228
19462  *
19463  * tmpslice.data = <char *> result
19464  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
19465  * for i in range(ndim):
19466  * tmpslice.shape[i] = src.shape[i]
19467  */
19468  __pyx_t_4 = __pyx_v_src->memview;
19469  __pyx_v_tmpslice->memview = __pyx_t_4;
19470 
19471  /* "View.MemoryView":1229
19472  * tmpslice.data = <char *> result
19473  * tmpslice.memview = src.memview
19474  * for i in range(ndim): # <<<<<<<<<<<<<<
19475  * tmpslice.shape[i] = src.shape[i]
19476  * tmpslice.suboffsets[i] = -1
19477  */
19478  __pyx_t_3 = __pyx_v_ndim;
19479  __pyx_t_5 = __pyx_t_3;
19480  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19481  __pyx_v_i = __pyx_t_6;
19482 
19483  /* "View.MemoryView":1230
19484  * tmpslice.memview = src.memview
19485  * for i in range(ndim):
19486  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
19487  * tmpslice.suboffsets[i] = -1
19488  *
19489  */
19490  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19491 
19492  /* "View.MemoryView":1231
19493  * for i in range(ndim):
19494  * tmpslice.shape[i] = src.shape[i]
19495  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19496  *
19497  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
19498  */
19499  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
19500  }
19501 
19502  /* "View.MemoryView":1233
19503  * tmpslice.suboffsets[i] = -1
19504  *
19505  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
19506  * ndim, order)
19507  *
19508  */
19509  (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));
19510 
19511  /* "View.MemoryView":1237
19512  *
19513  *
19514  * for i in range(ndim): # <<<<<<<<<<<<<<
19515  * if tmpslice.shape[i] == 1:
19516  * tmpslice.strides[i] = 0
19517  */
19518  __pyx_t_3 = __pyx_v_ndim;
19519  __pyx_t_5 = __pyx_t_3;
19520  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19521  __pyx_v_i = __pyx_t_6;
19522 
19523  /* "View.MemoryView":1238
19524  *
19525  * for i in range(ndim):
19526  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19527  * tmpslice.strides[i] = 0
19528  *
19529  */
19530  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19531  if (__pyx_t_2) {
19532 
19533  /* "View.MemoryView":1239
19534  * for i in range(ndim):
19535  * if tmpslice.shape[i] == 1:
19536  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
19537  *
19538  * if slice_is_contig(src[0], order, ndim):
19539  */
19540  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19541 
19542  /* "View.MemoryView":1238
19543  *
19544  * for i in range(ndim):
19545  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19546  * tmpslice.strides[i] = 0
19547  *
19548  */
19549  }
19550  }
19551 
19552  /* "View.MemoryView":1241
19553  * tmpslice.strides[i] = 0
19554  *
19555  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19556  * memcpy(result, src.data, size)
19557  * else:
19558  */
19559  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19560  if (__pyx_t_2) {
19561 
19562  /* "View.MemoryView":1242
19563  *
19564  * if slice_is_contig(src[0], order, ndim):
19565  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
19566  * else:
19567  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19568  */
19569  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19570 
19571  /* "View.MemoryView":1241
19572  * tmpslice.strides[i] = 0
19573  *
19574  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19575  * memcpy(result, src.data, size)
19576  * else:
19577  */
19578  goto __pyx_L9;
19579  }
19580 
19581  /* "View.MemoryView":1244
19582  * memcpy(result, src.data, size)
19583  * else:
19584  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
19585  *
19586  * return result
19587  */
19588  /*else*/ {
19589  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19590  }
19591  __pyx_L9:;
19592 
19593  /* "View.MemoryView":1246
19594  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19595  *
19596  * return result # <<<<<<<<<<<<<<
19597  *
19598  *
19599  */
19600  __pyx_r = __pyx_v_result;
19601  goto __pyx_L0;
19602 
19603  /* "View.MemoryView":1208
19604  *
19605  * @cname('__pyx_memoryview_copy_data_to_temp')
19606  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19607  * __Pyx_memviewslice *tmpslice,
19608  * char order,
19609  */
19610 
19611  /* function exit code */
19612  __pyx_L1_error:;
19613  {
19614  #ifdef WITH_THREAD
19615  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19616  #endif
19617  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19618  #ifdef WITH_THREAD
19619  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19620  #endif
19621  }
19622  __pyx_r = NULL;
19623  __pyx_L0:;
19624  return __pyx_r;
19625 }
19626 
19627 /* "View.MemoryView":1251
19628  *
19629  * @cname('__pyx_memoryview_err_extents')
19630  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19631  * Py_ssize_t extent2) except -1 with gil:
19632  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19633  */
19634 
19635 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19636  int __pyx_r;
19637  __Pyx_RefNannyDeclarations
19638  PyObject *__pyx_t_1 = NULL;
19639  PyObject *__pyx_t_2 = NULL;
19640  PyObject *__pyx_t_3 = NULL;
19641  PyObject *__pyx_t_4 = NULL;
19642  int __pyx_lineno = 0;
19643  const char *__pyx_filename = NULL;
19644  int __pyx_clineno = 0;
19645  #ifdef WITH_THREAD
19646  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19647  #endif
19648  __Pyx_RefNannySetupContext("_err_extents", 0);
19649 
19650  /* "View.MemoryView":1254
19651  * Py_ssize_t extent2) except -1 with gil:
19652  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19653  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
19654  *
19655  * @cname('__pyx_memoryview_err_dim')
19656  */
19657  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error)
19658  __Pyx_GOTREF(__pyx_t_1);
19659  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1254, __pyx_L1_error)
19660  __Pyx_GOTREF(__pyx_t_2);
19661  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1254, __pyx_L1_error)
19662  __Pyx_GOTREF(__pyx_t_3);
19663  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1254, __pyx_L1_error)
19664  __Pyx_GOTREF(__pyx_t_4);
19665  __Pyx_GIVEREF(__pyx_t_1);
19666  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19667  __Pyx_GIVEREF(__pyx_t_2);
19668  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19669  __Pyx_GIVEREF(__pyx_t_3);
19670  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19671  __pyx_t_1 = 0;
19672  __pyx_t_2 = 0;
19673  __pyx_t_3 = 0;
19674 
19675  /* "View.MemoryView":1253
19676  * cdef int _err_extents(int i, Py_ssize_t extent1,
19677  * Py_ssize_t extent2) except -1 with gil:
19678  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
19679  * (i, extent1, extent2))
19680  *
19681  */
19682  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1253, __pyx_L1_error)
19683  __Pyx_GOTREF(__pyx_t_3);
19684  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19685  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1253, __pyx_L1_error)
19686  __Pyx_GOTREF(__pyx_t_4);
19687  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19688  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19689  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19690  __PYX_ERR(2, 1253, __pyx_L1_error)
19691 
19692  /* "View.MemoryView":1251
19693  *
19694  * @cname('__pyx_memoryview_err_extents')
19695  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19696  * Py_ssize_t extent2) except -1 with gil:
19697  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19698  */
19699 
19700  /* function exit code */
19701  __pyx_L1_error:;
19702  __Pyx_XDECREF(__pyx_t_1);
19703  __Pyx_XDECREF(__pyx_t_2);
19704  __Pyx_XDECREF(__pyx_t_3);
19705  __Pyx_XDECREF(__pyx_t_4);
19706  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19707  __pyx_r = -1;
19708  __Pyx_RefNannyFinishContext();
19709  #ifdef WITH_THREAD
19710  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19711  #endif
19712  return __pyx_r;
19713 }
19714 
19715 /* "View.MemoryView":1257
19716  *
19717  * @cname('__pyx_memoryview_err_dim')
19718  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19719  * raise error(msg.decode('ascii') % dim)
19720  *
19721  */
19722 
19723 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
19724  int __pyx_r;
19725  __Pyx_RefNannyDeclarations
19726  PyObject *__pyx_t_1 = NULL;
19727  PyObject *__pyx_t_2 = NULL;
19728  PyObject *__pyx_t_3 = NULL;
19729  PyObject *__pyx_t_4 = NULL;
19730  int __pyx_lineno = 0;
19731  const char *__pyx_filename = NULL;
19732  int __pyx_clineno = 0;
19733  #ifdef WITH_THREAD
19734  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19735  #endif
19736  __Pyx_RefNannySetupContext("_err_dim", 0);
19737  __Pyx_INCREF(__pyx_v_error);
19738 
19739  /* "View.MemoryView":1258
19740  * @cname('__pyx_memoryview_err_dim')
19741  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
19742  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
19743  *
19744  * @cname('__pyx_memoryview_err')
19745  */
19746  __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(2, 1258, __pyx_L1_error)
19747  __Pyx_GOTREF(__pyx_t_2);
19748  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1258, __pyx_L1_error)
19749  __Pyx_GOTREF(__pyx_t_3);
19750  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1258, __pyx_L1_error)
19751  __Pyx_GOTREF(__pyx_t_4);
19752  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19753  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19754  __Pyx_INCREF(__pyx_v_error);
19755  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19756  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19757  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19758  if (likely(__pyx_t_2)) {
19759  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19760  __Pyx_INCREF(__pyx_t_2);
19761  __Pyx_INCREF(function);
19762  __Pyx_DECREF_SET(__pyx_t_3, function);
19763  }
19764  }
19765  __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);
19766  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19767  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19768  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1258, __pyx_L1_error)
19769  __Pyx_GOTREF(__pyx_t_1);
19770  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19771  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19772  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19773  __PYX_ERR(2, 1258, __pyx_L1_error)
19774 
19775  /* "View.MemoryView":1257
19776  *
19777  * @cname('__pyx_memoryview_err_dim')
19778  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19779  * raise error(msg.decode('ascii') % dim)
19780  *
19781  */
19782 
19783  /* function exit code */
19784  __pyx_L1_error:;
19785  __Pyx_XDECREF(__pyx_t_1);
19786  __Pyx_XDECREF(__pyx_t_2);
19787  __Pyx_XDECREF(__pyx_t_3);
19788  __Pyx_XDECREF(__pyx_t_4);
19789  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19790  __pyx_r = -1;
19791  __Pyx_XDECREF(__pyx_v_error);
19792  __Pyx_RefNannyFinishContext();
19793  #ifdef WITH_THREAD
19794  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19795  #endif
19796  return __pyx_r;
19797 }
19798 
19799 /* "View.MemoryView":1261
19800  *
19801  * @cname('__pyx_memoryview_err')
19802  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19803  * if msg != NULL:
19804  * raise error(msg.decode('ascii'))
19805  */
19806 
19807 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
19808  int __pyx_r;
19809  __Pyx_RefNannyDeclarations
19810  int __pyx_t_1;
19811  PyObject *__pyx_t_2 = NULL;
19812  PyObject *__pyx_t_3 = NULL;
19813  PyObject *__pyx_t_4 = NULL;
19814  PyObject *__pyx_t_5 = NULL;
19815  int __pyx_lineno = 0;
19816  const char *__pyx_filename = NULL;
19817  int __pyx_clineno = 0;
19818  #ifdef WITH_THREAD
19819  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19820  #endif
19821  __Pyx_RefNannySetupContext("_err", 0);
19822  __Pyx_INCREF(__pyx_v_error);
19823 
19824  /* "View.MemoryView":1262
19825  * @cname('__pyx_memoryview_err')
19826  * cdef int _err(object error, char *msg) except -1 with gil:
19827  * if msg != NULL: # <<<<<<<<<<<<<<
19828  * raise error(msg.decode('ascii'))
19829  * else:
19830  */
19831  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19832  if (unlikely(__pyx_t_1)) {
19833 
19834  /* "View.MemoryView":1263
19835  * cdef int _err(object error, char *msg) except -1 with gil:
19836  * if msg != NULL:
19837  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
19838  * else:
19839  * raise error
19840  */
19841  __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(2, 1263, __pyx_L1_error)
19842  __Pyx_GOTREF(__pyx_t_3);
19843  __Pyx_INCREF(__pyx_v_error);
19844  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19845  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19846  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19847  if (likely(__pyx_t_5)) {
19848  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19849  __Pyx_INCREF(__pyx_t_5);
19850  __Pyx_INCREF(function);
19851  __Pyx_DECREF_SET(__pyx_t_4, function);
19852  }
19853  }
19854  __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);
19855  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19856  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19857  if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1263, __pyx_L1_error)
19858  __Pyx_GOTREF(__pyx_t_2);
19859  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19860  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19861  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19862  __PYX_ERR(2, 1263, __pyx_L1_error)
19863 
19864  /* "View.MemoryView":1262
19865  * @cname('__pyx_memoryview_err')
19866  * cdef int _err(object error, char *msg) except -1 with gil:
19867  * if msg != NULL: # <<<<<<<<<<<<<<
19868  * raise error(msg.decode('ascii'))
19869  * else:
19870  */
19871  }
19872 
19873  /* "View.MemoryView":1265
19874  * raise error(msg.decode('ascii'))
19875  * else:
19876  * raise error # <<<<<<<<<<<<<<
19877  *
19878  * @cname('__pyx_memoryview_copy_contents')
19879  */
19880  /*else*/ {
19881  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19882  __PYX_ERR(2, 1265, __pyx_L1_error)
19883  }
19884 
19885  /* "View.MemoryView":1261
19886  *
19887  * @cname('__pyx_memoryview_err')
19888  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19889  * if msg != NULL:
19890  * raise error(msg.decode('ascii'))
19891  */
19892 
19893  /* function exit code */
19894  __pyx_L1_error:;
19895  __Pyx_XDECREF(__pyx_t_2);
19896  __Pyx_XDECREF(__pyx_t_3);
19897  __Pyx_XDECREF(__pyx_t_4);
19898  __Pyx_XDECREF(__pyx_t_5);
19899  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19900  __pyx_r = -1;
19901  __Pyx_XDECREF(__pyx_v_error);
19902  __Pyx_RefNannyFinishContext();
19903  #ifdef WITH_THREAD
19904  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19905  #endif
19906  return __pyx_r;
19907 }
19908 
19909 /* "View.MemoryView":1268
19910  *
19911  * @cname('__pyx_memoryview_copy_contents')
19912  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19913  * __Pyx_memviewslice dst,
19914  * int src_ndim, int dst_ndim,
19915  */
19916 
19917 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) {
19918  void *__pyx_v_tmpdata;
19919  size_t __pyx_v_itemsize;
19920  int __pyx_v_i;
19921  char __pyx_v_order;
19922  int __pyx_v_broadcasting;
19923  int __pyx_v_direct_copy;
19924  __Pyx_memviewslice __pyx_v_tmp;
19925  int __pyx_v_ndim;
19926  int __pyx_r;
19927  Py_ssize_t __pyx_t_1;
19928  int __pyx_t_2;
19929  int __pyx_t_3;
19930  int __pyx_t_4;
19931  int __pyx_t_5;
19932  int __pyx_t_6;
19933  void *__pyx_t_7;
19934  int __pyx_t_8;
19935  int __pyx_lineno = 0;
19936  const char *__pyx_filename = NULL;
19937  int __pyx_clineno = 0;
19938 
19939  /* "View.MemoryView":1276
19940  * Check for overlapping memory and verify the shapes.
19941  * """
19942  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
19943  * cdef size_t itemsize = src.memview.view.itemsize
19944  * cdef int i
19945  */
19946  __pyx_v_tmpdata = NULL;
19947 
19948  /* "View.MemoryView":1277
19949  * """
19950  * cdef void *tmpdata = NULL
19951  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19952  * cdef int i
19953  * cdef char order = get_best_order(&src, src_ndim)
19954  */
19955  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19956  __pyx_v_itemsize = __pyx_t_1;
19957 
19958  /* "View.MemoryView":1279
19959  * cdef size_t itemsize = src.memview.view.itemsize
19960  * cdef int i
19961  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
19962  * cdef bint broadcasting = False
19963  * cdef bint direct_copy = False
19964  */
19965  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19966 
19967  /* "View.MemoryView":1280
19968  * cdef int i
19969  * cdef char order = get_best_order(&src, src_ndim)
19970  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
19971  * cdef bint direct_copy = False
19972  * cdef __Pyx_memviewslice tmp
19973  */
19974  __pyx_v_broadcasting = 0;
19975 
19976  /* "View.MemoryView":1281
19977  * cdef char order = get_best_order(&src, src_ndim)
19978  * cdef bint broadcasting = False
19979  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
19980  * cdef __Pyx_memviewslice tmp
19981  *
19982  */
19983  __pyx_v_direct_copy = 0;
19984 
19985  /* "View.MemoryView":1284
19986  * cdef __Pyx_memviewslice tmp
19987  *
19988  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19989  * broadcast_leading(&src, src_ndim, dst_ndim)
19990  * elif dst_ndim < src_ndim:
19991  */
19992  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19993  if (__pyx_t_2) {
19994 
19995  /* "View.MemoryView":1285
19996  *
19997  * if src_ndim < dst_ndim:
19998  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19999  * elif dst_ndim < src_ndim:
20000  * broadcast_leading(&dst, dst_ndim, src_ndim)
20001  */
20002  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
20003 
20004  /* "View.MemoryView":1284
20005  * cdef __Pyx_memviewslice tmp
20006  *
20007  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
20008  * broadcast_leading(&src, src_ndim, dst_ndim)
20009  * elif dst_ndim < src_ndim:
20010  */
20011  goto __pyx_L3;
20012  }
20013 
20014  /* "View.MemoryView":1286
20015  * if src_ndim < dst_ndim:
20016  * broadcast_leading(&src, src_ndim, dst_ndim)
20017  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
20018  * broadcast_leading(&dst, dst_ndim, src_ndim)
20019  *
20020  */
20021  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
20022  if (__pyx_t_2) {
20023 
20024  /* "View.MemoryView":1287
20025  * broadcast_leading(&src, src_ndim, dst_ndim)
20026  * elif dst_ndim < src_ndim:
20027  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
20028  *
20029  * cdef int ndim = max(src_ndim, dst_ndim)
20030  */
20031  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
20032 
20033  /* "View.MemoryView":1286
20034  * if src_ndim < dst_ndim:
20035  * broadcast_leading(&src, src_ndim, dst_ndim)
20036  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
20037  * broadcast_leading(&dst, dst_ndim, src_ndim)
20038  *
20039  */
20040  }
20041  __pyx_L3:;
20042 
20043  /* "View.MemoryView":1289
20044  * broadcast_leading(&dst, dst_ndim, src_ndim)
20045  *
20046  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
20047  *
20048  * for i in range(ndim):
20049  */
20050  __pyx_t_3 = __pyx_v_dst_ndim;
20051  __pyx_t_4 = __pyx_v_src_ndim;
20052  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
20053  __pyx_t_5 = __pyx_t_3;
20054  } else {
20055  __pyx_t_5 = __pyx_t_4;
20056  }
20057  __pyx_v_ndim = __pyx_t_5;
20058 
20059  /* "View.MemoryView":1291
20060  * cdef int ndim = max(src_ndim, dst_ndim)
20061  *
20062  * for i in range(ndim): # <<<<<<<<<<<<<<
20063  * if src.shape[i] != dst.shape[i]:
20064  * if src.shape[i] == 1:
20065  */
20066  __pyx_t_5 = __pyx_v_ndim;
20067  __pyx_t_3 = __pyx_t_5;
20068  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20069  __pyx_v_i = __pyx_t_4;
20070 
20071  /* "View.MemoryView":1292
20072  *
20073  * for i in range(ndim):
20074  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20075  * if src.shape[i] == 1:
20076  * broadcasting = True
20077  */
20078  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
20079  if (__pyx_t_2) {
20080 
20081  /* "View.MemoryView":1293
20082  * for i in range(ndim):
20083  * if src.shape[i] != dst.shape[i]:
20084  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20085  * broadcasting = True
20086  * src.strides[i] = 0
20087  */
20088  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
20089  if (__pyx_t_2) {
20090 
20091  /* "View.MemoryView":1294
20092  * if src.shape[i] != dst.shape[i]:
20093  * if src.shape[i] == 1:
20094  * broadcasting = True # <<<<<<<<<<<<<<
20095  * src.strides[i] = 0
20096  * else:
20097  */
20098  __pyx_v_broadcasting = 1;
20099 
20100  /* "View.MemoryView":1295
20101  * if src.shape[i] == 1:
20102  * broadcasting = True
20103  * src.strides[i] = 0 # <<<<<<<<<<<<<<
20104  * else:
20105  * _err_extents(i, dst.shape[i], src.shape[i])
20106  */
20107  (__pyx_v_src.strides[__pyx_v_i]) = 0;
20108 
20109  /* "View.MemoryView":1293
20110  * for i in range(ndim):
20111  * if src.shape[i] != dst.shape[i]:
20112  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
20113  * broadcasting = True
20114  * src.strides[i] = 0
20115  */
20116  goto __pyx_L7;
20117  }
20118 
20119  /* "View.MemoryView":1297
20120  * src.strides[i] = 0
20121  * else:
20122  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
20123  *
20124  * if src.suboffsets[i] >= 0:
20125  */
20126  /*else*/ {
20127  __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(2, 1297, __pyx_L1_error)
20128  }
20129  __pyx_L7:;
20130 
20131  /* "View.MemoryView":1292
20132  *
20133  * for i in range(ndim):
20134  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
20135  * if src.shape[i] == 1:
20136  * broadcasting = True
20137  */
20138  }
20139 
20140  /* "View.MemoryView":1299
20141  * _err_extents(i, dst.shape[i], src.shape[i])
20142  *
20143  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20144  * _err_dim(ValueError, "Dimension %d is not direct", i)
20145  *
20146  */
20147  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
20148  if (__pyx_t_2) {
20149 
20150  /* "View.MemoryView":1300
20151  *
20152  * if src.suboffsets[i] >= 0:
20153  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
20154  *
20155  * if slices_overlap(&src, &dst, ndim, itemsize):
20156  */
20157  __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(2, 1300, __pyx_L1_error)
20158 
20159  /* "View.MemoryView":1299
20160  * _err_extents(i, dst.shape[i], src.shape[i])
20161  *
20162  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
20163  * _err_dim(ValueError, "Dimension %d is not direct", i)
20164  *
20165  */
20166  }
20167  }
20168 
20169  /* "View.MemoryView":1302
20170  * _err_dim(ValueError, "Dimension %d is not direct", i)
20171  *
20172  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20173  *
20174  * if not slice_is_contig(src, order, ndim):
20175  */
20176  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
20177  if (__pyx_t_2) {
20178 
20179  /* "View.MemoryView":1304
20180  * if slices_overlap(&src, &dst, ndim, itemsize):
20181  *
20182  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20183  * order = get_best_order(&dst, ndim)
20184  *
20185  */
20186  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
20187  if (__pyx_t_2) {
20188 
20189  /* "View.MemoryView":1305
20190  *
20191  * if not slice_is_contig(src, order, ndim):
20192  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
20193  *
20194  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20195  */
20196  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
20197 
20198  /* "View.MemoryView":1304
20199  * if slices_overlap(&src, &dst, ndim, itemsize):
20200  *
20201  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
20202  * order = get_best_order(&dst, ndim)
20203  *
20204  */
20205  }
20206 
20207  /* "View.MemoryView":1307
20208  * order = get_best_order(&dst, ndim)
20209  *
20210  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
20211  * src = tmp
20212  *
20213  */
20214  __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(2, 1307, __pyx_L1_error)
20215  __pyx_v_tmpdata = __pyx_t_7;
20216 
20217  /* "View.MemoryView":1308
20218  *
20219  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
20220  * src = tmp # <<<<<<<<<<<<<<
20221  *
20222  * if not broadcasting:
20223  */
20224  __pyx_v_src = __pyx_v_tmp;
20225 
20226  /* "View.MemoryView":1302
20227  * _err_dim(ValueError, "Dimension %d is not direct", i)
20228  *
20229  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
20230  *
20231  * if not slice_is_contig(src, order, ndim):
20232  */
20233  }
20234 
20235  /* "View.MemoryView":1310
20236  * src = tmp
20237  *
20238  * if not broadcasting: # <<<<<<<<<<<<<<
20239  *
20240  *
20241  */
20242  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
20243  if (__pyx_t_2) {
20244 
20245  /* "View.MemoryView":1313
20246  *
20247  *
20248  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20249  * direct_copy = slice_is_contig(dst, 'C', ndim)
20250  * elif slice_is_contig(src, 'F', ndim):
20251  */
20252  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
20253  if (__pyx_t_2) {
20254 
20255  /* "View.MemoryView":1314
20256  *
20257  * if slice_is_contig(src, 'C', ndim):
20258  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
20259  * elif slice_is_contig(src, 'F', ndim):
20260  * direct_copy = slice_is_contig(dst, 'F', ndim)
20261  */
20262  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
20263 
20264  /* "View.MemoryView":1313
20265  *
20266  *
20267  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20268  * direct_copy = slice_is_contig(dst, 'C', ndim)
20269  * elif slice_is_contig(src, 'F', ndim):
20270  */
20271  goto __pyx_L12;
20272  }
20273 
20274  /* "View.MemoryView":1315
20275  * if slice_is_contig(src, 'C', ndim):
20276  * direct_copy = slice_is_contig(dst, 'C', ndim)
20277  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20278  * direct_copy = slice_is_contig(dst, 'F', ndim)
20279  *
20280  */
20281  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
20282  if (__pyx_t_2) {
20283 
20284  /* "View.MemoryView":1316
20285  * direct_copy = slice_is_contig(dst, 'C', ndim)
20286  * elif slice_is_contig(src, 'F', ndim):
20287  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
20288  *
20289  * if direct_copy:
20290  */
20291  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
20292 
20293  /* "View.MemoryView":1315
20294  * if slice_is_contig(src, 'C', ndim):
20295  * direct_copy = slice_is_contig(dst, 'C', ndim)
20296  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20297  * direct_copy = slice_is_contig(dst, 'F', ndim)
20298  *
20299  */
20300  }
20301  __pyx_L12:;
20302 
20303  /* "View.MemoryView":1318
20304  * direct_copy = slice_is_contig(dst, 'F', ndim)
20305  *
20306  * if direct_copy: # <<<<<<<<<<<<<<
20307  *
20308  * refcount_copying(&dst, dtype_is_object, ndim, False)
20309  */
20310  __pyx_t_2 = (__pyx_v_direct_copy != 0);
20311  if (__pyx_t_2) {
20312 
20313  /* "View.MemoryView":1320
20314  * if direct_copy:
20315  *
20316  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20317  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20318  * refcount_copying(&dst, dtype_is_object, ndim, True)
20319  */
20320  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20321 
20322  /* "View.MemoryView":1321
20323  *
20324  * refcount_copying(&dst, dtype_is_object, ndim, False)
20325  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
20326  * refcount_copying(&dst, dtype_is_object, ndim, True)
20327  * free(tmpdata)
20328  */
20329  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20330 
20331  /* "View.MemoryView":1322
20332  * refcount_copying(&dst, dtype_is_object, ndim, False)
20333  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20334  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20335  * free(tmpdata)
20336  * return 0
20337  */
20338  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20339 
20340  /* "View.MemoryView":1323
20341  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20342  * refcount_copying(&dst, dtype_is_object, ndim, True)
20343  * free(tmpdata) # <<<<<<<<<<<<<<
20344  * return 0
20345  *
20346  */
20347  free(__pyx_v_tmpdata);
20348 
20349  /* "View.MemoryView":1324
20350  * refcount_copying(&dst, dtype_is_object, ndim, True)
20351  * free(tmpdata)
20352  * return 0 # <<<<<<<<<<<<<<
20353  *
20354  * if order == 'F' == get_best_order(&dst, ndim):
20355  */
20356  __pyx_r = 0;
20357  goto __pyx_L0;
20358 
20359  /* "View.MemoryView":1318
20360  * direct_copy = slice_is_contig(dst, 'F', ndim)
20361  *
20362  * if direct_copy: # <<<<<<<<<<<<<<
20363  *
20364  * refcount_copying(&dst, dtype_is_object, ndim, False)
20365  */
20366  }
20367 
20368  /* "View.MemoryView":1310
20369  * src = tmp
20370  *
20371  * if not broadcasting: # <<<<<<<<<<<<<<
20372  *
20373  *
20374  */
20375  }
20376 
20377  /* "View.MemoryView":1326
20378  * return 0
20379  *
20380  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20381  *
20382  *
20383  */
20384  __pyx_t_2 = (__pyx_v_order == 'F');
20385  if (__pyx_t_2) {
20386  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20387  }
20388  __pyx_t_8 = (__pyx_t_2 != 0);
20389  if (__pyx_t_8) {
20390 
20391  /* "View.MemoryView":1329
20392  *
20393  *
20394  * transpose_memslice(&src) # <<<<<<<<<<<<<<
20395  * transpose_memslice(&dst)
20396  *
20397  */
20398  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1329, __pyx_L1_error)
20399 
20400  /* "View.MemoryView":1330
20401  *
20402  * transpose_memslice(&src)
20403  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
20404  *
20405  * refcount_copying(&dst, dtype_is_object, ndim, False)
20406  */
20407  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1330, __pyx_L1_error)
20408 
20409  /* "View.MemoryView":1326
20410  * return 0
20411  *
20412  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20413  *
20414  *
20415  */
20416  }
20417 
20418  /* "View.MemoryView":1332
20419  * transpose_memslice(&dst)
20420  *
20421  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20422  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20423  * refcount_copying(&dst, dtype_is_object, ndim, True)
20424  */
20425  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20426 
20427  /* "View.MemoryView":1333
20428  *
20429  * refcount_copying(&dst, dtype_is_object, ndim, False)
20430  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
20431  * refcount_copying(&dst, dtype_is_object, ndim, True)
20432  *
20433  */
20434  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20435 
20436  /* "View.MemoryView":1334
20437  * refcount_copying(&dst, dtype_is_object, ndim, False)
20438  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20439  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20440  *
20441  * free(tmpdata)
20442  */
20443  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20444 
20445  /* "View.MemoryView":1336
20446  * refcount_copying(&dst, dtype_is_object, ndim, True)
20447  *
20448  * free(tmpdata) # <<<<<<<<<<<<<<
20449  * return 0
20450  *
20451  */
20452  free(__pyx_v_tmpdata);
20453 
20454  /* "View.MemoryView":1337
20455  *
20456  * free(tmpdata)
20457  * return 0 # <<<<<<<<<<<<<<
20458  *
20459  * @cname('__pyx_memoryview_broadcast_leading')
20460  */
20461  __pyx_r = 0;
20462  goto __pyx_L0;
20463 
20464  /* "View.MemoryView":1268
20465  *
20466  * @cname('__pyx_memoryview_copy_contents')
20467  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20468  * __Pyx_memviewslice dst,
20469  * int src_ndim, int dst_ndim,
20470  */
20471 
20472  /* function exit code */
20473  __pyx_L1_error:;
20474  {
20475  #ifdef WITH_THREAD
20476  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20477  #endif
20478  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20479  #ifdef WITH_THREAD
20480  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20481  #endif
20482  }
20483  __pyx_r = -1;
20484  __pyx_L0:;
20485  return __pyx_r;
20486 }
20487 
20488 /* "View.MemoryView":1340
20489  *
20490  * @cname('__pyx_memoryview_broadcast_leading')
20491  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20492  * int ndim,
20493  * int ndim_other) nogil:
20494  */
20495 
20496 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
20497  int __pyx_v_i;
20498  int __pyx_v_offset;
20499  int __pyx_t_1;
20500  int __pyx_t_2;
20501  int __pyx_t_3;
20502 
20503  /* "View.MemoryView":1344
20504  * int ndim_other) nogil:
20505  * cdef int i
20506  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
20507  *
20508  * for i in range(ndim - 1, -1, -1):
20509  */
20510  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20511 
20512  /* "View.MemoryView":1346
20513  * cdef int offset = ndim_other - ndim
20514  *
20515  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20516  * mslice.shape[i + offset] = mslice.shape[i]
20517  * mslice.strides[i + offset] = mslice.strides[i]
20518  */
20519  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20520  __pyx_v_i = __pyx_t_1;
20521 
20522  /* "View.MemoryView":1347
20523  *
20524  * for i in range(ndim - 1, -1, -1):
20525  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
20526  * mslice.strides[i + offset] = mslice.strides[i]
20527  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20528  */
20529  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20530 
20531  /* "View.MemoryView":1348
20532  * for i in range(ndim - 1, -1, -1):
20533  * mslice.shape[i + offset] = mslice.shape[i]
20534  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
20535  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20536  *
20537  */
20538  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20539 
20540  /* "View.MemoryView":1349
20541  * mslice.shape[i + offset] = mslice.shape[i]
20542  * mslice.strides[i + offset] = mslice.strides[i]
20543  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
20544  *
20545  * for i in range(offset):
20546  */
20547  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20548  }
20549 
20550  /* "View.MemoryView":1351
20551  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20552  *
20553  * for i in range(offset): # <<<<<<<<<<<<<<
20554  * mslice.shape[i] = 1
20555  * mslice.strides[i] = mslice.strides[0]
20556  */
20557  __pyx_t_1 = __pyx_v_offset;
20558  __pyx_t_2 = __pyx_t_1;
20559  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20560  __pyx_v_i = __pyx_t_3;
20561 
20562  /* "View.MemoryView":1352
20563  *
20564  * for i in range(offset):
20565  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
20566  * mslice.strides[i] = mslice.strides[0]
20567  * mslice.suboffsets[i] = -1
20568  */
20569  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20570 
20571  /* "View.MemoryView":1353
20572  * for i in range(offset):
20573  * mslice.shape[i] = 1
20574  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
20575  * mslice.suboffsets[i] = -1
20576  *
20577  */
20578  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20579 
20580  /* "View.MemoryView":1354
20581  * mslice.shape[i] = 1
20582  * mslice.strides[i] = mslice.strides[0]
20583  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20584  *
20585  *
20586  */
20587  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20588  }
20589 
20590  /* "View.MemoryView":1340
20591  *
20592  * @cname('__pyx_memoryview_broadcast_leading')
20593  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20594  * int ndim,
20595  * int ndim_other) nogil:
20596  */
20597 
20598  /* function exit code */
20599 }
20600 
20601 /* "View.MemoryView":1362
20602  *
20603  * @cname('__pyx_memoryview_refcount_copying')
20604  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20605  * int ndim, bint inc) nogil:
20606  *
20607  */
20608 
20609 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) {
20610  int __pyx_t_1;
20611 
20612  /* "View.MemoryView":1366
20613  *
20614  *
20615  * if dtype_is_object: # <<<<<<<<<<<<<<
20616  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20617  * dst.strides, ndim, inc)
20618  */
20619  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20620  if (__pyx_t_1) {
20621 
20622  /* "View.MemoryView":1367
20623  *
20624  * if dtype_is_object:
20625  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
20626  * dst.strides, ndim, inc)
20627  *
20628  */
20629  __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);
20630 
20631  /* "View.MemoryView":1366
20632  *
20633  *
20634  * if dtype_is_object: # <<<<<<<<<<<<<<
20635  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20636  * dst.strides, ndim, inc)
20637  */
20638  }
20639 
20640  /* "View.MemoryView":1362
20641  *
20642  * @cname('__pyx_memoryview_refcount_copying')
20643  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20644  * int ndim, bint inc) nogil:
20645  *
20646  */
20647 
20648  /* function exit code */
20649 }
20650 
20651 /* "View.MemoryView":1371
20652  *
20653  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20654  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20655  * Py_ssize_t *strides, int ndim,
20656  * bint inc) with gil:
20657  */
20658 
20659 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) {
20660  __Pyx_RefNannyDeclarations
20661  #ifdef WITH_THREAD
20662  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20663  #endif
20664  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
20665 
20666  /* "View.MemoryView":1374
20667  * Py_ssize_t *strides, int ndim,
20668  * bint inc) with gil:
20669  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
20670  *
20671  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20672  */
20673  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20674 
20675  /* "View.MemoryView":1371
20676  *
20677  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20678  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20679  * Py_ssize_t *strides, int ndim,
20680  * bint inc) with gil:
20681  */
20682 
20683  /* function exit code */
20684  __Pyx_RefNannyFinishContext();
20685  #ifdef WITH_THREAD
20686  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20687  #endif
20688 }
20689 
20690 /* "View.MemoryView":1377
20691  *
20692  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20693  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20694  * Py_ssize_t *strides, int ndim, bint inc):
20695  * cdef Py_ssize_t i
20696  */
20697 
20698 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) {
20699  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20700  __Pyx_RefNannyDeclarations
20701  Py_ssize_t __pyx_t_1;
20702  Py_ssize_t __pyx_t_2;
20703  Py_ssize_t __pyx_t_3;
20704  int __pyx_t_4;
20705  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
20706 
20707  /* "View.MemoryView":1381
20708  * cdef Py_ssize_t i
20709  *
20710  * for i in range(shape[0]): # <<<<<<<<<<<<<<
20711  * if ndim == 1:
20712  * if inc:
20713  */
20714  __pyx_t_1 = (__pyx_v_shape[0]);
20715  __pyx_t_2 = __pyx_t_1;
20716  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20717  __pyx_v_i = __pyx_t_3;
20718 
20719  /* "View.MemoryView":1382
20720  *
20721  * for i in range(shape[0]):
20722  * if ndim == 1: # <<<<<<<<<<<<<<
20723  * if inc:
20724  * Py_INCREF((<PyObject **> data)[0])
20725  */
20726  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20727  if (__pyx_t_4) {
20728 
20729  /* "View.MemoryView":1383
20730  * for i in range(shape[0]):
20731  * if ndim == 1:
20732  * if inc: # <<<<<<<<<<<<<<
20733  * Py_INCREF((<PyObject **> data)[0])
20734  * else:
20735  */
20736  __pyx_t_4 = (__pyx_v_inc != 0);
20737  if (__pyx_t_4) {
20738 
20739  /* "View.MemoryView":1384
20740  * if ndim == 1:
20741  * if inc:
20742  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20743  * else:
20744  * Py_DECREF((<PyObject **> data)[0])
20745  */
20746  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20747 
20748  /* "View.MemoryView":1383
20749  * for i in range(shape[0]):
20750  * if ndim == 1:
20751  * if inc: # <<<<<<<<<<<<<<
20752  * Py_INCREF((<PyObject **> data)[0])
20753  * else:
20754  */
20755  goto __pyx_L6;
20756  }
20757 
20758  /* "View.MemoryView":1386
20759  * Py_INCREF((<PyObject **> data)[0])
20760  * else:
20761  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20762  * else:
20763  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20764  */
20765  /*else*/ {
20766  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20767  }
20768  __pyx_L6:;
20769 
20770  /* "View.MemoryView":1382
20771  *
20772  * for i in range(shape[0]):
20773  * if ndim == 1: # <<<<<<<<<<<<<<
20774  * if inc:
20775  * Py_INCREF((<PyObject **> data)[0])
20776  */
20777  goto __pyx_L5;
20778  }
20779 
20780  /* "View.MemoryView":1388
20781  * Py_DECREF((<PyObject **> data)[0])
20782  * else:
20783  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20784  * ndim - 1, inc)
20785  *
20786  */
20787  /*else*/ {
20788 
20789  /* "View.MemoryView":1389
20790  * else:
20791  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20792  * ndim - 1, inc) # <<<<<<<<<<<<<<
20793  *
20794  * data += strides[0]
20795  */
20796  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20797  }
20798  __pyx_L5:;
20799 
20800  /* "View.MemoryView":1391
20801  * ndim - 1, inc)
20802  *
20803  * data += strides[0] # <<<<<<<<<<<<<<
20804  *
20805  *
20806  */
20807  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20808  }
20809 
20810  /* "View.MemoryView":1377
20811  *
20812  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20813  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20814  * Py_ssize_t *strides, int ndim, bint inc):
20815  * cdef Py_ssize_t i
20816  */
20817 
20818  /* function exit code */
20819  __Pyx_RefNannyFinishContext();
20820 }
20821 
20822 /* "View.MemoryView":1397
20823  *
20824  * @cname('__pyx_memoryview_slice_assign_scalar')
20825  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20826  * size_t itemsize, void *item,
20827  * bint dtype_is_object) nogil:
20828  */
20829 
20830 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) {
20831 
20832  /* "View.MemoryView":1400
20833  * size_t itemsize, void *item,
20834  * bint dtype_is_object) nogil:
20835  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20836  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20837  * itemsize, item)
20838  */
20839  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20840 
20841  /* "View.MemoryView":1401
20842  * bint dtype_is_object) nogil:
20843  * refcount_copying(dst, dtype_is_object, ndim, False)
20844  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
20845  * itemsize, item)
20846  * refcount_copying(dst, dtype_is_object, ndim, True)
20847  */
20848  __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);
20849 
20850  /* "View.MemoryView":1403
20851  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20852  * itemsize, item)
20853  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20854  *
20855  *
20856  */
20857  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20858 
20859  /* "View.MemoryView":1397
20860  *
20861  * @cname('__pyx_memoryview_slice_assign_scalar')
20862  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20863  * size_t itemsize, void *item,
20864  * bint dtype_is_object) nogil:
20865  */
20866 
20867  /* function exit code */
20868 }
20869 
20870 /* "View.MemoryView":1407
20871  *
20872  * @cname('__pyx_memoryview__slice_assign_scalar')
20873  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20874  * Py_ssize_t *strides, int ndim,
20875  * size_t itemsize, void *item) nogil:
20876  */
20877 
20878 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) {
20879  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20880  Py_ssize_t __pyx_v_stride;
20881  Py_ssize_t __pyx_v_extent;
20882  int __pyx_t_1;
20883  Py_ssize_t __pyx_t_2;
20884  Py_ssize_t __pyx_t_3;
20885  Py_ssize_t __pyx_t_4;
20886 
20887  /* "View.MemoryView":1411
20888  * size_t itemsize, void *item) nogil:
20889  * cdef Py_ssize_t i
20890  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
20891  * cdef Py_ssize_t extent = shape[0]
20892  *
20893  */
20894  __pyx_v_stride = (__pyx_v_strides[0]);
20895 
20896  /* "View.MemoryView":1412
20897  * cdef Py_ssize_t i
20898  * cdef Py_ssize_t stride = strides[0]
20899  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
20900  *
20901  * if ndim == 1:
20902  */
20903  __pyx_v_extent = (__pyx_v_shape[0]);
20904 
20905  /* "View.MemoryView":1414
20906  * cdef Py_ssize_t extent = shape[0]
20907  *
20908  * if ndim == 1: # <<<<<<<<<<<<<<
20909  * for i in range(extent):
20910  * memcpy(data, item, itemsize)
20911  */
20912  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20913  if (__pyx_t_1) {
20914 
20915  /* "View.MemoryView":1415
20916  *
20917  * if ndim == 1:
20918  * for i in range(extent): # <<<<<<<<<<<<<<
20919  * memcpy(data, item, itemsize)
20920  * data += stride
20921  */
20922  __pyx_t_2 = __pyx_v_extent;
20923  __pyx_t_3 = __pyx_t_2;
20924  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20925  __pyx_v_i = __pyx_t_4;
20926 
20927  /* "View.MemoryView":1416
20928  * if ndim == 1:
20929  * for i in range(extent):
20930  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
20931  * data += stride
20932  * else:
20933  */
20934  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20935 
20936  /* "View.MemoryView":1417
20937  * for i in range(extent):
20938  * memcpy(data, item, itemsize)
20939  * data += stride # <<<<<<<<<<<<<<
20940  * else:
20941  * for i in range(extent):
20942  */
20943  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20944  }
20945 
20946  /* "View.MemoryView":1414
20947  * cdef Py_ssize_t extent = shape[0]
20948  *
20949  * if ndim == 1: # <<<<<<<<<<<<<<
20950  * for i in range(extent):
20951  * memcpy(data, item, itemsize)
20952  */
20953  goto __pyx_L3;
20954  }
20955 
20956  /* "View.MemoryView":1419
20957  * data += stride
20958  * else:
20959  * for i in range(extent): # <<<<<<<<<<<<<<
20960  * _slice_assign_scalar(data, shape + 1, strides + 1,
20961  * ndim - 1, itemsize, item)
20962  */
20963  /*else*/ {
20964  __pyx_t_2 = __pyx_v_extent;
20965  __pyx_t_3 = __pyx_t_2;
20966  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20967  __pyx_v_i = __pyx_t_4;
20968 
20969  /* "View.MemoryView":1420
20970  * else:
20971  * for i in range(extent):
20972  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20973  * ndim - 1, itemsize, item)
20974  * data += stride
20975  */
20976  __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);
20977 
20978  /* "View.MemoryView":1422
20979  * _slice_assign_scalar(data, shape + 1, strides + 1,
20980  * ndim - 1, itemsize, item)
20981  * data += stride # <<<<<<<<<<<<<<
20982  *
20983  *
20984  */
20985  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20986  }
20987  }
20988  __pyx_L3:;
20989 
20990  /* "View.MemoryView":1407
20991  *
20992  * @cname('__pyx_memoryview__slice_assign_scalar')
20993  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20994  * Py_ssize_t *strides, int ndim,
20995  * size_t itemsize, void *item) nogil:
20996  */
20997 
20998  /* function exit code */
20999 }
21000 
21001 /* "(tree fragment)":1
21002  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21003  * cdef object __pyx_PickleError
21004  * cdef object __pyx_result
21005  */
21006 
21007 /* Python wrapper */
21008 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
21009 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};
21010 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
21011  PyObject *__pyx_v___pyx_type = 0;
21012  long __pyx_v___pyx_checksum;
21013  PyObject *__pyx_v___pyx_state = 0;
21014  int __pyx_lineno = 0;
21015  const char *__pyx_filename = NULL;
21016  int __pyx_clineno = 0;
21017  PyObject *__pyx_r = 0;
21018  __Pyx_RefNannyDeclarations
21019  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
21020  {
21021  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
21022  PyObject* values[3] = {0,0,0};
21023  if (unlikely(__pyx_kwds)) {
21024  Py_ssize_t kw_args;
21025  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21026  switch (pos_args) {
21027  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21028  CYTHON_FALLTHROUGH;
21029  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21030  CYTHON_FALLTHROUGH;
21031  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21032  CYTHON_FALLTHROUGH;
21033  case 0: break;
21034  default: goto __pyx_L5_argtuple_error;
21035  }
21036  kw_args = PyDict_Size(__pyx_kwds);
21037  switch (pos_args) {
21038  case 0:
21039  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
21040  else goto __pyx_L5_argtuple_error;
21041  CYTHON_FALLTHROUGH;
21042  case 1:
21043  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
21044  else {
21045  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
21046  }
21047  CYTHON_FALLTHROUGH;
21048  case 2:
21049  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
21050  else {
21051  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
21052  }
21053  }
21054  if (unlikely(kw_args > 0)) {
21055  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
21056  }
21057  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
21058  goto __pyx_L5_argtuple_error;
21059  } else {
21060  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21061  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
21062  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
21063  }
21064  __pyx_v___pyx_type = values[0];
21065  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
21066  __pyx_v___pyx_state = values[2];
21067  }
21068  goto __pyx_L4_argument_unpacking_done;
21069  __pyx_L5_argtuple_error:;
21070  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
21071  __pyx_L3_error:;
21072  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21073  __Pyx_RefNannyFinishContext();
21074  return NULL;
21075  __pyx_L4_argument_unpacking_done:;
21076  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
21077 
21078  /* function exit code */
21079  __Pyx_RefNannyFinishContext();
21080  return __pyx_r;
21081 }
21082 
21083 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) {
21084  PyObject *__pyx_v___pyx_PickleError = 0;
21085  PyObject *__pyx_v___pyx_result = 0;
21086  PyObject *__pyx_r = NULL;
21087  __Pyx_RefNannyDeclarations
21088  PyObject *__pyx_t_1 = NULL;
21089  int __pyx_t_2;
21090  int __pyx_t_3;
21091  PyObject *__pyx_t_4 = NULL;
21092  PyObject *__pyx_t_5 = NULL;
21093  PyObject *__pyx_t_6 = NULL;
21094  int __pyx_lineno = 0;
21095  const char *__pyx_filename = NULL;
21096  int __pyx_clineno = 0;
21097  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
21098 
21099  /* "(tree fragment)":4
21100  * cdef object __pyx_PickleError
21101  * cdef object __pyx_result
21102  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
21103  * from pickle import PickleError as __pyx_PickleError
21104  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
21105  */
21106  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
21107  __Pyx_GOTREF(__pyx_t_1);
21108  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__21, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 4, __pyx_L1_error)
21109  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21110  __pyx_t_3 = (__pyx_t_2 != 0);
21111  if (__pyx_t_3) {
21112 
21113  /* "(tree fragment)":5
21114  * cdef object __pyx_result
21115  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
21116  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
21117  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
21118  * __pyx_result = Enum.__new__(__pyx_type)
21119  */
21120  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
21121  __Pyx_GOTREF(__pyx_t_1);
21122  __Pyx_INCREF(__pyx_n_s_PickleError);
21123  __Pyx_GIVEREF(__pyx_n_s_PickleError);
21124  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
21125  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
21126  __Pyx_GOTREF(__pyx_t_4);
21127  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21128  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
21129  __Pyx_GOTREF(__pyx_t_1);
21130  __Pyx_INCREF(__pyx_t_1);
21131  __pyx_v___pyx_PickleError = __pyx_t_1;
21132  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21133  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21134 
21135  /* "(tree fragment)":6
21136  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
21137  * from pickle import PickleError as __pyx_PickleError
21138  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
21139  * __pyx_result = Enum.__new__(__pyx_type)
21140  * if __pyx_state is not None:
21141  */
21142  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
21143  __Pyx_GOTREF(__pyx_t_1);
21144  __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(2, 6, __pyx_L1_error)
21145  __Pyx_GOTREF(__pyx_t_5);
21146  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21147  __Pyx_INCREF(__pyx_v___pyx_PickleError);
21148  __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
21149  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
21150  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
21151  if (likely(__pyx_t_6)) {
21152  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
21153  __Pyx_INCREF(__pyx_t_6);
21154  __Pyx_INCREF(function);
21155  __Pyx_DECREF_SET(__pyx_t_1, function);
21156  }
21157  }
21158  __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);
21159  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21160  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21161  if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
21162  __Pyx_GOTREF(__pyx_t_4);
21163  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21164  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
21165  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21166  __PYX_ERR(2, 6, __pyx_L1_error)
21167 
21168  /* "(tree fragment)":4
21169  * cdef object __pyx_PickleError
21170  * cdef object __pyx_result
21171  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
21172  * from pickle import PickleError as __pyx_PickleError
21173  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
21174  */
21175  }
21176 
21177  /* "(tree fragment)":7
21178  * from pickle import PickleError as __pyx_PickleError
21179  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
21180  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
21181  * if __pyx_state is not None:
21182  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21183  */
21184  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error)
21185  __Pyx_GOTREF(__pyx_t_1);
21186  __pyx_t_5 = NULL;
21187  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
21188  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
21189  if (likely(__pyx_t_5)) {
21190  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
21191  __Pyx_INCREF(__pyx_t_5);
21192  __Pyx_INCREF(function);
21193  __Pyx_DECREF_SET(__pyx_t_1, function);
21194  }
21195  }
21196  __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);
21197  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21198  if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 7, __pyx_L1_error)
21199  __Pyx_GOTREF(__pyx_t_4);
21200  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21201  __pyx_v___pyx_result = __pyx_t_4;
21202  __pyx_t_4 = 0;
21203 
21204  /* "(tree fragment)":8
21205  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
21206  * __pyx_result = Enum.__new__(__pyx_type)
21207  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21208  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21209  * return __pyx_result
21210  */
21211  __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
21212  __pyx_t_2 = (__pyx_t_3 != 0);
21213  if (__pyx_t_2) {
21214 
21215  /* "(tree fragment)":9
21216  * __pyx_result = Enum.__new__(__pyx_type)
21217  * if __pyx_state is not None:
21218  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
21219  * return __pyx_result
21220  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21221  */
21222  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(2, 9, __pyx_L1_error)
21223  __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(2, 9, __pyx_L1_error)
21224  __Pyx_GOTREF(__pyx_t_4);
21225  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21226 
21227  /* "(tree fragment)":8
21228  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
21229  * __pyx_result = Enum.__new__(__pyx_type)
21230  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21231  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21232  * return __pyx_result
21233  */
21234  }
21235 
21236  /* "(tree fragment)":10
21237  * if __pyx_state is not None:
21238  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21239  * return __pyx_result # <<<<<<<<<<<<<<
21240  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21241  * __pyx_result.name = __pyx_state[0]
21242  */
21243  __Pyx_XDECREF(__pyx_r);
21244  __Pyx_INCREF(__pyx_v___pyx_result);
21245  __pyx_r = __pyx_v___pyx_result;
21246  goto __pyx_L0;
21247 
21248  /* "(tree fragment)":1
21249  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21250  * cdef object __pyx_PickleError
21251  * cdef object __pyx_result
21252  */
21253 
21254  /* function exit code */
21255  __pyx_L1_error:;
21256  __Pyx_XDECREF(__pyx_t_1);
21257  __Pyx_XDECREF(__pyx_t_4);
21258  __Pyx_XDECREF(__pyx_t_5);
21259  __Pyx_XDECREF(__pyx_t_6);
21260  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21261  __pyx_r = NULL;
21262  __pyx_L0:;
21263  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21264  __Pyx_XDECREF(__pyx_v___pyx_result);
21265  __Pyx_XGIVEREF(__pyx_r);
21266  __Pyx_RefNannyFinishContext();
21267  return __pyx_r;
21268 }
21269 
21270 /* "(tree fragment)":11
21271  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21272  * return __pyx_result
21273  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21274  * __pyx_result.name = __pyx_state[0]
21275  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21276  */
21277 
21278 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21279  PyObject *__pyx_r = NULL;
21280  __Pyx_RefNannyDeclarations
21281  PyObject *__pyx_t_1 = NULL;
21282  int __pyx_t_2;
21283  Py_ssize_t __pyx_t_3;
21284  int __pyx_t_4;
21285  int __pyx_t_5;
21286  PyObject *__pyx_t_6 = NULL;
21287  PyObject *__pyx_t_7 = NULL;
21288  PyObject *__pyx_t_8 = NULL;
21289  int __pyx_lineno = 0;
21290  const char *__pyx_filename = NULL;
21291  int __pyx_clineno = 0;
21292  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
21293 
21294  /* "(tree fragment)":12
21295  * return __pyx_result
21296  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21297  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
21298  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21299  * __pyx_result.__dict__.update(__pyx_state[1])
21300  */
21301  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21302  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21303  __PYX_ERR(2, 12, __pyx_L1_error)
21304  }
21305  __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(2, 12, __pyx_L1_error)
21306  __Pyx_GOTREF(__pyx_t_1);
21307  __Pyx_GIVEREF(__pyx_t_1);
21308  __Pyx_GOTREF(__pyx_v___pyx_result->name);
21309  __Pyx_DECREF(__pyx_v___pyx_result->name);
21310  __pyx_v___pyx_result->name = __pyx_t_1;
21311  __pyx_t_1 = 0;
21312 
21313  /* "(tree fragment)":13
21314  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21315  * __pyx_result.name = __pyx_state[0]
21316  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21317  * __pyx_result.__dict__.update(__pyx_state[1])
21318  */
21319  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21320  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21321  __PYX_ERR(2, 13, __pyx_L1_error)
21322  }
21323  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
21324  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21325  if (__pyx_t_4) {
21326  } else {
21327  __pyx_t_2 = __pyx_t_4;
21328  goto __pyx_L4_bool_binop_done;
21329  }
21330  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
21331  __pyx_t_5 = (__pyx_t_4 != 0);
21332  __pyx_t_2 = __pyx_t_5;
21333  __pyx_L4_bool_binop_done:;
21334  if (__pyx_t_2) {
21335 
21336  /* "(tree fragment)":14
21337  * __pyx_result.name = __pyx_state[0]
21338  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21339  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
21340  */
21341  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
21342  __Pyx_GOTREF(__pyx_t_6);
21343  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
21344  __Pyx_GOTREF(__pyx_t_7);
21345  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21346  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21347  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21348  __PYX_ERR(2, 14, __pyx_L1_error)
21349  }
21350  __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(2, 14, __pyx_L1_error)
21351  __Pyx_GOTREF(__pyx_t_6);
21352  __pyx_t_8 = NULL;
21353  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21354  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21355  if (likely(__pyx_t_8)) {
21356  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21357  __Pyx_INCREF(__pyx_t_8);
21358  __Pyx_INCREF(function);
21359  __Pyx_DECREF_SET(__pyx_t_7, function);
21360  }
21361  }
21362  __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);
21363  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21364  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21365  if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
21366  __Pyx_GOTREF(__pyx_t_1);
21367  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21368  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21369 
21370  /* "(tree fragment)":13
21371  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21372  * __pyx_result.name = __pyx_state[0]
21373  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21374  * __pyx_result.__dict__.update(__pyx_state[1])
21375  */
21376  }
21377 
21378  /* "(tree fragment)":11
21379  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21380  * return __pyx_result
21381  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21382  * __pyx_result.name = __pyx_state[0]
21383  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21384  */
21385 
21386  /* function exit code */
21387  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21388  goto __pyx_L0;
21389  __pyx_L1_error:;
21390  __Pyx_XDECREF(__pyx_t_1);
21391  __Pyx_XDECREF(__pyx_t_6);
21392  __Pyx_XDECREF(__pyx_t_7);
21393  __Pyx_XDECREF(__pyx_t_8);
21394  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21395  __pyx_r = 0;
21396  __pyx_L0:;
21397  __Pyx_XGIVEREF(__pyx_r);
21398  __Pyx_RefNannyFinishContext();
21399  return __pyx_r;
21400 }
21401 
21402 /* "BufferFormatFromTypeInfo":1463
21403  *
21404  * @cname('__pyx_format_from_typeinfo')
21405  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
21406  * cdef __Pyx_StructField *field
21407  * cdef __pyx_typeinfo_string fmt
21408  */
21409 
21410 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) {
21411  __Pyx_StructField *__pyx_v_field;
21412  struct __pyx_typeinfo_string __pyx_v_fmt;
21413  PyObject *__pyx_v_part = 0;
21414  PyObject *__pyx_v_result = 0;
21415  PyObject *__pyx_v_alignment = NULL;
21416  PyObject *__pyx_v_parts = NULL;
21417  PyObject *__pyx_v_extents = NULL;
21418  int __pyx_v_i;
21419  PyObject *__pyx_r = NULL;
21420  __Pyx_RefNannyDeclarations
21421  int __pyx_t_1;
21422  PyObject *__pyx_t_2 = NULL;
21423  __Pyx_StructField *__pyx_t_3;
21424  PyObject *__pyx_t_4 = NULL;
21425  PyObject *__pyx_t_5 = NULL;
21426  int __pyx_t_6;
21427  int __pyx_t_7;
21428  int __pyx_t_8;
21429  int __pyx_t_9;
21430  int __pyx_lineno = 0;
21431  const char *__pyx_filename = NULL;
21432  int __pyx_clineno = 0;
21433  __Pyx_RefNannySetupContext("format_from_typeinfo", 0);
21434 
21435  /* "BufferFormatFromTypeInfo":1468
21436  * cdef bytes part, result
21437  *
21438  * if type.typegroup == 'S': # <<<<<<<<<<<<<<
21439  * assert type.fields != NULL
21440  * assert type.fields.type != NULL
21441  */
21442  __pyx_t_1 = ((__pyx_v_type->typegroup == 'S') != 0);
21443  if (__pyx_t_1) {
21444 
21445  /* "BufferFormatFromTypeInfo":1469
21446  *
21447  * if type.typegroup == 'S':
21448  * assert type.fields != NULL # <<<<<<<<<<<<<<
21449  * assert type.fields.type != NULL
21450  *
21451  */
21452  #ifndef CYTHON_WITHOUT_ASSERTIONS
21453  if (unlikely(!Py_OptimizeFlag)) {
21454  if (unlikely(!((__pyx_v_type->fields != NULL) != 0))) {
21455  PyErr_SetNone(PyExc_AssertionError);
21456  __PYX_ERR(2, 1469, __pyx_L1_error)
21457  }
21458  }
21459  #endif
21460 
21461  /* "BufferFormatFromTypeInfo":1470
21462  * if type.typegroup == 'S':
21463  * assert type.fields != NULL
21464  * assert type.fields.type != NULL # <<<<<<<<<<<<<<
21465  *
21466  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
21467  */
21468  #ifndef CYTHON_WITHOUT_ASSERTIONS
21469  if (unlikely(!Py_OptimizeFlag)) {
21470  if (unlikely(!((__pyx_v_type->fields->type != NULL) != 0))) {
21471  PyErr_SetNone(PyExc_AssertionError);
21472  __PYX_ERR(2, 1470, __pyx_L1_error)
21473  }
21474  }
21475  #endif
21476 
21477  /* "BufferFormatFromTypeInfo":1472
21478  * assert type.fields.type != NULL
21479  *
21480  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
21481  * alignment = b'^'
21482  * else:
21483  */
21484  __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
21485  if (__pyx_t_1) {
21486 
21487  /* "BufferFormatFromTypeInfo":1473
21488  *
21489  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
21490  * alignment = b'^' # <<<<<<<<<<<<<<
21491  * else:
21492  * alignment = b''
21493  */
21494  __Pyx_INCREF(__pyx_kp_b__22);
21495  __pyx_v_alignment = __pyx_kp_b__22;
21496 
21497  /* "BufferFormatFromTypeInfo":1472
21498  * assert type.fields.type != NULL
21499  *
21500  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
21501  * alignment = b'^'
21502  * else:
21503  */
21504  goto __pyx_L4;
21505  }
21506 
21507  /* "BufferFormatFromTypeInfo":1475
21508  * alignment = b'^'
21509  * else:
21510  * alignment = b'' # <<<<<<<<<<<<<<
21511  *
21512  * parts = [b"T{"]
21513  */
21514  /*else*/ {
21515  __Pyx_INCREF(__pyx_kp_b__23);
21516  __pyx_v_alignment = __pyx_kp_b__23;
21517  }
21518  __pyx_L4:;
21519 
21520  /* "BufferFormatFromTypeInfo":1477
21521  * alignment = b''
21522  *
21523  * parts = [b"T{"] # <<<<<<<<<<<<<<
21524  * field = type.fields
21525  *
21526  */
21527  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1477, __pyx_L1_error)
21528  __Pyx_GOTREF(__pyx_t_2);
21529  __Pyx_INCREF(__pyx_kp_b_T);
21530  __Pyx_GIVEREF(__pyx_kp_b_T);
21531  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_b_T);
21532  __pyx_v_parts = ((PyObject*)__pyx_t_2);
21533  __pyx_t_2 = 0;
21534 
21535  /* "BufferFormatFromTypeInfo":1478
21536  *
21537  * parts = [b"T{"]
21538  * field = type.fields # <<<<<<<<<<<<<<
21539  *
21540  * while field.type:
21541  */
21542  __pyx_t_3 = __pyx_v_type->fields;
21543  __pyx_v_field = __pyx_t_3;
21544 
21545  /* "BufferFormatFromTypeInfo":1480
21546  * field = type.fields
21547  *
21548  * while field.type: # <<<<<<<<<<<<<<
21549  * part = format_from_typeinfo(field.type)
21550  * parts.append(part + b':' + field.name + b':')
21551  */
21552  while (1) {
21553  __pyx_t_1 = (__pyx_v_field->type != 0);
21554  if (!__pyx_t_1) break;
21555 
21556  /* "BufferFormatFromTypeInfo":1481
21557  *
21558  * while field.type:
21559  * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<<
21560  * parts.append(part + b':' + field.name + b':')
21561  * field += 1
21562  */
21563  __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1481, __pyx_L1_error)
21564  __Pyx_GOTREF(__pyx_t_2);
21565  __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
21566  __pyx_t_2 = 0;
21567 
21568  /* "BufferFormatFromTypeInfo":1482
21569  * while field.type:
21570  * part = format_from_typeinfo(field.type)
21571  * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<<
21572  * field += 1
21573  *
21574  */
21575  __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__24); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1482, __pyx_L1_error)
21576  __Pyx_GOTREF(__pyx_t_2);
21577  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1482, __pyx_L1_error)
21578  __Pyx_GOTREF(__pyx_t_4);
21579  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1482, __pyx_L1_error)
21580  __Pyx_GOTREF(__pyx_t_5);
21581  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21582  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21583  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__24); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1482, __pyx_L1_error)
21584  __Pyx_GOTREF(__pyx_t_4);
21585  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21586  __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1482, __pyx_L1_error)
21587  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21588 
21589  /* "BufferFormatFromTypeInfo":1483
21590  * part = format_from_typeinfo(field.type)
21591  * parts.append(part + b':' + field.name + b':')
21592  * field += 1 # <<<<<<<<<<<<<<
21593  *
21594  * result = alignment.join(parts) + b'}'
21595  */
21596  __pyx_v_field = (__pyx_v_field + 1);
21597  }
21598 
21599  /* "BufferFormatFromTypeInfo":1485
21600  * field += 1
21601  *
21602  * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<<
21603  * else:
21604  * fmt = __Pyx_TypeInfoToFormat(type)
21605  */
21606  __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1485, __pyx_L1_error)
21607  __Pyx_GOTREF(__pyx_t_4);
21608  __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_b__25); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1485, __pyx_L1_error)
21609  __Pyx_GOTREF(__pyx_t_5);
21610  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21611  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(2, 1485, __pyx_L1_error)
21612  __pyx_v_result = ((PyObject*)__pyx_t_5);
21613  __pyx_t_5 = 0;
21614 
21615  /* "BufferFormatFromTypeInfo":1468
21616  * cdef bytes part, result
21617  *
21618  * if type.typegroup == 'S': # <<<<<<<<<<<<<<
21619  * assert type.fields != NULL
21620  * assert type.fields.type != NULL
21621  */
21622  goto __pyx_L3;
21623  }
21624 
21625  /* "BufferFormatFromTypeInfo":1487
21626  * result = alignment.join(parts) + b'}'
21627  * else:
21628  * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<<
21629  * if type.arraysize[0]:
21630  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
21631  */
21632  /*else*/ {
21633  __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
21634 
21635  /* "BufferFormatFromTypeInfo":1488
21636  * else:
21637  * fmt = __Pyx_TypeInfoToFormat(type)
21638  * if type.arraysize[0]: # <<<<<<<<<<<<<<
21639  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
21640  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
21641  */
21642  __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
21643  if (__pyx_t_1) {
21644 
21645  /* "BufferFormatFromTypeInfo":1489
21646  * fmt = __Pyx_TypeInfoToFormat(type)
21647  * if type.arraysize[0]:
21648  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] # <<<<<<<<<<<<<<
21649  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
21650  * else:
21651  */
21652  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1489, __pyx_L1_error)
21653  __Pyx_GOTREF(__pyx_t_5);
21654  __pyx_t_7 = __pyx_v_type->ndim;
21655  __pyx_t_8 = __pyx_t_7;
21656  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
21657  __pyx_v_i = __pyx_t_9;
21658  __pyx_t_4 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1489, __pyx_L1_error)
21659  __Pyx_GOTREF(__pyx_t_4);
21660  __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1489, __pyx_L1_error)
21661  __Pyx_GOTREF(__pyx_t_2);
21662  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21663  if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 1489, __pyx_L1_error)
21664  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21665  }
21666  __pyx_v_extents = ((PyObject*)__pyx_t_5);
21667  __pyx_t_5 = 0;
21668 
21669  /* "BufferFormatFromTypeInfo":1490
21670  * if type.arraysize[0]:
21671  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
21672  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string # <<<<<<<<<<<<<<
21673  * else:
21674  * result = fmt.string
21675  */
21676  __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__26, __pyx_v_extents); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1490, __pyx_L1_error)
21677  __Pyx_GOTREF(__pyx_t_5);
21678  __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1490, __pyx_L1_error)
21679  __Pyx_GOTREF(__pyx_t_2);
21680  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21681  __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1490, __pyx_L1_error)
21682  __Pyx_GOTREF(__pyx_t_5);
21683  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21684  __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1490, __pyx_L1_error)
21685  __Pyx_GOTREF(__pyx_t_2);
21686  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1490, __pyx_L1_error)
21687  __Pyx_GOTREF(__pyx_t_4);
21688  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21689  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21690  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(2, 1490, __pyx_L1_error)
21691  __pyx_v_result = ((PyObject*)__pyx_t_4);
21692  __pyx_t_4 = 0;
21693 
21694  /* "BufferFormatFromTypeInfo":1488
21695  * else:
21696  * fmt = __Pyx_TypeInfoToFormat(type)
21697  * if type.arraysize[0]: # <<<<<<<<<<<<<<
21698  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
21699  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
21700  */
21701  goto __pyx_L7;
21702  }
21703 
21704  /* "BufferFormatFromTypeInfo":1492
21705  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
21706  * else:
21707  * result = fmt.string # <<<<<<<<<<<<<<
21708  *
21709  * return result
21710  */
21711  /*else*/ {
21712  __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1492, __pyx_L1_error)
21713  __Pyx_GOTREF(__pyx_t_4);
21714  __pyx_v_result = ((PyObject*)__pyx_t_4);
21715  __pyx_t_4 = 0;
21716  }
21717  __pyx_L7:;
21718  }
21719  __pyx_L3:;
21720 
21721  /* "BufferFormatFromTypeInfo":1494
21722  * result = fmt.string
21723  *
21724  * return result # <<<<<<<<<<<<<<
21725  */
21726  __Pyx_XDECREF(__pyx_r);
21727  __Pyx_INCREF(__pyx_v_result);
21728  __pyx_r = __pyx_v_result;
21729  goto __pyx_L0;
21730 
21731  /* "BufferFormatFromTypeInfo":1463
21732  *
21733  * @cname('__pyx_format_from_typeinfo')
21734  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
21735  * cdef __Pyx_StructField *field
21736  * cdef __pyx_typeinfo_string fmt
21737  */
21738 
21739  /* function exit code */
21740  __pyx_L1_error:;
21741  __Pyx_XDECREF(__pyx_t_2);
21742  __Pyx_XDECREF(__pyx_t_4);
21743  __Pyx_XDECREF(__pyx_t_5);
21744  __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
21745  __pyx_r = 0;
21746  __pyx_L0:;
21747  __Pyx_XDECREF(__pyx_v_part);
21748  __Pyx_XDECREF(__pyx_v_result);
21749  __Pyx_XDECREF(__pyx_v_alignment);
21750  __Pyx_XDECREF(__pyx_v_parts);
21751  __Pyx_XDECREF(__pyx_v_extents);
21752  __Pyx_XGIVEREF(__pyx_r);
21753  __Pyx_RefNannyFinishContext();
21754  return __pyx_r;
21755 }
21756 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21757 
21758 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21759  struct __pyx_array_obj *p;
21760  PyObject *o;
21761  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21762  o = (*t->tp_alloc)(t, 0);
21763  } else {
21764  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21765  }
21766  if (unlikely(!o)) return 0;
21767  p = ((struct __pyx_array_obj *)o);
21768  p->__pyx_vtab = __pyx_vtabptr_array;
21769  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21770  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21771  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
21772  return o;
21773  bad:
21774  Py_DECREF(o); o = 0;
21775  return NULL;
21776 }
21777 
21778 static void __pyx_tp_dealloc_array(PyObject *o) {
21779  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
21780  #if CYTHON_USE_TP_FINALIZE
21781  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))) {
21782  if (PyObject_CallFinalizerFromDealloc(o)) return;
21783  }
21784  #endif
21785  {
21786  PyObject *etype, *eval, *etb;
21787  PyErr_Fetch(&etype, &eval, &etb);
21788  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21789  __pyx_array___dealloc__(o);
21790  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21791  PyErr_Restore(etype, eval, etb);
21792  }
21793  Py_CLEAR(p->mode);
21794  Py_CLEAR(p->_format);
21795  (*Py_TYPE(o)->tp_free)(o);
21796 }
21797 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21798  PyObject *r;
21799  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21800  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21801  Py_DECREF(x);
21802  return r;
21803 }
21804 
21805 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21806  if (v) {
21807  return __pyx_array___setitem__(o, i, v);
21808  }
21809  else {
21810  PyErr_Format(PyExc_NotImplementedError,
21811  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21812  return -1;
21813  }
21814 }
21815 
21816 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21817  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21818  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21819  PyErr_Clear();
21820  v = __pyx_array___getattr__(o, n);
21821  }
21822  return v;
21823 }
21824 
21825 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
21826  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21827 }
21828 
21829 static PyMethodDef __pyx_methods_array[] = {
21830  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21831  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21832  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21833  {0, 0, 0, 0}
21834 };
21835 
21836 static struct PyGetSetDef __pyx_getsets_array[] = {
21837  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
21838  {0, 0, 0, 0, 0}
21839 };
21840 
21841 static PySequenceMethods __pyx_tp_as_sequence_array = {
21842  __pyx_array___len__, /*sq_length*/
21843  0, /*sq_concat*/
21844  0, /*sq_repeat*/
21845  __pyx_sq_item_array, /*sq_item*/
21846  0, /*sq_slice*/
21847  0, /*sq_ass_item*/
21848  0, /*sq_ass_slice*/
21849  0, /*sq_contains*/
21850  0, /*sq_inplace_concat*/
21851  0, /*sq_inplace_repeat*/
21852 };
21853 
21854 static PyMappingMethods __pyx_tp_as_mapping_array = {
21855  __pyx_array___len__, /*mp_length*/
21856  __pyx_array___getitem__, /*mp_subscript*/
21857  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
21858 };
21859 
21860 static PyBufferProcs __pyx_tp_as_buffer_array = {
21861  #if PY_MAJOR_VERSION < 3
21862  0, /*bf_getreadbuffer*/
21863  #endif
21864  #if PY_MAJOR_VERSION < 3
21865  0, /*bf_getwritebuffer*/
21866  #endif
21867  #if PY_MAJOR_VERSION < 3
21868  0, /*bf_getsegcount*/
21869  #endif
21870  #if PY_MAJOR_VERSION < 3
21871  0, /*bf_getcharbuffer*/
21872  #endif
21873  __pyx_array_getbuffer, /*bf_getbuffer*/
21874  0, /*bf_releasebuffer*/
21875 };
21876 
21877 static PyTypeObject __pyx_type___pyx_array = {
21878  PyVarObject_HEAD_INIT(0, 0)
21879  "cpartitioning.array", /*tp_name*/
21880  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
21881  0, /*tp_itemsize*/
21882  __pyx_tp_dealloc_array, /*tp_dealloc*/
21883  #if PY_VERSION_HEX < 0x030800b4
21884  0, /*tp_print*/
21885  #endif
21886  #if PY_VERSION_HEX >= 0x030800b4
21887  0, /*tp_vectorcall_offset*/
21888  #endif
21889  0, /*tp_getattr*/
21890  0, /*tp_setattr*/
21891  #if PY_MAJOR_VERSION < 3
21892  0, /*tp_compare*/
21893  #endif
21894  #if PY_MAJOR_VERSION >= 3
21895  0, /*tp_as_async*/
21896  #endif
21897  0, /*tp_repr*/
21898  0, /*tp_as_number*/
21899  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
21900  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
21901  0, /*tp_hash*/
21902  0, /*tp_call*/
21903  0, /*tp_str*/
21904  __pyx_tp_getattro_array, /*tp_getattro*/
21905  0, /*tp_setattro*/
21906  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
21907  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21908  0, /*tp_doc*/
21909  0, /*tp_traverse*/
21910  0, /*tp_clear*/
21911  0, /*tp_richcompare*/
21912  0, /*tp_weaklistoffset*/
21913  0, /*tp_iter*/
21914  0, /*tp_iternext*/
21915  __pyx_methods_array, /*tp_methods*/
21916  0, /*tp_members*/
21917  __pyx_getsets_array, /*tp_getset*/
21918  0, /*tp_base*/
21919  0, /*tp_dict*/
21920  0, /*tp_descr_get*/
21921  0, /*tp_descr_set*/
21922  0, /*tp_dictoffset*/
21923  0, /*tp_init*/
21924  0, /*tp_alloc*/
21925  __pyx_tp_new_array, /*tp_new*/
21926  0, /*tp_free*/
21927  0, /*tp_is_gc*/
21928  0, /*tp_bases*/
21929  0, /*tp_mro*/
21930  0, /*tp_cache*/
21931  0, /*tp_subclasses*/
21932  0, /*tp_weaklist*/
21933  0, /*tp_del*/
21934  0, /*tp_version_tag*/
21935  #if PY_VERSION_HEX >= 0x030400a1
21936  0, /*tp_finalize*/
21937  #endif
21938  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21939  0, /*tp_vectorcall*/
21940  #endif
21941  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21942  0, /*tp_print*/
21943  #endif
21944  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21945  0, /*tp_pypy_flags*/
21946  #endif
21947 };
21948 
21949 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21950  struct __pyx_MemviewEnum_obj *p;
21951  PyObject *o;
21952  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21953  o = (*t->tp_alloc)(t, 0);
21954  } else {
21955  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21956  }
21957  if (unlikely(!o)) return 0;
21958  p = ((struct __pyx_MemviewEnum_obj *)o);
21959  p->name = Py_None; Py_INCREF(Py_None);
21960  return o;
21961 }
21962 
21963 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21964  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21965  #if CYTHON_USE_TP_FINALIZE
21966  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21967  if (PyObject_CallFinalizerFromDealloc(o)) return;
21968  }
21969  #endif
21970  PyObject_GC_UnTrack(o);
21971  Py_CLEAR(p->name);
21972  (*Py_TYPE(o)->tp_free)(o);
21973 }
21974 
21975 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
21976  int e;
21977  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21978  if (p->name) {
21979  e = (*v)(p->name, a); if (e) return e;
21980  }
21981  return 0;
21982 }
21983 
21984 static int __pyx_tp_clear_Enum(PyObject *o) {
21985  PyObject* tmp;
21986  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21987  tmp = ((PyObject*)p->name);
21988  p->name = Py_None; Py_INCREF(Py_None);
21989  Py_XDECREF(tmp);
21990  return 0;
21991 }
21992 
21993 static PyMethodDef __pyx_methods_Enum[] = {
21994  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21995  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21996  {0, 0, 0, 0}
21997 };
21998 
21999 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22000  PyVarObject_HEAD_INIT(0, 0)
22001  "cpartitioning.Enum", /*tp_name*/
22002  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
22003  0, /*tp_itemsize*/
22004  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
22005  #if PY_VERSION_HEX < 0x030800b4
22006  0, /*tp_print*/
22007  #endif
22008  #if PY_VERSION_HEX >= 0x030800b4
22009  0, /*tp_vectorcall_offset*/
22010  #endif
22011  0, /*tp_getattr*/
22012  0, /*tp_setattr*/
22013  #if PY_MAJOR_VERSION < 3
22014  0, /*tp_compare*/
22015  #endif
22016  #if PY_MAJOR_VERSION >= 3
22017  0, /*tp_as_async*/
22018  #endif
22019  __pyx_MemviewEnum___repr__, /*tp_repr*/
22020  0, /*tp_as_number*/
22021  0, /*tp_as_sequence*/
22022  0, /*tp_as_mapping*/
22023  0, /*tp_hash*/
22024  0, /*tp_call*/
22025  0, /*tp_str*/
22026  0, /*tp_getattro*/
22027  0, /*tp_setattro*/
22028  0, /*tp_as_buffer*/
22029  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22030  0, /*tp_doc*/
22031  __pyx_tp_traverse_Enum, /*tp_traverse*/
22032  __pyx_tp_clear_Enum, /*tp_clear*/
22033  0, /*tp_richcompare*/
22034  0, /*tp_weaklistoffset*/
22035  0, /*tp_iter*/
22036  0, /*tp_iternext*/
22037  __pyx_methods_Enum, /*tp_methods*/
22038  0, /*tp_members*/
22039  0, /*tp_getset*/
22040  0, /*tp_base*/
22041  0, /*tp_dict*/
22042  0, /*tp_descr_get*/
22043  0, /*tp_descr_set*/
22044  0, /*tp_dictoffset*/
22045  __pyx_MemviewEnum___init__, /*tp_init*/
22046  0, /*tp_alloc*/
22047  __pyx_tp_new_Enum, /*tp_new*/
22048  0, /*tp_free*/
22049  0, /*tp_is_gc*/
22050  0, /*tp_bases*/
22051  0, /*tp_mro*/
22052  0, /*tp_cache*/
22053  0, /*tp_subclasses*/
22054  0, /*tp_weaklist*/
22055  0, /*tp_del*/
22056  0, /*tp_version_tag*/
22057  #if PY_VERSION_HEX >= 0x030400a1
22058  0, /*tp_finalize*/
22059  #endif
22060  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22061  0, /*tp_vectorcall*/
22062  #endif
22063  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22064  0, /*tp_print*/
22065  #endif
22066  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
22067  0, /*tp_pypy_flags*/
22068  #endif
22069 };
22070 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22071 
22072 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22073  struct __pyx_memoryview_obj *p;
22074  PyObject *o;
22075  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22076  o = (*t->tp_alloc)(t, 0);
22077  } else {
22078  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22079  }
22080  if (unlikely(!o)) return 0;
22081  p = ((struct __pyx_memoryview_obj *)o);
22082  p->__pyx_vtab = __pyx_vtabptr_memoryview;
22083  p->obj = Py_None; Py_INCREF(Py_None);
22084  p->_size = Py_None; Py_INCREF(Py_None);
22085  p->_array_interface = Py_None; Py_INCREF(Py_None);
22086  p->view.obj = NULL;
22087  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
22088  return o;
22089  bad:
22090  Py_DECREF(o); o = 0;
22091  return NULL;
22092 }
22093 
22094 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22095  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22096  #if CYTHON_USE_TP_FINALIZE
22097  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22098  if (PyObject_CallFinalizerFromDealloc(o)) return;
22099  }
22100  #endif
22101  PyObject_GC_UnTrack(o);
22102  {
22103  PyObject *etype, *eval, *etb;
22104  PyErr_Fetch(&etype, &eval, &etb);
22105  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22106  __pyx_memoryview___dealloc__(o);
22107  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22108  PyErr_Restore(etype, eval, etb);
22109  }
22110  Py_CLEAR(p->obj);
22111  Py_CLEAR(p->_size);
22112  Py_CLEAR(p->_array_interface);
22113  (*Py_TYPE(o)->tp_free)(o);
22114 }
22115 
22116 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
22117  int e;
22118  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22119  if (p->obj) {
22120  e = (*v)(p->obj, a); if (e) return e;
22121  }
22122  if (p->_size) {
22123  e = (*v)(p->_size, a); if (e) return e;
22124  }
22125  if (p->_array_interface) {
22126  e = (*v)(p->_array_interface, a); if (e) return e;
22127  }
22128  if (p->view.obj) {
22129  e = (*v)(p->view.obj, a); if (e) return e;
22130  }
22131  return 0;
22132 }
22133 
22134 static int __pyx_tp_clear_memoryview(PyObject *o) {
22135  PyObject* tmp;
22136  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22137  tmp = ((PyObject*)p->obj);
22138  p->obj = Py_None; Py_INCREF(Py_None);
22139  Py_XDECREF(tmp);
22140  tmp = ((PyObject*)p->_size);
22141  p->_size = Py_None; Py_INCREF(Py_None);
22142  Py_XDECREF(tmp);
22143  tmp = ((PyObject*)p->_array_interface);
22144  p->_array_interface = Py_None; Py_INCREF(Py_None);
22145  Py_XDECREF(tmp);
22146  Py_CLEAR(p->view.obj);
22147  return 0;
22148 }
22149 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22150  PyObject *r;
22151  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22152  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22153  Py_DECREF(x);
22154  return r;
22155 }
22156 
22157 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
22158  if (v) {
22159  return __pyx_memoryview___setitem__(o, i, v);
22160  }
22161  else {
22162  PyErr_Format(PyExc_NotImplementedError,
22163  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22164  return -1;
22165  }
22166 }
22167 
22168 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
22169  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22170 }
22171 
22172 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
22173  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22174 }
22175 
22176 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
22177  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22178 }
22179 
22180 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
22181  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22182 }
22183 
22184 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
22185  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22186 }
22187 
22188 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
22189  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22190 }
22191 
22192 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
22193  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22194 }
22195 
22196 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
22197  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22198 }
22199 
22200 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
22201  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22202 }
22203 
22204 static PyMethodDef __pyx_methods_memoryview[] = {
22205  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22206  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22207  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22208  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22209  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22210  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22211  {0, 0, 0, 0}
22212 };
22213 
22214 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22215  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
22216  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
22217  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
22218  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
22219  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
22220  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
22221  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
22222  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
22223  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
22224  {0, 0, 0, 0, 0}
22225 };
22226 
22227 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22228  __pyx_memoryview___len__, /*sq_length*/
22229  0, /*sq_concat*/
22230  0, /*sq_repeat*/
22231  __pyx_sq_item_memoryview, /*sq_item*/
22232  0, /*sq_slice*/
22233  0, /*sq_ass_item*/
22234  0, /*sq_ass_slice*/
22235  0, /*sq_contains*/
22236  0, /*sq_inplace_concat*/
22237  0, /*sq_inplace_repeat*/
22238 };
22239 
22240 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22241  __pyx_memoryview___len__, /*mp_length*/
22242  __pyx_memoryview___getitem__, /*mp_subscript*/
22243  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
22244 };
22245 
22246 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22247  #if PY_MAJOR_VERSION < 3
22248  0, /*bf_getreadbuffer*/
22249  #endif
22250  #if PY_MAJOR_VERSION < 3
22251  0, /*bf_getwritebuffer*/
22252  #endif
22253  #if PY_MAJOR_VERSION < 3
22254  0, /*bf_getsegcount*/
22255  #endif
22256  #if PY_MAJOR_VERSION < 3
22257  0, /*bf_getcharbuffer*/
22258  #endif
22259  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
22260  0, /*bf_releasebuffer*/
22261 };
22262 
22263 static PyTypeObject __pyx_type___pyx_memoryview = {
22264  PyVarObject_HEAD_INIT(0, 0)
22265  "cpartitioning.memoryview", /*tp_name*/
22266  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
22267  0, /*tp_itemsize*/
22268  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
22269  #if PY_VERSION_HEX < 0x030800b4
22270  0, /*tp_print*/
22271  #endif
22272  #if PY_VERSION_HEX >= 0x030800b4
22273  0, /*tp_vectorcall_offset*/
22274  #endif
22275  0, /*tp_getattr*/
22276  0, /*tp_setattr*/
22277  #if PY_MAJOR_VERSION < 3
22278  0, /*tp_compare*/
22279  #endif
22280  #if PY_MAJOR_VERSION >= 3
22281  0, /*tp_as_async*/
22282  #endif
22283  __pyx_memoryview___repr__, /*tp_repr*/
22284  0, /*tp_as_number*/
22285  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
22286  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
22287  0, /*tp_hash*/
22288  0, /*tp_call*/
22289  __pyx_memoryview___str__, /*tp_str*/
22290  0, /*tp_getattro*/
22291  0, /*tp_setattro*/
22292  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
22293  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22294  0, /*tp_doc*/
22295  __pyx_tp_traverse_memoryview, /*tp_traverse*/
22296  __pyx_tp_clear_memoryview, /*tp_clear*/
22297  0, /*tp_richcompare*/
22298  0, /*tp_weaklistoffset*/
22299  0, /*tp_iter*/
22300  0, /*tp_iternext*/
22301  __pyx_methods_memoryview, /*tp_methods*/
22302  0, /*tp_members*/
22303  __pyx_getsets_memoryview, /*tp_getset*/
22304  0, /*tp_base*/
22305  0, /*tp_dict*/
22306  0, /*tp_descr_get*/
22307  0, /*tp_descr_set*/
22308  0, /*tp_dictoffset*/
22309  0, /*tp_init*/
22310  0, /*tp_alloc*/
22311  __pyx_tp_new_memoryview, /*tp_new*/
22312  0, /*tp_free*/
22313  0, /*tp_is_gc*/
22314  0, /*tp_bases*/
22315  0, /*tp_mro*/
22316  0, /*tp_cache*/
22317  0, /*tp_subclasses*/
22318  0, /*tp_weaklist*/
22319  0, /*tp_del*/
22320  0, /*tp_version_tag*/
22321  #if PY_VERSION_HEX >= 0x030400a1
22322  0, /*tp_finalize*/
22323  #endif
22324  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22325  0, /*tp_vectorcall*/
22326  #endif
22327  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22328  0, /*tp_print*/
22329  #endif
22330  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
22331  0, /*tp_pypy_flags*/
22332  #endif
22333 };
22334 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22335 
22336 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22337  struct __pyx_memoryviewslice_obj *p;
22338  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22339  if (unlikely(!o)) return 0;
22340  p = ((struct __pyx_memoryviewslice_obj *)o);
22341  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22342  p->from_object = Py_None; Py_INCREF(Py_None);
22343  p->from_slice.memview = NULL;
22344  return o;
22345 }
22346 
22347 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22348  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22349  #if CYTHON_USE_TP_FINALIZE
22350  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22351  if (PyObject_CallFinalizerFromDealloc(o)) return;
22352  }
22353  #endif
22354  PyObject_GC_UnTrack(o);
22355  {
22356  PyObject *etype, *eval, *etb;
22357  PyErr_Fetch(&etype, &eval, &etb);
22358  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22359  __pyx_memoryviewslice___dealloc__(o);
22360  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22361  PyErr_Restore(etype, eval, etb);
22362  }
22363  Py_CLEAR(p->from_object);
22364  PyObject_GC_Track(o);
22365  __pyx_tp_dealloc_memoryview(o);
22366 }
22367 
22368 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
22369  int e;
22370  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22371  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
22372  if (p->from_object) {
22373  e = (*v)(p->from_object, a); if (e) return e;
22374  }
22375  return 0;
22376 }
22377 
22378 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22379  PyObject* tmp;
22380  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22381  __pyx_tp_clear_memoryview(o);
22382  tmp = ((PyObject*)p->from_object);
22383  p->from_object = Py_None; Py_INCREF(Py_None);
22384  Py_XDECREF(tmp);
22385  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22386  return 0;
22387 }
22388 
22389 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
22390  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22391 }
22392 
22393 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22394  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22395  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22396  {0, 0, 0, 0}
22397 };
22398 
22399 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22400  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
22401  {0, 0, 0, 0, 0}
22402 };
22403 
22404 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22405  PyVarObject_HEAD_INIT(0, 0)
22406  "cpartitioning._memoryviewslice", /*tp_name*/
22407  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
22408  0, /*tp_itemsize*/
22409  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
22410  #if PY_VERSION_HEX < 0x030800b4
22411  0, /*tp_print*/
22412  #endif
22413  #if PY_VERSION_HEX >= 0x030800b4
22414  0, /*tp_vectorcall_offset*/
22415  #endif
22416  0, /*tp_getattr*/
22417  0, /*tp_setattr*/
22418  #if PY_MAJOR_VERSION < 3
22419  0, /*tp_compare*/
22420  #endif
22421  #if PY_MAJOR_VERSION >= 3
22422  0, /*tp_as_async*/
22423  #endif
22424  #if CYTHON_COMPILING_IN_PYPY
22425  __pyx_memoryview___repr__, /*tp_repr*/
22426  #else
22427  0, /*tp_repr*/
22428  #endif
22429  0, /*tp_as_number*/
22430  0, /*tp_as_sequence*/
22431  0, /*tp_as_mapping*/
22432  0, /*tp_hash*/
22433  0, /*tp_call*/
22434  #if CYTHON_COMPILING_IN_PYPY
22435  __pyx_memoryview___str__, /*tp_str*/
22436  #else
22437  0, /*tp_str*/
22438  #endif
22439  0, /*tp_getattro*/
22440  0, /*tp_setattro*/
22441  0, /*tp_as_buffer*/
22442  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22443  "Internal class for passing memoryview slices to Python", /*tp_doc*/
22444  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
22445  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
22446  0, /*tp_richcompare*/
22447  0, /*tp_weaklistoffset*/
22448  0, /*tp_iter*/
22449  0, /*tp_iternext*/
22450  __pyx_methods__memoryviewslice, /*tp_methods*/
22451  0, /*tp_members*/
22452  __pyx_getsets__memoryviewslice, /*tp_getset*/
22453  0, /*tp_base*/
22454  0, /*tp_dict*/
22455  0, /*tp_descr_get*/
22456  0, /*tp_descr_set*/
22457  0, /*tp_dictoffset*/
22458  0, /*tp_init*/
22459  0, /*tp_alloc*/
22460  __pyx_tp_new__memoryviewslice, /*tp_new*/
22461  0, /*tp_free*/
22462  0, /*tp_is_gc*/
22463  0, /*tp_bases*/
22464  0, /*tp_mro*/
22465  0, /*tp_cache*/
22466  0, /*tp_subclasses*/
22467  0, /*tp_weaklist*/
22468  0, /*tp_del*/
22469  0, /*tp_version_tag*/
22470  #if PY_VERSION_HEX >= 0x030400a1
22471  0, /*tp_finalize*/
22472  #endif
22473  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22474  0, /*tp_vectorcall*/
22475  #endif
22476  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22477  0, /*tp_print*/
22478  #endif
22479  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
22480  0, /*tp_pypy_flags*/
22481  #endif
22482 };
22483 
22484 static PyMethodDef __pyx_methods[] = {
22485  {0, 0, 0, 0}
22486 };
22487 
22488 #if PY_MAJOR_VERSION >= 3
22489 #if CYTHON_PEP489_MULTI_PHASE_INIT
22490 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
22491 static int __pyx_pymod_exec_cpartitioning(PyObject* module); /*proto*/
22492 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22493  {Py_mod_create, (void*)__pyx_pymod_create},
22494  {Py_mod_exec, (void*)__pyx_pymod_exec_cpartitioning},
22495  {0, NULL}
22496 };
22497 #endif
22498 
22499 static struct PyModuleDef __pyx_moduledef = {
22500  PyModuleDef_HEAD_INIT,
22501  "cpartitioning",
22502  0, /* m_doc */
22503  #if CYTHON_PEP489_MULTI_PHASE_INIT
22504  0, /* m_size */
22505  #else
22506  -1, /* m_size */
22507  #endif
22508  __pyx_methods /* m_methods */,
22509  #if CYTHON_PEP489_MULTI_PHASE_INIT
22510  __pyx_moduledef_slots, /* m_slots */
22511  #else
22512  NULL, /* m_reload */
22513  #endif
22514  NULL, /* m_traverse */
22515  NULL, /* m_clear */
22516  NULL /* m_free */
22517 };
22518 #endif
22519 #ifndef CYTHON_SMALL_CODE
22520 #if defined(__clang__)
22521  #define CYTHON_SMALL_CODE
22522 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22523  #define CYTHON_SMALL_CODE __attribute__((cold))
22524 #else
22525  #define CYTHON_SMALL_CODE
22526 #endif
22527 #endif
22528 
22529 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22530  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22531  {&__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},
22532  {&__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},
22533  {&__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},
22534  {&__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},
22535  {&__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},
22536  {&__pyx_n_s_Comm, __pyx_k_Comm, sizeof(__pyx_k_Comm), 0, 0, 1, 1},
22537  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22538  {&__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},
22539  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22540  {&__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},
22541  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22542  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22543  {&__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},
22544  {&__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},
22545  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22546  {&__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},
22547  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22548  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
22549  {&__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},
22550  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22551  {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 0},
22552  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22553  {&__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},
22554  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22555  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22556  {&__pyx_kp_b__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 0, 0, 0},
22557  {&__pyx_kp_b__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 0, 0},
22558  {&__pyx_kp_b__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 0, 0},
22559  {&__pyx_kp_b__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 0, 0, 0},
22560  {&__pyx_kp_u__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 1, 0, 0},
22561  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22562  {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
22563  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
22564  {&__pyx_n_s_buildDiscontinuousGalerkinLocal2, __pyx_k_buildDiscontinuousGalerkinLocal2, sizeof(__pyx_k_buildDiscontinuousGalerkinLocal2), 0, 0, 1, 1},
22565  {&__pyx_n_s_buildQuadraticCubeLocal2GlobalMa, __pyx_k_buildQuadraticCubeLocal2GlobalMa, sizeof(__pyx_k_buildQuadraticCubeLocal2GlobalMa), 0, 0, 1, 1},
22566  {&__pyx_kp_s_buildQuadraticCubeSubdomain2Glob, __pyx_k_buildQuadraticCubeSubdomain2Glob, sizeof(__pyx_k_buildQuadraticCubeSubdomain2Glob), 0, 0, 1, 0},
22567  {&__pyx_kp_s_buildQuadraticCubeSubdomain2Glob_2, __pyx_k_buildQuadraticCubeSubdomain2Glob_2, sizeof(__pyx_k_buildQuadraticCubeSubdomain2Glob_2), 0, 0, 1, 0},
22568  {&__pyx_n_s_buildQuadraticLocal2GlobalMappin, __pyx_k_buildQuadraticLocal2GlobalMappin, sizeof(__pyx_k_buildQuadraticLocal2GlobalMappin), 0, 0, 1, 1},
22569  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
22570  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
22571  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
22572  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22573  {&__pyx_n_s_cmesh, __pyx_k_cmesh, sizeof(__pyx_k_cmesh), 0, 0, 1, 1},
22574  {&__pyx_n_s_comm, __pyx_k_comm, sizeof(__pyx_k_comm), 0, 0, 1, 1},
22575  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22576  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22577  {&__pyx_n_s_convertPUMIPartitionToPython, __pyx_k_convertPUMIPartitionToPython, sizeof(__pyx_k_convertPUMIPartitionToPython), 0, 0, 1, 1},
22578  {&__pyx_n_s_cpartitioning, __pyx_k_cpartitioning, sizeof(__pyx_k_cpartitioning), 0, 0, 1, 1},
22579  {&__pyx_n_s_dgNumbering_subdomain2global, __pyx_k_dgNumbering_subdomain2global, sizeof(__pyx_k_dgNumbering_subdomain2global), 0, 0, 1, 1},
22580  {&__pyx_n_s_dg_dof_offsets_subdomain_owned, __pyx_k_dg_dof_offsets_subdomain_owned, sizeof(__pyx_k_dg_dof_offsets_subdomain_owned), 0, 0, 1, 1},
22581  {&__pyx_n_s_dg_subdomain_l2g, __pyx_k_dg_subdomain_l2g, sizeof(__pyx_k_dg_subdomain_l2g), 0, 0, 1, 1},
22582  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
22583  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22584  {&__pyx_n_s_edgeNumbering_subdomain2global, __pyx_k_edgeNumbering_subdomain2global, sizeof(__pyx_k_edgeNumbering_subdomain2global), 0, 0, 1, 1},
22585  {&__pyx_n_s_edgeOffsets_subdomain_owned, __pyx_k_edgeOffsets_subdomain_owned, sizeof(__pyx_k_edgeOffsets_subdomain_owned), 0, 0, 1, 1},
22586  {&__pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_k_elementBoundaryNumbering_subdoma, sizeof(__pyx_k_elementBoundaryNumbering_subdoma), 0, 0, 1, 1},
22587  {&__pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_k_elementBoundaryOffsets_subdomain, sizeof(__pyx_k_elementBoundaryOffsets_subdomain), 0, 0, 1, 1},
22588  {&__pyx_n_s_elementNumbering_subdomain2globa, __pyx_k_elementNumbering_subdomain2globa, sizeof(__pyx_k_elementNumbering_subdomain2globa), 0, 0, 1, 1},
22589  {&__pyx_n_s_elementOffsets_subdomain_owned, __pyx_k_elementOffsets_subdomain_owned, sizeof(__pyx_k_elementOffsets_subdomain_owned), 0, 0, 1, 1},
22590  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
22591  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22592  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
22593  {&__pyx_n_s_filebase, __pyx_k_filebase, sizeof(__pyx_k_filebase), 0, 0, 1, 1},
22594  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
22595  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
22596  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22597  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22598  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22599  {&__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},
22600  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
22601  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
22602  {&__pyx_n_s_indexBase, __pyx_k_indexBase, sizeof(__pyx_k_indexBase), 0, 0, 1, 1},
22603  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22604  {&__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},
22605  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
22606  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
22607  {&__pyx_n_s_max_dof_neighbors, __pyx_k_max_dof_neighbors, sizeof(__pyx_k_max_dof_neighbors), 0, 0, 1, 1},
22608  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
22609  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
22610  {&__pyx_n_s_nDOF_all_processes, __pyx_k_nDOF_all_processes, sizeof(__pyx_k_nDOF_all_processes), 0, 0, 1, 1},
22611  {&__pyx_n_s_nDOF_element, __pyx_k_nDOF_element, sizeof(__pyx_k_nDOF_element), 0, 0, 1, 1},
22612  {&__pyx_n_s_nDOF_subdomain, __pyx_k_nDOF_subdomain, sizeof(__pyx_k_nDOF_subdomain), 0, 0, 1, 1},
22613  {&__pyx_n_s_nLayersOfOverlap, __pyx_k_nLayersOfOverlap, sizeof(__pyx_k_nLayersOfOverlap), 0, 0, 1, 1},
22614  {&__pyx_n_s_nSpace, __pyx_k_nSpace, sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
22615  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
22616  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22617  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22618  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
22619  {&__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},
22620  {&__pyx_n_s_nodeNumbering_subdomain2global, __pyx_k_nodeNumbering_subdomain2global, sizeof(__pyx_k_nodeNumbering_subdomain2global), 0, 0, 1, 1},
22621  {&__pyx_n_s_nodeOffsets_subdomain_owned, __pyx_k_nodeOffsets_subdomain_owned, sizeof(__pyx_k_nodeOffsets_subdomain_owned), 0, 0, 1, 1},
22622  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
22623  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22624  {&__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},
22625  {&__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},
22626  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
22627  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
22628  {&__pyx_n_s_partitionElements, __pyx_k_partitionElements, sizeof(__pyx_k_partitionElements), 0, 0, 1, 1},
22629  {&__pyx_n_s_partitionNodes, __pyx_k_partitionNodes, sizeof(__pyx_k_partitionNodes), 0, 0, 1, 1},
22630  {&__pyx_n_s_partitionNodesFromTetgenFiles, __pyx_k_partitionNodesFromTetgenFiles, sizeof(__pyx_k_partitionNodesFromTetgenFiles), 0, 0, 1, 1},
22631  {&__pyx_n_s_partitionNodesFromTriangleFiles, __pyx_k_partitionNodesFromTriangleFiles, sizeof(__pyx_k_partitionNodesFromTriangleFiles), 0, 0, 1, 1},
22632  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22633  {&__pyx_n_s_proteus, __pyx_k_proteus, sizeof(__pyx_k_proteus), 0, 0, 1, 1},
22634  {&__pyx_n_s_proteus_Comm, __pyx_k_proteus_Comm, sizeof(__pyx_k_proteus_Comm), 0, 0, 1, 1},
22635  {&__pyx_kp_s_proteus_cpartitioning_pyx, __pyx_k_proteus_cpartitioning_pyx, sizeof(__pyx_k_proteus_cpartitioning_pyx), 0, 0, 1, 0},
22636  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22637  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22638  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22639  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22640  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22641  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22642  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22643  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22644  {&__pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_k_quadraticNumbering_subdomain2glo, sizeof(__pyx_k_quadraticNumbering_subdomain2glo), 0, 0, 1, 1},
22645  {&__pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_k_quadratic_dof_offsets_subdomain, sizeof(__pyx_k_quadratic_dof_offsets_subdomain), 0, 0, 1, 1},
22646  {&__pyx_n_s_quadratic_lagrangeNodes, __pyx_k_quadratic_lagrangeNodes, sizeof(__pyx_k_quadratic_lagrangeNodes), 0, 0, 1, 1},
22647  {&__pyx_n_s_quadratic_subdomain_l2g, __pyx_k_quadratic_subdomain_l2g, sizeof(__pyx_k_quadratic_subdomain_l2g), 0, 0, 1, 1},
22648  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
22649  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22650  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22651  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22652  {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
22653  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22654  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22655  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
22656  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
22657  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
22658  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
22659  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
22660  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22661  {&__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},
22662  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22663  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22664  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
22665  {&__pyx_n_s_subdomain_cmesh, __pyx_k_subdomain_cmesh, sizeof(__pyx_k_subdomain_cmesh), 0, 0, 1, 1},
22666  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
22667  {&__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},
22668  {&__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},
22669  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22670  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
22671  {0, 0, 0, 0, 0, 0, 0}
22672 };
22673 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
22674  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error)
22675  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 133, __pyx_L1_error)
22676  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 148, __pyx_L1_error)
22677  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 151, __pyx_L1_error)
22678  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(2, 180, __pyx_L1_error)
22679  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error)
22680  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 404, __pyx_L1_error)
22681  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 613, __pyx_L1_error)
22682  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 832, __pyx_L1_error)
22683  return 0;
22684  __pyx_L1_error:;
22685  return -1;
22686 }
22687 
22688 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
22689  __Pyx_RefNannyDeclarations
22690  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
22691 
22692  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
22693  * __pyx_import_array()
22694  * except Exception:
22695  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
22696  *
22697  * cdef inline int import_umath() except -1:
22698  */
22699  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 945, __pyx_L1_error)
22700  __Pyx_GOTREF(__pyx_tuple_);
22701  __Pyx_GIVEREF(__pyx_tuple_);
22702 
22703  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
22704  * _import_umath()
22705  * except Exception:
22706  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
22707  *
22708  * cdef inline int import_ufunc() except -1:
22709  */
22710  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 951, __pyx_L1_error)
22711  __Pyx_GOTREF(__pyx_tuple__2);
22712  __Pyx_GIVEREF(__pyx_tuple__2);
22713 
22714  /* "View.MemoryView":133
22715  *
22716  * if not self.ndim:
22717  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
22718  *
22719  * if itemsize <= 0:
22720  */
22721  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(2, 133, __pyx_L1_error)
22722  __Pyx_GOTREF(__pyx_tuple__3);
22723  __Pyx_GIVEREF(__pyx_tuple__3);
22724 
22725  /* "View.MemoryView":136
22726  *
22727  * if itemsize <= 0:
22728  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
22729  *
22730  * if not isinstance(format, bytes):
22731  */
22732  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(2, 136, __pyx_L1_error)
22733  __Pyx_GOTREF(__pyx_tuple__4);
22734  __Pyx_GIVEREF(__pyx_tuple__4);
22735 
22736  /* "View.MemoryView":148
22737  *
22738  * if not self._shape:
22739  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
22740  *
22741  *
22742  */
22743  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 148, __pyx_L1_error)
22744  __Pyx_GOTREF(__pyx_tuple__5);
22745  __Pyx_GIVEREF(__pyx_tuple__5);
22746 
22747  /* "View.MemoryView":176
22748  * self.data = <char *>malloc(self.len)
22749  * if not self.data:
22750  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
22751  *
22752  * if self.dtype_is_object:
22753  */
22754  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 176, __pyx_L1_error)
22755  __Pyx_GOTREF(__pyx_tuple__6);
22756  __Pyx_GIVEREF(__pyx_tuple__6);
22757 
22758  /* "View.MemoryView":192
22759  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
22760  * if not (flags & bufmode):
22761  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
22762  * info.buf = self.data
22763  * info.len = self.len
22764  */
22765  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 192, __pyx_L1_error)
22766  __Pyx_GOTREF(__pyx_tuple__7);
22767  __Pyx_GIVEREF(__pyx_tuple__7);
22768 
22769  /* "(tree fragment)":2
22770  * def __reduce_cython__(self):
22771  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22772  * def __setstate_cython__(self, __pyx_state):
22773  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22774  */
22775  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 2, __pyx_L1_error)
22776  __Pyx_GOTREF(__pyx_tuple__8);
22777  __Pyx_GIVEREF(__pyx_tuple__8);
22778 
22779  /* "(tree fragment)":4
22780  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22781  * def __setstate_cython__(self, __pyx_state):
22782  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22783  */
22784  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 4, __pyx_L1_error)
22785  __Pyx_GOTREF(__pyx_tuple__9);
22786  __Pyx_GIVEREF(__pyx_tuple__9);
22787 
22788  /* "View.MemoryView":418
22789  * def __setitem__(memoryview self, object index, object value):
22790  * if self.view.readonly:
22791  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
22792  *
22793  * have_slices, index = _unellipsify(index, self.view.ndim)
22794  */
22795  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 418, __pyx_L1_error)
22796  __Pyx_GOTREF(__pyx_tuple__10);
22797  __Pyx_GIVEREF(__pyx_tuple__10);
22798 
22799  /* "View.MemoryView":495
22800  * result = struct.unpack(self.view.format, bytesitem)
22801  * except struct.error:
22802  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
22803  * else:
22804  * if len(self.view.format) == 1:
22805  */
22806  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 495, __pyx_L1_error)
22807  __Pyx_GOTREF(__pyx_tuple__11);
22808  __Pyx_GIVEREF(__pyx_tuple__11);
22809 
22810  /* "View.MemoryView":520
22811  * def __getbuffer__(self, Py_buffer *info, int flags):
22812  * if flags & PyBUF_WRITABLE and self.view.readonly:
22813  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
22814  *
22815  * if flags & PyBUF_ND:
22816  */
22817  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 520, __pyx_L1_error)
22818  __Pyx_GOTREF(__pyx_tuple__12);
22819  __Pyx_GIVEREF(__pyx_tuple__12);
22820 
22821  /* "View.MemoryView":570
22822  * if self.view.strides == NULL:
22823  *
22824  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
22825  *
22826  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
22827  */
22828  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 570, __pyx_L1_error)
22829  __Pyx_GOTREF(__pyx_tuple__13);
22830  __Pyx_GIVEREF(__pyx_tuple__13);
22831 
22832  /* "View.MemoryView":577
22833  * def suboffsets(self):
22834  * if self.view.suboffsets == NULL:
22835  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
22836  *
22837  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22838  */
22839  __pyx_tuple__14 = PyTuple_New(1); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 577, __pyx_L1_error)
22840  __Pyx_GOTREF(__pyx_tuple__14);
22841  __Pyx_INCREF(__pyx_int_neg_1);
22842  __Pyx_GIVEREF(__pyx_int_neg_1);
22843  PyTuple_SET_ITEM(__pyx_tuple__14, 0, __pyx_int_neg_1);
22844  __Pyx_GIVEREF(__pyx_tuple__14);
22845 
22846  /* "(tree fragment)":2
22847  * def __reduce_cython__(self):
22848  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22849  * def __setstate_cython__(self, __pyx_state):
22850  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22851  */
22852  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 2, __pyx_L1_error)
22853  __Pyx_GOTREF(__pyx_tuple__15);
22854  __Pyx_GIVEREF(__pyx_tuple__15);
22855 
22856  /* "(tree fragment)":4
22857  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22858  * def __setstate_cython__(self, __pyx_state):
22859  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22860  */
22861  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 4, __pyx_L1_error)
22862  __Pyx_GOTREF(__pyx_tuple__16);
22863  __Pyx_GIVEREF(__pyx_tuple__16);
22864 
22865  /* "View.MemoryView":682
22866  * if item is Ellipsis:
22867  * if not seen_ellipsis:
22868  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
22869  * seen_ellipsis = True
22870  * else:
22871  */
22872  __pyx_slice__17 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(2, 682, __pyx_L1_error)
22873  __Pyx_GOTREF(__pyx_slice__17);
22874  __Pyx_GIVEREF(__pyx_slice__17);
22875 
22876  /* "View.MemoryView":703
22877  * for suboffset in suboffsets[:ndim]:
22878  * if suboffset >= 0:
22879  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
22880  *
22881  *
22882  */
22883  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 703, __pyx_L1_error)
22884  __Pyx_GOTREF(__pyx_tuple__18);
22885  __Pyx_GIVEREF(__pyx_tuple__18);
22886 
22887  /* "(tree fragment)":2
22888  * def __reduce_cython__(self):
22889  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22890  * def __setstate_cython__(self, __pyx_state):
22891  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22892  */
22893  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 2, __pyx_L1_error)
22894  __Pyx_GOTREF(__pyx_tuple__19);
22895  __Pyx_GIVEREF(__pyx_tuple__19);
22896 
22897  /* "(tree fragment)":4
22898  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22899  * def __setstate_cython__(self, __pyx_state):
22900  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22901  */
22902  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 4, __pyx_L1_error)
22903  __Pyx_GOTREF(__pyx_tuple__20);
22904  __Pyx_GIVEREF(__pyx_tuple__20);
22905  __pyx_tuple__21 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 4, __pyx_L1_error)
22906  __Pyx_GOTREF(__pyx_tuple__21);
22907  __Pyx_GIVEREF(__pyx_tuple__21);
22908 
22909  /* "cpartitioning.pyx":20
22910  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
22911  *
22912  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
22913  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22914  * c_partitionElements(comm.ob_mpi,
22915  */
22916  __pyx_tuple__27 = PyTuple_Pack(4, __pyx_n_s_comm, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 20, __pyx_L1_error)
22917  __Pyx_GOTREF(__pyx_tuple__27);
22918  __Pyx_GIVEREF(__pyx_tuple__27);
22919  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionElements, 20, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 20, __pyx_L1_error)
22920 
22921  /* "cpartitioning.pyx":36
22922  * )
22923  *
22924  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
22925  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22926  * c_partitionNodes(comm.ob_mpi,
22927  */
22928  __pyx_tuple__29 = PyTuple_Pack(4, __pyx_n_s_comm, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 36, __pyx_L1_error)
22929  __Pyx_GOTREF(__pyx_tuple__29);
22930  __Pyx_GIVEREF(__pyx_tuple__29);
22931  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionNodes, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 36, __pyx_L1_error)
22932 
22933  /* "cpartitioning.pyx":52
22934  * )
22935  *
22936  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
22937  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
22938  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22939  */
22940  __pyx_tuple__31 = PyTuple_Pack(3, __pyx_n_s_comm, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 52, __pyx_L1_error)
22941  __Pyx_GOTREF(__pyx_tuple__31);
22942  __Pyx_GIVEREF(__pyx_tuple__31);
22943  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_convertPUMIPartitionToPython, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 52, __pyx_L1_error)
22944 
22945  /* "cpartitioning.pyx":66
22946  * )
22947  *
22948  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
22949  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22950  * if not isinstance(filebase, bytes):
22951  */
22952  __pyx_tuple__33 = PyTuple_Pack(6, __pyx_n_s_comm, __pyx_n_s_filebase, __pyx_n_s_indexBase, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 66, __pyx_L1_error)
22953  __Pyx_GOTREF(__pyx_tuple__33);
22954  __Pyx_GIVEREF(__pyx_tuple__33);
22955  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionNodesFromTetgenFiles, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 66, __pyx_L1_error)
22956 
22957  /* "cpartitioning.pyx":86
22958  * )
22959  *
22960  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
22961  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22962  * if not isinstance(filebase, bytes):
22963  */
22964  __pyx_tuple__35 = PyTuple_Pack(6, __pyx_n_s_comm, __pyx_n_s_filebase, __pyx_n_s_indexBase, __pyx_n_s_nLayersOfOverlap, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 86, __pyx_L1_error)
22965  __Pyx_GOTREF(__pyx_tuple__35);
22966  __Pyx_GIVEREF(__pyx_tuple__35);
22967  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_partitionNodesFromTriangleFiles, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 86, __pyx_L1_error)
22968 
22969  /* "cpartitioning.pyx":106
22970  * )
22971  *
22972  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
22973  * int nSpace,
22974  * cmeshTools.CMesh cmesh,
22975  */
22976  __pyx_tuple__37 = PyTuple_Pack(19, __pyx_n_s_comm, __pyx_n_s_nSpace, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_nodeOffsets_subdomain_owned, __pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_n_s_edgeOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_nodeNumbering_subdomain2global, __pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_n_s_edgeNumbering_subdomain2global, __pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_n_s_quadratic_subdomain_l2g, __pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_n_s_quadratic_lagrangeNodes, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 106, __pyx_L1_error)
22977  __Pyx_GOTREF(__pyx_tuple__37);
22978  __Pyx_GIVEREF(__pyx_tuple__37);
22979  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(16, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildQuadraticLocal2GlobalMappin, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 106, __pyx_L1_error)
22980 
22981  /* "cpartitioning.pyx":171
22982  * max_dof_neighbors)
22983  *
22984  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
22985  * int nSpace,
22986  * cmeshTools.CMesh cmesh,
22987  */
22988  __pyx_tuple__39 = PyTuple_Pack(19, __pyx_n_s_comm, __pyx_n_s_nSpace, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_nodeOffsets_subdomain_owned, __pyx_n_s_elementBoundaryOffsets_subdomain, __pyx_n_s_edgeOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_nodeNumbering_subdomain2global, __pyx_n_s_elementBoundaryNumbering_subdoma, __pyx_n_s_edgeNumbering_subdomain2global, __pyx_n_s_quadratic_dof_offsets_subdomain, __pyx_n_s_quadratic_subdomain_l2g, __pyx_n_s_quadraticNumbering_subdomain2glo, __pyx_n_s_quadratic_lagrangeNodes, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 171, __pyx_L1_error)
22989  __Pyx_GOTREF(__pyx_tuple__39);
22990  __Pyx_GIVEREF(__pyx_tuple__39);
22991  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(16, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildQuadraticCubeLocal2GlobalMa, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 171, __pyx_L1_error)
22992 
22993  /* "cpartitioning.pyx":212
22994  * max_dof_neighbors)
22995  *
22996  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
22997  * int nDOF_element,
22998  * cmeshTools.CMesh cmesh,
22999  */
23000  __pyx_tuple__41 = PyTuple_Pack(12, __pyx_n_s_comm, __pyx_n_s_nDOF_element, __pyx_n_s_cmesh, __pyx_n_s_subdomain_cmesh, __pyx_n_s_elementOffsets_subdomain_owned, __pyx_n_s_elementNumbering_subdomain2globa, __pyx_n_s_dg_dof_offsets_subdomain_owned, __pyx_n_s_dg_subdomain_l2g, __pyx_n_s_dgNumbering_subdomain2global, __pyx_n_s_nDOF_all_processes, __pyx_n_s_nDOF_subdomain, __pyx_n_s_max_dof_neighbors); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 212, __pyx_L1_error)
23001  __Pyx_GOTREF(__pyx_tuple__41);
23002  __Pyx_GIVEREF(__pyx_tuple__41);
23003  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpartitioning_pyx, __pyx_n_s_buildDiscontinuousGalerkinLocal2, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 212, __pyx_L1_error)
23004 
23005  /* "View.MemoryView":286
23006  * return self.name
23007  *
23008  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23009  * cdef strided = Enum("<strided and direct>") # default
23010  * cdef indirect = Enum("<strided and indirect>")
23011  */
23012  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 286, __pyx_L1_error)
23013  __Pyx_GOTREF(__pyx_tuple__43);
23014  __Pyx_GIVEREF(__pyx_tuple__43);
23015 
23016  /* "View.MemoryView":287
23017  *
23018  * cdef generic = Enum("<strided and direct or indirect>")
23019  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23020  * cdef indirect = Enum("<strided and indirect>")
23021  *
23022  */
23023  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(2, 287, __pyx_L1_error)
23024  __Pyx_GOTREF(__pyx_tuple__44);
23025  __Pyx_GIVEREF(__pyx_tuple__44);
23026 
23027  /* "View.MemoryView":288
23028  * cdef generic = Enum("<strided and direct or indirect>")
23029  * cdef strided = Enum("<strided and direct>") # default
23030  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23031  *
23032  *
23033  */
23034  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(2, 288, __pyx_L1_error)
23035  __Pyx_GOTREF(__pyx_tuple__45);
23036  __Pyx_GIVEREF(__pyx_tuple__45);
23037 
23038  /* "View.MemoryView":291
23039  *
23040  *
23041  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23042  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23043  *
23044  */
23045  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(2, 291, __pyx_L1_error)
23046  __Pyx_GOTREF(__pyx_tuple__46);
23047  __Pyx_GIVEREF(__pyx_tuple__46);
23048 
23049  /* "View.MemoryView":292
23050  *
23051  * cdef contiguous = Enum("<contiguous and direct>")
23052  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23053  *
23054  *
23055  */
23056  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 292, __pyx_L1_error)
23057  __Pyx_GOTREF(__pyx_tuple__47);
23058  __Pyx_GIVEREF(__pyx_tuple__47);
23059 
23060  /* "(tree fragment)":1
23061  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23062  * cdef object __pyx_PickleError
23063  * cdef object __pyx_result
23064  */
23065  __pyx_tuple__48 = 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__48)) __PYX_ERR(2, 1, __pyx_L1_error)
23066  __Pyx_GOTREF(__pyx_tuple__48);
23067  __Pyx_GIVEREF(__pyx_tuple__48);
23068  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(2, 1, __pyx_L1_error)
23069  __Pyx_RefNannyFinishContext();
23070  return 0;
23071  __pyx_L1_error:;
23072  __Pyx_RefNannyFinishContext();
23073  return -1;
23074 }
23075 
23076 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
23077  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23078  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23079  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23080  __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
23081  __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
23082  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23083  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23084  return 0;
23085  __pyx_L1_error:;
23086  return -1;
23087 }
23088 
23089 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
23090 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
23091 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
23092 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
23093 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
23094 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
23095 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
23096 
23097 static int __Pyx_modinit_global_init_code(void) {
23098  __Pyx_RefNannyDeclarations
23099  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
23100  /*--- Global init code ---*/
23101  generic = Py_None; Py_INCREF(Py_None);
23102  strided = Py_None; Py_INCREF(Py_None);
23103  indirect = Py_None; Py_INCREF(Py_None);
23104  contiguous = Py_None; Py_INCREF(Py_None);
23105  indirect_contiguous = Py_None; Py_INCREF(Py_None);
23106  __Pyx_RefNannyFinishContext();
23107  return 0;
23108 }
23109 
23110 static int __Pyx_modinit_variable_export_code(void) {
23111  __Pyx_RefNannyDeclarations
23112  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
23113  /*--- Variable export code ---*/
23114  __Pyx_RefNannyFinishContext();
23115  return 0;
23116 }
23117 
23118 static int __Pyx_modinit_function_export_code(void) {
23119  __Pyx_RefNannyDeclarations
23120  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
23121  /*--- Function export code ---*/
23122  __Pyx_RefNannyFinishContext();
23123  return 0;
23124 }
23125 
23126 static int __Pyx_modinit_type_init_code(void) {
23127  __Pyx_RefNannyDeclarations
23128  int __pyx_lineno = 0;
23129  const char *__pyx_filename = NULL;
23130  int __pyx_clineno = 0;
23131  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
23132  /*--- Type init code ---*/
23133  __pyx_vtabptr_array = &__pyx_vtable_array;
23134  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
23135  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
23136  #if PY_VERSION_HEX < 0x030800B1
23137  __pyx_type___pyx_array.tp_print = 0;
23138  #endif
23139  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
23140  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 105, __pyx_L1_error)
23141  __pyx_array_type = &__pyx_type___pyx_array;
23142  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
23143  #if PY_VERSION_HEX < 0x030800B1
23144  __pyx_type___pyx_MemviewEnum.tp_print = 0;
23145  #endif
23146  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23147  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23148  }
23149  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 279, __pyx_L1_error)
23150  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23151  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23152  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23153  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23154  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23155  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23156  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23157  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
23158  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23159  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
23160  #if PY_VERSION_HEX < 0x030800B1
23161  __pyx_type___pyx_memoryview.tp_print = 0;
23162  #endif
23163  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23164  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23165  }
23166  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
23167  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 330, __pyx_L1_error)
23168  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23169  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23170  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23171  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
23172  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23173  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23174  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
23175  #if PY_VERSION_HEX < 0x030800B1
23176  __pyx_type___pyx_memoryviewslice.tp_print = 0;
23177  #endif
23178  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23179  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23180  }
23181  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
23182  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 965, __pyx_L1_error)
23183  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23184  __Pyx_RefNannyFinishContext();
23185  return 0;
23186  __pyx_L1_error:;
23187  __Pyx_RefNannyFinishContext();
23188  return -1;
23189 }
23190 
23191 static int __Pyx_modinit_type_import_code(void) {
23192  __Pyx_RefNannyDeclarations
23193  PyObject *__pyx_t_1 = NULL;
23194  int __pyx_lineno = 0;
23195  const char *__pyx_filename = NULL;
23196  int __pyx_clineno = 0;
23197  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
23198  /*--- Type import code ---*/
23199  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
23200  __Pyx_GOTREF(__pyx_t_1);
23201  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
23202  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23203  sizeof(PyTypeObject),
23204  #else
23205  sizeof(PyHeapTypeObject),
23206  #endif
23207  __Pyx_ImportType_CheckSize_Warn);
23208  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
23209  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23210  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
23211  __Pyx_GOTREF(__pyx_t_1);
23212  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23213  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
23214  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
23215  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
23216  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
23217  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
23218  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23219  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
23220  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23221  if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
23222  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23223  if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
23224  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23225  if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
23226  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23227  if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
23228  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23229  if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
23230  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23231  if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
23232  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23233  if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
23234  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23235  if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
23236  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23237  if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
23238  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23239  if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
23240  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
23241  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
23242  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23243  __pyx_t_1 = PyImport_ImportModule("mpi4py.MPI"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 28, __pyx_L1_error)
23244  __Pyx_GOTREF(__pyx_t_1);
23245  __pyx_ptype_6mpi4py_3MPI_Datatype = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Datatype", sizeof(struct PyMPIDatatypeObject), __Pyx_ImportType_CheckSize_Warn);
23246  if (!__pyx_ptype_6mpi4py_3MPI_Datatype) __PYX_ERR(4, 28, __pyx_L1_error)
23247  __pyx_ptype_6mpi4py_3MPI_Status = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Status", sizeof(struct PyMPIStatusObject), __Pyx_ImportType_CheckSize_Warn);
23248  if (!__pyx_ptype_6mpi4py_3MPI_Status) __PYX_ERR(4, 36, __pyx_L1_error)
23249  __pyx_ptype_6mpi4py_3MPI_Request = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Request", sizeof(struct PyMPIRequestObject), __Pyx_ImportType_CheckSize_Warn);
23250  if (!__pyx_ptype_6mpi4py_3MPI_Request) __PYX_ERR(4, 44, __pyx_L1_error)
23251  __pyx_ptype_6mpi4py_3MPI_Prequest = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Prequest", sizeof(struct PyMPIPrequestObject), __Pyx_ImportType_CheckSize_Warn);
23252  if (!__pyx_ptype_6mpi4py_3MPI_Prequest) __PYX_ERR(4, 53, __pyx_L1_error)
23253  __pyx_ptype_6mpi4py_3MPI_Grequest = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Grequest", sizeof(struct PyMPIGrequestObject), __Pyx_ImportType_CheckSize_Warn);
23254  if (!__pyx_ptype_6mpi4py_3MPI_Grequest) __PYX_ERR(4, 59, __pyx_L1_error)
23255  __pyx_ptype_6mpi4py_3MPI_Message = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Message", sizeof(struct PyMPIMessageObject), __Pyx_ImportType_CheckSize_Warn);
23256  if (!__pyx_ptype_6mpi4py_3MPI_Message) __PYX_ERR(4, 65, __pyx_L1_error)
23257  __pyx_ptype_6mpi4py_3MPI_Op = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Op", sizeof(struct PyMPIOpObject), __Pyx_ImportType_CheckSize_Warn);
23258  if (!__pyx_ptype_6mpi4py_3MPI_Op) __PYX_ERR(4, 74, __pyx_L1_error)
23259  __pyx_ptype_6mpi4py_3MPI_Group = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Group", sizeof(struct PyMPIGroupObject), __Pyx_ImportType_CheckSize_Warn);
23260  if (!__pyx_ptype_6mpi4py_3MPI_Group) __PYX_ERR(4, 84, __pyx_L1_error)
23261  __pyx_ptype_6mpi4py_3MPI_Info = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Info", sizeof(struct PyMPIInfoObject), __Pyx_ImportType_CheckSize_Warn);
23262  if (!__pyx_ptype_6mpi4py_3MPI_Info) __PYX_ERR(4, 92, __pyx_L1_error)
23263  __pyx_ptype_6mpi4py_3MPI_Errhandler = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Errhandler", sizeof(struct PyMPIErrhandlerObject), __Pyx_ImportType_CheckSize_Warn);
23264  if (!__pyx_ptype_6mpi4py_3MPI_Errhandler) __PYX_ERR(4, 100, __pyx_L1_error)
23265  __pyx_ptype_6mpi4py_3MPI_Comm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Comm", sizeof(struct PyMPICommObject), __Pyx_ImportType_CheckSize_Warn);
23266  if (!__pyx_ptype_6mpi4py_3MPI_Comm) __PYX_ERR(4, 108, __pyx_L1_error)
23267  __pyx_ptype_6mpi4py_3MPI_Intracomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Intracomm", sizeof(struct PyMPIIntracommObject), __Pyx_ImportType_CheckSize_Warn);
23268  if (!__pyx_ptype_6mpi4py_3MPI_Intracomm) __PYX_ERR(4, 116, __pyx_L1_error)
23269  __pyx_ptype_6mpi4py_3MPI_Topocomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Topocomm", sizeof(struct PyMPITopocommObject), __Pyx_ImportType_CheckSize_Warn);
23270  if (!__pyx_ptype_6mpi4py_3MPI_Topocomm) __PYX_ERR(4, 122, __pyx_L1_error)
23271  __pyx_ptype_6mpi4py_3MPI_Cartcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Cartcomm", sizeof(struct PyMPICartcommObject), __Pyx_ImportType_CheckSize_Warn);
23272  if (!__pyx_ptype_6mpi4py_3MPI_Cartcomm) __PYX_ERR(4, 128, __pyx_L1_error)
23273  __pyx_ptype_6mpi4py_3MPI_Graphcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Graphcomm", sizeof(struct PyMPIGraphcommObject), __Pyx_ImportType_CheckSize_Warn);
23274  if (!__pyx_ptype_6mpi4py_3MPI_Graphcomm) __PYX_ERR(4, 134, __pyx_L1_error)
23275  __pyx_ptype_6mpi4py_3MPI_Distgraphcomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Distgraphcomm", sizeof(struct PyMPIDistgraphcommObject), __Pyx_ImportType_CheckSize_Warn);
23276  if (!__pyx_ptype_6mpi4py_3MPI_Distgraphcomm) __PYX_ERR(4, 140, __pyx_L1_error)
23277  __pyx_ptype_6mpi4py_3MPI_Intercomm = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Intercomm", sizeof(struct PyMPIIntercommObject), __Pyx_ImportType_CheckSize_Warn);
23278  if (!__pyx_ptype_6mpi4py_3MPI_Intercomm) __PYX_ERR(4, 146, __pyx_L1_error)
23279  __pyx_ptype_6mpi4py_3MPI_Win = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "Win", sizeof(struct PyMPIWinObject), __Pyx_ImportType_CheckSize_Warn);
23280  if (!__pyx_ptype_6mpi4py_3MPI_Win) __PYX_ERR(4, 152, __pyx_L1_error)
23281  __pyx_ptype_6mpi4py_3MPI_File = __Pyx_ImportType(__pyx_t_1, "mpi4py.MPI", "File", sizeof(struct PyMPIFileObject), __Pyx_ImportType_CheckSize_Warn);
23282  if (!__pyx_ptype_6mpi4py_3MPI_File) __PYX_ERR(4, 161, __pyx_L1_error)
23283  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23284  __pyx_t_1 = PyImport_ImportModule("proteus.cmeshTools"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 5, __pyx_L1_error)
23285  __Pyx_GOTREF(__pyx_t_1);
23286  __pyx_ptype_7proteus_10cmeshTools_CMesh = __Pyx_ImportType(__pyx_t_1, "proteus.cmeshTools", "CMesh", sizeof(struct __pyx_obj_7proteus_10cmeshTools_CMesh), __Pyx_ImportType_CheckSize_Warn);
23287  if (!__pyx_ptype_7proteus_10cmeshTools_CMesh) __PYX_ERR(5, 5, __pyx_L1_error)
23288  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23289  __Pyx_RefNannyFinishContext();
23290  return 0;
23291  __pyx_L1_error:;
23292  __Pyx_XDECREF(__pyx_t_1);
23293  __Pyx_RefNannyFinishContext();
23294  return -1;
23295 }
23296 
23297 static int __Pyx_modinit_variable_import_code(void) {
23298  __Pyx_RefNannyDeclarations
23299  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
23300  /*--- Variable import code ---*/
23301  __Pyx_RefNannyFinishContext();
23302  return 0;
23303 }
23304 
23305 static int __Pyx_modinit_function_import_code(void) {
23306  __Pyx_RefNannyDeclarations
23307  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
23308  /*--- Function import code ---*/
23309  __Pyx_RefNannyFinishContext();
23310  return 0;
23311 }
23312 
23313 
23314 #ifndef CYTHON_NO_PYINIT_EXPORT
23315 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23316 #elif PY_MAJOR_VERSION < 3
23317 #ifdef __cplusplus
23318 #define __Pyx_PyMODINIT_FUNC extern "C" void
23319 #else
23320 #define __Pyx_PyMODINIT_FUNC void
23321 #endif
23322 #else
23323 #ifdef __cplusplus
23324 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
23325 #else
23326 #define __Pyx_PyMODINIT_FUNC PyObject *
23327 #endif
23328 #endif
23329 
23330 
23331 #if PY_MAJOR_VERSION < 3
23332 __Pyx_PyMODINIT_FUNC initcpartitioning(void) CYTHON_SMALL_CODE; /*proto*/
23333 __Pyx_PyMODINIT_FUNC initcpartitioning(void)
23334 #else
23335 __Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void) CYTHON_SMALL_CODE; /*proto*/
23336 __Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void)
23337 #if CYTHON_PEP489_MULTI_PHASE_INIT
23338 {
23339  return PyModuleDef_Init(&__pyx_moduledef);
23340 }
23341 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
23342  #if PY_VERSION_HEX >= 0x030700A1
23343  static PY_INT64_T main_interpreter_id = -1;
23344  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23345  if (main_interpreter_id == -1) {
23346  main_interpreter_id = current_id;
23347  return (unlikely(current_id == -1)) ? -1 : 0;
23348  } else if (unlikely(main_interpreter_id != current_id))
23349  #else
23350  static PyInterpreterState *main_interpreter = NULL;
23351  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23352  if (!main_interpreter) {
23353  main_interpreter = current_interpreter;
23354  } else if (unlikely(main_interpreter != current_interpreter))
23355  #endif
23356  {
23357  PyErr_SetString(
23358  PyExc_ImportError,
23359  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23360  return -1;
23361  }
23362  return 0;
23363 }
23364 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) {
23365  PyObject *value = PyObject_GetAttrString(spec, from_name);
23366  int result = 0;
23367  if (likely(value)) {
23368  if (allow_none || value != Py_None) {
23369  result = PyDict_SetItemString(moddict, to_name, value);
23370  }
23371  Py_DECREF(value);
23372  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23373  PyErr_Clear();
23374  } else {
23375  result = -1;
23376  }
23377  return result;
23378 }
23379 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23380  PyObject *module = NULL, *moddict, *modname;
23381  if (__Pyx_check_single_interpreter())
23382  return NULL;
23383  if (__pyx_m)
23384  return __Pyx_NewRef(__pyx_m);
23385  modname = PyObject_GetAttrString(spec, "name");
23386  if (unlikely(!modname)) goto bad;
23387  module = PyModule_NewObject(modname);
23388  Py_DECREF(modname);
23389  if (unlikely(!module)) goto bad;
23390  moddict = PyModule_GetDict(module);
23391  if (unlikely(!moddict)) goto bad;
23392  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
23393  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
23394  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
23395  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
23396  return module;
23397 bad:
23398  Py_XDECREF(module);
23399  return NULL;
23400 }
23401 
23402 
23403 static CYTHON_SMALL_CODE int __pyx_pymod_exec_cpartitioning(PyObject *__pyx_pyinit_module)
23404 #endif
23405 #endif
23406 {
23407  PyObject *__pyx_t_1 = NULL;
23408  PyObject *__pyx_t_2 = NULL;
23409  static PyThread_type_lock __pyx_t_3[8];
23410  int __pyx_lineno = 0;
23411  const char *__pyx_filename = NULL;
23412  int __pyx_clineno = 0;
23413  __Pyx_RefNannyDeclarations
23414  #if CYTHON_PEP489_MULTI_PHASE_INIT
23415  if (__pyx_m) {
23416  if (__pyx_m == __pyx_pyinit_module) return 0;
23417  PyErr_SetString(PyExc_RuntimeError, "Module 'cpartitioning' has already been imported. Re-initialisation is not supported.");
23418  return -1;
23419  }
23420  #elif PY_MAJOR_VERSION >= 3
23421  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
23422  #endif
23423  #if CYTHON_REFNANNY
23424 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
23425 if (!__Pyx_RefNanny) {
23426  PyErr_Clear();
23427  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
23428  if (!__Pyx_RefNanny)
23429  Py_FatalError("failed to import 'refnanny' module");
23430 }
23431 #endif
23432  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void)", 0);
23433  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23434  #ifdef __Pxy_PyFrame_Initialize_Offsets
23435  __Pxy_PyFrame_Initialize_Offsets();
23436  #endif
23437  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23438  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23439  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23440  #ifdef __Pyx_CyFunction_USED
23441  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23442  #endif
23443  #ifdef __Pyx_FusedFunction_USED
23444  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23445  #endif
23446  #ifdef __Pyx_Coroutine_USED
23447  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23448  #endif
23449  #ifdef __Pyx_Generator_USED
23450  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23451  #endif
23452  #ifdef __Pyx_AsyncGen_USED
23453  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23454  #endif
23455  #ifdef __Pyx_StopAsyncIteration_USED
23456  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23457  #endif
23458  /*--- Library function declarations ---*/
23459  /*--- Threads initialization code ---*/
23460  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23461  PyEval_InitThreads();
23462  #endif
23463  /*--- Module creation code ---*/
23464  #if CYTHON_PEP489_MULTI_PHASE_INIT
23465  __pyx_m = __pyx_pyinit_module;
23466  Py_INCREF(__pyx_m);
23467  #else
23468  #if PY_MAJOR_VERSION < 3
23469  __pyx_m = Py_InitModule4("cpartitioning", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23470  #else
23471  __pyx_m = PyModule_Create(&__pyx_moduledef);
23472  #endif
23473  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23474  #endif
23475  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23476  Py_INCREF(__pyx_d);
23477  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23478  Py_INCREF(__pyx_b);
23479  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23480  Py_INCREF(__pyx_cython_runtime);
23481  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23482  /*--- Initialize various global constants etc. ---*/
23483  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23484  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23485  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23486  #endif
23487  if (__pyx_module_is_main_cpartitioning) {
23488  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23489  }
23490  #if PY_MAJOR_VERSION >= 3
23491  {
23492  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23493  if (!PyDict_GetItemString(modules, "cpartitioning")) {
23494  if (unlikely(PyDict_SetItemString(modules, "cpartitioning", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23495  }
23496  }
23497  #endif
23498  /*--- Builtin init code ---*/
23499  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23500  /*--- Constants init code ---*/
23501  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23502  /*--- Global type/function init code ---*/
23503  (void)__Pyx_modinit_global_init_code();
23504  (void)__Pyx_modinit_variable_export_code();
23505  (void)__Pyx_modinit_function_export_code();
23506  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23507  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23508  (void)__Pyx_modinit_variable_import_code();
23509  (void)__Pyx_modinit_function_import_code();
23510  /*--- Execution code ---*/
23511  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23512  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23513  #endif
23514 
23515  /* "cpartitioning.pyx":2
23516  * # A type of -*- python -*- file
23517  * from proteus import Comm as proteus_Comm # <<<<<<<<<<<<<<
23518  * import numpy as np
23519  * cimport numpy as np
23520  */
23521  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
23522  __Pyx_GOTREF(__pyx_t_1);
23523  __Pyx_INCREF(__pyx_n_s_Comm);
23524  __Pyx_GIVEREF(__pyx_n_s_Comm);
23525  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Comm);
23526  __pyx_t_2 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error)
23527  __Pyx_GOTREF(__pyx_t_2);
23528  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23529  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Comm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
23530  __Pyx_GOTREF(__pyx_t_1);
23531  if (PyDict_SetItem(__pyx_d, __pyx_n_s_proteus_Comm, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
23532  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23533  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23534 
23535  /* "cpartitioning.pyx":3
23536  * # A type of -*- python -*- file
23537  * from proteus import Comm as proteus_Comm
23538  * import numpy as np # <<<<<<<<<<<<<<
23539  * cimport numpy as np
23540  * from mpi4py.MPI cimport (Comm,
23541  */
23542  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
23543  __Pyx_GOTREF(__pyx_t_2);
23544  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
23545  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23546 
23547  /* "cpartitioning.pyx":20
23548  * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
23549  *
23550  * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23551  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23552  * c_partitionElements(comm.ob_mpi,
23553  */
23554  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_1partitionElements, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
23555  __Pyx_GOTREF(__pyx_t_2);
23556  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionElements, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23557  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23558 
23559  /* "cpartitioning.pyx":36
23560  * )
23561  *
23562  * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23563  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23564  * c_partitionNodes(comm.ob_mpi,
23565  */
23566  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_3partitionNodes, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
23567  __Pyx_GOTREF(__pyx_t_2);
23568  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionNodes, __pyx_t_2) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
23569  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23570 
23571  /* "cpartitioning.pyx":52
23572  * )
23573  *
23574  * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23575  * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
23576  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23577  */
23578  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_5convertPUMIPartitionToPython, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
23579  __Pyx_GOTREF(__pyx_t_2);
23580  if (PyDict_SetItem(__pyx_d, __pyx_n_s_convertPUMIPartitionToPython, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
23581  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23582 
23583  /* "cpartitioning.pyx":66
23584  * )
23585  *
23586  * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23587  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23588  * if not isinstance(filebase, bytes):
23589  */
23590  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_7partitionNodesFromTetgenFiles, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error)
23591  __Pyx_GOTREF(__pyx_t_2);
23592  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionNodesFromTetgenFiles, __pyx_t_2) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
23593  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23594 
23595  /* "cpartitioning.pyx":86
23596  * )
23597  *
23598  * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23599  * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23600  * if not isinstance(filebase, bytes):
23601  */
23602  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_9partitionNodesFromTriangleFiles, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
23603  __Pyx_GOTREF(__pyx_t_2);
23604  if (PyDict_SetItem(__pyx_d, __pyx_n_s_partitionNodesFromTriangleFiles, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
23605  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23606 
23607  /* "cpartitioning.pyx":106
23608  * )
23609  *
23610  * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23611  * int nSpace,
23612  * cmeshTools.CMesh cmesh,
23613  */
23614  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_11buildQuadraticLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
23615  __Pyx_GOTREF(__pyx_t_2);
23616  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildQuadraticLocal2GlobalMappin, __pyx_t_2) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
23617  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23618 
23619  /* "cpartitioning.pyx":171
23620  * max_dof_neighbors)
23621  *
23622  * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23623  * int nSpace,
23624  * cmeshTools.CMesh cmesh,
23625  */
23626  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
23627  __Pyx_GOTREF(__pyx_t_2);
23628  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildQuadraticCubeLocal2GlobalMa, __pyx_t_2) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
23629  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23630 
23631  /* "cpartitioning.pyx":212
23632  * max_dof_neighbors)
23633  *
23634  * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
23635  * int nDOF_element,
23636  * cmeshTools.CMesh cmesh,
23637  */
23638  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings, NULL, __pyx_n_s_cpartitioning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error)
23639  __Pyx_GOTREF(__pyx_t_2);
23640  if (PyDict_SetItem(__pyx_d, __pyx_n_s_buildDiscontinuousGalerkinLocal2, __pyx_t_2) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
23641  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23642 
23643  /* "cpartitioning.pyx":1
23644  * # A type of -*- python -*- file # <<<<<<<<<<<<<<
23645  * from proteus import Comm as proteus_Comm
23646  * import numpy as np
23647  */
23648  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
23649  __Pyx_GOTREF(__pyx_t_2);
23650  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23651  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23652 
23653  /* "View.MemoryView":209
23654  * info.obj = self
23655  *
23656  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23657  *
23658  * def __dealloc__(array self):
23659  */
23660  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 209, __pyx_L1_error)
23661  __Pyx_GOTREF(__pyx_t_2);
23662  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 209, __pyx_L1_error)
23663  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23664  PyType_Modified(__pyx_array_type);
23665 
23666  /* "View.MemoryView":286
23667  * return self.name
23668  *
23669  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23670  * cdef strided = Enum("<strided and direct>") # default
23671  * cdef indirect = Enum("<strided and indirect>")
23672  */
23673  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 286, __pyx_L1_error)
23674  __Pyx_GOTREF(__pyx_t_2);
23675  __Pyx_XGOTREF(generic);
23676  __Pyx_DECREF_SET(generic, __pyx_t_2);
23677  __Pyx_GIVEREF(__pyx_t_2);
23678  __pyx_t_2 = 0;
23679 
23680  /* "View.MemoryView":287
23681  *
23682  * cdef generic = Enum("<strided and direct or indirect>")
23683  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23684  * cdef indirect = Enum("<strided and indirect>")
23685  *
23686  */
23687  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 287, __pyx_L1_error)
23688  __Pyx_GOTREF(__pyx_t_2);
23689  __Pyx_XGOTREF(strided);
23690  __Pyx_DECREF_SET(strided, __pyx_t_2);
23691  __Pyx_GIVEREF(__pyx_t_2);
23692  __pyx_t_2 = 0;
23693 
23694  /* "View.MemoryView":288
23695  * cdef generic = Enum("<strided and direct or indirect>")
23696  * cdef strided = Enum("<strided and direct>") # default
23697  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23698  *
23699  *
23700  */
23701  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 288, __pyx_L1_error)
23702  __Pyx_GOTREF(__pyx_t_2);
23703  __Pyx_XGOTREF(indirect);
23704  __Pyx_DECREF_SET(indirect, __pyx_t_2);
23705  __Pyx_GIVEREF(__pyx_t_2);
23706  __pyx_t_2 = 0;
23707 
23708  /* "View.MemoryView":291
23709  *
23710  *
23711  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23712  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23713  *
23714  */
23715  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 291, __pyx_L1_error)
23716  __Pyx_GOTREF(__pyx_t_2);
23717  __Pyx_XGOTREF(contiguous);
23718  __Pyx_DECREF_SET(contiguous, __pyx_t_2);
23719  __Pyx_GIVEREF(__pyx_t_2);
23720  __pyx_t_2 = 0;
23721 
23722  /* "View.MemoryView":292
23723  *
23724  * cdef contiguous = Enum("<contiguous and direct>")
23725  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23726  *
23727  *
23728  */
23729  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 292, __pyx_L1_error)
23730  __Pyx_GOTREF(__pyx_t_2);
23731  __Pyx_XGOTREF(indirect_contiguous);
23732  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
23733  __Pyx_GIVEREF(__pyx_t_2);
23734  __pyx_t_2 = 0;
23735 
23736  /* "View.MemoryView":316
23737  *
23738  * DEF THREAD_LOCKS_PREALLOCATED = 8
23739  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
23740  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
23741  * PyThread_allocate_lock(),
23742  */
23743  __pyx_memoryview_thread_locks_used = 0;
23744 
23745  /* "View.MemoryView":317
23746  * DEF THREAD_LOCKS_PREALLOCATED = 8
23747  * cdef int __pyx_memoryview_thread_locks_used = 0
23748  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
23749  * PyThread_allocate_lock(),
23750  * PyThread_allocate_lock(),
23751  */
23752  __pyx_t_3[0] = PyThread_allocate_lock();
23753  __pyx_t_3[1] = PyThread_allocate_lock();
23754  __pyx_t_3[2] = PyThread_allocate_lock();
23755  __pyx_t_3[3] = PyThread_allocate_lock();
23756  __pyx_t_3[4] = PyThread_allocate_lock();
23757  __pyx_t_3[5] = PyThread_allocate_lock();
23758  __pyx_t_3[6] = PyThread_allocate_lock();
23759  __pyx_t_3[7] = PyThread_allocate_lock();
23760  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23761 
23762  /* "View.MemoryView":549
23763  * info.obj = self
23764  *
23765  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23766  *
23767  *
23768  */
23769  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 549, __pyx_L1_error)
23770  __Pyx_GOTREF(__pyx_t_2);
23771  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 549, __pyx_L1_error)
23772  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23773  PyType_Modified(__pyx_memoryview_type);
23774 
23775  /* "View.MemoryView":995
23776  * return self.from_object
23777  *
23778  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23779  *
23780  *
23781  */
23782  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 995, __pyx_L1_error)
23783  __Pyx_GOTREF(__pyx_t_2);
23784  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(2, 995, __pyx_L1_error)
23785  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23786  PyType_Modified(__pyx_memoryviewslice_type);
23787 
23788  /* "(tree fragment)":1
23789  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23790  * cdef object __pyx_PickleError
23791  * cdef object __pyx_result
23792  */
23793  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1, __pyx_L1_error)
23794  __Pyx_GOTREF(__pyx_t_2);
23795  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
23796  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23797 
23798  /* "BufferFormatFromTypeInfo":1463
23799  *
23800  * @cname('__pyx_format_from_typeinfo')
23801  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
23802  * cdef __Pyx_StructField *field
23803  * cdef __pyx_typeinfo_string fmt
23804  */
23805 
23806  /*--- Wrapped vars code ---*/
23807 
23808  goto __pyx_L0;
23809  __pyx_L1_error:;
23810  __Pyx_XDECREF(__pyx_t_1);
23811  __Pyx_XDECREF(__pyx_t_2);
23812  if (__pyx_m) {
23813  if (__pyx_d) {
23814  __Pyx_AddTraceback("init cpartitioning", __pyx_clineno, __pyx_lineno, __pyx_filename);
23815  }
23816  Py_CLEAR(__pyx_m);
23817  } else if (!PyErr_Occurred()) {
23818  PyErr_SetString(PyExc_ImportError, "init cpartitioning");
23819  }
23820  __pyx_L0:;
23821  __Pyx_RefNannyFinishContext();
23822  #if CYTHON_PEP489_MULTI_PHASE_INIT
23823  return (__pyx_m != NULL) ? 0 : -1;
23824  #elif PY_MAJOR_VERSION >= 3
23825  return __pyx_m;
23826  #else
23827  return;
23828  #endif
23829 }
23830 
23831 /* --- Runtime support code --- */
23832 /* Refnanny */
23833 #if CYTHON_REFNANNY
23834 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
23835  PyObject *m = NULL, *p = NULL;
23836  void *r = NULL;
23837  m = PyImport_ImportModule(modname);
23838  if (!m) goto end;
23839  p = PyObject_GetAttrString(m, "RefNannyAPI");
23840  if (!p) goto end;
23841  r = PyLong_AsVoidPtr(p);
23842 end:
23843  Py_XDECREF(p);
23844  Py_XDECREF(m);
23845  return (__Pyx_RefNannyAPIStruct *)r;
23846 }
23847 #endif
23848 
23849 /* RaiseArgTupleInvalid */
23850 static void __Pyx_RaiseArgtupleInvalid(
23851  const char* func_name,
23852  int exact,
23853  Py_ssize_t num_min,
23854  Py_ssize_t num_max,
23855  Py_ssize_t num_found)
23856 {
23857  Py_ssize_t num_expected;
23858  const char *more_or_less;
23859  if (num_found < num_min) {
23860  num_expected = num_min;
23861  more_or_less = "at least";
23862  } else {
23863  num_expected = num_max;
23864  more_or_less = "at most";
23865  }
23866  if (exact) {
23867  more_or_less = "exactly";
23868  }
23869  PyErr_Format(PyExc_TypeError,
23870  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
23871  func_name, more_or_less, num_expected,
23872  (num_expected == 1) ? "" : "s", num_found);
23873 }
23874 
23875 /* RaiseDoubleKeywords */
23876 static void __Pyx_RaiseDoubleKeywordsError(
23877  const char* func_name,
23878  PyObject* kw_name)
23879 {
23880  PyErr_Format(PyExc_TypeError,
23881  #if PY_MAJOR_VERSION >= 3
23882  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23883  #else
23884  "%s() got multiple values for keyword argument '%s'", func_name,
23885  PyString_AsString(kw_name));
23886  #endif
23887 }
23888 
23889 /* ParseKeywords */
23890 static int __Pyx_ParseOptionalKeywords(
23891  PyObject *kwds,
23892  PyObject **argnames[],
23893  PyObject *kwds2,
23894  PyObject *values[],
23895  Py_ssize_t num_pos_args,
23896  const char* function_name)
23897 {
23898  PyObject *key = 0, *value = 0;
23899  Py_ssize_t pos = 0;
23900  PyObject*** name;
23901  PyObject*** first_kw_arg = argnames + num_pos_args;
23902  while (PyDict_Next(kwds, &pos, &key, &value)) {
23903  name = first_kw_arg;
23904  while (*name && (**name != key)) name++;
23905  if (*name) {
23906  values[name-argnames] = value;
23907  continue;
23908  }
23909  name = first_kw_arg;
23910  #if PY_MAJOR_VERSION < 3
23911  if (likely(PyString_Check(key))) {
23912  while (*name) {
23913  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23914  && _PyString_Eq(**name, key)) {
23915  values[name-argnames] = value;
23916  break;
23917  }
23918  name++;
23919  }
23920  if (*name) continue;
23921  else {
23922  PyObject*** argname = argnames;
23923  while (argname != first_kw_arg) {
23924  if ((**argname == key) || (
23925  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23926  && _PyString_Eq(**argname, key))) {
23927  goto arg_passed_twice;
23928  }
23929  argname++;
23930  }
23931  }
23932  } else
23933  #endif
23934  if (likely(PyUnicode_Check(key))) {
23935  while (*name) {
23936  int cmp = (**name == key) ? 0 :
23937  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23938  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23939  #endif
23940  PyUnicode_Compare(**name, key);
23941  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23942  if (cmp == 0) {
23943  values[name-argnames] = value;
23944  break;
23945  }
23946  name++;
23947  }
23948  if (*name) continue;
23949  else {
23950  PyObject*** argname = argnames;
23951  while (argname != first_kw_arg) {
23952  int cmp = (**argname == key) ? 0 :
23953  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23954  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23955  #endif
23956  PyUnicode_Compare(**argname, key);
23957  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23958  if (cmp == 0) goto arg_passed_twice;
23959  argname++;
23960  }
23961  }
23962  } else
23963  goto invalid_keyword_type;
23964  if (kwds2) {
23965  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
23966  } else {
23967  goto invalid_keyword;
23968  }
23969  }
23970  return 0;
23971 arg_passed_twice:
23972  __Pyx_RaiseDoubleKeywordsError(function_name, key);
23973  goto bad;
23974 invalid_keyword_type:
23975  PyErr_Format(PyExc_TypeError,
23976  "%.200s() keywords must be strings", function_name);
23977  goto bad;
23978 invalid_keyword:
23979  PyErr_Format(PyExc_TypeError,
23980  #if PY_MAJOR_VERSION < 3
23981  "%.200s() got an unexpected keyword argument '%.200s'",
23982  function_name, PyString_AsString(key));
23983  #else
23984  "%s() got an unexpected keyword argument '%U'",
23985  function_name, key);
23986  #endif
23987 bad:
23988  return -1;
23989 }
23990 
23991 /* ArgTypeTest */
23992 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
23993 {
23994  if (unlikely(!type)) {
23995  PyErr_SetString(PyExc_SystemError, "Missing type object");
23996  return 0;
23997  }
23998  else if (exact) {
23999  #if PY_MAJOR_VERSION == 2
24000  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
24001  #endif
24002  }
24003  else {
24004  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
24005  }
24006  PyErr_Format(PyExc_TypeError,
24007  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24008  name, type->tp_name, Py_TYPE(obj)->tp_name);
24009  return 0;
24010 }
24011 
24012 /* PyObjectGetAttrStr */
24013 #if CYTHON_USE_TYPE_SLOTS
24014 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24015  PyTypeObject* tp = Py_TYPE(obj);
24016  if (likely(tp->tp_getattro))
24017  return tp->tp_getattro(obj, attr_name);
24018 #if PY_MAJOR_VERSION < 3
24019  if (likely(tp->tp_getattr))
24020  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24021 #endif
24022  return PyObject_GetAttr(obj, attr_name);
24023 }
24024 #endif
24025 
24026 /* GetBuiltinName */
24027 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24028  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24029  if (unlikely(!result)) {
24030  PyErr_Format(PyExc_NameError,
24031 #if PY_MAJOR_VERSION >= 3
24032  "name '%U' is not defined", name);
24033 #else
24034  "name '%.200s' is not defined", PyString_AS_STRING(name));
24035 #endif
24036  }
24037  return result;
24038 }
24039 
24040 /* PyDictVersioning */
24041 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24042 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24043  PyObject *dict = Py_TYPE(obj)->tp_dict;
24044  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24045 }
24046 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24047  PyObject **dictptr = NULL;
24048  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24049  if (offset) {
24050 #if CYTHON_COMPILING_IN_CPYTHON
24051  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
24052 #else
24053  dictptr = _PyObject_GetDictPtr(obj);
24054 #endif
24055  }
24056  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24057 }
24058 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24059  PyObject *dict = Py_TYPE(obj)->tp_dict;
24060  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24061  return 0;
24062  return obj_dict_version == __Pyx_get_object_dict_version(obj);
24063 }
24064 #endif
24065 
24066 /* GetModuleGlobalName */
24067 #if CYTHON_USE_DICT_VERSIONS
24068 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24069 #else
24070 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24071 #endif
24072 {
24073  PyObject *result;
24074 #if !CYTHON_AVOID_BORROWED_REFS
24075 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24076  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24077  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24078  if (likely(result)) {
24079  return __Pyx_NewRef(result);
24080  } else if (unlikely(PyErr_Occurred())) {
24081  return NULL;
24082  }
24083 #else
24084  result = PyDict_GetItem(__pyx_d, name);
24085  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24086  if (likely(result)) {
24087  return __Pyx_NewRef(result);
24088  }
24089 #endif
24090 #else
24091  result = PyObject_GetItem(__pyx_d, name);
24092  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24093  if (likely(result)) {
24094  return __Pyx_NewRef(result);
24095  }
24096  PyErr_Clear();
24097 #endif
24098  return __Pyx_GetBuiltinName(name);
24099 }
24100 
24101 /* PyIntBinop */
24102 #if !CYTHON_COMPILING_IN_PYPY
24103 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
24104  (void)inplace;
24105  (void)zerodivision_check;
24106  #if PY_MAJOR_VERSION < 3
24107  if (likely(PyInt_CheckExact(op1))) {
24108  const long b = intval;
24109  long x;
24110  long a = PyInt_AS_LONG(op1);
24111  x = (long)((unsigned long)a + b);
24112  if (likely((x^a) >= 0 || (x^b) >= 0))
24113  return PyInt_FromLong(x);
24114  return PyLong_Type.tp_as_number->nb_add(op1, op2);
24115  }
24116  #endif
24117  #if CYTHON_USE_PYLONG_INTERNALS
24118  if (likely(PyLong_CheckExact(op1))) {
24119  const long b = intval;
24120  long a, x;
24121 #ifdef HAVE_LONG_LONG
24122  const PY_LONG_LONG llb = intval;
24123  PY_LONG_LONG lla, llx;
24124 #endif
24125  const digit* digits = ((PyLongObject*)op1)->ob_digit;
24126  const Py_ssize_t size = Py_SIZE(op1);
24127  if (likely(__Pyx_sst_abs(size) <= 1)) {
24128  a = likely(size) ? digits[0] : 0;
24129  if (size == -1) a = -a;
24130  } else {
24131  switch (size) {
24132  case -2:
24133  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24134  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24135  break;
24136 #ifdef HAVE_LONG_LONG
24137  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24138  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24139  goto long_long;
24140 #endif
24141  }
24142  CYTHON_FALLTHROUGH;
24143  case 2:
24144  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24145  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24146  break;
24147 #ifdef HAVE_LONG_LONG
24148  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
24149  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
24150  goto long_long;
24151 #endif
24152  }
24153  CYTHON_FALLTHROUGH;
24154  case -3:
24155  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24156  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24157  break;
24158 #ifdef HAVE_LONG_LONG
24159  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24160  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]));
24161  goto long_long;
24162 #endif
24163  }
24164  CYTHON_FALLTHROUGH;
24165  case 3:
24166  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24167  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24168  break;
24169 #ifdef HAVE_LONG_LONG
24170  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
24171  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]));
24172  goto long_long;
24173 #endif
24174  }
24175  CYTHON_FALLTHROUGH;
24176  case -4:
24177  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24178  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24179  break;
24180 #ifdef HAVE_LONG_LONG
24181  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24182  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]));
24183  goto long_long;
24184 #endif
24185  }
24186  CYTHON_FALLTHROUGH;
24187  case 4:
24188  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24189  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24190  break;
24191 #ifdef HAVE_LONG_LONG
24192  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
24193  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]));
24194  goto long_long;
24195 #endif
24196  }
24197  CYTHON_FALLTHROUGH;
24198  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
24199  }
24200  }
24201  x = a + b;
24202  return PyLong_FromLong(x);
24203 #ifdef HAVE_LONG_LONG
24204  long_long:
24205  llx = lla + llb;
24206  return PyLong_FromLongLong(llx);
24207 #endif
24208 
24209 
24210  }
24211  #endif
24212  if (PyFloat_CheckExact(op1)) {
24213  const long b = intval;
24214  double a = PyFloat_AS_DOUBLE(op1);
24215  double result;
24216  PyFPE_START_PROTECT("add", return NULL)
24217  result = ((double)a) + (double)b;
24218  PyFPE_END_PROTECT(result)
24219  return PyFloat_FromDouble(result);
24220  }
24221  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
24222 }
24223 #endif
24224 
24225 /* PyCFunctionFastCall */
24226 #if CYTHON_FAST_PYCCALL
24227 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24228  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24229  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24230  PyObject *self = PyCFunction_GET_SELF(func);
24231  int flags = PyCFunction_GET_FLAGS(func);
24232  assert(PyCFunction_Check(func));
24233  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24234  assert(nargs >= 0);
24235  assert(nargs == 0 || args != NULL);
24236  /* _PyCFunction_FastCallDict() must not be called with an exception set,
24237  because it may clear it (directly or indirectly) and so the
24238  caller loses its exception */
24239  assert(!PyErr_Occurred());
24240  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24241  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
24242  } else {
24243  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
24244  }
24245 }
24246 #endif
24247 
24248 /* PyFunctionFastCall */
24249 #if CYTHON_FAST_PYCALL
24250 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24251  PyObject *globals) {
24252  PyFrameObject *f;
24253  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24254  PyObject **fastlocals;
24255  Py_ssize_t i;
24256  PyObject *result;
24257  assert(globals != NULL);
24258  /* XXX Perhaps we should create a specialized
24259  PyFrame_New() that doesn't take locals, but does
24260  take builtins without sanity checking them.
24261  */
24262  assert(tstate != NULL);
24263  f = PyFrame_New(tstate, co, globals, NULL);
24264  if (f == NULL) {
24265  return NULL;
24266  }
24267  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
24268  for (i = 0; i < na; i++) {
24269  Py_INCREF(*args);
24270  fastlocals[i] = *args++;
24271  }
24272  result = PyEval_EvalFrameEx(f,0);
24273  ++tstate->recursion_depth;
24274  Py_DECREF(f);
24275  --tstate->recursion_depth;
24276  return result;
24277 }
24278 #if 1 || PY_VERSION_HEX < 0x030600B1
24279 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24280  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24281  PyObject *globals = PyFunction_GET_GLOBALS(func);
24282  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24283  PyObject *closure;
24284 #if PY_MAJOR_VERSION >= 3
24285  PyObject *kwdefs;
24286 #endif
24287  PyObject *kwtuple, **k;
24288  PyObject **d;
24289  Py_ssize_t nd;
24290  Py_ssize_t nk;
24291  PyObject *result;
24292  assert(kwargs == NULL || PyDict_Check(kwargs));
24293  nk = kwargs ? PyDict_Size(kwargs) : 0;
24294  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
24295  return NULL;
24296  }
24297  if (
24298 #if PY_MAJOR_VERSION >= 3
24299  co->co_kwonlyargcount == 0 &&
24300 #endif
24301  likely(kwargs == NULL || nk == 0) &&
24302  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24303  if (argdefs == NULL && co->co_argcount == nargs) {
24304  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24305  goto done;
24306  }
24307  else if (nargs == 0 && argdefs != NULL
24308  && co->co_argcount == Py_SIZE(argdefs)) {
24309  /* function called with no arguments, but all parameters have
24310  a default value: use default values as arguments .*/
24311  args = &PyTuple_GET_ITEM(argdefs, 0);
24312  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24313  goto done;
24314  }
24315  }
24316  if (kwargs != NULL) {
24317  Py_ssize_t pos, i;
24318  kwtuple = PyTuple_New(2 * nk);
24319  if (kwtuple == NULL) {
24320  result = NULL;
24321  goto done;
24322  }
24323  k = &PyTuple_GET_ITEM(kwtuple, 0);
24324  pos = i = 0;
24325  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24326  Py_INCREF(k[i]);
24327  Py_INCREF(k[i+1]);
24328  i += 2;
24329  }
24330  nk = i / 2;
24331  }
24332  else {
24333  kwtuple = NULL;
24334  k = NULL;
24335  }
24336  closure = PyFunction_GET_CLOSURE(func);
24337 #if PY_MAJOR_VERSION >= 3
24338  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24339 #endif
24340  if (argdefs != NULL) {
24341  d = &PyTuple_GET_ITEM(argdefs, 0);
24342  nd = Py_SIZE(argdefs);
24343  }
24344  else {
24345  d = NULL;
24346  nd = 0;
24347  }
24348 #if PY_MAJOR_VERSION >= 3
24349  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24350  args, (int)nargs,
24351  k, (int)nk,
24352  d, (int)nd, kwdefs, closure);
24353 #else
24354  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24355  args, (int)nargs,
24356  k, (int)nk,
24357  d, (int)nd, closure);
24358 #endif
24359  Py_XDECREF(kwtuple);
24360 done:
24361  Py_LeaveRecursiveCall();
24362  return result;
24363 }
24364 #endif
24365 #endif
24366 
24367 /* PyObjectCall */
24368 #if CYTHON_COMPILING_IN_CPYTHON
24369 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24370  PyObject *result;
24371  ternaryfunc call = Py_TYPE(func)->tp_call;
24372  if (unlikely(!call))
24373  return PyObject_Call(func, arg, kw);
24374  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24375  return NULL;
24376  result = (*call)(func, arg, kw);
24377  Py_LeaveRecursiveCall();
24378  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24379  PyErr_SetString(
24380  PyExc_SystemError,
24381  "NULL result without error in PyObject_Call");
24382  }
24383  return result;
24384 }
24385 #endif
24386 
24387 /* PyObjectCall2Args */
24388 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
24389  PyObject *args, *result = NULL;
24390  #if CYTHON_FAST_PYCALL
24391  if (PyFunction_Check(function)) {
24392  PyObject *args[2] = {arg1, arg2};
24393  return __Pyx_PyFunction_FastCall(function, args, 2);
24394  }
24395  #endif
24396  #if CYTHON_FAST_PYCCALL
24397  if (__Pyx_PyFastCFunction_Check(function)) {
24398  PyObject *args[2] = {arg1, arg2};
24399  return __Pyx_PyCFunction_FastCall(function, args, 2);
24400  }
24401  #endif
24402  args = PyTuple_New(2);
24403  if (unlikely(!args)) goto done;
24404  Py_INCREF(arg1);
24405  PyTuple_SET_ITEM(args, 0, arg1);
24406  Py_INCREF(arg2);
24407  PyTuple_SET_ITEM(args, 1, arg2);
24408  Py_INCREF(function);
24409  result = __Pyx_PyObject_Call(function, args, NULL);
24410  Py_DECREF(args);
24411  Py_DECREF(function);
24412 done:
24413  return result;
24414 }
24415 
24416 /* PyObjectCallMethO */
24417 #if CYTHON_COMPILING_IN_CPYTHON
24418 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24419  PyObject *self, *result;
24420  PyCFunction cfunc;
24421  cfunc = PyCFunction_GET_FUNCTION(func);
24422  self = PyCFunction_GET_SELF(func);
24423  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24424  return NULL;
24425  result = cfunc(self, arg);
24426  Py_LeaveRecursiveCall();
24427  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24428  PyErr_SetString(
24429  PyExc_SystemError,
24430  "NULL result without error in PyObject_Call");
24431  }
24432  return result;
24433 }
24434 #endif
24435 
24436 /* PyObjectCallOneArg */
24437 #if CYTHON_COMPILING_IN_CPYTHON
24438 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24439  PyObject *result;
24440  PyObject *args = PyTuple_New(1);
24441  if (unlikely(!args)) return NULL;
24442  Py_INCREF(arg);
24443  PyTuple_SET_ITEM(args, 0, arg);
24444  result = __Pyx_PyObject_Call(func, args, NULL);
24445  Py_DECREF(args);
24446  return result;
24447 }
24448 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24449 #if CYTHON_FAST_PYCALL
24450  if (PyFunction_Check(func)) {
24451  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24452  }
24453 #endif
24454  if (likely(PyCFunction_Check(func))) {
24455  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24456  return __Pyx_PyObject_CallMethO(func, arg);
24457 #if CYTHON_FAST_PYCCALL
24458  } else if (__Pyx_PyFastCFunction_Check(func)) {
24459  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24460 #endif
24461  }
24462  }
24463  return __Pyx__PyObject_CallOneArg(func, arg);
24464 }
24465 #else
24466 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24467  PyObject *result;
24468  PyObject *args = PyTuple_Pack(1, arg);
24469  if (unlikely(!args)) return NULL;
24470  result = __Pyx_PyObject_Call(func, args, NULL);
24471  Py_DECREF(args);
24472  return result;
24473 }
24474 #endif
24475 
24476 /* PyObjectCallNoArg */
24477 #if CYTHON_COMPILING_IN_CPYTHON
24478 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24479 #if CYTHON_FAST_PYCALL
24480  if (PyFunction_Check(func)) {
24481  return __Pyx_PyFunction_FastCall(func, NULL, 0);
24482  }
24483 #endif
24484 #ifdef __Pyx_CyFunction_USED
24485  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24486 #else
24487  if (likely(PyCFunction_Check(func)))
24488 #endif
24489  {
24490  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24491  return __Pyx_PyObject_CallMethO(func, NULL);
24492  }
24493  }
24494  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24495 }
24496 #endif
24497 
24498 /* GetTopmostException */
24499 #if CYTHON_USE_EXC_INFO_STACK
24500 static _PyErr_StackItem *
24501 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
24502 {
24503  _PyErr_StackItem *exc_info = tstate->exc_info;
24504  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
24505  exc_info->previous_item != NULL)
24506  {
24507  exc_info = exc_info->previous_item;
24508  }
24509  return exc_info;
24510 }
24511 #endif
24512 
24513 /* SaveResetException */
24514 #if CYTHON_FAST_THREAD_STATE
24515 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24516  #if CYTHON_USE_EXC_INFO_STACK
24517  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
24518  *type = exc_info->exc_type;
24519  *value = exc_info->exc_value;
24520  *tb = exc_info->exc_traceback;
24521  #else
24522  *type = tstate->exc_type;
24523  *value = tstate->exc_value;
24524  *tb = tstate->exc_traceback;
24525  #endif
24526  Py_XINCREF(*type);
24527  Py_XINCREF(*value);
24528  Py_XINCREF(*tb);
24529 }
24530 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24531  PyObject *tmp_type, *tmp_value, *tmp_tb;
24532  #if CYTHON_USE_EXC_INFO_STACK
24533  _PyErr_StackItem *exc_info = tstate->exc_info;
24534  tmp_type = exc_info->exc_type;
24535  tmp_value = exc_info->exc_value;
24536  tmp_tb = exc_info->exc_traceback;
24537  exc_info->exc_type = type;
24538  exc_info->exc_value = value;
24539  exc_info->exc_traceback = tb;
24540  #else
24541  tmp_type = tstate->exc_type;
24542  tmp_value = tstate->exc_value;
24543  tmp_tb = tstate->exc_traceback;
24544  tstate->exc_type = type;
24545  tstate->exc_value = value;
24546  tstate->exc_traceback = tb;
24547  #endif
24548  Py_XDECREF(tmp_type);
24549  Py_XDECREF(tmp_value);
24550  Py_XDECREF(tmp_tb);
24551 }
24552 #endif
24553 
24554 /* PyErrExceptionMatches */
24555 #if CYTHON_FAST_THREAD_STATE
24556 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24557  Py_ssize_t i, n;
24558  n = PyTuple_GET_SIZE(tuple);
24559 #if PY_MAJOR_VERSION >= 3
24560  for (i=0; i<n; i++) {
24561  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24562  }
24563 #endif
24564  for (i=0; i<n; i++) {
24565  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
24566  }
24567  return 0;
24568 }
24569 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24570  PyObject *exc_type = tstate->curexc_type;
24571  if (exc_type == err) return 1;
24572  if (unlikely(!exc_type)) return 0;
24573  if (unlikely(PyTuple_Check(err)))
24574  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24575  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24576 }
24577 #endif
24578 
24579 /* GetException */
24580 #if CYTHON_FAST_THREAD_STATE
24581 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
24582 #else
24583 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
24584 #endif
24585 {
24586  PyObject *local_type, *local_value, *local_tb;
24587 #if CYTHON_FAST_THREAD_STATE
24588  PyObject *tmp_type, *tmp_value, *tmp_tb;
24589  local_type = tstate->curexc_type;
24590  local_value = tstate->curexc_value;
24591  local_tb = tstate->curexc_traceback;
24592  tstate->curexc_type = 0;
24593  tstate->curexc_value = 0;
24594  tstate->curexc_traceback = 0;
24595 #else
24596  PyErr_Fetch(&local_type, &local_value, &local_tb);
24597 #endif
24598  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
24599 #if CYTHON_FAST_THREAD_STATE
24600  if (unlikely(tstate->curexc_type))
24601 #else
24602  if (unlikely(PyErr_Occurred()))
24603 #endif
24604  goto bad;
24605  #if PY_MAJOR_VERSION >= 3
24606  if (local_tb) {
24607  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
24608  goto bad;
24609  }
24610  #endif
24611  Py_XINCREF(local_tb);
24612  Py_XINCREF(local_type);
24613  Py_XINCREF(local_value);
24614  *type = local_type;
24615  *value = local_value;
24616  *tb = local_tb;
24617 #if CYTHON_FAST_THREAD_STATE
24618  #if CYTHON_USE_EXC_INFO_STACK
24619  {
24620  _PyErr_StackItem *exc_info = tstate->exc_info;
24621  tmp_type = exc_info->exc_type;
24622  tmp_value = exc_info->exc_value;
24623  tmp_tb = exc_info->exc_traceback;
24624  exc_info->exc_type = local_type;
24625  exc_info->exc_value = local_value;
24626  exc_info->exc_traceback = local_tb;
24627  }
24628  #else
24629  tmp_type = tstate->exc_type;
24630  tmp_value = tstate->exc_value;
24631  tmp_tb = tstate->exc_traceback;
24632  tstate->exc_type = local_type;
24633  tstate->exc_value = local_value;
24634  tstate->exc_traceback = local_tb;
24635  #endif
24636  Py_XDECREF(tmp_type);
24637  Py_XDECREF(tmp_value);
24638  Py_XDECREF(tmp_tb);
24639 #else
24640  PyErr_SetExcInfo(local_type, local_value, local_tb);
24641 #endif
24642  return 0;
24643 bad:
24644  *type = 0;
24645  *value = 0;
24646  *tb = 0;
24647  Py_XDECREF(local_type);
24648  Py_XDECREF(local_value);
24649  Py_XDECREF(local_tb);
24650  return -1;
24651 }
24652 
24653 /* PyErrFetchRestore */
24654 #if CYTHON_FAST_THREAD_STATE
24655 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24656  PyObject *tmp_type, *tmp_value, *tmp_tb;
24657  tmp_type = tstate->curexc_type;
24658  tmp_value = tstate->curexc_value;
24659  tmp_tb = tstate->curexc_traceback;
24660  tstate->curexc_type = type;
24661  tstate->curexc_value = value;
24662  tstate->curexc_traceback = tb;
24663  Py_XDECREF(tmp_type);
24664  Py_XDECREF(tmp_value);
24665  Py_XDECREF(tmp_tb);
24666 }
24667 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24668  *type = tstate->curexc_type;
24669  *value = tstate->curexc_value;
24670  *tb = tstate->curexc_traceback;
24671  tstate->curexc_type = 0;
24672  tstate->curexc_value = 0;
24673  tstate->curexc_traceback = 0;
24674 }
24675 #endif
24676 
24677 /* RaiseException */
24678 #if PY_MAJOR_VERSION < 3
24679 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24680  CYTHON_UNUSED PyObject *cause) {
24681  __Pyx_PyThreadState_declare
24682  Py_XINCREF(type);
24683  if (!value || value == Py_None)
24684  value = NULL;
24685  else
24686  Py_INCREF(value);
24687  if (!tb || tb == Py_None)
24688  tb = NULL;
24689  else {
24690  Py_INCREF(tb);
24691  if (!PyTraceBack_Check(tb)) {
24692  PyErr_SetString(PyExc_TypeError,
24693  "raise: arg 3 must be a traceback or None");
24694  goto raise_error;
24695  }
24696  }
24697  if (PyType_Check(type)) {
24698 #if CYTHON_COMPILING_IN_PYPY
24699  if (!value) {
24700  Py_INCREF(Py_None);
24701  value = Py_None;
24702  }
24703 #endif
24704  PyErr_NormalizeException(&type, &value, &tb);
24705  } else {
24706  if (value) {
24707  PyErr_SetString(PyExc_TypeError,
24708  "instance exception may not have a separate value");
24709  goto raise_error;
24710  }
24711  value = type;
24712  type = (PyObject*) Py_TYPE(type);
24713  Py_INCREF(type);
24714  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24715  PyErr_SetString(PyExc_TypeError,
24716  "raise: exception class must be a subclass of BaseException");
24717  goto raise_error;
24718  }
24719  }
24720  __Pyx_PyThreadState_assign
24721  __Pyx_ErrRestore(type, value, tb);
24722  return;
24723 raise_error:
24724  Py_XDECREF(value);
24725  Py_XDECREF(type);
24726  Py_XDECREF(tb);
24727  return;
24728 }
24729 #else
24730 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24731  PyObject* owned_instance = NULL;
24732  if (tb == Py_None) {
24733  tb = 0;
24734  } else if (tb && !PyTraceBack_Check(tb)) {
24735  PyErr_SetString(PyExc_TypeError,
24736  "raise: arg 3 must be a traceback or None");
24737  goto bad;
24738  }
24739  if (value == Py_None)
24740  value = 0;
24741  if (PyExceptionInstance_Check(type)) {
24742  if (value) {
24743  PyErr_SetString(PyExc_TypeError,
24744  "instance exception may not have a separate value");
24745  goto bad;
24746  }
24747  value = type;
24748  type = (PyObject*) Py_TYPE(value);
24749  } else if (PyExceptionClass_Check(type)) {
24750  PyObject *instance_class = NULL;
24751  if (value && PyExceptionInstance_Check(value)) {
24752  instance_class = (PyObject*) Py_TYPE(value);
24753  if (instance_class != type) {
24754  int is_subclass = PyObject_IsSubclass(instance_class, type);
24755  if (!is_subclass) {
24756  instance_class = NULL;
24757  } else if (unlikely(is_subclass == -1)) {
24758  goto bad;
24759  } else {
24760  type = instance_class;
24761  }
24762  }
24763  }
24764  if (!instance_class) {
24765  PyObject *args;
24766  if (!value)
24767  args = PyTuple_New(0);
24768  else if (PyTuple_Check(value)) {
24769  Py_INCREF(value);
24770  args = value;
24771  } else
24772  args = PyTuple_Pack(1, value);
24773  if (!args)
24774  goto bad;
24775  owned_instance = PyObject_Call(type, args, NULL);
24776  Py_DECREF(args);
24777  if (!owned_instance)
24778  goto bad;
24779  value = owned_instance;
24780  if (!PyExceptionInstance_Check(value)) {
24781  PyErr_Format(PyExc_TypeError,
24782  "calling %R should have returned an instance of "
24783  "BaseException, not %R",
24784  type, Py_TYPE(value));
24785  goto bad;
24786  }
24787  }
24788  } else {
24789  PyErr_SetString(PyExc_TypeError,
24790  "raise: exception class must be a subclass of BaseException");
24791  goto bad;
24792  }
24793  if (cause) {
24794  PyObject *fixed_cause;
24795  if (cause == Py_None) {
24796  fixed_cause = NULL;
24797  } else if (PyExceptionClass_Check(cause)) {
24798  fixed_cause = PyObject_CallObject(cause, NULL);
24799  if (fixed_cause == NULL)
24800  goto bad;
24801  } else if (PyExceptionInstance_Check(cause)) {
24802  fixed_cause = cause;
24803  Py_INCREF(fixed_cause);
24804  } else {
24805  PyErr_SetString(PyExc_TypeError,
24806  "exception causes must derive from "
24807  "BaseException");
24808  goto bad;
24809  }
24810  PyException_SetCause(value, fixed_cause);
24811  }
24812  PyErr_SetObject(type, value);
24813  if (tb) {
24814 #if CYTHON_COMPILING_IN_PYPY
24815  PyObject *tmp_type, *tmp_value, *tmp_tb;
24816  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24817  Py_INCREF(tb);
24818  PyErr_Restore(tmp_type, tmp_value, tb);
24819  Py_XDECREF(tmp_tb);
24820 #else
24821  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24822  PyObject* tmp_tb = tstate->curexc_traceback;
24823  if (tb != tmp_tb) {
24824  Py_INCREF(tb);
24825  tstate->curexc_traceback = tb;
24826  Py_XDECREF(tmp_tb);
24827  }
24828 #endif
24829  }
24830 bad:
24831  Py_XDECREF(owned_instance);
24832  return;
24833 }
24834 #endif
24835 
24836 /* BytesEquals */
24837 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
24838 #if CYTHON_COMPILING_IN_PYPY
24839  return PyObject_RichCompareBool(s1, s2, equals);
24840 #else
24841  if (s1 == s2) {
24842  return (equals == Py_EQ);
24843  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24844  const char *ps1, *ps2;
24845  Py_ssize_t length = PyBytes_GET_SIZE(s1);
24846  if (length != PyBytes_GET_SIZE(s2))
24847  return (equals == Py_NE);
24848  ps1 = PyBytes_AS_STRING(s1);
24849  ps2 = PyBytes_AS_STRING(s2);
24850  if (ps1[0] != ps2[0]) {
24851  return (equals == Py_NE);
24852  } else if (length == 1) {
24853  return (equals == Py_EQ);
24854  } else {
24855  int result;
24856 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
24857  Py_hash_t hash1, hash2;
24858  hash1 = ((PyBytesObject*)s1)->ob_shash;
24859  hash2 = ((PyBytesObject*)s2)->ob_shash;
24860  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24861  return (equals == Py_NE);
24862  }
24863 #endif
24864  result = memcmp(ps1, ps2, (size_t)length);
24865  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24866  }
24867  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
24868  return (equals == Py_NE);
24869  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
24870  return (equals == Py_NE);
24871  } else {
24872  int result;
24873  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24874  if (!py_result)
24875  return -1;
24876  result = __Pyx_PyObject_IsTrue(py_result);
24877  Py_DECREF(py_result);
24878  return result;
24879  }
24880 #endif
24881 }
24882 
24883 /* UnicodeEquals */
24884 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
24885 #if CYTHON_COMPILING_IN_PYPY
24886  return PyObject_RichCompareBool(s1, s2, equals);
24887 #else
24888 #if PY_MAJOR_VERSION < 3
24889  PyObject* owned_ref = NULL;
24890 #endif
24891  int s1_is_unicode, s2_is_unicode;
24892  if (s1 == s2) {
24893  goto return_eq;
24894  }
24895  s1_is_unicode = PyUnicode_CheckExact(s1);
24896  s2_is_unicode = PyUnicode_CheckExact(s2);
24897 #if PY_MAJOR_VERSION < 3
24898  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
24899  owned_ref = PyUnicode_FromObject(s2);
24900  if (unlikely(!owned_ref))
24901  return -1;
24902  s2 = owned_ref;
24903  s2_is_unicode = 1;
24904  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
24905  owned_ref = PyUnicode_FromObject(s1);
24906  if (unlikely(!owned_ref))
24907  return -1;
24908  s1 = owned_ref;
24909  s1_is_unicode = 1;
24910  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
24911  return __Pyx_PyBytes_Equals(s1, s2, equals);
24912  }
24913 #endif
24914  if (s1_is_unicode & s2_is_unicode) {
24915  Py_ssize_t length;
24916  int kind;
24917  void *data1, *data2;
24918  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
24919  return -1;
24920  length = __Pyx_PyUnicode_GET_LENGTH(s1);
24921  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
24922  goto return_ne;
24923  }
24924 #if CYTHON_USE_UNICODE_INTERNALS
24925  {
24926  Py_hash_t hash1, hash2;
24927  #if CYTHON_PEP393_ENABLED
24928  hash1 = ((PyASCIIObject*)s1)->hash;
24929  hash2 = ((PyASCIIObject*)s2)->hash;
24930  #else
24931  hash1 = ((PyUnicodeObject*)s1)->hash;
24932  hash2 = ((PyUnicodeObject*)s2)->hash;
24933  #endif
24934  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24935  goto return_ne;
24936  }
24937  }
24938 #endif
24939  kind = __Pyx_PyUnicode_KIND(s1);
24940  if (kind != __Pyx_PyUnicode_KIND(s2)) {
24941  goto return_ne;
24942  }
24943  data1 = __Pyx_PyUnicode_DATA(s1);
24944  data2 = __Pyx_PyUnicode_DATA(s2);
24945  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
24946  goto return_ne;
24947  } else if (length == 1) {
24948  goto return_eq;
24949  } else {
24950  int result = memcmp(data1, data2, (size_t)(length * kind));
24951  #if PY_MAJOR_VERSION < 3
24952  Py_XDECREF(owned_ref);
24953  #endif
24954  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24955  }
24956  } else if ((s1 == Py_None) & s2_is_unicode) {
24957  goto return_ne;
24958  } else if ((s2 == Py_None) & s1_is_unicode) {
24959  goto return_ne;
24960  } else {
24961  int result;
24962  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24963  #if PY_MAJOR_VERSION < 3
24964  Py_XDECREF(owned_ref);
24965  #endif
24966  if (!py_result)
24967  return -1;
24968  result = __Pyx_PyObject_IsTrue(py_result);
24969  Py_DECREF(py_result);
24970  return result;
24971  }
24972 return_eq:
24973  #if PY_MAJOR_VERSION < 3
24974  Py_XDECREF(owned_ref);
24975  #endif
24976  return (equals == Py_EQ);
24977 return_ne:
24978  #if PY_MAJOR_VERSION < 3
24979  Py_XDECREF(owned_ref);
24980  #endif
24981  return (equals == Py_NE);
24982 #endif
24983 }
24984 
24985 /* DivInt[Py_ssize_t] */
24986 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
24987  Py_ssize_t q = a / b;
24988  Py_ssize_t r = a - q*b;
24989  q -= ((r != 0) & ((r ^ b) < 0));
24990  return q;
24991 }
24992 
24993 /* GetAttr */
24994 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
24995 #if CYTHON_USE_TYPE_SLOTS
24996 #if PY_MAJOR_VERSION >= 3
24997  if (likely(PyUnicode_Check(n)))
24998 #else
24999  if (likely(PyString_Check(n)))
25000 #endif
25001  return __Pyx_PyObject_GetAttrStr(o, n);
25002 #endif
25003  return PyObject_GetAttr(o, n);
25004 }
25005 
25006 /* GetItemInt */
25007 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
25008  PyObject *r;
25009  if (!j) return NULL;
25010  r = PyObject_GetItem(o, j);
25011  Py_DECREF(j);
25012  return r;
25013 }
25014 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
25015  CYTHON_NCP_UNUSED int wraparound,
25016  CYTHON_NCP_UNUSED int boundscheck) {
25017 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25018  Py_ssize_t wrapped_i = i;
25019  if (wraparound & unlikely(i < 0)) {
25020  wrapped_i += PyList_GET_SIZE(o);
25021  }
25022  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
25023  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
25024  Py_INCREF(r);
25025  return r;
25026  }
25027  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25028 #else
25029  return PySequence_GetItem(o, i);
25030 #endif
25031 }
25032 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
25033  CYTHON_NCP_UNUSED int wraparound,
25034  CYTHON_NCP_UNUSED int boundscheck) {
25035 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25036  Py_ssize_t wrapped_i = i;
25037  if (wraparound & unlikely(i < 0)) {
25038  wrapped_i += PyTuple_GET_SIZE(o);
25039  }
25040  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
25041  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
25042  Py_INCREF(r);
25043  return r;
25044  }
25045  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25046 #else
25047  return PySequence_GetItem(o, i);
25048 #endif
25049 }
25050 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
25051  CYTHON_NCP_UNUSED int wraparound,
25052  CYTHON_NCP_UNUSED int boundscheck) {
25053 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
25054  if (is_list || PyList_CheckExact(o)) {
25055  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
25056  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
25057  PyObject *r = PyList_GET_ITEM(o, n);
25058  Py_INCREF(r);
25059  return r;
25060  }
25061  }
25062  else if (PyTuple_CheckExact(o)) {
25063  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
25064  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
25065  PyObject *r = PyTuple_GET_ITEM(o, n);
25066  Py_INCREF(r);
25067  return r;
25068  }
25069  } else {
25070  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
25071  if (likely(m && m->sq_item)) {
25072  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
25073  Py_ssize_t l = m->sq_length(o);
25074  if (likely(l >= 0)) {
25075  i += l;
25076  } else {
25077  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25078  return NULL;
25079  PyErr_Clear();
25080  }
25081  }
25082  return m->sq_item(o, i);
25083  }
25084  }
25085 #else
25086  if (is_list || PySequence_Check(o)) {
25087  return PySequence_GetItem(o, i);
25088  }
25089 #endif
25090  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25091 }
25092 
25093 /* ObjectGetItem */
25094 #if CYTHON_USE_TYPE_SLOTS
25095 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
25096  PyObject *runerr;
25097  Py_ssize_t key_value;
25098  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
25099  if (unlikely(!(m && m->sq_item))) {
25100  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
25101  return NULL;
25102  }
25103  key_value = __Pyx_PyIndex_AsSsize_t(index);
25104  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
25105  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
25106  }
25107  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
25108  PyErr_Clear();
25109  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
25110  }
25111  return NULL;
25112 }
25113 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
25114  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
25115  if (likely(m && m->mp_subscript)) {
25116  return m->mp_subscript(obj, key);
25117  }
25118  return __Pyx_PyObject_GetIndex(obj, key);
25119 }
25120 #endif
25121 
25122 /* decode_c_string */
25123 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25124  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25125  const char* encoding, const char* errors,
25126  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
25127  Py_ssize_t length;
25128  if (unlikely((start < 0) | (stop < 0))) {
25129  size_t slen = strlen(cstring);
25130  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
25131  PyErr_SetString(PyExc_OverflowError,
25132  "c-string too long to convert to Python");
25133  return NULL;
25134  }
25135  length = (Py_ssize_t) slen;
25136  if (start < 0) {
25137  start += length;
25138  if (start < 0)
25139  start = 0;
25140  }
25141  if (stop < 0)
25142  stop += length;
25143  }
25144  if (unlikely(stop <= start))
25145  return __Pyx_NewRef(__pyx_empty_unicode);
25146  length = stop - start;
25147  cstring += start;
25148  if (decode_func) {
25149  return decode_func(cstring, length, errors);
25150  } else {
25151  return PyUnicode_Decode(cstring, length, encoding, errors);
25152  }
25153 }
25154 
25155 /* GetAttr3 */
25156 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25157  __Pyx_PyThreadState_declare
25158  __Pyx_PyThreadState_assign
25159  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25160  return NULL;
25161  __Pyx_PyErr_Clear();
25162  Py_INCREF(d);
25163  return d;
25164 }
25165 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
25166  PyObject *r = __Pyx_GetAttr(o, n);
25167  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
25168 }
25169 
25170 /* RaiseTooManyValuesToUnpack */
25171 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25172  PyErr_Format(PyExc_ValueError,
25173  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
25174 }
25175 
25176 /* RaiseNeedMoreValuesToUnpack */
25177 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25178  PyErr_Format(PyExc_ValueError,
25179  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
25180  index, (index == 1) ? "" : "s");
25181 }
25182 
25183 /* RaiseNoneIterError */
25184 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
25185  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
25186 }
25187 
25188 /* ExtTypeTest */
25189 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25190  if (unlikely(!type)) {
25191  PyErr_SetString(PyExc_SystemError, "Missing type object");
25192  return 0;
25193  }
25194  if (likely(__Pyx_TypeCheck(obj, type)))
25195  return 1;
25196  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
25197  Py_TYPE(obj)->tp_name, type->tp_name);
25198  return 0;
25199 }
25200 
25201 /* SwapException */
25202 #if CYTHON_FAST_THREAD_STATE
25203 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25204  PyObject *tmp_type, *tmp_value, *tmp_tb;
25205  #if CYTHON_USE_EXC_INFO_STACK
25206  _PyErr_StackItem *exc_info = tstate->exc_info;
25207  tmp_type = exc_info->exc_type;
25208  tmp_value = exc_info->exc_value;
25209  tmp_tb = exc_info->exc_traceback;
25210  exc_info->exc_type = *type;
25211  exc_info->exc_value = *value;
25212  exc_info->exc_traceback = *tb;
25213  #else
25214  tmp_type = tstate->exc_type;
25215  tmp_value = tstate->exc_value;
25216  tmp_tb = tstate->exc_traceback;
25217  tstate->exc_type = *type;
25218  tstate->exc_value = *value;
25219  tstate->exc_traceback = *tb;
25220  #endif
25221  *type = tmp_type;
25222  *value = tmp_value;
25223  *tb = tmp_tb;
25224 }
25225 #else
25226 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25227  PyObject *tmp_type, *tmp_value, *tmp_tb;
25228  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25229  PyErr_SetExcInfo(*type, *value, *tb);
25230  *type = tmp_type;
25231  *value = tmp_value;
25232  *tb = tmp_tb;
25233 }
25234 #endif
25235 
25236 /* Import */
25237 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
25238  PyObject *empty_list = 0;
25239  PyObject *module = 0;
25240  PyObject *global_dict = 0;
25241  PyObject *empty_dict = 0;
25242  PyObject *list;
25243  #if PY_MAJOR_VERSION < 3
25244  PyObject *py_import;
25245  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25246  if (!py_import)
25247  goto bad;
25248  #endif
25249  if (from_list)
25250  list = from_list;
25251  else {
25252  empty_list = PyList_New(0);
25253  if (!empty_list)
25254  goto bad;
25255  list = empty_list;
25256  }
25257  global_dict = PyModule_GetDict(__pyx_m);
25258  if (!global_dict)
25259  goto bad;
25260  empty_dict = PyDict_New();
25261  if (!empty_dict)
25262  goto bad;
25263  {
25264  #if PY_MAJOR_VERSION >= 3
25265  if (level == -1) {
25266  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
25267  module = PyImport_ImportModuleLevelObject(
25268  name, global_dict, empty_dict, list, 1);
25269  if (!module) {
25270  if (!PyErr_ExceptionMatches(PyExc_ImportError))
25271  goto bad;
25272  PyErr_Clear();
25273  }
25274  }
25275  level = 0;
25276  }
25277  #endif
25278  if (!module) {
25279  #if PY_MAJOR_VERSION < 3
25280  PyObject *py_level = PyInt_FromLong(level);
25281  if (!py_level)
25282  goto bad;
25283  module = PyObject_CallFunctionObjArgs(py_import,
25284  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25285  Py_DECREF(py_level);
25286  #else
25287  module = PyImport_ImportModuleLevelObject(
25288  name, global_dict, empty_dict, list, level);
25289  #endif
25290  }
25291  }
25292 bad:
25293  #if PY_MAJOR_VERSION < 3
25294  Py_XDECREF(py_import);
25295  #endif
25296  Py_XDECREF(empty_list);
25297  Py_XDECREF(empty_dict);
25298  return module;
25299 }
25300 
25301 /* FastTypeChecks */
25302 #if CYTHON_COMPILING_IN_CPYTHON
25303 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25304  while (a) {
25305  a = a->tp_base;
25306  if (a == b)
25307  return 1;
25308  }
25309  return b == &PyBaseObject_Type;
25310 }
25311 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25312  PyObject *mro;
25313  if (a == b) return 1;
25314  mro = a->tp_mro;
25315  if (likely(mro)) {
25316  Py_ssize_t i, n;
25317  n = PyTuple_GET_SIZE(mro);
25318  for (i = 0; i < n; i++) {
25319  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25320  return 1;
25321  }
25322  return 0;
25323  }
25324  return __Pyx_InBases(a, b);
25325 }
25326 #if PY_MAJOR_VERSION == 2
25327 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25328  PyObject *exception, *value, *tb;
25329  int res;
25330  __Pyx_PyThreadState_declare
25331  __Pyx_PyThreadState_assign
25332  __Pyx_ErrFetch(&exception, &value, &tb);
25333  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25334  if (unlikely(res == -1)) {
25335  PyErr_WriteUnraisable(err);
25336  res = 0;
25337  }
25338  if (!res) {
25339  res = PyObject_IsSubclass(err, exc_type2);
25340  if (unlikely(res == -1)) {
25341  PyErr_WriteUnraisable(err);
25342  res = 0;
25343  }
25344  }
25345  __Pyx_ErrRestore(exception, value, tb);
25346  return res;
25347 }
25348 #else
25349 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25350  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25351  if (!res) {
25352  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25353  }
25354  return res;
25355 }
25356 #endif
25357 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25358  Py_ssize_t i, n;
25359  assert(PyExceptionClass_Check(exc_type));
25360  n = PyTuple_GET_SIZE(tuple);
25361 #if PY_MAJOR_VERSION >= 3
25362  for (i=0; i<n; i++) {
25363  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25364  }
25365 #endif
25366  for (i=0; i<n; i++) {
25367  PyObject *t = PyTuple_GET_ITEM(tuple, i);
25368  #if PY_MAJOR_VERSION < 3
25369  if (likely(exc_type == t)) return 1;
25370  #endif
25371  if (likely(PyExceptionClass_Check(t))) {
25372  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
25373  } else {
25374  }
25375  }
25376  return 0;
25377 }
25378 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25379  if (likely(err == exc_type)) return 1;
25380  if (likely(PyExceptionClass_Check(err))) {
25381  if (likely(PyExceptionClass_Check(exc_type))) {
25382  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25383  } else if (likely(PyTuple_Check(exc_type))) {
25384  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25385  } else {
25386  }
25387  }
25388  return PyErr_GivenExceptionMatches(err, exc_type);
25389 }
25390 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25391  assert(PyExceptionClass_Check(exc_type1));
25392  assert(PyExceptionClass_Check(exc_type2));
25393  if (likely(err == exc_type1 || err == exc_type2)) return 1;
25394  if (likely(PyExceptionClass_Check(err))) {
25395  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25396  }
25397  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25398 }
25399 #endif
25400 
25401 /* None */
25402 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
25403  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
25404 }
25405 
25406 /* DivInt[long] */
25407 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
25408  long q = a / b;
25409  long r = a - q*b;
25410  q -= ((r != 0) & ((r ^ b) < 0));
25411  return q;
25412 }
25413 
25414 /* ImportFrom */
25415 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25416  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25417  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25418  PyErr_Format(PyExc_ImportError,
25419  #if PY_MAJOR_VERSION < 3
25420  "cannot import name %.230s", PyString_AS_STRING(name));
25421  #else
25422  "cannot import name %S", name);
25423  #endif
25424  }
25425  return value;
25426 }
25427 
25428 /* HasAttr */
25429 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25430  PyObject *r;
25431  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25432  PyErr_SetString(PyExc_TypeError,
25433  "hasattr(): attribute name must be string");
25434  return -1;
25435  }
25436  r = __Pyx_GetAttr(o, n);
25437  if (unlikely(!r)) {
25438  PyErr_Clear();
25439  return 0;
25440  } else {
25441  Py_DECREF(r);
25442  return 1;
25443  }
25444 }
25445 
25446 /* StringJoin */
25447 #if !CYTHON_COMPILING_IN_CPYTHON
25448 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
25449  return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
25450 }
25451 #endif
25452 
25453 /* PyObject_GenericGetAttrNoDict */
25454 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25455 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25456  PyErr_Format(PyExc_AttributeError,
25457 #if PY_MAJOR_VERSION >= 3
25458  "'%.50s' object has no attribute '%U'",
25459  tp->tp_name, attr_name);
25460 #else
25461  "'%.50s' object has no attribute '%.400s'",
25462  tp->tp_name, PyString_AS_STRING(attr_name));
25463 #endif
25464  return NULL;
25465 }
25466 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25467  PyObject *descr;
25468  PyTypeObject *tp = Py_TYPE(obj);
25469  if (unlikely(!PyString_Check(attr_name))) {
25470  return PyObject_GenericGetAttr(obj, attr_name);
25471  }
25472  assert(!tp->tp_dictoffset);
25473  descr = _PyType_Lookup(tp, attr_name);
25474  if (unlikely(!descr)) {
25475  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25476  }
25477  Py_INCREF(descr);
25478  #if PY_MAJOR_VERSION < 3
25479  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25480  #endif
25481  {
25482  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25483  if (unlikely(f)) {
25484  PyObject *res = f(descr, obj, (PyObject *)tp);
25485  Py_DECREF(descr);
25486  return res;
25487  }
25488  }
25489  return descr;
25490 }
25491 #endif
25492 
25493 /* PyObject_GenericGetAttr */
25494 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25495 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25496  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25497  return PyObject_GenericGetAttr(obj, attr_name);
25498  }
25499  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25500 }
25501 #endif
25502 
25503 /* SetVTable */
25504 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
25505 #if PY_VERSION_HEX >= 0x02070000
25506  PyObject *ob = PyCapsule_New(vtable, 0, 0);
25507 #else
25508  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25509 #endif
25510  if (!ob)
25511  goto bad;
25512  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25513  goto bad;
25514  Py_DECREF(ob);
25515  return 0;
25516 bad:
25517  Py_XDECREF(ob);
25518  return -1;
25519 }
25520 
25521 /* PyObjectGetAttrStrNoError */
25522 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
25523  __Pyx_PyThreadState_declare
25524  __Pyx_PyThreadState_assign
25525  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25526  __Pyx_PyErr_Clear();
25527 }
25528 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
25529  PyObject *result;
25530 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
25531  PyTypeObject* tp = Py_TYPE(obj);
25532  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
25533  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
25534  }
25535 #endif
25536  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
25537  if (unlikely(!result)) {
25538  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
25539  }
25540  return result;
25541 }
25542 
25543 /* SetupReduce */
25544 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25545  int ret;
25546  PyObject *name_attr;
25547  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25548  if (likely(name_attr)) {
25549  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25550  } else {
25551  ret = -1;
25552  }
25553  if (unlikely(ret < 0)) {
25554  PyErr_Clear();
25555  ret = 0;
25556  }
25557  Py_XDECREF(name_attr);
25558  return ret;
25559 }
25560 static int __Pyx_setup_reduce(PyObject* type_obj) {
25561  int ret = 0;
25562  PyObject *object_reduce = NULL;
25563  PyObject *object_getstate = NULL;
25564  PyObject *object_reduce_ex = NULL;
25565  PyObject *reduce = NULL;
25566  PyObject *reduce_ex = NULL;
25567  PyObject *reduce_cython = NULL;
25568  PyObject *setstate = NULL;
25569  PyObject *setstate_cython = NULL;
25570  PyObject *getstate = NULL;
25571 #if CYTHON_USE_PYTYPE_LOOKUP
25572  getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
25573 #else
25574  getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
25575  if (!getstate && PyErr_Occurred()) {
25576  goto __PYX_BAD;
25577  }
25578 #endif
25579  if (getstate) {
25580 #if CYTHON_USE_PYTYPE_LOOKUP
25581  object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
25582 #else
25583  object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
25584  if (!object_getstate && PyErr_Occurred()) {
25585  goto __PYX_BAD;
25586  }
25587 #endif
25588  if (object_getstate != getstate) {
25589  goto __PYX_GOOD;
25590  }
25591  }
25592 #if CYTHON_USE_PYTYPE_LOOKUP
25593  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25594 #else
25595  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25596 #endif
25597  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
25598  if (reduce_ex == object_reduce_ex) {
25599 #if CYTHON_USE_PYTYPE_LOOKUP
25600  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25601 #else
25602  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25603 #endif
25604  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
25605  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25606  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
25607  if (likely(reduce_cython)) {
25608  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25609  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25610  } else if (reduce == object_reduce || PyErr_Occurred()) {
25611  goto __PYX_BAD;
25612  }
25613  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25614  if (!setstate) PyErr_Clear();
25615  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25616  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
25617  if (likely(setstate_cython)) {
25618  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25619  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25620  } else if (!setstate || PyErr_Occurred()) {
25621  goto __PYX_BAD;
25622  }
25623  }
25624  PyType_Modified((PyTypeObject*)type_obj);
25625  }
25626  }
25627  goto __PYX_GOOD;
25628 __PYX_BAD:
25629  if (!PyErr_Occurred())
25630  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25631  ret = -1;
25632 __PYX_GOOD:
25633 #if !CYTHON_USE_PYTYPE_LOOKUP
25634  Py_XDECREF(object_reduce);
25635  Py_XDECREF(object_reduce_ex);
25636  Py_XDECREF(object_getstate);
25637  Py_XDECREF(getstate);
25638 #endif
25639  Py_XDECREF(reduce);
25640  Py_XDECREF(reduce_ex);
25641  Py_XDECREF(reduce_cython);
25642  Py_XDECREF(setstate);
25643  Py_XDECREF(setstate_cython);
25644  return ret;
25645 }
25646 
25647 /* TypeImport */
25648 #ifndef __PYX_HAVE_RT_ImportType
25649 #define __PYX_HAVE_RT_ImportType
25650 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
25651  size_t size, enum __Pyx_ImportType_CheckSize check_size)
25652 {
25653  PyObject *result = 0;
25654  char warning[200];
25655  Py_ssize_t basicsize;
25656 #ifdef Py_LIMITED_API
25657  PyObject *py_basicsize;
25658 #endif
25659  result = PyObject_GetAttrString(module, class_name);
25660  if (!result)
25661  goto bad;
25662  if (!PyType_Check(result)) {
25663  PyErr_Format(PyExc_TypeError,
25664  "%.200s.%.200s is not a type object",
25665  module_name, class_name);
25666  goto bad;
25667  }
25668 #ifndef Py_LIMITED_API
25669  basicsize = ((PyTypeObject *)result)->tp_basicsize;
25670 #else
25671  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
25672  if (!py_basicsize)
25673  goto bad;
25674  basicsize = PyLong_AsSsize_t(py_basicsize);
25675  Py_DECREF(py_basicsize);
25676  py_basicsize = 0;
25677  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25678  goto bad;
25679 #endif
25680  if ((size_t)basicsize < size) {
25681  PyErr_Format(PyExc_ValueError,
25682  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25683  "Expected %zd from C header, got %zd from PyObject",
25684  module_name, class_name, size, basicsize);
25685  goto bad;
25686  }
25687  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
25688  PyErr_Format(PyExc_ValueError,
25689  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25690  "Expected %zd from C header, got %zd from PyObject",
25691  module_name, class_name, size, basicsize);
25692  goto bad;
25693  }
25694  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
25695  PyOS_snprintf(warning, sizeof(warning),
25696  "%s.%s size changed, may indicate binary incompatibility. "
25697  "Expected %zd from C header, got %zd from PyObject",
25698  module_name, class_name, size, basicsize);
25699  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
25700  }
25701  return (PyTypeObject *)result;
25702 bad:
25703  Py_XDECREF(result);
25704  return NULL;
25705 }
25706 #endif
25707 
25708 /* CLineInTraceback */
25709 #ifndef CYTHON_CLINE_IN_TRACEBACK
25710 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
25711  PyObject *use_cline;
25712  PyObject *ptype, *pvalue, *ptraceback;
25713 #if CYTHON_COMPILING_IN_CPYTHON
25714  PyObject **cython_runtime_dict;
25715 #endif
25716  if (unlikely(!__pyx_cython_runtime)) {
25717  return c_line;
25718  }
25719  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25720 #if CYTHON_COMPILING_IN_CPYTHON
25721  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25722  if (likely(cython_runtime_dict)) {
25723  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
25724  use_cline, *cython_runtime_dict,
25725  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
25726  } else
25727 #endif
25728  {
25729  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25730  if (use_cline_obj) {
25731  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25732  Py_DECREF(use_cline_obj);
25733  } else {
25734  PyErr_Clear();
25735  use_cline = NULL;
25736  }
25737  }
25738  if (!use_cline) {
25739  c_line = 0;
25740  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25741  }
25742  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
25743  c_line = 0;
25744  }
25745  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25746  return c_line;
25747 }
25748 #endif
25749 
25750 /* CodeObjectCache */
25751 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
25752  int start = 0, mid = 0, end = count - 1;
25753  if (end >= 0 && code_line > entries[end].code_line) {
25754  return count;
25755  }
25756  while (start < end) {
25757  mid = start + (end - start) / 2;
25758  if (code_line < entries[mid].code_line) {
25759  end = mid;
25760  } else if (code_line > entries[mid].code_line) {
25761  start = mid + 1;
25762  } else {
25763  return mid;
25764  }
25765  }
25766  if (code_line <= entries[mid].code_line) {
25767  return mid;
25768  } else {
25769  return mid + 1;
25770  }
25771 }
25772 static PyCodeObject *__pyx_find_code_object(int code_line) {
25773  PyCodeObject* code_object;
25774  int pos;
25775  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25776  return NULL;
25777  }
25778  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25779  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
25780  return NULL;
25781  }
25782  code_object = __pyx_code_cache.entries[pos].code_object;
25783  Py_INCREF(code_object);
25784  return code_object;
25785 }
25786 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
25787  int pos, i;
25788  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25789  if (unlikely(!code_line)) {
25790  return;
25791  }
25792  if (unlikely(!entries)) {
25793  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
25794  if (likely(entries)) {
25795  __pyx_code_cache.entries = entries;
25796  __pyx_code_cache.max_count = 64;
25797  __pyx_code_cache.count = 1;
25798  entries[0].code_line = code_line;
25799  entries[0].code_object = code_object;
25800  Py_INCREF(code_object);
25801  }
25802  return;
25803  }
25804  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25805  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
25806  PyCodeObject* tmp = entries[pos].code_object;
25807  entries[pos].code_object = code_object;
25808  Py_DECREF(tmp);
25809  return;
25810  }
25811  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
25812  int new_max = __pyx_code_cache.max_count + 64;
25813  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
25814  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
25815  if (unlikely(!entries)) {
25816  return;
25817  }
25818  __pyx_code_cache.entries = entries;
25819  __pyx_code_cache.max_count = new_max;
25820  }
25821  for (i=__pyx_code_cache.count; i>pos; i--) {
25822  entries[i] = entries[i-1];
25823  }
25824  entries[pos].code_line = code_line;
25825  entries[pos].code_object = code_object;
25826  __pyx_code_cache.count++;
25827  Py_INCREF(code_object);
25828 }
25829 
25830 /* AddTraceback */
25831 #include "compile.h"
25832 #include "frameobject.h"
25833 #include "traceback.h"
25834 #if PY_VERSION_HEX >= 0x030b00a6
25835  #ifndef Py_BUILD_CORE
25836  #define Py_BUILD_CORE 1
25837  #endif
25838  #include "internal/pycore_frame.h"
25839 #endif
25840 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
25841  const char *funcname, int c_line,
25842  int py_line, const char *filename) {
25843  PyCodeObject *py_code = NULL;
25844  PyObject *py_funcname = NULL;
25845  #if PY_MAJOR_VERSION < 3
25846  PyObject *py_srcfile = NULL;
25847  py_srcfile = PyString_FromString(filename);
25848  if (!py_srcfile) goto bad;
25849  #endif
25850  if (c_line) {
25851  #if PY_MAJOR_VERSION < 3
25852  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25853  if (!py_funcname) goto bad;
25854  #else
25855  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
25856  if (!py_funcname) goto bad;
25857  funcname = PyUnicode_AsUTF8(py_funcname);
25858  if (!funcname) goto bad;
25859  #endif
25860  }
25861  else {
25862  #if PY_MAJOR_VERSION < 3
25863  py_funcname = PyString_FromString(funcname);
25864  if (!py_funcname) goto bad;
25865  #endif
25866  }
25867  #if PY_MAJOR_VERSION < 3
25868  py_code = __Pyx_PyCode_New(
25869  0,
25870  0,
25871  0,
25872  0,
25873  0,
25874  __pyx_empty_bytes, /*PyObject *code,*/
25875  __pyx_empty_tuple, /*PyObject *consts,*/
25876  __pyx_empty_tuple, /*PyObject *names,*/
25877  __pyx_empty_tuple, /*PyObject *varnames,*/
25878  __pyx_empty_tuple, /*PyObject *freevars,*/
25879  __pyx_empty_tuple, /*PyObject *cellvars,*/
25880  py_srcfile, /*PyObject *filename,*/
25881  py_funcname, /*PyObject *name,*/
25882  py_line,
25883  __pyx_empty_bytes /*PyObject *lnotab*/
25884  );
25885  Py_DECREF(py_srcfile);
25886  #else
25887  py_code = PyCode_NewEmpty(filename, funcname, py_line);
25888  #endif
25889  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
25890  return py_code;
25891 bad:
25892  Py_XDECREF(py_funcname);
25893  #if PY_MAJOR_VERSION < 3
25894  Py_XDECREF(py_srcfile);
25895  #endif
25896  return NULL;
25897 }
25898 static void __Pyx_AddTraceback(const char *funcname, int c_line,
25899  int py_line, const char *filename) {
25900  PyCodeObject *py_code = 0;
25901  PyFrameObject *py_frame = 0;
25902  PyThreadState *tstate = __Pyx_PyThreadState_Current;
25903  PyObject *ptype, *pvalue, *ptraceback;
25904  if (c_line) {
25905  c_line = __Pyx_CLineForTraceback(tstate, c_line);
25906  }
25907  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
25908  if (!py_code) {
25909  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25910  py_code = __Pyx_CreateCodeObjectForTraceback(
25911  funcname, c_line, py_line, filename);
25912  if (!py_code) {
25913  /* If the code object creation fails, then we should clear the
25914  fetched exception references and propagate the new exception */
25915  Py_XDECREF(ptype);
25916  Py_XDECREF(pvalue);
25917  Py_XDECREF(ptraceback);
25918  goto bad;
25919  }
25920  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25921  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
25922  }
25923  py_frame = PyFrame_New(
25924  tstate, /*PyThreadState *tstate,*/
25925  py_code, /*PyCodeObject *code,*/
25926  __pyx_d, /*PyObject *globals,*/
25927  0 /*PyObject *locals*/
25928  );
25929  if (!py_frame) goto bad;
25930  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
25931  PyTraceBack_Here(py_frame);
25932 bad:
25933  Py_XDECREF(py_code);
25934  Py_XDECREF(py_frame);
25935 }
25936 
25937 /* CIntFromPyVerify */
25938 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
25939  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
25940 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
25941  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
25942 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
25943  {\
25944  func_type value = func_value;\
25945  if (sizeof(target_type) < sizeof(func_type)) {\
25946  if (unlikely(value != (func_type) (target_type) value)) {\
25947  func_type zero = 0;\
25948  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
25949  return (target_type) -1;\
25950  if (is_unsigned && unlikely(value < zero))\
25951  goto raise_neg_overflow;\
25952  else\
25953  goto raise_overflow;\
25954  }\
25955  }\
25956  return (target_type) value;\
25957  }
25958 
25959 /* MemviewDtypeToObject */
25960 static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp) {
25961  return (PyObject *) __Pyx_PyInt_From_int(*(int *) itemp);
25962 }
25963 static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj) {
25964  int value = __Pyx_PyInt_As_int(obj);
25965  if ((value == (int)-1) && PyErr_Occurred())
25966  return 0;
25967  *(int *) itemp = value;
25968  return 1;
25969 }
25970 
25971 /* Declarations */
25972 #if CYTHON_CCOMPLEX
25973  #ifdef __cplusplus
25974  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
25975  return ::std::complex< float >(x, y);
25976  }
25977  #else
25978  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
25979  return x + y*(__pyx_t_float_complex)_Complex_I;
25980  }
25981  #endif
25982 #else
25983  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
25984  __pyx_t_float_complex z;
25985  z.real = x;
25986  z.imag = y;
25987  return z;
25988  }
25989 #endif
25990 
25991 /* Arithmetic */
25992 #if CYTHON_CCOMPLEX
25993 #else
25994  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25995  return (a.real == b.real) && (a.imag == b.imag);
25996  }
25997  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25998  __pyx_t_float_complex z;
25999  z.real = a.real + b.real;
26000  z.imag = a.imag + b.imag;
26001  return z;
26002  }
26003  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26004  __pyx_t_float_complex z;
26005  z.real = a.real - b.real;
26006  z.imag = a.imag - b.imag;
26007  return z;
26008  }
26009  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26010  __pyx_t_float_complex z;
26011  z.real = a.real * b.real - a.imag * b.imag;
26012  z.imag = a.real * b.imag + a.imag * b.real;
26013  return z;
26014  }
26015  #if 1
26016  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26017  if (b.imag == 0) {
26018  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26019  } else if (fabsf(b.real) >= fabsf(b.imag)) {
26020  if (b.real == 0 && b.imag == 0) {
26021  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
26022  } else {
26023  float r = b.imag / b.real;
26024  float s = (float)(1.0) / (b.real + b.imag * r);
26025  return __pyx_t_float_complex_from_parts(
26026  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
26027  }
26028  } else {
26029  float r = b.real / b.imag;
26030  float s = (float)(1.0) / (b.imag + b.real * r);
26031  return __pyx_t_float_complex_from_parts(
26032  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
26033  }
26034  }
26035  #else
26036  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26037  if (b.imag == 0) {
26038  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26039  } else {
26040  float denom = b.real * b.real + b.imag * b.imag;
26041  return __pyx_t_float_complex_from_parts(
26042  (a.real * b.real + a.imag * b.imag) / denom,
26043  (a.imag * b.real - a.real * b.imag) / denom);
26044  }
26045  }
26046  #endif
26047  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
26048  __pyx_t_float_complex z;
26049  z.real = -a.real;
26050  z.imag = -a.imag;
26051  return z;
26052  }
26053  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
26054  return (a.real == 0) && (a.imag == 0);
26055  }
26056  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
26057  __pyx_t_float_complex z;
26058  z.real = a.real;
26059  z.imag = -a.imag;
26060  return z;
26061  }
26062  #if 1
26063  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
26064  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26065  return sqrtf(z.real*z.real + z.imag*z.imag);
26066  #else
26067  return hypotf(z.real, z.imag);
26068  #endif
26069  }
26070  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26071  __pyx_t_float_complex z;
26072  float r, lnr, theta, z_r, z_theta;
26073  if (b.imag == 0 && b.real == (int)b.real) {
26074  if (b.real < 0) {
26075  float denom = a.real * a.real + a.imag * a.imag;
26076  a.real = a.real / denom;
26077  a.imag = -a.imag / denom;
26078  b.real = -b.real;
26079  }
26080  switch ((int)b.real) {
26081  case 0:
26082  z.real = 1;
26083  z.imag = 0;
26084  return z;
26085  case 1:
26086  return a;
26087  case 2:
26088  return __Pyx_c_prod_float(a, a);
26089  case 3:
26090  z = __Pyx_c_prod_float(a, a);
26091  return __Pyx_c_prod_float(z, a);
26092  case 4:
26093  z = __Pyx_c_prod_float(a, a);
26094  return __Pyx_c_prod_float(z, z);
26095  }
26096  }
26097  if (a.imag == 0) {
26098  if (a.real == 0) {
26099  return a;
26100  } else if (b.imag == 0) {
26101  z.real = powf(a.real, b.real);
26102  z.imag = 0;
26103  return z;
26104  } else if (a.real > 0) {
26105  r = a.real;
26106  theta = 0;
26107  } else {
26108  r = -a.real;
26109  theta = atan2f(0.0, -1.0);
26110  }
26111  } else {
26112  r = __Pyx_c_abs_float(a);
26113  theta = atan2f(a.imag, a.real);
26114  }
26115  lnr = logf(r);
26116  z_r = expf(lnr * b.real - theta * b.imag);
26117  z_theta = theta * b.real + lnr * b.imag;
26118  z.real = z_r * cosf(z_theta);
26119  z.imag = z_r * sinf(z_theta);
26120  return z;
26121  }
26122  #endif
26123 #endif
26124 
26125 /* Declarations */
26126 #if CYTHON_CCOMPLEX
26127  #ifdef __cplusplus
26128  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26129  return ::std::complex< double >(x, y);
26130  }
26131  #else
26132  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26133  return x + y*(__pyx_t_double_complex)_Complex_I;
26134  }
26135  #endif
26136 #else
26137  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
26138  __pyx_t_double_complex z;
26139  z.real = x;
26140  z.imag = y;
26141  return z;
26142  }
26143 #endif
26144 
26145 /* Arithmetic */
26146 #if CYTHON_CCOMPLEX
26147 #else
26148  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26149  return (a.real == b.real) && (a.imag == b.imag);
26150  }
26151  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26152  __pyx_t_double_complex z;
26153  z.real = a.real + b.real;
26154  z.imag = a.imag + b.imag;
26155  return z;
26156  }
26157  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26158  __pyx_t_double_complex z;
26159  z.real = a.real - b.real;
26160  z.imag = a.imag - b.imag;
26161  return z;
26162  }
26163  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26164  __pyx_t_double_complex z;
26165  z.real = a.real * b.real - a.imag * b.imag;
26166  z.imag = a.real * b.imag + a.imag * b.real;
26167  return z;
26168  }
26169  #if 1
26170  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26171  if (b.imag == 0) {
26172  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26173  } else if (fabs(b.real) >= fabs(b.imag)) {
26174  if (b.real == 0 && b.imag == 0) {
26175  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
26176  } else {
26177  double r = b.imag / b.real;
26178  double s = (double)(1.0) / (b.real + b.imag * r);
26179  return __pyx_t_double_complex_from_parts(
26180  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
26181  }
26182  } else {
26183  double r = b.real / b.imag;
26184  double s = (double)(1.0) / (b.imag + b.real * r);
26185  return __pyx_t_double_complex_from_parts(
26186  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
26187  }
26188  }
26189  #else
26190  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26191  if (b.imag == 0) {
26192  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26193  } else {
26194  double denom = b.real * b.real + b.imag * b.imag;
26195  return __pyx_t_double_complex_from_parts(
26196  (a.real * b.real + a.imag * b.imag) / denom,
26197  (a.imag * b.real - a.real * b.imag) / denom);
26198  }
26199  }
26200  #endif
26201  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
26202  __pyx_t_double_complex z;
26203  z.real = -a.real;
26204  z.imag = -a.imag;
26205  return z;
26206  }
26207  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
26208  return (a.real == 0) && (a.imag == 0);
26209  }
26210  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
26211  __pyx_t_double_complex z;
26212  z.real = a.real;
26213  z.imag = -a.imag;
26214  return z;
26215  }
26216  #if 1
26217  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
26218  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
26219  return sqrt(z.real*z.real + z.imag*z.imag);
26220  #else
26221  return hypot(z.real, z.imag);
26222  #endif
26223  }
26224  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26225  __pyx_t_double_complex z;
26226  double r, lnr, theta, z_r, z_theta;
26227  if (b.imag == 0 && b.real == (int)b.real) {
26228  if (b.real < 0) {
26229  double denom = a.real * a.real + a.imag * a.imag;
26230  a.real = a.real / denom;
26231  a.imag = -a.imag / denom;
26232  b.real = -b.real;
26233  }
26234  switch ((int)b.real) {
26235  case 0:
26236  z.real = 1;
26237  z.imag = 0;
26238  return z;
26239  case 1:
26240  return a;
26241  case 2:
26242  return __Pyx_c_prod_double(a, a);
26243  case 3:
26244  z = __Pyx_c_prod_double(a, a);
26245  return __Pyx_c_prod_double(z, a);
26246  case 4:
26247  z = __Pyx_c_prod_double(a, a);
26248  return __Pyx_c_prod_double(z, z);
26249  }
26250  }
26251  if (a.imag == 0) {
26252  if (a.real == 0) {
26253  return a;
26254  } else if (b.imag == 0) {
26255  z.real = pow(a.real, b.real);
26256  z.imag = 0;
26257  return z;
26258  } else if (a.real > 0) {
26259  r = a.real;
26260  theta = 0;
26261  } else {
26262  r = -a.real;
26263  theta = atan2(0.0, -1.0);
26264  }
26265  } else {
26266  r = __Pyx_c_abs_double(a);
26267  theta = atan2(a.imag, a.real);
26268  }
26269  lnr = log(r);
26270  z_r = exp(lnr * b.real - theta * b.imag);
26271  z_theta = theta * b.real + lnr * b.imag;
26272  z.real = z_r * cos(z_theta);
26273  z.imag = z_r * sin(z_theta);
26274  return z;
26275  }
26276  #endif
26277 #endif
26278 
26279 #if PY_MAJOR_VERSION < 3
26280 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
26281  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
26282  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
26283  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
26284  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26285  return -1;
26286 }
26287 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26288  PyObject *obj = view->obj;
26289  if (!obj) return;
26290  if (PyObject_CheckBuffer(obj)) {
26291  PyBuffer_Release(view);
26292  return;
26293  }
26294  if ((0)) {}
26295  view->obj = NULL;
26296  Py_DECREF(obj);
26297 }
26298 #endif
26299 
26300 
26301 /* MemviewSliceIsContig */
26302 static int
26303 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
26304 {
26305  int i, index, step, start;
26306  Py_ssize_t itemsize = mvs.memview->view.itemsize;
26307  if (order == 'F') {
26308  step = 1;
26309  start = 0;
26310  } else {
26311  step = -1;
26312  start = ndim - 1;
26313  }
26314  for (i = 0; i < ndim; i++) {
26315  index = start + step * i;
26316  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26317  return 0;
26318  itemsize *= mvs.shape[index];
26319  }
26320  return 1;
26321 }
26322 
26323 /* OverlappingSlices */
26324 static void
26325 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26326  void **out_start, void **out_end,
26327  int ndim, size_t itemsize)
26328 {
26329  char *start, *end;
26330  int i;
26331  start = end = slice->data;
26332  for (i = 0; i < ndim; i++) {
26333  Py_ssize_t stride = slice->strides[i];
26334  Py_ssize_t extent = slice->shape[i];
26335  if (extent == 0) {
26336  *out_start = *out_end = start;
26337  return;
26338  } else {
26339  if (stride > 0)
26340  end += stride * (extent - 1);
26341  else
26342  start += stride * (extent - 1);
26343  }
26344  }
26345  *out_start = start;
26346  *out_end = end + itemsize;
26347 }
26348 static int
26349 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26350  __Pyx_memviewslice *slice2,
26351  int ndim, size_t itemsize)
26352 {
26353  void *start1, *end1, *start2, *end2;
26354  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26355  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26356  return (start1 < end2) && (start2 < end1);
26357 }
26358 
26359 /* Capsule */
26360 static CYTHON_INLINE PyObject *
26361 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
26362 {
26363  PyObject *cobj;
26364 #if PY_VERSION_HEX >= 0x02070000
26365  cobj = PyCapsule_New(p, sig, NULL);
26366 #else
26367  cobj = PyCObject_FromVoidPtr(p, NULL);
26368 #endif
26369  return cobj;
26370 }
26371 
26372 /* CIntFromPy */
26373 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
26374 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26375 #pragma GCC diagnostic push
26376 #pragma GCC diagnostic ignored "-Wconversion"
26377 #endif
26378  const int neg_one = (int) -1, const_zero = (int) 0;
26379 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26380 #pragma GCC diagnostic pop
26381 #endif
26382  const int is_unsigned = neg_one > const_zero;
26383 #if PY_MAJOR_VERSION < 3
26384  if (likely(PyInt_Check(x))) {
26385  if (sizeof(int) < sizeof(long)) {
26386  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
26387  } else {
26388  long val = PyInt_AS_LONG(x);
26389  if (is_unsigned && unlikely(val < 0)) {
26390  goto raise_neg_overflow;
26391  }
26392  return (int) val;
26393  }
26394  } else
26395 #endif
26396  if (likely(PyLong_Check(x))) {
26397  if (is_unsigned) {
26398 #if CYTHON_USE_PYLONG_INTERNALS
26399  const digit* digits = ((PyLongObject*)x)->ob_digit;
26400  switch (Py_SIZE(x)) {
26401  case 0: return (int) 0;
26402  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
26403  case 2:
26404  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
26405  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26406  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26407  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
26408  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26409  }
26410  }
26411  break;
26412  case 3:
26413  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
26414  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26415  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26416  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
26417  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26418  }
26419  }
26420  break;
26421  case 4:
26422  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
26423  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26424  __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])))
26425  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
26426  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26427  }
26428  }
26429  break;
26430  }
26431 #endif
26432 #if CYTHON_COMPILING_IN_CPYTHON
26433  if (unlikely(Py_SIZE(x) < 0)) {
26434  goto raise_neg_overflow;
26435  }
26436 #else
26437  {
26438  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26439  if (unlikely(result < 0))
26440  return (int) -1;
26441  if (unlikely(result == 1))
26442  goto raise_neg_overflow;
26443  }
26444 #endif
26445  if (sizeof(int) <= sizeof(unsigned long)) {
26446  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
26447 #ifdef HAVE_LONG_LONG
26448  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
26449  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26450 #endif
26451  }
26452  } else {
26453 #if CYTHON_USE_PYLONG_INTERNALS
26454  const digit* digits = ((PyLongObject*)x)->ob_digit;
26455  switch (Py_SIZE(x)) {
26456  case 0: return (int) 0;
26457  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
26458  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
26459  case -2:
26460  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
26461  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26462  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26463  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26464  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26465  }
26466  }
26467  break;
26468  case 2:
26469  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
26470  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26471  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26472  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26473  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26474  }
26475  }
26476  break;
26477  case -3:
26478  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
26479  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26480  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26481  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26482  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26483  }
26484  }
26485  break;
26486  case 3:
26487  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
26488  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26489  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26490  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26491  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26492  }
26493  }
26494  break;
26495  case -4:
26496  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
26497  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26498  __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])))
26499  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
26500  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26501  }
26502  }
26503  break;
26504  case 4:
26505  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
26506  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26507  __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])))
26508  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
26509  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26510  }
26511  }
26512  break;
26513  }
26514 #endif
26515  if (sizeof(int) <= sizeof(long)) {
26516  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
26517 #ifdef HAVE_LONG_LONG
26518  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
26519  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
26520 #endif
26521  }
26522  }
26523  {
26524 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
26525  PyErr_SetString(PyExc_RuntimeError,
26526  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26527 #else
26528  int val;
26529  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
26530  #if PY_MAJOR_VERSION < 3
26531  if (likely(v) && !PyLong_Check(v)) {
26532  PyObject *tmp = v;
26533  v = PyNumber_Long(tmp);
26534  Py_DECREF(tmp);
26535  }
26536  #endif
26537  if (likely(v)) {
26538  int one = 1; int is_little = (int)*(unsigned char *)&one;
26539  unsigned char *bytes = (unsigned char *)&val;
26540  int ret = _PyLong_AsByteArray((PyLongObject *)v,
26541  bytes, sizeof(val),
26542  is_little, !is_unsigned);
26543  Py_DECREF(v);
26544  if (likely(!ret))
26545  return val;
26546  }
26547 #endif
26548  return (int) -1;
26549  }
26550  } else {
26551  int val;
26552  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26553  if (!tmp) return (int) -1;
26554  val = __Pyx_PyInt_As_int(tmp);
26555  Py_DECREF(tmp);
26556  return val;
26557  }
26558 raise_overflow:
26559  PyErr_SetString(PyExc_OverflowError,
26560  "value too large to convert to int");
26561  return (int) -1;
26562 raise_neg_overflow:
26563  PyErr_SetString(PyExc_OverflowError,
26564  "can't convert negative value to int");
26565  return (int) -1;
26566 }
26567 
26568 /* CIntToPy */
26569 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
26570 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26571 #pragma GCC diagnostic push
26572 #pragma GCC diagnostic ignored "-Wconversion"
26573 #endif
26574  const int neg_one = (int) -1, const_zero = (int) 0;
26575 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26576 #pragma GCC diagnostic pop
26577 #endif
26578  const int is_unsigned = neg_one > const_zero;
26579  if (is_unsigned) {
26580  if (sizeof(int) < sizeof(long)) {
26581  return PyInt_FromLong((long) value);
26582  } else if (sizeof(int) <= sizeof(unsigned long)) {
26583  return PyLong_FromUnsignedLong((unsigned long) value);
26584 #ifdef HAVE_LONG_LONG
26585  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
26586  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
26587 #endif
26588  }
26589  } else {
26590  if (sizeof(int) <= sizeof(long)) {
26591  return PyInt_FromLong((long) value);
26592 #ifdef HAVE_LONG_LONG
26593  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
26594  return PyLong_FromLongLong((PY_LONG_LONG) value);
26595 #endif
26596  }
26597  }
26598  {
26599  int one = 1; int little = (int)*(unsigned char *)&one;
26600  unsigned char *bytes = (unsigned char *)&value;
26601  return _PyLong_FromByteArray(bytes, sizeof(int),
26602  little, !is_unsigned);
26603  }
26604 }
26605 
26606 /* TypeInfoToFormat */
26607 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) {
26608  struct __pyx_typeinfo_string result = { {0} };
26609  char *buf = (char *) result.string;
26610  size_t size = type->size;
26611  switch (type->typegroup) {
26612  case 'H':
26613  *buf = 'c';
26614  break;
26615  case 'I':
26616  case 'U':
26617  if (size == 1)
26618  *buf = (type->is_unsigned) ? 'B' : 'b';
26619  else if (size == 2)
26620  *buf = (type->is_unsigned) ? 'H' : 'h';
26621  else if (size == 4)
26622  *buf = (type->is_unsigned) ? 'I' : 'i';
26623  else if (size == 8)
26624  *buf = (type->is_unsigned) ? 'Q' : 'q';
26625  break;
26626  case 'P':
26627  *buf = 'P';
26628  break;
26629  case 'C':
26630  {
26631  __Pyx_TypeInfo complex_type = *type;
26632  complex_type.typegroup = 'R';
26633  complex_type.size /= 2;
26634  *buf++ = 'Z';
26635  *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
26636  break;
26637  }
26638  case 'R':
26639  if (size == 4)
26640  *buf = 'f';
26641  else if (size == 8)
26642  *buf = 'd';
26643  else
26644  *buf = 'g';
26645  break;
26646  }
26647  return result;
26648 }
26649 
26650 /* MemviewSliceCopyTemplate */
26651 static __Pyx_memviewslice
26652 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
26653  const char *mode, int ndim,
26654  size_t sizeof_dtype, int contig_flag,
26655  int dtype_is_object)
26656 {
26657  __Pyx_RefNannyDeclarations
26658  int i;
26659  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
26660  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
26661  Py_buffer *buf = &from_memview->view;
26662  PyObject *shape_tuple = NULL;
26663  PyObject *temp_int = NULL;
26664  struct __pyx_array_obj *array_obj = NULL;
26665  struct __pyx_memoryview_obj *memview_obj = NULL;
26666  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
26667  for (i = 0; i < ndim; i++) {
26668  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
26669  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
26670  "indirect dimensions (axis %d)", i);
26671  goto fail;
26672  }
26673  }
26674  shape_tuple = PyTuple_New(ndim);
26675  if (unlikely(!shape_tuple)) {
26676  goto fail;
26677  }
26678  __Pyx_GOTREF(shape_tuple);
26679  for(i = 0; i < ndim; i++) {
26680  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
26681  if(unlikely(!temp_int)) {
26682  goto fail;
26683  } else {
26684  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
26685  temp_int = NULL;
26686  }
26687  }
26688  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
26689  if (unlikely(!array_obj)) {
26690  goto fail;
26691  }
26692  __Pyx_GOTREF(array_obj);
26693  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26694  (PyObject *) array_obj, contig_flag,
26695  dtype_is_object,
26696  from_mvs->memview->typeinfo);
26697  if (unlikely(!memview_obj))
26698  goto fail;
26699  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
26700  goto fail;
26701  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
26702  dtype_is_object) < 0))
26703  goto fail;
26704  goto no_fail;
26705 fail:
26706  __Pyx_XDECREF(new_mvs.memview);
26707  new_mvs.memview = NULL;
26708  new_mvs.data = NULL;
26709 no_fail:
26710  __Pyx_XDECREF(shape_tuple);
26711  __Pyx_XDECREF(temp_int);
26712  __Pyx_XDECREF(array_obj);
26713  __Pyx_RefNannyFinishContext();
26714  return new_mvs;
26715 }
26716 
26717 /* MemviewSliceInit */
26718 static int
26719 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
26720  int ndim,
26721  __Pyx_memviewslice *memviewslice,
26722  int memview_is_new_reference)
26723 {
26724  __Pyx_RefNannyDeclarations
26725  int i, retval=-1;
26726  Py_buffer *buf = &memview->view;
26727  __Pyx_RefNannySetupContext("init_memviewslice", 0);
26728  if (unlikely(memviewslice->memview || memviewslice->data)) {
26729  PyErr_SetString(PyExc_ValueError,
26730  "memviewslice is already initialized!");
26731  goto fail;
26732  }
26733  if (buf->strides) {
26734  for (i = 0; i < ndim; i++) {
26735  memviewslice->strides[i] = buf->strides[i];
26736  }
26737  } else {
26738  Py_ssize_t stride = buf->itemsize;
26739  for (i = ndim - 1; i >= 0; i--) {
26740  memviewslice->strides[i] = stride;
26741  stride *= buf->shape[i];
26742  }
26743  }
26744  for (i = 0; i < ndim; i++) {
26745  memviewslice->shape[i] = buf->shape[i];
26746  if (buf->suboffsets) {
26747  memviewslice->suboffsets[i] = buf->suboffsets[i];
26748  } else {
26749  memviewslice->suboffsets[i] = -1;
26750  }
26751  }
26752  memviewslice->memview = memview;
26753  memviewslice->data = (char *)buf->buf;
26754  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
26755  Py_INCREF(memview);
26756  }
26757  retval = 0;
26758  goto no_fail;
26759 fail:
26760  memviewslice->memview = 0;
26761  memviewslice->data = 0;
26762  retval = -1;
26763 no_fail:
26764  __Pyx_RefNannyFinishContext();
26765  return retval;
26766 }
26767 #ifndef Py_NO_RETURN
26768 #define Py_NO_RETURN
26769 #endif
26770 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
26771  va_list vargs;
26772  char msg[200];
26773 #ifdef HAVE_STDARG_PROTOTYPES
26774  va_start(vargs, fmt);
26775 #else
26776  va_start(vargs);
26777 #endif
26778  vsnprintf(msg, 200, fmt, vargs);
26779  va_end(vargs);
26780  Py_FatalError(msg);
26781 }
26782 static CYTHON_INLINE int
26783 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
26784  PyThread_type_lock lock)
26785 {
26786  int result;
26787  PyThread_acquire_lock(lock, 1);
26788  result = (*acquisition_count)++;
26789  PyThread_release_lock(lock);
26790  return result;
26791 }
26792 static CYTHON_INLINE int
26793 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
26794  PyThread_type_lock lock)
26795 {
26796  int result;
26797  PyThread_acquire_lock(lock, 1);
26798  result = (*acquisition_count)--;
26799  PyThread_release_lock(lock);
26800  return result;
26801 }
26802 static CYTHON_INLINE void
26803 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
26804 {
26805  int first_time;
26806  struct __pyx_memoryview_obj *memview = memslice->memview;
26807  if (unlikely(!memview || (PyObject *) memview == Py_None))
26808  return;
26809  if (unlikely(__pyx_get_slice_count(memview) < 0))
26810  __pyx_fatalerror("Acquisition count is %d (line %d)",
26811  __pyx_get_slice_count(memview), lineno);
26812  first_time = __pyx_add_acquisition_count(memview) == 0;
26813  if (unlikely(first_time)) {
26814  if (have_gil) {
26815  Py_INCREF((PyObject *) memview);
26816  } else {
26817  PyGILState_STATE _gilstate = PyGILState_Ensure();
26818  Py_INCREF((PyObject *) memview);
26819  PyGILState_Release(_gilstate);
26820  }
26821  }
26822 }
26823 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
26824  int have_gil, int lineno) {
26825  int last_time;
26826  struct __pyx_memoryview_obj *memview = memslice->memview;
26827  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
26828  memslice->memview = NULL;
26829  return;
26830  }
26831  if (unlikely(__pyx_get_slice_count(memview) <= 0))
26832  __pyx_fatalerror("Acquisition count is %d (line %d)",
26833  __pyx_get_slice_count(memview), lineno);
26834  last_time = __pyx_sub_acquisition_count(memview) == 1;
26835  memslice->data = NULL;
26836  if (unlikely(last_time)) {
26837  if (have_gil) {
26838  Py_CLEAR(memslice->memview);
26839  } else {
26840  PyGILState_STATE _gilstate = PyGILState_Ensure();
26841  Py_CLEAR(memslice->memview);
26842  PyGILState_Release(_gilstate);
26843  }
26844  } else {
26845  memslice->memview = NULL;
26846  }
26847 }
26848 
26849 /* CIntFromPy */
26850 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
26851 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26852 #pragma GCC diagnostic push
26853 #pragma GCC diagnostic ignored "-Wconversion"
26854 #endif
26855  const long neg_one = (long) -1, const_zero = (long) 0;
26856 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
26857 #pragma GCC diagnostic pop
26858 #endif
26859  const int is_unsigned = neg_one > const_zero;
26860 #if PY_MAJOR_VERSION < 3
26861  if (likely(PyInt_Check(x))) {
26862  if (sizeof(long) < sizeof(long)) {
26863  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
26864  } else {
26865  long val = PyInt_AS_LONG(x);
26866  if (is_unsigned && unlikely(val < 0)) {
26867  goto raise_neg_overflow;
26868  }
26869  return (long) val;
26870  }
26871  } else
26872 #endif
26873  if (likely(PyLong_Check(x))) {
26874  if (is_unsigned) {
26875 #if CYTHON_USE_PYLONG_INTERNALS
26876  const digit* digits = ((PyLongObject*)x)->ob_digit;
26877  switch (Py_SIZE(x)) {
26878  case 0: return (long) 0;
26879  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
26880  case 2:
26881  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
26882  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26883  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26884  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
26885  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
26886  }
26887  }
26888  break;
26889  case 3:
26890  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
26891  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26892  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26893  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
26894  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
26895  }
26896  }
26897  break;
26898  case 4:
26899  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
26900  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26901  __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])))
26902  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
26903  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
26904  }
26905  }
26906  break;
26907  }
26908 #endif
26909 #if CYTHON_COMPILING_IN_CPYTHON
26910  if (unlikely(Py_SIZE(x) < 0)) {
26911  goto raise_neg_overflow;
26912  }
26913 #else
26914  {
26915  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26916  if (unlikely(result < 0))
26917  return (long) -1;
26918  if (unlikely(result == 1))
26919  goto raise_neg_overflow;
26920  }
26921 #endif
26922  if (sizeof(long) <= sizeof(unsigned long)) {
26923  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
26924 #ifdef HAVE_LONG_LONG
26925  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
26926  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26927 #endif
26928  }
26929  } else {
26930 #if CYTHON_USE_PYLONG_INTERNALS
26931  const digit* digits = ((PyLongObject*)x)->ob_digit;
26932  switch (Py_SIZE(x)) {
26933  case 0: return (long) 0;
26934  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
26935  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
26936  case -2:
26937  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
26938  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26939  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26940  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26941  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26942  }
26943  }
26944  break;
26945  case 2:
26946  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
26947  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
26948  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26949  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26950  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26951  }
26952  }
26953  break;
26954  case -3:
26955  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26956  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26957  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26958  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26959  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26960  }
26961  }
26962  break;
26963  case 3:
26964  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
26965  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
26966  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
26967  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26968  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26969  }
26970  }
26971  break;
26972  case -4:
26973  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26974  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26975  __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])))
26976  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
26977  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26978  }
26979  }
26980  break;
26981  case 4:
26982  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
26983  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
26984  __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])))
26985  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
26986  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
26987  }
26988  }
26989  break;
26990  }
26991 #endif
26992  if (sizeof(long) <= sizeof(long)) {
26993  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
26994 #ifdef HAVE_LONG_LONG
26995  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
26996  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
26997 #endif
26998  }
26999  }
27000  {
27001 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27002  PyErr_SetString(PyExc_RuntimeError,
27003  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27004 #else
27005  long val;
27006  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27007  #if PY_MAJOR_VERSION < 3
27008  if (likely(v) && !PyLong_Check(v)) {
27009  PyObject *tmp = v;
27010  v = PyNumber_Long(tmp);
27011  Py_DECREF(tmp);
27012  }
27013  #endif
27014  if (likely(v)) {
27015  int one = 1; int is_little = (int)*(unsigned char *)&one;
27016  unsigned char *bytes = (unsigned char *)&val;
27017  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27018  bytes, sizeof(val),
27019  is_little, !is_unsigned);
27020  Py_DECREF(v);
27021  if (likely(!ret))
27022  return val;
27023  }
27024 #endif
27025  return (long) -1;
27026  }
27027  } else {
27028  long val;
27029  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27030  if (!tmp) return (long) -1;
27031  val = __Pyx_PyInt_As_long(tmp);
27032  Py_DECREF(tmp);
27033  return val;
27034  }
27035 raise_overflow:
27036  PyErr_SetString(PyExc_OverflowError,
27037  "value too large to convert to long");
27038  return (long) -1;
27039 raise_neg_overflow:
27040  PyErr_SetString(PyExc_OverflowError,
27041  "can't convert negative value to long");
27042  return (long) -1;
27043 }
27044 
27045 /* CIntToPy */
27046 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
27047 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27048 #pragma GCC diagnostic push
27049 #pragma GCC diagnostic ignored "-Wconversion"
27050 #endif
27051  const long neg_one = (long) -1, const_zero = (long) 0;
27052 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27053 #pragma GCC diagnostic pop
27054 #endif
27055  const int is_unsigned = neg_one > const_zero;
27056  if (is_unsigned) {
27057  if (sizeof(long) < sizeof(long)) {
27058  return PyInt_FromLong((long) value);
27059  } else if (sizeof(long) <= sizeof(unsigned long)) {
27060  return PyLong_FromUnsignedLong((unsigned long) value);
27061 #ifdef HAVE_LONG_LONG
27062  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
27063  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27064 #endif
27065  }
27066  } else {
27067  if (sizeof(long) <= sizeof(long)) {
27068  return PyInt_FromLong((long) value);
27069 #ifdef HAVE_LONG_LONG
27070  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
27071  return PyLong_FromLongLong((PY_LONG_LONG) value);
27072 #endif
27073  }
27074  }
27075  {
27076  int one = 1; int little = (int)*(unsigned char *)&one;
27077  unsigned char *bytes = (unsigned char *)&value;
27078  return _PyLong_FromByteArray(bytes, sizeof(long),
27079  little, !is_unsigned);
27080  }
27081 }
27082 
27083 /* CIntFromPy */
27084 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
27085 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27086 #pragma GCC diagnostic push
27087 #pragma GCC diagnostic ignored "-Wconversion"
27088 #endif
27089  const char neg_one = (char) -1, const_zero = (char) 0;
27090 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27091 #pragma GCC diagnostic pop
27092 #endif
27093  const int is_unsigned = neg_one > const_zero;
27094 #if PY_MAJOR_VERSION < 3
27095  if (likely(PyInt_Check(x))) {
27096  if (sizeof(char) < sizeof(long)) {
27097  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
27098  } else {
27099  long val = PyInt_AS_LONG(x);
27100  if (is_unsigned && unlikely(val < 0)) {
27101  goto raise_neg_overflow;
27102  }
27103  return (char) val;
27104  }
27105  } else
27106 #endif
27107  if (likely(PyLong_Check(x))) {
27108  if (is_unsigned) {
27109 #if CYTHON_USE_PYLONG_INTERNALS
27110  const digit* digits = ((PyLongObject*)x)->ob_digit;
27111  switch (Py_SIZE(x)) {
27112  case 0: return (char) 0;
27113  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
27114  case 2:
27115  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
27116  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27117  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27118  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
27119  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27120  }
27121  }
27122  break;
27123  case 3:
27124  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
27125  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27126  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27127  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
27128  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27129  }
27130  }
27131  break;
27132  case 4:
27133  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
27134  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27135  __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])))
27136  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
27137  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27138  }
27139  }
27140  break;
27141  }
27142 #endif
27143 #if CYTHON_COMPILING_IN_CPYTHON
27144  if (unlikely(Py_SIZE(x) < 0)) {
27145  goto raise_neg_overflow;
27146  }
27147 #else
27148  {
27149  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27150  if (unlikely(result < 0))
27151  return (char) -1;
27152  if (unlikely(result == 1))
27153  goto raise_neg_overflow;
27154  }
27155 #endif
27156  if (sizeof(char) <= sizeof(unsigned long)) {
27157  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
27158 #ifdef HAVE_LONG_LONG
27159  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
27160  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27161 #endif
27162  }
27163  } else {
27164 #if CYTHON_USE_PYLONG_INTERNALS
27165  const digit* digits = ((PyLongObject*)x)->ob_digit;
27166  switch (Py_SIZE(x)) {
27167  case 0: return (char) 0;
27168  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
27169  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
27170  case -2:
27171  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
27172  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27173  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27174  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27175  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27176  }
27177  }
27178  break;
27179  case 2:
27180  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
27181  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27182  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27183  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27184  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27185  }
27186  }
27187  break;
27188  case -3:
27189  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27190  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27191  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27192  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27193  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27194  }
27195  }
27196  break;
27197  case 3:
27198  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
27199  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27200  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27201  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27202  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27203  }
27204  }
27205  break;
27206  case -4:
27207  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27208  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27209  __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])))
27210  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
27211  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27212  }
27213  }
27214  break;
27215  case 4:
27216  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
27217  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27218  __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])))
27219  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
27220  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27221  }
27222  }
27223  break;
27224  }
27225 #endif
27226  if (sizeof(char) <= sizeof(long)) {
27227  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
27228 #ifdef HAVE_LONG_LONG
27229  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
27230  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
27231 #endif
27232  }
27233  }
27234  {
27235 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27236  PyErr_SetString(PyExc_RuntimeError,
27237  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27238 #else
27239  char val;
27240  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27241  #if PY_MAJOR_VERSION < 3
27242  if (likely(v) && !PyLong_Check(v)) {
27243  PyObject *tmp = v;
27244  v = PyNumber_Long(tmp);
27245  Py_DECREF(tmp);
27246  }
27247  #endif
27248  if (likely(v)) {
27249  int one = 1; int is_little = (int)*(unsigned char *)&one;
27250  unsigned char *bytes = (unsigned char *)&val;
27251  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27252  bytes, sizeof(val),
27253  is_little, !is_unsigned);
27254  Py_DECREF(v);
27255  if (likely(!ret))
27256  return val;
27257  }
27258 #endif
27259  return (char) -1;
27260  }
27261  } else {
27262  char val;
27263  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27264  if (!tmp) return (char) -1;
27265  val = __Pyx_PyInt_As_char(tmp);
27266  Py_DECREF(tmp);
27267  return val;
27268  }
27269 raise_overflow:
27270  PyErr_SetString(PyExc_OverflowError,
27271  "value too large to convert to char");
27272  return (char) -1;
27273 raise_neg_overflow:
27274  PyErr_SetString(PyExc_OverflowError,
27275  "can't convert negative value to char");
27276  return (char) -1;
27277 }
27278 
27279 /* CheckBinaryVersion */
27280 static int __Pyx_check_binary_version(void) {
27281  char ctversion[5];
27282  int same=1, i, found_dot;
27283  const char* rt_from_call = Py_GetVersion();
27284  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
27285  found_dot = 0;
27286  for (i = 0; i < 4; i++) {
27287  if (!ctversion[i]) {
27288  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
27289  break;
27290  }
27291  if (rt_from_call[i] != ctversion[i]) {
27292  same = 0;
27293  break;
27294  }
27295  }
27296  if (!same) {
27297  char rtversion[5] = {'\0'};
27298  char message[200];
27299  for (i=0; i<4; ++i) {
27300  if (rt_from_call[i] == '.') {
27301  if (found_dot) break;
27302  found_dot = 1;
27303  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
27304  break;
27305  }
27306  rtversion[i] = rt_from_call[i];
27307  }
27308  PyOS_snprintf(message, sizeof(message),
27309  "compiletime version %s of module '%.100s' "
27310  "does not match runtime version %s",
27311  ctversion, __Pyx_MODULE_NAME, rtversion);
27312  return PyErr_WarnEx(NULL, message, 1);
27313  }
27314  return 0;
27315 }
27316 
27317 /* InitStrings */
27318 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
27319  while (t->p) {
27320  #if PY_MAJOR_VERSION < 3
27321  if (t->is_unicode) {
27322  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
27323  } else if (t->intern) {
27324  *t->p = PyString_InternFromString(t->s);
27325  } else {
27326  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
27327  }
27328  #else
27329  if (t->is_unicode | t->is_str) {
27330  if (t->intern) {
27331  *t->p = PyUnicode_InternFromString(t->s);
27332  } else if (t->encoding) {
27333  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
27334  } else {
27335  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
27336  }
27337  } else {
27338  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
27339  }
27340  #endif
27341  if (!*t->p)
27342  return -1;
27343  if (PyObject_Hash(*t->p) == -1)
27344  return -1;
27345  ++t;
27346  }
27347  return 0;
27348 }
27349 
27350 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
27351  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
27352 }
27353 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
27354  Py_ssize_t ignore;
27355  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
27356 }
27357 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27358 #if !CYTHON_PEP393_ENABLED
27359 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27360  char* defenc_c;
27361  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
27362  if (!defenc) return NULL;
27363  defenc_c = PyBytes_AS_STRING(defenc);
27364 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27365  {
27366  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
27367  char* c;
27368  for (c = defenc_c; c < end; c++) {
27369  if ((unsigned char) (*c) >= 128) {
27370  PyUnicode_AsASCIIString(o);
27371  return NULL;
27372  }
27373  }
27374  }
27375 #endif
27376  *length = PyBytes_GET_SIZE(defenc);
27377  return defenc_c;
27378 }
27379 #else
27380 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27381  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
27382 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27383  if (likely(PyUnicode_IS_ASCII(o))) {
27384  *length = PyUnicode_GET_LENGTH(o);
27385  return PyUnicode_AsUTF8(o);
27386  } else {
27387  PyUnicode_AsASCIIString(o);
27388  return NULL;
27389  }
27390 #else
27391  return PyUnicode_AsUTF8AndSize(o, length);
27392 #endif
27393 }
27394 #endif
27395 #endif
27396 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27397 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
27398  if (
27399 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27400  __Pyx_sys_getdefaultencoding_not_ascii &&
27401 #endif
27402  PyUnicode_Check(o)) {
27403  return __Pyx_PyUnicode_AsStringAndSize(o, length);
27404  } else
27405 #endif
27406 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
27407  if (PyByteArray_Check(o)) {
27408  *length = PyByteArray_GET_SIZE(o);
27409  return PyByteArray_AS_STRING(o);
27410  } else
27411 #endif
27412  {
27413  char* result;
27414  int r = PyBytes_AsStringAndSize(o, &result, length);
27415  if (unlikely(r < 0)) {
27416  return NULL;
27417  } else {
27418  return result;
27419  }
27420  }
27421 }
27422 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
27423  int is_true = x == Py_True;
27424  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
27425  else return PyObject_IsTrue(x);
27426 }
27427 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
27428  int retval;
27429  if (unlikely(!x)) return -1;
27430  retval = __Pyx_PyObject_IsTrue(x);
27431  Py_DECREF(x);
27432  return retval;
27433 }
27434 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
27435 #if PY_MAJOR_VERSION >= 3
27436  if (PyLong_Check(result)) {
27437  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
27438  "__int__ returned non-int (type %.200s). "
27439  "The ability to return an instance of a strict subclass of int "
27440  "is deprecated, and may be removed in a future version of Python.",
27441  Py_TYPE(result)->tp_name)) {
27442  Py_DECREF(result);
27443  return NULL;
27444  }
27445  return result;
27446  }
27447 #endif
27448  PyErr_Format(PyExc_TypeError,
27449  "__%.4s__ returned non-%.4s (type %.200s)",
27450  type_name, type_name, Py_TYPE(result)->tp_name);
27451  Py_DECREF(result);
27452  return NULL;
27453 }
27454 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
27455 #if CYTHON_USE_TYPE_SLOTS
27456  PyNumberMethods *m;
27457 #endif
27458  const char *name = NULL;
27459  PyObject *res = NULL;
27460 #if PY_MAJOR_VERSION < 3
27461  if (likely(PyInt_Check(x) || PyLong_Check(x)))
27462 #else
27463  if (likely(PyLong_Check(x)))
27464 #endif
27465  return __Pyx_NewRef(x);
27466 #if CYTHON_USE_TYPE_SLOTS
27467  m = Py_TYPE(x)->tp_as_number;
27468  #if PY_MAJOR_VERSION < 3
27469  if (m && m->nb_int) {
27470  name = "int";
27471  res = m->nb_int(x);
27472  }
27473  else if (m && m->nb_long) {
27474  name = "long";
27475  res = m->nb_long(x);
27476  }
27477  #else
27478  if (likely(m && m->nb_int)) {
27479  name = "int";
27480  res = m->nb_int(x);
27481  }
27482  #endif
27483 #else
27484  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
27485  res = PyNumber_Int(x);
27486  }
27487 #endif
27488  if (likely(res)) {
27489 #if PY_MAJOR_VERSION < 3
27490  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
27491 #else
27492  if (unlikely(!PyLong_CheckExact(res))) {
27493 #endif
27494  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
27495  }
27496  }
27497  else if (!PyErr_Occurred()) {
27498  PyErr_SetString(PyExc_TypeError,
27499  "an integer is required");
27500  }
27501  return res;
27502 }
27503 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
27504  Py_ssize_t ival;
27505  PyObject *x;
27506 #if PY_MAJOR_VERSION < 3
27507  if (likely(PyInt_CheckExact(b))) {
27508  if (sizeof(Py_ssize_t) >= sizeof(long))
27509  return PyInt_AS_LONG(b);
27510  else
27511  return PyInt_AsSsize_t(b);
27512  }
27513 #endif
27514  if (likely(PyLong_CheckExact(b))) {
27515  #if CYTHON_USE_PYLONG_INTERNALS
27516  const digit* digits = ((PyLongObject*)b)->ob_digit;
27517  const Py_ssize_t size = Py_SIZE(b);
27518  if (likely(__Pyx_sst_abs(size) <= 1)) {
27519  ival = likely(size) ? digits[0] : 0;
27520  if (size == -1) ival = -ival;
27521  return ival;
27522  } else {
27523  switch (size) {
27524  case 2:
27525  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27526  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27527  }
27528  break;
27529  case -2:
27530  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27531  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27532  }
27533  break;
27534  case 3:
27535  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27536  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27537  }
27538  break;
27539  case -3:
27540  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27541  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27542  }
27543  break;
27544  case 4:
27545  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27546  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]));
27547  }
27548  break;
27549  case -4:
27550  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27551  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]));
27552  }
27553  break;
27554  }
27555  }
27556  #endif
27557  return PyLong_AsSsize_t(b);
27558  }
27559  x = PyNumber_Index(b);
27560  if (!x) return -1;
27561  ival = PyInt_AsSsize_t(x);
27562  Py_DECREF(x);
27563  return ival;
27564 }
27565 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
27566  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
27567  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
27568 #if PY_MAJOR_VERSION < 3
27569  } else if (likely(PyInt_CheckExact(o))) {
27570  return PyInt_AS_LONG(o);
27571 #endif
27572  } else {
27573  Py_ssize_t ival;
27574  PyObject *x;
27575  x = PyNumber_Index(o);
27576  if (!x) return -1;
27577  ival = PyInt_AsLong(x);
27578  Py_DECREF(x);
27579  return ival;
27580  }
27581 }
27582 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
27583  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
27584 }
27585 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
27586  return PyInt_FromSize_t(ival);
27587 }
27588 
27589 
27590 #endif /* Py_PYTHON_H */
Mesh::nodeDiametersArray
double * nodeDiametersArray
Definition: mesh.h:69
proteus::partitionElements
int partitionElements(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, int nElements_overlap)
Definition: partitioning.cpp:4451
Mesh::interiorElementBoundariesArray
int * interiorElementBoundariesArray
Definition: mesh.h:50
Mesh::elementBoundaryNodesArray
int * elementBoundaryNodesArray
Definition: mesh.h:47
proteus::partitionNodesFromTriangleFiles
int partitionNodesFromTriangleFiles(const MPI_Comm &PROTEUS_COMM_WORLD, const char *filebase, int indexBase, Mesh &newMesh, int nNodes_overlap)
Definition: partitioning.cpp:2958
Mesh::nodeArray
double * nodeArray
Definition: mesh.h:67
Mesh::nodeElementsArray
int * nodeElementsArray
Definition: mesh.h:43
Mesh::max_nElements_node
int max_nElements_node
Definition: mesh.h:38
Mesh::pz
int pz
Definition: mesh.h:64
Mesh::nodeElementOffsets
int * nodeElementOffsets
Definition: mesh.h:44
proteus::buildQuadraticSubdomain2GlobalMappings_2d
int buildQuadraticSubdomain2GlobalMappings_2d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementBoundaryOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *elementBoundaryNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Definition: partitioning.cpp:5638
Mesh
Definition: mesh.h:28
Mesh::nEdges_global
int nEdges_global
Definition: mesh.h:39
Mesh::exteriorElementBoundariesArray
int * exteriorElementBoundariesArray
Definition: mesh.h:51
f
Double f
Definition: Headers.h:64
s
Double s
Definition: Headers.h:84
Mesh::nodeStarOffsets
int * nodeStarOffsets
Definition: mesh.h:54
Mesh::volume
double volume
Definition: mesh.h:70
Mesh::nNodes_elementBoundary
int nNodes_elementBoundary
Definition: mesh.h:33
Mesh::nElementBoundaries_global
int nElementBoundaries_global
Definition: mesh.h:35
partitioning.h
Mesh::hMin
double hMin
Definition: mesh.h:70
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
q
Double q
Definition: Headers.h:81
proteus::buildQuadraticCubeSubdomain2GlobalMappings_3d
int buildQuadraticCubeSubdomain2GlobalMappings_3d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *edgeOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *edgeNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Definition: partitioning.cpp:6076
proteus::buildQuadraticSubdomain2GlobalMappings_1d
int buildQuadraticSubdomain2GlobalMappings_1d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *elementNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Definition: partitioning.cpp:5486
Mesh::nInteriorElementBoundaries_global
int nInteriorElementBoundaries_global
Definition: mesh.h:36
Mesh::ny
int ny
Definition: mesh.h:63
Mesh::nodeStarArray
int * nodeStarArray
Definition: mesh.h:53
Mesh::h
double h
Definition: mesh.h:70
Mesh::nNodes_element
int nNodes_element
Definition: mesh.h:32
Mesh::elementBoundaryLocalElementBoundariesArray
int * elementBoundaryLocalElementBoundariesArray
Definition: mesh.h:49
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
Mesh::elementBoundaryMaterialTypes
int * elementBoundaryMaterialTypes
Definition: mesh.h:56
Mesh::elementInnerDiametersArray
double * elementInnerDiametersArray
Definition: mesh.h:67
T
Double T
Definition: Headers.h:87
Mesh::V_KNOT
double * V_KNOT
Definition: mesh.h:62
z
Double * z
Definition: Headers.h:49
proteus::buildQuadraticSubdomain2GlobalMappings_3d
int buildQuadraticSubdomain2GlobalMappings_3d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *edgeOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *edgeNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
Definition: partitioning.cpp:5797
Mesh::elementNodesArray
int * elementNodesArray
Definition: mesh.h:42
u
Double u
Definition: Headers.h:89
Mesh::elementBoundaryBarycentersArray
double * elementBoundaryBarycentersArray
Definition: mesh.h:68
Mesh::py
int py
Definition: mesh.h:64
Mesh::nz
int nz
Definition: mesh.h:63
Mesh::elementBoundariesArray
int * elementBoundariesArray
Definition: mesh.h:46
Mesh::elementBarycentersArray
double * elementBarycentersArray
Definition: mesh.h:68
c
Double c
Definition: Headers.h:54
Mesh::nElements_global
int nElements_global
Definition: mesh.h:30
mesh.h
Mesh::nodeMaterialTypes
int * nodeMaterialTypes
Definition: mesh.h:57
proteus::partitionNodes
int partitionNodes(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, int nNodes_overlap)
Definition: partitioning.cpp:539
Mesh::nElementBoundaries_element
int nElementBoundaries_element
Definition: mesh.h:34
Mesh::elementMaterialTypes
int * elementMaterialTypes
Definition: mesh.h:55
Mesh::elementDiametersArray
double * elementDiametersArray
Definition: mesh.h:67
Mesh::nNodes_global
int nNodes_global
Definition: mesh.h:31
Mesh::nExteriorElementBoundaries_global
int nExteriorElementBoundaries_global
Definition: mesh.h:37
Mesh::px
int px
Definition: mesh.h:64
proteus::partitionNodesFromTetgenFiles
int partitionNodesFromTetgenFiles(const MPI_Comm &PROTEUS_COMM_WORLD, const char *filebase, int indexBase, Mesh &newMesh, int nNodes_overlap)
Definition: partitioning.cpp:1464
Mesh::W_KNOT
double * W_KNOT
Definition: mesh.h:62
Mesh::elementIJK
int * elementIJK
Definition: mesh.h:60
Mesh::max_nNodeNeighbors_node
int max_nNodeNeighbors_node
Definition: mesh.h:40
proteus::buildDiscontinuousGalerkinSubdomain2GlobalMappings
int buildDiscontinuousGalerkinSubdomain2GlobalMappings(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementOffsets_subdomain_owned, const int *elementNumbering_subdomain2global, int nDOF_element, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global)
Definition: partitioning.cpp:6450
Mesh::sigmaMax
double sigmaMax
Definition: mesh.h:70
Mesh::nodeSupportArray
double * nodeSupportArray
Definition: mesh.h:69
r
Double r
Definition: Headers.h:83
Mesh::weights
double * weights
Definition: mesh.h:61
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
Mesh::edgeNodesArray
int * edgeNodesArray
Definition: mesh.h:52
Mesh::nx
int nx
Definition: mesh.h:63
Mesh::elementBoundaryDiametersArray
double * elementBoundaryDiametersArray
Definition: mesh.h:67
Mesh::elementBoundaryElementsArray
int * elementBoundaryElementsArray
Definition: mesh.h:48
Mesh::elementNeighborsArray
int * elementNeighborsArray
Definition: mesh.h:45
Mesh::U_KNOT
double * U_KNOT
Definition: mesh.h:62