proteus  1.8.1
C/C++/Fortran libraries
BoundaryConditions.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__BoundaryConditions
708 #define __PYX_HAVE_API__BoundaryConditions
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 "pythread.h"
721 #include <stdlib.h>
722 #include "pystate.h"
723 #ifdef _OPENMP
724 #include <omp.h>
725 #endif /* _OPENMP */
726 
727 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
728 #define CYTHON_WITHOUT_ASSERTIONS
729 #endif
730 
731 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
732  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
733 
734 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
735 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
736 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
737 #define __PYX_DEFAULT_STRING_ENCODING ""
738 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
739 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
740 #define __Pyx_uchar_cast(c) ((unsigned char)c)
741 #define __Pyx_long_cast(x) ((long)x)
742 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
743  (sizeof(type) < sizeof(Py_ssize_t)) ||\
744  (sizeof(type) > sizeof(Py_ssize_t) &&\
745  likely(v < (type)PY_SSIZE_T_MAX ||\
746  v == (type)PY_SSIZE_T_MAX) &&\
747  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
748  v == (type)PY_SSIZE_T_MIN))) ||\
749  (sizeof(type) == sizeof(Py_ssize_t) &&\
750  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
751  v == (type)PY_SSIZE_T_MAX))) )
752 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
753  return (size_t) i < (size_t) limit;
754 }
755 #if defined (__cplusplus) && __cplusplus >= 201103L
756  #include <cstdlib>
757  #define __Pyx_sst_abs(value) std::abs(value)
758 #elif SIZEOF_INT >= SIZEOF_SIZE_T
759  #define __Pyx_sst_abs(value) abs(value)
760 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
761  #define __Pyx_sst_abs(value) labs(value)
762 #elif defined (_MSC_VER)
763  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
764 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
765  #define __Pyx_sst_abs(value) llabs(value)
766 #elif defined (__GNUC__)
767  #define __Pyx_sst_abs(value) __builtin_llabs(value)
768 #else
769  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
770 #endif
771 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
772 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
773 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
774 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
775 #define __Pyx_PyBytes_FromString PyBytes_FromString
776 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
777 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
778 #if PY_MAJOR_VERSION < 3
779  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
780  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
781 #else
782  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
783  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
784 #endif
785 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
786 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
787 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
788 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
789 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
790 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
791 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
792 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
793 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
794 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
795 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
796 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
797 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
798 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
799 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
800 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
801 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
802  const Py_UNICODE *u_end = u;
803  while (*u_end++) ;
804  return (size_t)(u_end - u - 1);
805 }
806 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
807 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
808 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
809 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
810 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
811 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
812 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
813 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
814 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
815 #define __Pyx_PySequence_Tuple(obj)\
816  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
817 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
818 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
819 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
820 #if CYTHON_ASSUME_SAFE_MACROS
821 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
822 #else
823 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
824 #endif
825 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
826 #if PY_MAJOR_VERSION >= 3
827 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
828 #else
829 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
830 #endif
831 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
832 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
833 static int __Pyx_sys_getdefaultencoding_not_ascii;
834 static int __Pyx_init_sys_getdefaultencoding_params(void) {
835  PyObject* sys;
836  PyObject* default_encoding = NULL;
837  PyObject* ascii_chars_u = NULL;
838  PyObject* ascii_chars_b = NULL;
839  const char* default_encoding_c;
840  sys = PyImport_ImportModule("sys");
841  if (!sys) goto bad;
842  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
843  Py_DECREF(sys);
844  if (!default_encoding) goto bad;
845  default_encoding_c = PyBytes_AsString(default_encoding);
846  if (!default_encoding_c) goto bad;
847  if (strcmp(default_encoding_c, "ascii") == 0) {
848  __Pyx_sys_getdefaultencoding_not_ascii = 0;
849  } else {
850  char ascii_chars[128];
851  int c;
852  for (c = 0; c < 128; c++) {
853  ascii_chars[c] = c;
854  }
855  __Pyx_sys_getdefaultencoding_not_ascii = 1;
856  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
857  if (!ascii_chars_u) goto bad;
858  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
859  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
860  PyErr_Format(
861  PyExc_ValueError,
862  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
863  default_encoding_c);
864  goto bad;
865  }
866  Py_DECREF(ascii_chars_u);
867  Py_DECREF(ascii_chars_b);
868  }
869  Py_DECREF(default_encoding);
870  return 0;
871 bad:
872  Py_XDECREF(default_encoding);
873  Py_XDECREF(ascii_chars_u);
874  Py_XDECREF(ascii_chars_b);
875  return -1;
876 }
877 #endif
878 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
879 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
880 #else
881 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
882 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
883 static char* __PYX_DEFAULT_STRING_ENCODING;
884 static int __Pyx_init_sys_getdefaultencoding_params(void) {
885  PyObject* sys;
886  PyObject* default_encoding = NULL;
887  char* default_encoding_c;
888  sys = PyImport_ImportModule("sys");
889  if (!sys) goto bad;
890  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
891  Py_DECREF(sys);
892  if (!default_encoding) goto bad;
893  default_encoding_c = PyBytes_AsString(default_encoding);
894  if (!default_encoding_c) goto bad;
895  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
896  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
897  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
898  Py_DECREF(default_encoding);
899  return 0;
900 bad:
901  Py_XDECREF(default_encoding);
902  return -1;
903 }
904 #endif
905 #endif
906 
907 
908 /* Test for GCC > 2.95 */
909 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
910  #define likely(x) __builtin_expect(!!(x), 1)
911  #define unlikely(x) __builtin_expect(!!(x), 0)
912 #else /* !__GNUC__ or GCC < 2.95 */
913  #define likely(x) (x)
914  #define unlikely(x) (x)
915 #endif /* __GNUC__ */
916 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
917 
918 static PyObject *__pyx_m = NULL;
919 static PyObject *__pyx_d;
920 static PyObject *__pyx_b;
921 static PyObject *__pyx_cython_runtime = NULL;
922 static PyObject *__pyx_empty_tuple;
923 static PyObject *__pyx_empty_bytes;
924 static PyObject *__pyx_empty_unicode;
925 static int __pyx_lineno;
926 static int __pyx_clineno = 0;
927 static const char * __pyx_cfilenm= __FILE__;
928 static const char *__pyx_filename;
929 
930 /* Header.proto */
931 #if !defined(CYTHON_CCOMPLEX)
932  #if defined(__cplusplus)
933  #define CYTHON_CCOMPLEX 1
934  #elif defined(_Complex_I)
935  #define CYTHON_CCOMPLEX 1
936  #else
937  #define CYTHON_CCOMPLEX 0
938  #endif
939 #endif
940 #if CYTHON_CCOMPLEX
941  #ifdef __cplusplus
942  #include <complex>
943  #else
944  #include <complex.h>
945  #endif
946 #endif
947 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
948  #undef _Complex_I
949  #define _Complex_I 1.0fj
950 #endif
951 
952 
953 static const char *__pyx_f[] = {
954  "proteus/BoundaryConditions.py",
955  "stringsource",
956  "proteus/BoundaryConditions.pxd",
957  "__init__.pxd",
958  "type.pxd",
959 };
960 /* MemviewSliceStruct.proto */
961 struct __pyx_memoryview_obj;
962 typedef struct {
963  struct __pyx_memoryview_obj *memview;
964  char *data;
965  Py_ssize_t shape[8];
966  Py_ssize_t strides[8];
967  Py_ssize_t suboffsets[8];
968 } __Pyx_memviewslice;
969 #define __Pyx_MemoryView_Len(m) (m.shape[0])
970 
971 /* Atomics.proto */
972 #include <pythread.h>
973 #ifndef CYTHON_ATOMICS
974  #define CYTHON_ATOMICS 1
975 #endif
976 #define __pyx_atomic_int_type int
977 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
978  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
979  !defined(__i386__)
980  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
981  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
982  #ifdef __PYX_DEBUG_ATOMICS
983  #warning "Using GNU atomics"
984  #endif
985 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
986  #include <Windows.h>
987  #undef __pyx_atomic_int_type
988  #define __pyx_atomic_int_type LONG
989  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
990  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
991  #ifdef __PYX_DEBUG_ATOMICS
992  #pragma message ("Using MSVC atomics")
993  #endif
994 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
995  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
996  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
997  #ifdef __PYX_DEBUG_ATOMICS
998  #warning "Using Intel atomics"
999  #endif
1000 #else
1001  #undef CYTHON_ATOMICS
1002  #define CYTHON_ATOMICS 0
1003  #ifdef __PYX_DEBUG_ATOMICS
1004  #warning "Not using atomics"
1005  #endif
1006 #endif
1007 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1008 #if CYTHON_ATOMICS
1009  #define __pyx_add_acquisition_count(memview)\
1010  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1011  #define __pyx_sub_acquisition_count(memview)\
1012  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1013 #else
1014  #define __pyx_add_acquisition_count(memview)\
1015  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1016  #define __pyx_sub_acquisition_count(memview)\
1017  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1018 #endif
1019 
1020 /* ForceInitThreads.proto */
1021 #ifndef __PYX_FORCE_INIT_THREADS
1022  #define __PYX_FORCE_INIT_THREADS 0
1023 #endif
1024 
1025 /* NoFastGil.proto */
1026 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1027 #define __Pyx_PyGILState_Release PyGILState_Release
1028 #define __Pyx_FastGIL_Remember()
1029 #define __Pyx_FastGIL_Forget()
1030 #define __Pyx_FastGilFuncInit()
1031 
1032 /* BufferFormatStructs.proto */
1033 #define IS_UNSIGNED(type) (((type) -1) > 0)
1034 struct __Pyx_StructField_;
1035 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1036 typedef struct {
1037  const char* name;
1038  struct __Pyx_StructField_* fields;
1039  size_t size;
1040  size_t arraysize[8];
1041  int ndim;
1042  char typegroup;
1043  char is_unsigned;
1044  int flags;
1045 } __Pyx_TypeInfo;
1046 typedef struct __Pyx_StructField_ {
1047  __Pyx_TypeInfo* type;
1048  const char* name;
1049  size_t offset;
1050 } __Pyx_StructField;
1051 typedef struct {
1052  __Pyx_StructField* field;
1053  size_t parent_offset;
1054 } __Pyx_BufFmt_StackElem;
1055 typedef struct {
1056  __Pyx_StructField root;
1057  __Pyx_BufFmt_StackElem* head;
1058  size_t fmt_offset;
1059  size_t new_count, enc_count;
1060  size_t struct_alignment;
1061  int is_complex;
1062  char enc_type;
1063  char new_packmode;
1064  char enc_packmode;
1065  char is_valid_array;
1066 } __Pyx_BufFmt_Context;
1067 
1068 
1069 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":690
1070  * # in Cython to enable them only on the right systems.
1071  *
1072  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1073  * ctypedef npy_int16 int16_t
1074  * ctypedef npy_int32 int32_t
1075  */
1076 typedef npy_int8 __pyx_t_5numpy_int8_t;
1077 
1078 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":691
1079  *
1080  * ctypedef npy_int8 int8_t
1081  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1082  * ctypedef npy_int32 int32_t
1083  * ctypedef npy_int64 int64_t
1084  */
1085 typedef npy_int16 __pyx_t_5numpy_int16_t;
1086 
1087 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":692
1088  * ctypedef npy_int8 int8_t
1089  * ctypedef npy_int16 int16_t
1090  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1091  * ctypedef npy_int64 int64_t
1092  * #ctypedef npy_int96 int96_t
1093  */
1094 typedef npy_int32 __pyx_t_5numpy_int32_t;
1095 
1096 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":693
1097  * ctypedef npy_int16 int16_t
1098  * ctypedef npy_int32 int32_t
1099  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1100  * #ctypedef npy_int96 int96_t
1101  * #ctypedef npy_int128 int128_t
1102  */
1103 typedef npy_int64 __pyx_t_5numpy_int64_t;
1104 
1105 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":697
1106  * #ctypedef npy_int128 int128_t
1107  *
1108  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1109  * ctypedef npy_uint16 uint16_t
1110  * ctypedef npy_uint32 uint32_t
1111  */
1112 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1113 
1114 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":698
1115  *
1116  * ctypedef npy_uint8 uint8_t
1117  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1118  * ctypedef npy_uint32 uint32_t
1119  * ctypedef npy_uint64 uint64_t
1120  */
1121 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1122 
1123 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":699
1124  * ctypedef npy_uint8 uint8_t
1125  * ctypedef npy_uint16 uint16_t
1126  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1127  * ctypedef npy_uint64 uint64_t
1128  * #ctypedef npy_uint96 uint96_t
1129  */
1130 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1131 
1132 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":700
1133  * ctypedef npy_uint16 uint16_t
1134  * ctypedef npy_uint32 uint32_t
1135  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1136  * #ctypedef npy_uint96 uint96_t
1137  * #ctypedef npy_uint128 uint128_t
1138  */
1139 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1140 
1141 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":704
1142  * #ctypedef npy_uint128 uint128_t
1143  *
1144  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1145  * ctypedef npy_float64 float64_t
1146  * #ctypedef npy_float80 float80_t
1147  */
1148 typedef npy_float32 __pyx_t_5numpy_float32_t;
1149 
1150 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":705
1151  *
1152  * ctypedef npy_float32 float32_t
1153  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1154  * #ctypedef npy_float80 float80_t
1155  * #ctypedef npy_float128 float128_t
1156  */
1157 typedef npy_float64 __pyx_t_5numpy_float64_t;
1158 
1159 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":714
1160  * # The int types are mapped a bit surprising --
1161  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1162  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1163  * ctypedef npy_longlong long_t
1164  * ctypedef npy_longlong longlong_t
1165  */
1166 typedef npy_long __pyx_t_5numpy_int_t;
1167 
1168 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":715
1169  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1170  * ctypedef npy_long int_t
1171  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1172  * ctypedef npy_longlong longlong_t
1173  *
1174  */
1175 typedef npy_longlong __pyx_t_5numpy_long_t;
1176 
1177 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":716
1178  * ctypedef npy_long int_t
1179  * ctypedef npy_longlong long_t
1180  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1181  *
1182  * ctypedef npy_ulong uint_t
1183  */
1184 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1185 
1186 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":718
1187  * ctypedef npy_longlong longlong_t
1188  *
1189  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1190  * ctypedef npy_ulonglong ulong_t
1191  * ctypedef npy_ulonglong ulonglong_t
1192  */
1193 typedef npy_ulong __pyx_t_5numpy_uint_t;
1194 
1195 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":719
1196  *
1197  * ctypedef npy_ulong uint_t
1198  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1199  * ctypedef npy_ulonglong ulonglong_t
1200  *
1201  */
1202 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1203 
1204 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":720
1205  * ctypedef npy_ulong uint_t
1206  * ctypedef npy_ulonglong ulong_t
1207  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1208  *
1209  * ctypedef npy_intp intp_t
1210  */
1211 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1212 
1213 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":722
1214  * ctypedef npy_ulonglong ulonglong_t
1215  *
1216  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1217  * ctypedef npy_uintp uintp_t
1218  *
1219  */
1220 typedef npy_intp __pyx_t_5numpy_intp_t;
1221 
1222 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":723
1223  *
1224  * ctypedef npy_intp intp_t
1225  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1226  *
1227  * ctypedef npy_double float_t
1228  */
1229 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1230 
1231 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":725
1232  * ctypedef npy_uintp uintp_t
1233  *
1234  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1235  * ctypedef npy_double double_t
1236  * ctypedef npy_longdouble longdouble_t
1237  */
1238 typedef npy_double __pyx_t_5numpy_float_t;
1239 
1240 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":726
1241  *
1242  * ctypedef npy_double float_t
1243  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1244  * ctypedef npy_longdouble longdouble_t
1245  *
1246  */
1247 typedef npy_double __pyx_t_5numpy_double_t;
1248 
1249 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":727
1250  * ctypedef npy_double float_t
1251  * ctypedef npy_double double_t
1252  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1253  *
1254  * ctypedef npy_cfloat cfloat_t
1255  */
1256 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1257 /* Declarations.proto */
1258 #if CYTHON_CCOMPLEX
1259  #ifdef __cplusplus
1260  typedef ::std::complex< float > __pyx_t_float_complex;
1261  #else
1262  typedef float _Complex __pyx_t_float_complex;
1263  #endif
1264 #else
1265  typedef struct { float real, imag; } __pyx_t_float_complex;
1266 #endif
1267 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1268 
1269 /* Declarations.proto */
1270 #if CYTHON_CCOMPLEX
1271  #ifdef __cplusplus
1272  typedef ::std::complex< double > __pyx_t_double_complex;
1273  #else
1274  typedef double _Complex __pyx_t_double_complex;
1275  #endif
1276 #else
1277  typedef struct { double real, imag; } __pyx_t_double_complex;
1278 #endif
1279 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1280 
1281 
1282 /*--- Type declarations ---*/
1283 struct __pyx_obj_18BoundaryConditions_BC_Base;
1284 struct __pyx_obj_18BoundaryConditions_BoundaryCondition;
1285 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC;
1286 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
1287 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
1288 struct __pyx_array_obj;
1289 struct __pyx_MemviewEnum_obj;
1290 struct __pyx_memoryview_obj;
1291 struct __pyx_memoryviewslice_obj;
1292 
1293 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":729
1294  * ctypedef npy_longdouble longdouble_t
1295  *
1296  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1297  * ctypedef npy_cdouble cdouble_t
1298  * ctypedef npy_clongdouble clongdouble_t
1299  */
1300 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1301 
1302 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":730
1303  *
1304  * ctypedef npy_cfloat cfloat_t
1305  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1306  * ctypedef npy_clongdouble clongdouble_t
1307  *
1308  */
1309 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1310 
1311 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":731
1312  * ctypedef npy_cfloat cfloat_t
1313  * ctypedef npy_cdouble cdouble_t
1314  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1315  *
1316  * ctypedef npy_cdouble complex_t
1317  */
1318 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1319 
1320 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":733
1321  * ctypedef npy_clongdouble clongdouble_t
1322  *
1323  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1324  *
1325  * cdef inline object PyArray_MultiIterNew1(a):
1326  */
1327 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1328 struct __pyx_defaults;
1329 typedef struct __pyx_defaults __pyx_defaults;
1330 struct __pyx_defaults1;
1331 typedef struct __pyx_defaults1 __pyx_defaults1;
1332 struct __pyx_defaults2;
1333 typedef struct __pyx_defaults2 __pyx_defaults2;
1334 
1335 /* "BoundaryConditions.pxd":16
1336  * # cpdef void getContext(BC_Base cls, object context=*)
1337  *
1338  * ctypedef double (*cpp_uOfXT) (BoundaryCondition, double[:], double) # <<<<<<<<<<<<<<
1339  * cdef class BoundaryCondition:
1340  * cdef cpp_uOfXT uuOfXT
1341  */
1342 typedef double (*__pyx_t_18BoundaryConditions_cpp_uOfXT)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, __Pyx_memviewslice, double);
1343 struct __pyx_defaults {
1344  PyObject *__pyx_arg_n;
1345 };
1346 struct __pyx_defaults1 {
1347  PyObject *__pyx_arg_n;
1348 };
1349 struct __pyx_defaults2 {
1350  PyObject *__pyx_arg_n;
1351 };
1352 
1353 /* "BoundaryConditions.pxd":5
1354  * import cython
1355  *
1356  * cdef class BC_Base: # <<<<<<<<<<<<<<
1357  * cdef double[:] _b_or
1358  * cdef public:
1359  */
1360 struct __pyx_obj_18BoundaryConditions_BC_Base {
1361  PyObject_HEAD
1362  __Pyx_memviewslice _b_or;
1363  int nd;
1364  PyObject *Shape;
1365  PyObject *name;
1366  PyObject *BC_type;
1367  PyObject *ct;
1368 };
1369 
1370 
1371 /* "BoundaryConditions.pxd":17
1372  *
1373  * ctypedef double (*cpp_uOfXT) (BoundaryCondition, double[:], double)
1374  * cdef class BoundaryCondition: # <<<<<<<<<<<<<<
1375  * cdef cpp_uOfXT uuOfXT
1376  * cdef public:
1377  */
1378 struct __pyx_obj_18BoundaryConditions_BoundaryCondition {
1379  PyObject_HEAD
1380  struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtab;
1381  __pyx_t_18BoundaryConditions_cpp_uOfXT uuOfXT;
1382  PyObject *uOfXT;
1383 };
1384 
1385 
1386 /* "BoundaryConditions.py":87
1387  * self.uOfXT = None
1388  *
1389  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
1390  * """
1391  * function returning constant BC
1392  */
1393 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC {
1394  PyObject_HEAD
1395  PyObject *__pyx_v_value;
1396 };
1397 
1398 
1399 /* "BoundaryConditions.py":100
1400  *
1401  *
1402  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
1403  * """
1404  * function returning value=a0+ax*x+ay*y+az*z
1405  */
1406 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC {
1407  PyObject_HEAD
1408  PyObject *__pyx_v_a;
1409  PyObject *__pyx_v_a0;
1410 };
1411 
1412 
1413 /* "BoundaryConditions.py":115
1414  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
1415  *
1416  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
1417  * """
1418  * function setting a linear ramp from t=0 to t=t1
1419  */
1420 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp {
1421  PyObject_HEAD
1422  PyObject *__pyx_v_t1;
1423  PyObject *__pyx_v_value;
1424 };
1425 
1426 
1427 /* "View.MemoryView":105
1428  *
1429  * @cname("__pyx_array")
1430  * cdef class array: # <<<<<<<<<<<<<<
1431  *
1432  * cdef:
1433  */
1434 struct __pyx_array_obj {
1435  PyObject_HEAD
1436  struct __pyx_vtabstruct_array *__pyx_vtab;
1437  char *data;
1438  Py_ssize_t len;
1439  char *format;
1440  int ndim;
1441  Py_ssize_t *_shape;
1442  Py_ssize_t *_strides;
1443  Py_ssize_t itemsize;
1444  PyObject *mode;
1445  PyObject *_format;
1446  void (*callback_free_data)(void *);
1447  int free_data;
1448  int dtype_is_object;
1449 };
1450 
1451 
1452 /* "View.MemoryView":279
1453  *
1454  * @cname('__pyx_MemviewEnum')
1455  * cdef class Enum(object): # <<<<<<<<<<<<<<
1456  * cdef object name
1457  * def __init__(self, name):
1458  */
1459 struct __pyx_MemviewEnum_obj {
1460  PyObject_HEAD
1461  PyObject *name;
1462 };
1463 
1464 
1465 /* "View.MemoryView":330
1466  *
1467  * @cname('__pyx_memoryview')
1468  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1469  *
1470  * cdef object obj
1471  */
1472 struct __pyx_memoryview_obj {
1473  PyObject_HEAD
1474  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1475  PyObject *obj;
1476  PyObject *_size;
1477  PyObject *_array_interface;
1478  PyThread_type_lock lock;
1479  __pyx_atomic_int acquisition_count[2];
1480  __pyx_atomic_int *acquisition_count_aligned_p;
1481  Py_buffer view;
1482  int flags;
1483  int dtype_is_object;
1484  __Pyx_TypeInfo *typeinfo;
1485 };
1486 
1487 
1488 /* "View.MemoryView":965
1489  *
1490  * @cname('__pyx_memoryviewslice')
1491  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1492  * "Internal class for passing memoryview slices to Python"
1493  *
1494  */
1495 struct __pyx_memoryviewslice_obj {
1496  struct __pyx_memoryview_obj __pyx_base;
1497  __Pyx_memviewslice from_slice;
1498  PyObject *from_object;
1499  PyObject *(*to_object_func)(char *);
1500  int (*to_dtype_func)(char *, PyObject *);
1501 };
1502 
1503 
1504 
1505 /* "BoundaryConditions.py":68
1506  *
1507  *
1508  * class BoundaryCondition: # <<<<<<<<<<<<<<
1509  * """
1510  * Boundary condition class
1511  */
1512 
1513 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition {
1514  void (*resetBC)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, int __pyx_skip_dispatch);
1515 };
1516 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
1517 
1518 
1519 /* "View.MemoryView":105
1520  *
1521  * @cname("__pyx_array")
1522  * cdef class array: # <<<<<<<<<<<<<<
1523  *
1524  * cdef:
1525  */
1526 
1527 struct __pyx_vtabstruct_array {
1528  PyObject *(*get_memview)(struct __pyx_array_obj *);
1529 };
1530 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1531 
1532 
1533 /* "View.MemoryView":330
1534  *
1535  * @cname('__pyx_memoryview')
1536  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1537  *
1538  * cdef object obj
1539  */
1540 
1541 struct __pyx_vtabstruct_memoryview {
1542  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1543  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1544  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1545  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1546  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1547  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1548  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1549 };
1550 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1551 
1552 
1553 /* "View.MemoryView":965
1554  *
1555  * @cname('__pyx_memoryviewslice')
1556  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1557  * "Internal class for passing memoryview slices to Python"
1558  *
1559  */
1560 
1561 struct __pyx_vtabstruct__memoryviewslice {
1562  struct __pyx_vtabstruct_memoryview __pyx_base;
1563 };
1564 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1565 
1566 /* --- Runtime support code (head) --- */
1567 /* Refnanny.proto */
1568 #ifndef CYTHON_REFNANNY
1569  #define CYTHON_REFNANNY 0
1570 #endif
1571 #if CYTHON_REFNANNY
1572  typedef struct {
1573  void (*INCREF)(void*, PyObject*, int);
1574  void (*DECREF)(void*, PyObject*, int);
1575  void (*GOTREF)(void*, PyObject*, int);
1576  void (*GIVEREF)(void*, PyObject*, int);
1577  void* (*SetupContext)(const char*, int, const char*);
1578  void (*FinishContext)(void**);
1579  } __Pyx_RefNannyAPIStruct;
1580  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1581  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1582  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1583 #ifdef WITH_THREAD
1584  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1585  if (acquire_gil) {\
1586  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1587  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1588  PyGILState_Release(__pyx_gilstate_save);\
1589  } else {\
1590  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1591  }
1592 #else
1593  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1594  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1595 #endif
1596  #define __Pyx_RefNannyFinishContext()\
1597  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1598  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1599  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1600  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1601  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1602  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1603  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1604  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1605  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1606 #else
1607  #define __Pyx_RefNannyDeclarations
1608  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1609  #define __Pyx_RefNannyFinishContext()
1610  #define __Pyx_INCREF(r) Py_INCREF(r)
1611  #define __Pyx_DECREF(r) Py_DECREF(r)
1612  #define __Pyx_GOTREF(r)
1613  #define __Pyx_GIVEREF(r)
1614  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1615  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1616  #define __Pyx_XGOTREF(r)
1617  #define __Pyx_XGIVEREF(r)
1618 #endif
1619 #define __Pyx_XDECREF_SET(r, v) do {\
1620  PyObject *tmp = (PyObject *) r;\
1621  r = v; __Pyx_XDECREF(tmp);\
1622  } while (0)
1623 #define __Pyx_DECREF_SET(r, v) do {\
1624  PyObject *tmp = (PyObject *) r;\
1625  r = v; __Pyx_DECREF(tmp);\
1626  } while (0)
1627 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1628 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1629 
1630 /* PyObjectGetAttrStr.proto */
1631 #if CYTHON_USE_TYPE_SLOTS
1632 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1633 #else
1634 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1635 #endif
1636 
1637 /* GetBuiltinName.proto */
1638 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1639 
1640 /* RaiseDoubleKeywords.proto */
1641 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1642 
1643 /* ParseKeywords.proto */
1644 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1645  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1646  const char* function_name);
1647 
1648 /* RaiseArgTupleInvalid.proto */
1649 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1650  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1651 
1652 /* PyThreadStateGet.proto */
1653 #if CYTHON_FAST_THREAD_STATE
1654 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1655 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1656 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1657 #else
1658 #define __Pyx_PyThreadState_declare
1659 #define __Pyx_PyThreadState_assign
1660 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1661 #endif
1662 
1663 /* PyErrFetchRestore.proto */
1664 #if CYTHON_FAST_THREAD_STATE
1665 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1666 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1667 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1668 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1669 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1670 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1671 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1672 #if CYTHON_COMPILING_IN_CPYTHON
1673 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1674 #else
1675 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1676 #endif
1677 #else
1678 #define __Pyx_PyErr_Clear() PyErr_Clear()
1679 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1680 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1681 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1682 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1683 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1684 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1685 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1686 #endif
1687 
1688 /* Profile.proto */
1689 #ifndef CYTHON_PROFILE
1690 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1691  #define CYTHON_PROFILE 0
1692 #else
1693  #define CYTHON_PROFILE 1
1694 #endif
1695 #endif
1696 #ifndef CYTHON_TRACE_NOGIL
1697  #define CYTHON_TRACE_NOGIL 0
1698 #else
1699  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1700  #define CYTHON_TRACE 1
1701  #endif
1702 #endif
1703 #ifndef CYTHON_TRACE
1704  #define CYTHON_TRACE 0
1705 #endif
1706 #if CYTHON_TRACE
1707  #undef CYTHON_PROFILE_REUSE_FRAME
1708 #endif
1709 #ifndef CYTHON_PROFILE_REUSE_FRAME
1710  #define CYTHON_PROFILE_REUSE_FRAME 0
1711 #endif
1712 #if CYTHON_PROFILE || CYTHON_TRACE
1713  #include "compile.h"
1714  #include "frameobject.h"
1715  #include "traceback.h"
1716 #if PY_VERSION_HEX >= 0x030b00a6
1717  #ifndef Py_BUILD_CORE
1718  #define Py_BUILD_CORE 1
1719  #endif
1720  #include "internal/pycore_frame.h"
1721 #endif
1722  #if CYTHON_PROFILE_REUSE_FRAME
1723  #define CYTHON_FRAME_MODIFIER static
1724  #define CYTHON_FRAME_DEL(frame)
1725  #else
1726  #define CYTHON_FRAME_MODIFIER
1727  #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1728  #endif
1729  #define __Pyx_TraceDeclarations\
1730  static PyCodeObject *__pyx_frame_code = NULL;\
1731  CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1732  int __Pyx_use_tracing = 0;
1733  #define __Pyx_TraceFrameInit(codeobj)\
1734  if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1735 #if PY_VERSION_HEX >= 0x030b00a2
1736  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1737  (unlikely((tstate)->cframe->use_tracing) &&\
1738  (!(check_tracing) || !(tstate)->tracing) &&\
1739  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1740  #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
1741  #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
1742 #elif PY_VERSION_HEX >= 0x030a00b1
1743  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1744  (unlikely((tstate)->cframe->use_tracing) &&\
1745  (!(check_tracing) || !(tstate)->tracing) &&\
1746  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1747  #define __Pyx_EnterTracing(tstate)\
1748  do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
1749  #define __Pyx_LeaveTracing(tstate)\
1750  do {\
1751  tstate->tracing--;\
1752  tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1753  || tstate->c_profilefunc != NULL);\
1754  } while (0)
1755 #else
1756  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1757  (unlikely((tstate)->use_tracing) &&\
1758  (!(check_tracing) || !(tstate)->tracing) &&\
1759  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1760  #define __Pyx_EnterTracing(tstate)\
1761  do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
1762  #define __Pyx_LeaveTracing(tstate)\
1763  do {\
1764  tstate->tracing--;\
1765  tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1766  || tstate->c_profilefunc != NULL);\
1767  } while (0)
1768 #endif
1769  #ifdef WITH_THREAD
1770  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1771  if (nogil) {\
1772  if (CYTHON_TRACE_NOGIL) {\
1773  PyThreadState *tstate;\
1774  PyGILState_STATE state = PyGILState_Ensure();\
1775  tstate = __Pyx_PyThreadState_Current;\
1776  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1777  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1778  }\
1779  PyGILState_Release(state);\
1780  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1781  }\
1782  } else {\
1783  PyThreadState* tstate = PyThreadState_GET();\
1784  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1785  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1786  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1787  }\
1788  }
1789  #else
1790  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1791  { PyThreadState* tstate = PyThreadState_GET();\
1792  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1793  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1794  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1795  }\
1796  }
1797  #endif
1798  #define __Pyx_TraceException()\
1799  if (likely(!__Pyx_use_tracing)); else {\
1800  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1801  if (__Pyx_IsTracing(tstate, 0, 1)) {\
1802  __Pyx_EnterTracing(tstate);\
1803  PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1804  if (exc_info) {\
1805  if (CYTHON_TRACE && tstate->c_tracefunc)\
1806  tstate->c_tracefunc(\
1807  tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1808  tstate->c_profilefunc(\
1809  tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1810  Py_DECREF(exc_info);\
1811  }\
1812  __Pyx_LeaveTracing(tstate);\
1813  }\
1814  }
1815  static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1816  PyObject *type, *value, *traceback;
1817  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1818  __Pyx_EnterTracing(tstate);
1819  if (CYTHON_TRACE && tstate->c_tracefunc)
1820  tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1821  if (tstate->c_profilefunc)
1822  tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1823  CYTHON_FRAME_DEL(frame);
1824  __Pyx_LeaveTracing(tstate);
1825  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1826  }
1827  #ifdef WITH_THREAD
1828  #define __Pyx_TraceReturn(result, nogil)\
1829  if (likely(!__Pyx_use_tracing)); else {\
1830  if (nogil) {\
1831  if (CYTHON_TRACE_NOGIL) {\
1832  PyThreadState *tstate;\
1833  PyGILState_STATE state = PyGILState_Ensure();\
1834  tstate = __Pyx_PyThreadState_Current;\
1835  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1836  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1837  }\
1838  PyGILState_Release(state);\
1839  }\
1840  } else {\
1841  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1842  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1843  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1844  }\
1845  }\
1846  }
1847  #else
1848  #define __Pyx_TraceReturn(result, nogil)\
1849  if (likely(!__Pyx_use_tracing)); else {\
1850  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1851  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1852  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1853  }\
1854  }
1855  #endif
1856  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
1857  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
1858 #else
1859  #define __Pyx_TraceDeclarations
1860  #define __Pyx_TraceFrameInit(codeobj)
1861  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1862  #define __Pyx_TraceException()
1863  #define __Pyx_TraceReturn(result, nogil)
1864 #endif
1865 #if CYTHON_TRACE
1866  static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
1867  int ret;
1868  PyObject *type, *value, *traceback;
1869  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1870  __Pyx_PyFrame_SetLineNumber(frame, lineno);
1871  __Pyx_EnterTracing(tstate);
1872  ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1873  __Pyx_LeaveTracing(tstate);
1874  if (likely(!ret)) {
1875  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1876  } else {
1877  Py_XDECREF(type);
1878  Py_XDECREF(value);
1879  Py_XDECREF(traceback);
1880  }
1881  return ret;
1882  }
1883  #ifdef WITH_THREAD
1884  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1885  if (likely(!__Pyx_use_tracing)); else {\
1886  if (nogil) {\
1887  if (CYTHON_TRACE_NOGIL) {\
1888  int ret = 0;\
1889  PyThreadState *tstate;\
1890  PyGILState_STATE state = PyGILState_Ensure();\
1891  tstate = __Pyx_PyThreadState_Current;\
1892  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1893  ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1894  }\
1895  PyGILState_Release(state);\
1896  if (unlikely(ret)) goto_error;\
1897  }\
1898  } else {\
1899  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1900  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1901  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1902  if (unlikely(ret)) goto_error;\
1903  }\
1904  }\
1905  }
1906  #else
1907  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1908  if (likely(!__Pyx_use_tracing)); else {\
1909  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1910  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1911  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1912  if (unlikely(ret)) goto_error;\
1913  }\
1914  }
1915  #endif
1916 #else
1917  #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1918 #endif
1919 
1920 /* GetItemInt.proto */
1921 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1922  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1923  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1924  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1925  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1926 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1927  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1928  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1929  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1930 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1931  int wraparound, int boundscheck);
1932 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1933  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1934  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1935  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1936 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1937  int wraparound, int boundscheck);
1938 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1939 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1940  int is_list, int wraparound, int boundscheck);
1941 
1942 /* ObjectGetItem.proto */
1943 #if CYTHON_USE_TYPE_SLOTS
1944 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1945 #else
1946 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1947 #endif
1948 
1949 /* MemviewSliceInit.proto */
1950 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1951 #define __Pyx_MEMVIEW_DIRECT 1
1952 #define __Pyx_MEMVIEW_PTR 2
1953 #define __Pyx_MEMVIEW_FULL 4
1954 #define __Pyx_MEMVIEW_CONTIG 8
1955 #define __Pyx_MEMVIEW_STRIDED 16
1956 #define __Pyx_MEMVIEW_FOLLOW 32
1957 #define __Pyx_IS_C_CONTIG 1
1958 #define __Pyx_IS_F_CONTIG 2
1959 static int __Pyx_init_memviewslice(
1960  struct __pyx_memoryview_obj *memview,
1961  int ndim,
1962  __Pyx_memviewslice *memviewslice,
1963  int memview_is_new_reference);
1964 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1965  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1966 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1967  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1968 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1969 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1970 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1971 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1972 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1973 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1974 
1975 /* Import.proto */
1976 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1977 
1978 /* ImportFrom.proto */
1979 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1980 
1981 /* PyFunctionFastCall.proto */
1982 #if CYTHON_FAST_PYCALL
1983 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1984  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1985 #if 1 || PY_VERSION_HEX < 0x030600B1
1986 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1987 #else
1988 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1989 #endif
1990 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1991  (sizeof(char [1 - 2*!(cond)]) - 1)
1992 #ifndef Py_MEMBER_SIZE
1993 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1994 #endif
1995 #if CYTHON_FAST_PYCALL
1996  static size_t __pyx_pyframe_localsplus_offset = 0;
1997  #include "frameobject.h"
1998 #if PY_VERSION_HEX >= 0x030b00a6
1999  #ifndef Py_BUILD_CORE
2000  #define Py_BUILD_CORE 1
2001  #endif
2002  #include "internal/pycore_frame.h"
2003 #endif
2004  #define __Pxy_PyFrame_Initialize_Offsets()\
2005  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2006  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2007  #define __Pyx_PyFrame_GetLocalsplus(frame)\
2008  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2009 #endif // CYTHON_FAST_PYCALL
2010 #endif
2011 
2012 /* PyObjectCall.proto */
2013 #if CYTHON_COMPILING_IN_CPYTHON
2014 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2015 #else
2016 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2017 #endif
2018 
2019 /* PyObjectCallMethO.proto */
2020 #if CYTHON_COMPILING_IN_CPYTHON
2021 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2022 #endif
2023 
2024 /* PyObjectCallNoArg.proto */
2025 #if CYTHON_COMPILING_IN_CPYTHON
2026 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2027 #else
2028 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
2029 #endif
2030 
2031 /* PyCFunctionFastCall.proto */
2032 #if CYTHON_FAST_PYCCALL
2033 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
2034 #else
2035 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
2036 #endif
2037 
2038 /* PyObjectCallOneArg.proto */
2039 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2040 
2041 /* PyErrExceptionMatches.proto */
2042 #if CYTHON_FAST_THREAD_STATE
2043 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2044 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2045 #else
2046 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2047 #endif
2048 
2049 /* GetAttr.proto */
2050 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2051 
2052 /* GetAttr3.proto */
2053 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2054 
2055 /* PyDictVersioning.proto */
2056 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2057 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2058 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2059 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2060  (version_var) = __PYX_GET_DICT_VERSION(dict);\
2061  (cache_var) = (value);
2062 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2063  static PY_UINT64_T __pyx_dict_version = 0;\
2064  static PyObject *__pyx_dict_cached_value = NULL;\
2065  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2066  (VAR) = __pyx_dict_cached_value;\
2067  } else {\
2068  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2069  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2070  }\
2071 }
2072 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2073 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2074 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2075 #else
2076 #define __PYX_GET_DICT_VERSION(dict) (0)
2077 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2078 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2079 #endif
2080 
2081 /* GetModuleGlobalName.proto */
2082 #if CYTHON_USE_DICT_VERSIONS
2083 #define __Pyx_GetModuleGlobalName(var, name) {\
2084  static PY_UINT64_T __pyx_dict_version = 0;\
2085  static PyObject *__pyx_dict_cached_value = NULL;\
2086  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
2087  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2088  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2089 }
2090 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
2091  PY_UINT64_T __pyx_dict_version;\
2092  PyObject *__pyx_dict_cached_value;\
2093  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2094 }
2095 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2096 #else
2097 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2098 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2099 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2100 #endif
2101 
2102 /* KeywordStringCheck.proto */
2103 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
2104 
2105 /* WriteUnraisableException.proto */
2106 static void __Pyx_WriteUnraisable(const char *name, int clineno,
2107  int lineno, const char *filename,
2108  int full_traceback, int nogil);
2109 
2110 /* None.proto */
2111 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
2112 
2113 /* FetchCommonType.proto */
2114 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2115 
2116 /* CythonFunctionShared.proto */
2117 #define __Pyx_CyFunction_USED 1
2118 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2119 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2120 #define __Pyx_CYFUNCTION_CCLASS 0x04
2121 #define __Pyx_CyFunction_GetClosure(f)\
2122  (((__pyx_CyFunctionObject *) (f))->func_closure)
2123 #define __Pyx_CyFunction_GetClassObj(f)\
2124  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2125 #define __Pyx_CyFunction_Defaults(type, f)\
2126  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2127 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2128  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2129 typedef struct {
2130  PyCFunctionObject func;
2131 #if PY_VERSION_HEX < 0x030500A0
2132  PyObject *func_weakreflist;
2133 #endif
2134  PyObject *func_dict;
2135  PyObject *func_name;
2136  PyObject *func_qualname;
2137  PyObject *func_doc;
2138  PyObject *func_globals;
2139  PyObject *func_code;
2140  PyObject *func_closure;
2141  PyObject *func_classobj;
2142  void *defaults;
2143  int defaults_pyobjects;
2144  size_t defaults_size; // used by FusedFunction for copying defaults
2145  int flags;
2146  PyObject *defaults_tuple;
2147  PyObject *defaults_kwdict;
2148  PyObject *(*defaults_getter)(PyObject *);
2149  PyObject *func_annotations;
2150 } __pyx_CyFunctionObject;
2151 static PyTypeObject *__pyx_CyFunctionType = 0;
2152 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2153 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2154  int flags, PyObject* qualname,
2155  PyObject *self,
2156  PyObject *module, PyObject *globals,
2157  PyObject* code);
2158 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2159  size_t size,
2160  int pyobjects);
2161 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2162  PyObject *tuple);
2163 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2164  PyObject *dict);
2165 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2166  PyObject *dict);
2167 static int __pyx_CyFunction_init(void);
2168 
2169 /* CythonFunction.proto */
2170 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2171  int flags, PyObject* qualname,
2172  PyObject *closure,
2173  PyObject *module, PyObject *globals,
2174  PyObject* code);
2175 
2176 /* PyObjectCall2Args.proto */
2177 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
2178 
2179 /* SliceObject.proto */
2180 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
2181  PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
2182  PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
2183  int has_cstart, int has_cstop, int wraparound);
2184 
2185 /* RaiseException.proto */
2186 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2187 
2188 /* PySequenceContains.proto */
2189 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2190  int result = PySequence_Contains(seq, item);
2191  return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2192 }
2193 
2194 /* HasAttr.proto */
2195 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2196 
2197 /* GetTopmostException.proto */
2198 #if CYTHON_USE_EXC_INFO_STACK
2199 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2200 #endif
2201 
2202 /* SaveResetException.proto */
2203 #if CYTHON_FAST_THREAD_STATE
2204 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2205 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2206 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2207 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2208 #else
2209 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2210 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2211 #endif
2212 
2213 /* GetException.proto */
2214 #if CYTHON_FAST_THREAD_STATE
2215 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2216 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2217 #else
2218 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2219 #endif
2220 
2221 /* ArgTypeTest.proto */
2222 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2223  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2224  __Pyx__ArgTypeTest(obj, type, name, exact))
2225 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2226 
2227 /* IncludeStringH.proto */
2228 #include <string.h>
2229 
2230 /* BytesEquals.proto */
2231 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2232 
2233 /* UnicodeEquals.proto */
2234 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2235 
2236 /* StrEquals.proto */
2237 #if PY_MAJOR_VERSION >= 3
2238 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2239 #else
2240 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2241 #endif
2242 
2243 /* DivInt[Py_ssize_t].proto */
2244 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2245 
2246 /* UnaryNegOverflows.proto */
2247 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2248  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2249 
2250 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2251 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2252 /* decode_c_string_utf16.proto */
2253 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2254  int byteorder = 0;
2255  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2256 }
2257 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2258  int byteorder = -1;
2259  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2260 }
2261 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2262  int byteorder = 1;
2263  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2264 }
2265 
2266 /* decode_c_string.proto */
2267 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2268  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2269  const char* encoding, const char* errors,
2270  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2271 
2272 /* RaiseTooManyValuesToUnpack.proto */
2273 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2274 
2275 /* RaiseNeedMoreValuesToUnpack.proto */
2276 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2277 
2278 /* RaiseNoneIterError.proto */
2279 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2280 
2281 /* ExtTypeTest.proto */
2282 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2283 
2284 /* SwapException.proto */
2285 #if CYTHON_FAST_THREAD_STATE
2286 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2287 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2288 #else
2289 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2290 #endif
2291 
2292 /* FastTypeChecks.proto */
2293 #if CYTHON_COMPILING_IN_CPYTHON
2294 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2295 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2296 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2297 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2298 #else
2299 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2300 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2301 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2302 #endif
2303 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2304 
2305 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2306 /* ListCompAppend.proto */
2307 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2308 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2309  PyListObject* L = (PyListObject*) list;
2310  Py_ssize_t len = Py_SIZE(list);
2311  if (likely(L->allocated > len)) {
2312  Py_INCREF(x);
2313  PyList_SET_ITEM(list, len, x);
2314  __Pyx_SET_SIZE(list, len + 1);
2315  return 0;
2316  }
2317  return PyList_Append(list, x);
2318 }
2319 #else
2320 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2321 #endif
2322 
2323 /* PyIntBinop.proto */
2324 #if !CYTHON_COMPILING_IN_PYPY
2325 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2326 #else
2327 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2328  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2329 #endif
2330 
2331 /* ListExtend.proto */
2332 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2333 #if CYTHON_COMPILING_IN_CPYTHON
2334  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2335  if (unlikely(!none))
2336  return -1;
2337  Py_DECREF(none);
2338  return 0;
2339 #else
2340  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2341 #endif
2342 }
2343 
2344 /* ListAppend.proto */
2345 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2346 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2347  PyListObject* L = (PyListObject*) list;
2348  Py_ssize_t len = Py_SIZE(list);
2349  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2350  Py_INCREF(x);
2351  PyList_SET_ITEM(list, len, x);
2352  __Pyx_SET_SIZE(list, len + 1);
2353  return 0;
2354  }
2355  return PyList_Append(list, x);
2356 }
2357 #else
2358 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2359 #endif
2360 
2361 /* None.proto */
2362 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2363 
2364 /* DivInt[long].proto */
2365 static CYTHON_INLINE long __Pyx_div_long(long, long);
2366 
2367 /* PyObject_GenericGetAttrNoDict.proto */
2368 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2369 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2370 #else
2371 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2372 #endif
2373 
2374 /* PyObject_GenericGetAttr.proto */
2375 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2376 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2377 #else
2378 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2379 #endif
2380 
2381 /* PyObjectGetAttrStrNoError.proto */
2382 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2383 
2384 /* SetupReduce.proto */
2385 static int __Pyx_setup_reduce(PyObject* type_obj);
2386 
2387 /* SetVTable.proto */
2388 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2389 
2390 /* TypeImport.proto */
2391 #ifndef __PYX_HAVE_RT_ImportType_proto
2392 #define __PYX_HAVE_RT_ImportType_proto
2393 enum __Pyx_ImportType_CheckSize {
2394  __Pyx_ImportType_CheckSize_Error = 0,
2395  __Pyx_ImportType_CheckSize_Warn = 1,
2396  __Pyx_ImportType_CheckSize_Ignore = 2
2397 };
2398 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2399 #endif
2400 
2401 /* CLineInTraceback.proto */
2402 #ifdef CYTHON_CLINE_IN_TRACEBACK
2403 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2404 #else
2405 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2406 #endif
2407 
2408 /* CodeObjectCache.proto */
2409 typedef struct {
2410  PyCodeObject* code_object;
2411  int code_line;
2412 } __Pyx_CodeObjectCacheEntry;
2413 struct __Pyx_CodeObjectCache {
2414  int count;
2415  int max_count;
2416  __Pyx_CodeObjectCacheEntry* entries;
2417 };
2418 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2419 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2420 static PyCodeObject *__pyx_find_code_object(int code_line);
2421 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2422 
2423 /* AddTraceback.proto */
2424 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2425  int py_line, const char *filename);
2426 
2427 #if PY_MAJOR_VERSION < 3
2428  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2429  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2430 #else
2431  #define __Pyx_GetBuffer PyObject_GetBuffer
2432  #define __Pyx_ReleaseBuffer PyBuffer_Release
2433 #endif
2434 
2435 
2436 /* BufferStructDeclare.proto */
2437 typedef struct {
2438  Py_ssize_t shape, strides, suboffsets;
2439 } __Pyx_Buf_DimInfo;
2440 typedef struct {
2441  size_t refcount;
2442  Py_buffer pybuffer;
2443 } __Pyx_Buffer;
2444 typedef struct {
2445  __Pyx_Buffer *rcbuffer;
2446  char *data;
2447  __Pyx_Buf_DimInfo diminfo[8];
2448 } __Pyx_LocalBuf_ND;
2449 
2450 /* MemviewSliceIsContig.proto */
2451 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2452 
2453 /* OverlappingSlices.proto */
2454 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2455  __Pyx_memviewslice *slice2,
2456  int ndim, size_t itemsize);
2457 
2458 /* Capsule.proto */
2459 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2460 
2461 /* MemviewDtypeToObject.proto */
2462 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
2463 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
2464 
2465 /* IsLittleEndian.proto */
2466 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2467 
2468 /* BufferFormatCheck.proto */
2469 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2470 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2471  __Pyx_BufFmt_StackElem* stack,
2472  __Pyx_TypeInfo* type);
2473 
2474 /* TypeInfoCompare.proto */
2475 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2476 
2477 /* MemviewSliceValidateAndInit.proto */
2478 static int __Pyx_ValidateAndInit_memviewslice(
2479  int *axes_specs,
2480  int c_or_f_flag,
2481  int buf_flags,
2482  int ndim,
2483  __Pyx_TypeInfo *dtype,
2484  __Pyx_BufFmt_StackElem stack[],
2485  __Pyx_memviewslice *memviewslice,
2486  PyObject *original_obj);
2487 
2488 /* ObjectToMemviewSlice.proto */
2489 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2490 
2491 /* GCCDiagnostics.proto */
2492 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2493 #define __Pyx_HAS_GCC_DIAGNOSTIC
2494 #endif
2495 
2496 /* RealImag.proto */
2497 #if CYTHON_CCOMPLEX
2498  #ifdef __cplusplus
2499  #define __Pyx_CREAL(z) ((z).real())
2500  #define __Pyx_CIMAG(z) ((z).imag())
2501  #else
2502  #define __Pyx_CREAL(z) (__real__(z))
2503  #define __Pyx_CIMAG(z) (__imag__(z))
2504  #endif
2505 #else
2506  #define __Pyx_CREAL(z) ((z).real)
2507  #define __Pyx_CIMAG(z) ((z).imag)
2508 #endif
2509 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2510  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2511  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2512  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2513 #else
2514  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2515  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2516 #endif
2517 
2518 /* Arithmetic.proto */
2519 #if CYTHON_CCOMPLEX
2520  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2521  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2522  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2523  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2524  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2525  #define __Pyx_c_neg_float(a) (-(a))
2526  #ifdef __cplusplus
2527  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2528  #define __Pyx_c_conj_float(z) (::std::conj(z))
2529  #if 1
2530  #define __Pyx_c_abs_float(z) (::std::abs(z))
2531  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2532  #endif
2533  #else
2534  #define __Pyx_c_is_zero_float(z) ((z)==0)
2535  #define __Pyx_c_conj_float(z) (conjf(z))
2536  #if 1
2537  #define __Pyx_c_abs_float(z) (cabsf(z))
2538  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2539  #endif
2540  #endif
2541 #else
2542  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2543  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2544  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2545  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2546  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2547  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2548  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2549  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2550  #if 1
2551  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2552  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2553  #endif
2554 #endif
2555 
2556 /* Arithmetic.proto */
2557 #if CYTHON_CCOMPLEX
2558  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2559  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2560  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2561  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2562  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2563  #define __Pyx_c_neg_double(a) (-(a))
2564  #ifdef __cplusplus
2565  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2566  #define __Pyx_c_conj_double(z) (::std::conj(z))
2567  #if 1
2568  #define __Pyx_c_abs_double(z) (::std::abs(z))
2569  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2570  #endif
2571  #else
2572  #define __Pyx_c_is_zero_double(z) ((z)==0)
2573  #define __Pyx_c_conj_double(z) (conj(z))
2574  #if 1
2575  #define __Pyx_c_abs_double(z) (cabs(z))
2576  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2577  #endif
2578  #endif
2579 #else
2580  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2581  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2582  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2583  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2584  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2585  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2586  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2587  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2588  #if 1
2589  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2590  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2591  #endif
2592 #endif
2593 
2594 /* MemviewSliceCopyTemplate.proto */
2595 static __Pyx_memviewslice
2596 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2597  const char *mode, int ndim,
2598  size_t sizeof_dtype, int contig_flag,
2599  int dtype_is_object);
2600 
2601 /* CIntToPy.proto */
2602 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2603 
2604 /* CIntFromPy.proto */
2605 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2606 
2607 /* CIntFromPy.proto */
2608 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2609 
2610 /* CIntToPy.proto */
2611 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2612 
2613 /* CIntFromPy.proto */
2614 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2615 
2616 /* CheckBinaryVersion.proto */
2617 static int __Pyx_check_binary_version(void);
2618 
2619 /* InitStrings.proto */
2620 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2621 
2622 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2623 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2624 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2625 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2626 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2627 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*/
2628 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2629 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2630 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2631 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2632 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2633 
2634 /* Module declarations from 'cython.view' */
2635 
2636 /* Module declarations from 'cython' */
2637 
2638 /* Module declarations from 'cpython.buffer' */
2639 
2640 /* Module declarations from 'libc.string' */
2641 
2642 /* Module declarations from 'libc.stdio' */
2643 
2644 /* Module declarations from '__builtin__' */
2645 
2646 /* Module declarations from 'cpython.type' */
2647 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2648 
2649 /* Module declarations from 'cpython' */
2650 
2651 /* Module declarations from 'cpython.object' */
2652 
2653 /* Module declarations from 'cpython.ref' */
2654 
2655 /* Module declarations from 'cpython.mem' */
2656 
2657 /* Module declarations from 'numpy' */
2658 
2659 /* Module declarations from 'numpy' */
2660 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2661 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2662 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2663 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2664 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2665 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2666 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2667 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2668 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2669 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2670 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2671 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2672 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2673 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2674 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2675 
2676 /* Module declarations from 'BoundaryConditions' */
2677 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BC_Base = 0;
2678 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BoundaryCondition = 0;
2679 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
2680 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
2681 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
2682 static PyTypeObject *__pyx_array_type = 0;
2683 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2684 static PyTypeObject *__pyx_memoryview_type = 0;
2685 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2686 static PyObject *generic = 0;
2687 static PyObject *strided = 0;
2688 static PyObject *indirect = 0;
2689 static PyObject *contiguous = 0;
2690 static PyObject *indirect_contiguous = 0;
2691 static int __pyx_memoryview_thread_locks_used;
2692 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2693 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(struct __pyx_obj_18BoundaryConditions_BC_Base *, PyObject *); /*proto*/
2694 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2695 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2696 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2697 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2698 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2699 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2700 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2701 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*/
2702 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2703 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2704 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2705 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2706 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2707 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2708 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2709 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2710 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2711 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2712 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2713 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2714 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2715 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2716 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2717 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2718 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2719 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2720 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2721 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2722 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2723 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2724 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2725 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2726 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2727 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2728 #define __Pyx_MODULE_NAME "BoundaryConditions"
2729 extern int __pyx_module_is_main_BoundaryConditions;
2730 int __pyx_module_is_main_BoundaryConditions = 0;
2731 
2732 /* Implementation of 'BoundaryConditions' */
2733 static PyObject *__pyx_builtin_sum;
2734 static PyObject *__pyx_builtin_TypeError;
2735 static PyObject *__pyx_builtin_ImportError;
2736 static PyObject *__pyx_builtin_ValueError;
2737 static PyObject *__pyx_builtin_MemoryError;
2738 static PyObject *__pyx_builtin_enumerate;
2739 static PyObject *__pyx_builtin_range;
2740 static PyObject *__pyx_builtin_Ellipsis;
2741 static PyObject *__pyx_builtin_id;
2742 static PyObject *__pyx_builtin_IndexError;
2743 static const char __pyx_k_O[] = "O";
2744 static const char __pyx_k_a[] = "a";
2745 static const char __pyx_k_c[] = "c";
2746 static const char __pyx_k_n[] = "n";
2747 static const char __pyx_k_t[] = "t";
2748 static const char __pyx_k_x[] = "x";
2749 static const char __pyx_k_a0[] = "a0";
2750 static const char __pyx_k_id[] = "id";
2751 static const char __pyx_k_nd[] = "nd";
2752 static const char __pyx_k_np[] = "np";
2753 static const char __pyx_k_t1[] = "t1";
2754 static const char __pyx_k_all[] = "__all__";
2755 static const char __pyx_k_b_i[] = "b_i";
2756 static const char __pyx_k_get[] = "get";
2757 static const char __pyx_k_new[] = "__new__";
2758 static const char __pyx_k_obj[] = "obj";
2759 static const char __pyx_k_sum[] = "sum";
2760 static const char __pyx_k_None[] = "None";
2761 static const char __pyx_k_b_or[] = "b_or";
2762 static const char __pyx_k_base[] = "base";
2763 static const char __pyx_k_dict[] = "__dict__";
2764 static const char __pyx_k_main[] = "__main__";
2765 static const char __pyx_k_mode[] = "mode";
2766 static const char __pyx_k_name[] = "name";
2767 static const char __pyx_k_ndim[] = "ndim";
2768 static const char __pyx_k_pack[] = "pack";
2769 static const char __pyx_k_self[] = "self";
2770 static const char __pyx_k_size[] = "size";
2771 static const char __pyx_k_step[] = "step";
2772 static const char __pyx_k_stop[] = "stop";
2773 static const char __pyx_k_test[] = "__test__";
2774 static const char __pyx_k_ASCII[] = "ASCII";
2775 static const char __pyx_k_class[] = "__class__";
2776 static const char __pyx_k_error[] = "error";
2777 static const char __pyx_k_flags[] = "flags";
2778 static const char __pyx_k_numpy[] = "numpy";
2779 static const char __pyx_k_range[] = "range";
2780 static const char __pyx_k_shape[] = "shape";
2781 static const char __pyx_k_start[] = "start";
2782 static const char __pyx_k_state[] = "state";
2783 static const char __pyx_k_value[] = "value";
2784 static const char __pyx_k_zeros[] = "zeros";
2785 static const char __pyx_k_Domain[] = "Domain";
2786 static const char __pyx_k_dict_2[] = "_dict";
2787 static const char __pyx_k_encode[] = "encode";
2788 static const char __pyx_k_format[] = "format";
2789 static const char __pyx_k_import[] = "__import__";
2790 static const char __pyx_k_name_2[] = "__name__";
2791 static const char __pyx_k_pickle[] = "pickle";
2792 static const char __pyx_k_reduce[] = "__reduce__";
2793 static const char __pyx_k_struct[] = "struct";
2794 static const char __pyx_k_unpack[] = "unpack";
2795 static const char __pyx_k_update[] = "update";
2796 static const char __pyx_k_BC_Base[] = "BC_Base";
2797 static const char __pyx_k_Context[] = "Context";
2798 static const char __pyx_k_context[] = "context";
2799 static const char __pyx_k_fortran[] = "fortran";
2800 static const char __pyx_k_memview[] = "memview";
2801 static const char __pyx_k_proteus[] = "proteus";
2802 static const char __pyx_k_resetBC[] = "resetBC";
2803 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2804 static const char __pyx_k_getstate[] = "__getstate__";
2805 static const char __pyx_k_itemsize[] = "itemsize";
2806 static const char __pyx_k_pyx_type[] = "__pyx_type";
2807 static const char __pyx_k_setstate[] = "__setstate__";
2808 static const char __pyx_k_TypeError[] = "TypeError";
2809 static const char __pyx_k_enumerate[] = "enumerate";
2810 static const char __pyx_k_pyx_state[] = "__pyx_state";
2811 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2812 static const char __pyx_k_IndexError[] = "IndexError";
2813 static const char __pyx_k_ValueError[] = "ValueError";
2814 static const char __pyx_k_getContext[] = "getContext";
2815 static const char __pyx_k_pyx_result[] = "__pyx_result";
2816 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2817 static const char __pyx_k_ImportError[] = "ImportError";
2818 static const char __pyx_k_MemoryError[] = "MemoryError";
2819 static const char __pyx_k_PickleError[] = "PickleError";
2820 static const char __pyx_k_init_cython[] = "init_cython";
2821 static const char __pyx_k_setLinearBC[] = "setLinearBC";
2822 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2823 static const char __pyx_k_stringsource[] = "stringsource";
2824 static const char __pyx_k_use_setstate[] = "use_setstate";
2825 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2826 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2827 static const char __pyx_k_setConstantBC[] = "setConstantBC";
2828 static const char __pyx_k_setLinearRamp[] = "setLinearRamp";
2829 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2830 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2831 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2832 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2833 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2834 static const char __pyx_k_BoundaryCondition[] = "BoundaryCondition";
2835 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2836 static const char __pyx_k_BC_Base_getContext[] = "BC_Base.getContext";
2837 static const char __pyx_k_BoundaryConditions[] = "BoundaryConditions";
2838 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2839 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2840 static const char __pyx_k_pyx_unpickle_BC_Base[] = "__pyx_unpickle_BC_Base";
2841 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2842 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2843 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2844 static const char __pyx_k_BC_Base___reduce_cython[] = "BC_Base.__reduce_cython__";
2845 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2846 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2847 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2848 static const char __pyx_k_BC_Base___setstate_cython[] = "BC_Base.__setstate_cython__";
2849 static const char __pyx_k_BoundaryCondition_resetBC[] = "BoundaryCondition.resetBC";
2850 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2851 static const char __pyx_k_setLinearBC_locals_lambda[] = "setLinearBC.<locals>.<lambda>";
2852 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2853 static const char __pyx_k_setConstantBC_locals_lambda[] = "setConstantBC.<locals>.<lambda>";
2854 static const char __pyx_k_setLinearRamp_locals_lambda[] = "setLinearRamp.<locals>.<lambda>";
2855 static const char __pyx_k_BoundaryCondition_init_cython[] = "BoundaryCondition.init_cython";
2856 static const char __pyx_k_BoundaryCondition_setLinearBC[] = "BoundaryCondition.setLinearBC";
2857 static const char __pyx_k_proteus_BoundaryConditions_py[] = "proteus/BoundaryConditions.py";
2858 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2859 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2860 static const char __pyx_k_BoundaryCondition_setConstantBC[] = "BoundaryCondition.setConstantBC";
2861 static const char __pyx_k_BoundaryCondition_setLinearRamp[] = "BoundaryCondition.setLinearRamp";
2862 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2863 static const char __pyx_k_self_uuOfXT_cannot_be_converted[] = "self.uuOfXT cannot be converted to a Python object for pickling";
2864 static const char __pyx_k_BoundaryCondition___reduce_cytho[] = "BoundaryCondition.__reduce_cython__";
2865 static const char __pyx_k_BoundaryCondition___setstate_cyt[] = "BoundaryCondition.__setstate_cython__";
2866 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2867 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2868 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2869 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2870 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2871 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x96e6a1f, 0x4d41573, 0x7d477a1) = (BC_type, Shape, _b_or, ct, name, nd))";
2872 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2873 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2874 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2875 static const char __pyx_k_Shape_or_nd_must_be_passed_to_BC[] = "Shape or nd must be passed to BC";
2876 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2877 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2878 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2879 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2880 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2881 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_2[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2882 static PyObject *__pyx_n_s_ASCII;
2883 static PyObject *__pyx_n_s_BC_Base;
2884 static PyObject *__pyx_n_s_BC_Base___reduce_cython;
2885 static PyObject *__pyx_n_s_BC_Base___setstate_cython;
2886 static PyObject *__pyx_n_s_BC_Base_getContext;
2887 static PyObject *__pyx_n_s_BoundaryCondition;
2888 static PyObject *__pyx_n_s_BoundaryCondition___reduce_cytho;
2889 static PyObject *__pyx_n_s_BoundaryCondition___setstate_cyt;
2890 static PyObject *__pyx_n_s_BoundaryCondition_init_cython;
2891 static PyObject *__pyx_n_s_BoundaryCondition_resetBC;
2892 static PyObject *__pyx_n_s_BoundaryCondition_setConstantBC;
2893 static PyObject *__pyx_n_s_BoundaryCondition_setLinearBC;
2894 static PyObject *__pyx_n_s_BoundaryCondition_setLinearRamp;
2895 static PyObject *__pyx_n_s_BoundaryConditions;
2896 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2897 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2898 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2899 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2900 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2901 static PyObject *__pyx_n_s_Context;
2902 static PyObject *__pyx_n_s_Domain;
2903 static PyObject *__pyx_n_s_Ellipsis;
2904 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2905 static PyObject *__pyx_n_s_ImportError;
2906 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2907 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2;
2908 static PyObject *__pyx_n_s_IndexError;
2909 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2910 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2911 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2912 static PyObject *__pyx_n_s_MemoryError;
2913 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2914 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2915 static PyObject *__pyx_n_s_None;
2916 static PyObject *__pyx_n_b_O;
2917 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2918 static PyObject *__pyx_n_s_PickleError;
2919 static PyObject *__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC;
2920 static PyObject *__pyx_n_s_TypeError;
2921 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2922 static PyObject *__pyx_n_s_ValueError;
2923 static PyObject *__pyx_n_s_View_MemoryView;
2924 static PyObject *__pyx_n_s_a;
2925 static PyObject *__pyx_n_s_a0;
2926 static PyObject *__pyx_n_s_all;
2927 static PyObject *__pyx_n_s_allocate_buffer;
2928 static PyObject *__pyx_n_s_b_i;
2929 static PyObject *__pyx_n_s_b_or;
2930 static PyObject *__pyx_n_s_base;
2931 static PyObject *__pyx_n_s_c;
2932 static PyObject *__pyx_n_u_c;
2933 static PyObject *__pyx_n_s_class;
2934 static PyObject *__pyx_n_s_cline_in_traceback;
2935 static PyObject *__pyx_n_s_context;
2936 static PyObject *__pyx_kp_s_contiguous_and_direct;
2937 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2938 static PyObject *__pyx_n_s_dict;
2939 static PyObject *__pyx_n_s_dict_2;
2940 static PyObject *__pyx_n_s_dtype_is_object;
2941 static PyObject *__pyx_n_s_encode;
2942 static PyObject *__pyx_n_s_enumerate;
2943 static PyObject *__pyx_n_s_error;
2944 static PyObject *__pyx_n_s_flags;
2945 static PyObject *__pyx_n_s_format;
2946 static PyObject *__pyx_n_s_fortran;
2947 static PyObject *__pyx_n_u_fortran;
2948 static PyObject *__pyx_n_s_get;
2949 static PyObject *__pyx_n_s_getContext;
2950 static PyObject *__pyx_n_s_getstate;
2951 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2952 static PyObject *__pyx_n_s_id;
2953 static PyObject *__pyx_n_s_import;
2954 static PyObject *__pyx_n_s_init_cython;
2955 static PyObject *__pyx_n_s_itemsize;
2956 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2957 static PyObject *__pyx_n_s_main;
2958 static PyObject *__pyx_n_s_memview;
2959 static PyObject *__pyx_n_s_mode;
2960 static PyObject *__pyx_n_s_n;
2961 static PyObject *__pyx_n_s_name;
2962 static PyObject *__pyx_n_s_name_2;
2963 static PyObject *__pyx_n_s_nd;
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_np;
2968 static PyObject *__pyx_n_s_numpy;
2969 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2970 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2971 static PyObject *__pyx_n_s_obj;
2972 static PyObject *__pyx_n_s_pack;
2973 static PyObject *__pyx_n_s_pickle;
2974 static PyObject *__pyx_n_s_proteus;
2975 static PyObject *__pyx_kp_s_proteus_BoundaryConditions_py;
2976 static PyObject *__pyx_n_s_pyx_PickleError;
2977 static PyObject *__pyx_n_s_pyx_checksum;
2978 static PyObject *__pyx_n_s_pyx_getbuffer;
2979 static PyObject *__pyx_n_s_pyx_result;
2980 static PyObject *__pyx_n_s_pyx_state;
2981 static PyObject *__pyx_n_s_pyx_type;
2982 static PyObject *__pyx_n_s_pyx_unpickle_BC_Base;
2983 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2984 static PyObject *__pyx_n_s_pyx_vtable;
2985 static PyObject *__pyx_n_s_range;
2986 static PyObject *__pyx_n_s_reduce;
2987 static PyObject *__pyx_n_s_reduce_cython;
2988 static PyObject *__pyx_n_s_reduce_ex;
2989 static PyObject *__pyx_n_s_resetBC;
2990 static PyObject *__pyx_n_s_self;
2991 static PyObject *__pyx_kp_s_self_uuOfXT_cannot_be_converted;
2992 static PyObject *__pyx_n_s_setConstantBC;
2993 static PyObject *__pyx_n_s_setConstantBC_locals_lambda;
2994 static PyObject *__pyx_n_s_setLinearBC;
2995 static PyObject *__pyx_n_s_setLinearBC_locals_lambda;
2996 static PyObject *__pyx_n_s_setLinearRamp;
2997 static PyObject *__pyx_n_s_setLinearRamp_locals_lambda;
2998 static PyObject *__pyx_n_s_setstate;
2999 static PyObject *__pyx_n_s_setstate_cython;
3000 static PyObject *__pyx_n_s_shape;
3001 static PyObject *__pyx_n_s_size;
3002 static PyObject *__pyx_n_s_start;
3003 static PyObject *__pyx_n_s_state;
3004 static PyObject *__pyx_n_s_step;
3005 static PyObject *__pyx_n_s_stop;
3006 static PyObject *__pyx_kp_s_strided_and_direct;
3007 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
3008 static PyObject *__pyx_kp_s_strided_and_indirect;
3009 static PyObject *__pyx_kp_s_stringsource;
3010 static PyObject *__pyx_n_s_struct;
3011 static PyObject *__pyx_n_s_sum;
3012 static PyObject *__pyx_n_s_t;
3013 static PyObject *__pyx_n_s_t1;
3014 static PyObject *__pyx_n_s_test;
3015 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3016 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3017 static PyObject *__pyx_n_s_unpack;
3018 static PyObject *__pyx_n_s_update;
3019 static PyObject *__pyx_n_s_use_setstate;
3020 static PyObject *__pyx_n_s_value;
3021 static PyObject *__pyx_n_s_x;
3022 static PyObject *__pyx_n_s_zeros;
3023 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd); /* proto */
3024 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
3025 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
3026 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3027 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
3028 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3029 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
3030 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
3031 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3032 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
3033 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
3034 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3035 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
3036 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
3037 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3038 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
3039 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
3040 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3041 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
3042 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
3043 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
3044 static PyObject *__pyx_pf_18BoundaryConditions_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
3045 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n); /* proto */
3046 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3047 static PyObject *__pyx_pf_18BoundaryConditions_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
3048 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n); /* proto */
3049 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a); /* proto */
3050 static PyObject *__pyx_pf_18BoundaryConditions_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
3051 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n); /* proto */
3052 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value); /* proto */
3053 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
3054 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3055 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
3056 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
3057 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3058 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3059 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 */
3060 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 */
3061 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3062 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3063 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3064 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3065 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3066 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 */
3067 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3068 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 */
3069 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3070 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3071 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3072 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3073 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 */
3074 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3075 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3076 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 */
3077 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 */
3078 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3079 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3080 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3081 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3082 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3083 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3084 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3085 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3086 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3087 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3088 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3089 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3090 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3091 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3092 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3093 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3094 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3095 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 */
3096 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3097 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3098 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3099 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 */
3100 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 */
3101 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3102 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3103 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3104 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3105 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3106 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3107 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3108 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3109 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3110 static PyObject *__pyx_int_0;
3111 static PyObject *__pyx_int_1;
3112 static PyObject *__pyx_int_3;
3113 static PyObject *__pyx_int_81007987;
3114 static PyObject *__pyx_int_112105877;
3115 static PyObject *__pyx_int_131364769;
3116 static PyObject *__pyx_int_136983863;
3117 static PyObject *__pyx_int_158231071;
3118 static PyObject *__pyx_int_184977713;
3119 static PyObject *__pyx_int_neg_1;
3120 static PyObject *__pyx_codeobj_;
3121 static PyObject *__pyx_slice__7;
3122 static PyObject *__pyx_tuple__11;
3123 static PyObject *__pyx_tuple__13;
3124 static PyObject *__pyx_tuple__15;
3125 static PyObject *__pyx_tuple__16;
3126 static PyObject *__pyx_tuple__17;
3127 static PyObject *__pyx_tuple__18;
3128 static PyObject *__pyx_tuple__19;
3129 static PyObject *__pyx_tuple__20;
3130 static PyObject *__pyx_tuple__21;
3131 static PyObject *__pyx_tuple__22;
3132 static PyObject *__pyx_tuple__23;
3133 static PyObject *__pyx_tuple__24;
3134 static PyObject *__pyx_tuple__25;
3135 static PyObject *__pyx_tuple__26;
3136 static PyObject *__pyx_tuple__27;
3137 static PyObject *__pyx_tuple__28;
3138 static PyObject *__pyx_tuple__29;
3139 static PyObject *__pyx_tuple__30;
3140 static PyObject *__pyx_tuple__31;
3141 static PyObject *__pyx_tuple__32;
3142 static PyObject *__pyx_tuple__33;
3143 static PyObject *__pyx_tuple__34;
3144 static PyObject *__pyx_tuple__36;
3145 static PyObject *__pyx_tuple__37;
3146 static PyObject *__pyx_tuple__38;
3147 static PyObject *__pyx_tuple__39;
3148 static PyObject *__pyx_tuple__40;
3149 static PyObject *__pyx_tuple__41;
3150 static PyObject *__pyx_tuple__42;
3151 static PyObject *__pyx_tuple__43;
3152 static PyObject *__pyx_tuple__44;
3153 static PyObject *__pyx_tuple__45;
3154 static PyObject *__pyx_tuple__46;
3155 static PyObject *__pyx_tuple__47;
3156 static PyObject *__pyx_tuple__48;
3157 static PyObject *__pyx_tuple__49;
3158 static PyObject *__pyx_tuple__50;
3159 static PyObject *__pyx_tuple__51;
3160 static PyObject *__pyx_tuple__52;
3161 static PyObject *__pyx_tuple__53;
3162 static PyObject *__pyx_codeobj__2;
3163 static PyObject *__pyx_codeobj__3;
3164 static PyObject *__pyx_codeobj__4;
3165 static PyObject *__pyx_codeobj__5;
3166 static PyObject *__pyx_codeobj__6;
3167 static PyObject *__pyx_codeobj__8;
3168 static PyObject *__pyx_codeobj__9;
3169 static PyObject *__pyx_codeobj__10;
3170 static PyObject *__pyx_codeobj__12;
3171 static PyObject *__pyx_codeobj__14;
3172 static PyObject *__pyx_codeobj__35;
3173 /* Late includes */
3174 
3175 /* "BoundaryConditions.py":24
3176  * Generic class regrouping boundary conditions
3177  * """
3178  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None): # <<<<<<<<<<<<<<
3179  * self.Shape = shape
3180  * self.name = name
3181  */
3182 
3183 /* Python wrapper */
3184 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3185 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3186  PyObject *__pyx_v_shape = 0;
3187  PyObject *__pyx_v_name = 0;
3188  PyObject *__pyx_v_b_or = 0;
3189  PyObject *__pyx_v_b_i = 0;
3190  PyObject *__pyx_v_nd = 0;
3191  int __pyx_lineno = 0;
3192  const char *__pyx_filename = NULL;
3193  int __pyx_clineno = 0;
3194  int __pyx_r;
3195  __Pyx_RefNannyDeclarations
3196  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3197  {
3198  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_name,&__pyx_n_s_b_or,&__pyx_n_s_b_i,&__pyx_n_s_nd,0};
3199  PyObject* values[5] = {0,0,0,0,0};
3200  values[0] = ((PyObject *)Py_None);
3201  values[1] = ((PyObject *)Py_None);
3202  values[2] = ((PyObject *)Py_None);
3203  values[3] = ((PyObject *)__pyx_int_0);
3204  values[4] = ((PyObject *)Py_None);
3205  if (unlikely(__pyx_kwds)) {
3206  Py_ssize_t kw_args;
3207  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3208  switch (pos_args) {
3209  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3210  CYTHON_FALLTHROUGH;
3211  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3212  CYTHON_FALLTHROUGH;
3213  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3214  CYTHON_FALLTHROUGH;
3215  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3216  CYTHON_FALLTHROUGH;
3217  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3218  CYTHON_FALLTHROUGH;
3219  case 0: break;
3220  default: goto __pyx_L5_argtuple_error;
3221  }
3222  kw_args = PyDict_Size(__pyx_kwds);
3223  switch (pos_args) {
3224  case 0:
3225  if (kw_args > 0) {
3226  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape);
3227  if (value) { values[0] = value; kw_args--; }
3228  }
3229  CYTHON_FALLTHROUGH;
3230  case 1:
3231  if (kw_args > 0) {
3232  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
3233  if (value) { values[1] = value; kw_args--; }
3234  }
3235  CYTHON_FALLTHROUGH;
3236  case 2:
3237  if (kw_args > 0) {
3238  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_or);
3239  if (value) { values[2] = value; kw_args--; }
3240  }
3241  CYTHON_FALLTHROUGH;
3242  case 3:
3243  if (kw_args > 0) {
3244  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_i);
3245  if (value) { values[3] = value; kw_args--; }
3246  }
3247  CYTHON_FALLTHROUGH;
3248  case 4:
3249  if (kw_args > 0) {
3250  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd);
3251  if (value) { values[4] = value; kw_args--; }
3252  }
3253  }
3254  if (unlikely(kw_args > 0)) {
3255  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 24, __pyx_L3_error)
3256  }
3257  } else {
3258  switch (PyTuple_GET_SIZE(__pyx_args)) {
3259  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3260  CYTHON_FALLTHROUGH;
3261  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3262  CYTHON_FALLTHROUGH;
3263  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3264  CYTHON_FALLTHROUGH;
3265  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3266  CYTHON_FALLTHROUGH;
3267  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3268  CYTHON_FALLTHROUGH;
3269  case 0: break;
3270  default: goto __pyx_L5_argtuple_error;
3271  }
3272  }
3273  __pyx_v_shape = values[0];
3274  __pyx_v_name = values[1];
3275  __pyx_v_b_or = values[2];
3276  __pyx_v_b_i = values[3];
3277  __pyx_v_nd = values[4];
3278  }
3279  goto __pyx_L4_argument_unpacking_done;
3280  __pyx_L5_argtuple_error:;
3281  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 24, __pyx_L3_error)
3282  __pyx_L3_error:;
3283  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3284  __Pyx_RefNannyFinishContext();
3285  return -1;
3286  __pyx_L4_argument_unpacking_done:;
3287  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base___init__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_shape, __pyx_v_name, __pyx_v_b_or, __pyx_v_b_i, __pyx_v_nd);
3288 
3289  /* function exit code */
3290  __Pyx_RefNannyFinishContext();
3291  return __pyx_r;
3292 }
3293 
3294 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd) {
3295  int __pyx_r;
3296  __Pyx_TraceDeclarations
3297  __Pyx_RefNannyDeclarations
3298  PyObject *__pyx_t_1 = NULL;
3299  int __pyx_t_2;
3300  int __pyx_t_3;
3301  PyObject *__pyx_t_4 = NULL;
3302  int __pyx_t_5;
3303  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
3304  int __pyx_lineno = 0;
3305  const char *__pyx_filename = NULL;
3306  int __pyx_clineno = 0;
3307  __Pyx_RefNannySetupContext("__init__", 0);
3308  __Pyx_TraceCall("__init__", __pyx_f[0], 24, 0, __PYX_ERR(0, 24, __pyx_L1_error));
3309 
3310  /* "BoundaryConditions.py":25
3311  * """
3312  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None):
3313  * self.Shape = shape # <<<<<<<<<<<<<<
3314  * self.name = name
3315  * self.BC_type = 'None'
3316  */
3317  __Pyx_INCREF(__pyx_v_shape);
3318  __Pyx_GIVEREF(__pyx_v_shape);
3319  __Pyx_GOTREF(__pyx_v_self->Shape);
3320  __Pyx_DECREF(__pyx_v_self->Shape);
3321  __pyx_v_self->Shape = __pyx_v_shape;
3322 
3323  /* "BoundaryConditions.py":26
3324  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None):
3325  * self.Shape = shape
3326  * self.name = name # <<<<<<<<<<<<<<
3327  * self.BC_type = 'None'
3328  * if shape is not None:
3329  */
3330  if (!(likely(PyString_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(0, 26, __pyx_L1_error)
3331  __pyx_t_1 = __pyx_v_name;
3332  __Pyx_INCREF(__pyx_t_1);
3333  __Pyx_GIVEREF(__pyx_t_1);
3334  __Pyx_GOTREF(__pyx_v_self->name);
3335  __Pyx_DECREF(__pyx_v_self->name);
3336  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3337  __pyx_t_1 = 0;
3338 
3339  /* "BoundaryConditions.py":27
3340  * self.Shape = shape
3341  * self.name = name
3342  * self.BC_type = 'None' # <<<<<<<<<<<<<<
3343  * if shape is not None:
3344  * self.nd = self.Shape.Domain.nd
3345  */
3346  __Pyx_INCREF(__pyx_n_s_None);
3347  __Pyx_GIVEREF(__pyx_n_s_None);
3348  __Pyx_GOTREF(__pyx_v_self->BC_type);
3349  __Pyx_DECREF(__pyx_v_self->BC_type);
3350  __pyx_v_self->BC_type = __pyx_n_s_None;
3351 
3352  /* "BoundaryConditions.py":28
3353  * self.name = name
3354  * self.BC_type = 'None'
3355  * if shape is not None: # <<<<<<<<<<<<<<
3356  * self.nd = self.Shape.Domain.nd
3357  * elif nd is not None:
3358  */
3359  __pyx_t_2 = (__pyx_v_shape != Py_None);
3360  __pyx_t_3 = (__pyx_t_2 != 0);
3361  if (__pyx_t_3) {
3362 
3363  /* "BoundaryConditions.py":29
3364  * self.BC_type = 'None'
3365  * if shape is not None:
3366  * self.nd = self.Shape.Domain.nd # <<<<<<<<<<<<<<
3367  * elif nd is not None:
3368  * self.nd = nd
3369  */
3370  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->Shape, __pyx_n_s_Domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
3371  __Pyx_GOTREF(__pyx_t_1);
3372  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nd); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
3373  __Pyx_GOTREF(__pyx_t_4);
3374  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3375  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L1_error)
3376  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3377  __pyx_v_self->nd = __pyx_t_5;
3378 
3379  /* "BoundaryConditions.py":28
3380  * self.name = name
3381  * self.BC_type = 'None'
3382  * if shape is not None: # <<<<<<<<<<<<<<
3383  * self.nd = self.Shape.Domain.nd
3384  * elif nd is not None:
3385  */
3386  goto __pyx_L3;
3387  }
3388 
3389  /* "BoundaryConditions.py":30
3390  * if shape is not None:
3391  * self.nd = self.Shape.Domain.nd
3392  * elif nd is not None: # <<<<<<<<<<<<<<
3393  * self.nd = nd
3394  * else:
3395  */
3396  __pyx_t_3 = (__pyx_v_nd != Py_None);
3397  __pyx_t_2 = (__pyx_t_3 != 0);
3398  if (__pyx_t_2) {
3399 
3400  /* "BoundaryConditions.py":31
3401  * self.nd = self.Shape.Domain.nd
3402  * elif nd is not None:
3403  * self.nd = nd # <<<<<<<<<<<<<<
3404  * else:
3405  * assert nd is not None, 'Shape or nd must be passed to BC'
3406  */
3407  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_nd); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
3408  __pyx_v_self->nd = __pyx_t_5;
3409 
3410  /* "BoundaryConditions.py":30
3411  * if shape is not None:
3412  * self.nd = self.Shape.Domain.nd
3413  * elif nd is not None: # <<<<<<<<<<<<<<
3414  * self.nd = nd
3415  * else:
3416  */
3417  goto __pyx_L3;
3418  }
3419 
3420  /* "BoundaryConditions.py":33
3421  * self.nd = nd
3422  * else:
3423  * assert nd is not None, 'Shape or nd must be passed to BC' # <<<<<<<<<<<<<<
3424  * if b_or is not None:
3425  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
3426  */
3427  /*else*/ {
3428  #ifndef CYTHON_WITHOUT_ASSERTIONS
3429  if (unlikely(!Py_OptimizeFlag)) {
3430  __pyx_t_2 = (__pyx_v_nd != Py_None);
3431  if (unlikely(!(__pyx_t_2 != 0))) {
3432  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Shape_or_nd_must_be_passed_to_BC);
3433  __PYX_ERR(0, 33, __pyx_L1_error)
3434  }
3435  }
3436  #endif
3437  }
3438  __pyx_L3:;
3439 
3440  /* "BoundaryConditions.py":34
3441  * else:
3442  * assert nd is not None, 'Shape or nd must be passed to BC'
3443  * if b_or is not None: # <<<<<<<<<<<<<<
3444  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
3445  * else:
3446  */
3447  __pyx_t_2 = (__pyx_v_b_or != Py_None);
3448  __pyx_t_3 = (__pyx_t_2 != 0);
3449  if (__pyx_t_3) {
3450 
3451  /* "BoundaryConditions.py":35
3452  * assert nd is not None, 'Shape or nd must be passed to BC'
3453  * if b_or is not None:
3454  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape # <<<<<<<<<<<<<<
3455  * else:
3456  * self._b_or = None
3457  */
3458  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_b_or, __pyx_v_b_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
3459  __Pyx_GOTREF(__pyx_t_4);
3460  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 35, __pyx_L1_error)
3461  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3462  __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
3463  __pyx_v_self->_b_or = __pyx_t_6;
3464  __pyx_t_6.memview = NULL;
3465  __pyx_t_6.data = NULL;
3466 
3467  /* "BoundaryConditions.py":34
3468  * else:
3469  * assert nd is not None, 'Shape or nd must be passed to BC'
3470  * if b_or is not None: # <<<<<<<<<<<<<<
3471  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
3472  * else:
3473  */
3474  goto __pyx_L4;
3475  }
3476 
3477  /* "BoundaryConditions.py":37
3478  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
3479  * else:
3480  * self._b_or = None # <<<<<<<<<<<<<<
3481  *
3482  * # @staticmethod
3483  */
3484  /*else*/ {
3485  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 37, __pyx_L1_error)
3486  __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
3487  __pyx_v_self->_b_or = __pyx_t_6;
3488  __pyx_t_6.memview = NULL;
3489  __pyx_t_6.data = NULL;
3490  }
3491  __pyx_L4:;
3492 
3493  /* "BoundaryConditions.py":24
3494  * Generic class regrouping boundary conditions
3495  * """
3496  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None): # <<<<<<<<<<<<<<
3497  * self.Shape = shape
3498  * self.name = name
3499  */
3500 
3501  /* function exit code */
3502  __pyx_r = 0;
3503  goto __pyx_L0;
3504  __pyx_L1_error:;
3505  __Pyx_XDECREF(__pyx_t_1);
3506  __Pyx_XDECREF(__pyx_t_4);
3507  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
3508  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3509  __pyx_r = -1;
3510  __pyx_L0:;
3511  __Pyx_TraceReturn(Py_None, 0);
3512  __Pyx_RefNannyFinishContext();
3513  return __pyx_r;
3514 }
3515 
3516 /* "BoundaryConditions.py":52
3517  * # setattr(BC_Base, name, default_value)
3518  *
3519  * def getContext(self, context=None): # <<<<<<<<<<<<<<
3520  * """
3521  * Gets context from proteus.Context or
3522  */
3523 
3524 /* Python wrapper */
3525 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3526 static char __pyx_doc_18BoundaryConditions_7BC_Base_2getContext[] = "BC_Base.getContext(self, context=None)\n\n Gets context from proteus.Context or\n\n Parameters\n ----------\n context: class, optional\n if set to None, the context will be created from proteus.Context\n ";
3527 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_3getContext = {"getContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext};
3528 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3529  PyObject *__pyx_v_context = 0;
3530  int __pyx_lineno = 0;
3531  const char *__pyx_filename = NULL;
3532  int __pyx_clineno = 0;
3533  PyObject *__pyx_r = 0;
3534  __Pyx_RefNannyDeclarations
3535  __Pyx_RefNannySetupContext("getContext (wrapper)", 0);
3536  {
3537  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
3538  PyObject* values[1] = {0};
3539  values[0] = ((PyObject *)Py_None);
3540  if (unlikely(__pyx_kwds)) {
3541  Py_ssize_t kw_args;
3542  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3543  switch (pos_args) {
3544  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3545  CYTHON_FALLTHROUGH;
3546  case 0: break;
3547  default: goto __pyx_L5_argtuple_error;
3548  }
3549  kw_args = PyDict_Size(__pyx_kwds);
3550  switch (pos_args) {
3551  case 0:
3552  if (kw_args > 0) {
3553  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
3554  if (value) { values[0] = value; kw_args--; }
3555  }
3556  }
3557  if (unlikely(kw_args > 0)) {
3558  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getContext") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3559  }
3560  } else {
3561  switch (PyTuple_GET_SIZE(__pyx_args)) {
3562  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3563  CYTHON_FALLTHROUGH;
3564  case 0: break;
3565  default: goto __pyx_L5_argtuple_error;
3566  }
3567  }
3568  __pyx_v_context = values[0];
3569  }
3570  goto __pyx_L4_argument_unpacking_done;
3571  __pyx_L5_argtuple_error:;
3572  __Pyx_RaiseArgtupleInvalid("getContext", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3573  __pyx_L3_error:;
3574  __Pyx_AddTraceback("BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3575  __Pyx_RefNannyFinishContext();
3576  return NULL;
3577  __pyx_L4_argument_unpacking_done:;
3578  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2getContext(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_context);
3579 
3580  /* function exit code */
3581  __Pyx_RefNannyFinishContext();
3582  return __pyx_r;
3583 }
3584 
3585 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context) {
3586  PyObject *__pyx_v_Context = NULL;
3587  PyObject *__pyx_r = NULL;
3588  __Pyx_TraceDeclarations
3589  __Pyx_RefNannyDeclarations
3590  int __pyx_t_1;
3591  PyObject *__pyx_t_2 = NULL;
3592  PyObject *__pyx_t_3 = NULL;
3593  PyObject *__pyx_t_4 = NULL;
3594  int __pyx_lineno = 0;
3595  const char *__pyx_filename = NULL;
3596  int __pyx_clineno = 0;
3597  __Pyx_TraceFrameInit(__pyx_codeobj_)
3598  __Pyx_RefNannySetupContext("getContext", 0);
3599  __Pyx_TraceCall("getContext", __pyx_f[0], 52, 0, __PYX_ERR(0, 52, __pyx_L1_error));
3600 
3601  /* "BoundaryConditions.py":61
3602  * if set to None, the context will be created from proteus.Context
3603  * """
3604  * if context: # <<<<<<<<<<<<<<
3605  * from proteus import Context
3606  * self.ct = Context.get()
3607  */
3608  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_context); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 61, __pyx_L1_error)
3609  if (__pyx_t_1) {
3610 
3611  /* "BoundaryConditions.py":62
3612  * """
3613  * if context:
3614  * from proteus import Context # <<<<<<<<<<<<<<
3615  * self.ct = Context.get()
3616  * else:
3617  */
3618  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3619  __Pyx_GOTREF(__pyx_t_2);
3620  __Pyx_INCREF(__pyx_n_s_Context);
3621  __Pyx_GIVEREF(__pyx_n_s_Context);
3622  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Context);
3623  __pyx_t_3 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
3624  __Pyx_GOTREF(__pyx_t_3);
3625  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3626  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Context); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3627  __Pyx_GOTREF(__pyx_t_2);
3628  __Pyx_INCREF(__pyx_t_2);
3629  __pyx_v_Context = __pyx_t_2;
3630  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3631  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3632 
3633  /* "BoundaryConditions.py":63
3634  * if context:
3635  * from proteus import Context
3636  * self.ct = Context.get() # <<<<<<<<<<<<<<
3637  * else:
3638  * self.ct = context
3639  */
3640  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_Context, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
3641  __Pyx_GOTREF(__pyx_t_2);
3642  __pyx_t_4 = NULL;
3643  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3644  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3645  if (likely(__pyx_t_4)) {
3646  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3647  __Pyx_INCREF(__pyx_t_4);
3648  __Pyx_INCREF(function);
3649  __Pyx_DECREF_SET(__pyx_t_2, function);
3650  }
3651  }
3652  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
3653  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3654  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error)
3655  __Pyx_GOTREF(__pyx_t_3);
3656  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3657  __Pyx_GIVEREF(__pyx_t_3);
3658  __Pyx_GOTREF(__pyx_v_self->ct);
3659  __Pyx_DECREF(__pyx_v_self->ct);
3660  __pyx_v_self->ct = __pyx_t_3;
3661  __pyx_t_3 = 0;
3662 
3663  /* "BoundaryConditions.py":61
3664  * if set to None, the context will be created from proteus.Context
3665  * """
3666  * if context: # <<<<<<<<<<<<<<
3667  * from proteus import Context
3668  * self.ct = Context.get()
3669  */
3670  goto __pyx_L3;
3671  }
3672 
3673  /* "BoundaryConditions.py":65
3674  * self.ct = Context.get()
3675  * else:
3676  * self.ct = context # <<<<<<<<<<<<<<
3677  *
3678  *
3679  */
3680  /*else*/ {
3681  __Pyx_INCREF(__pyx_v_context);
3682  __Pyx_GIVEREF(__pyx_v_context);
3683  __Pyx_GOTREF(__pyx_v_self->ct);
3684  __Pyx_DECREF(__pyx_v_self->ct);
3685  __pyx_v_self->ct = __pyx_v_context;
3686  }
3687  __pyx_L3:;
3688 
3689  /* "BoundaryConditions.py":52
3690  * # setattr(BC_Base, name, default_value)
3691  *
3692  * def getContext(self, context=None): # <<<<<<<<<<<<<<
3693  * """
3694  * Gets context from proteus.Context or
3695  */
3696 
3697  /* function exit code */
3698  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3699  goto __pyx_L0;
3700  __pyx_L1_error:;
3701  __Pyx_XDECREF(__pyx_t_2);
3702  __Pyx_XDECREF(__pyx_t_3);
3703  __Pyx_XDECREF(__pyx_t_4);
3704  __Pyx_AddTraceback("BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3705  __pyx_r = NULL;
3706  __pyx_L0:;
3707  __Pyx_XDECREF(__pyx_v_Context);
3708  __Pyx_XGIVEREF(__pyx_r);
3709  __Pyx_TraceReturn(__pyx_r, 0);
3710  __Pyx_RefNannyFinishContext();
3711  return __pyx_r;
3712 }
3713 
3714 /* "BoundaryConditions.pxd":8
3715  * cdef double[:] _b_or
3716  * cdef public:
3717  * cdef int nd # <<<<<<<<<<<<<<
3718  * object Shape
3719  * str name
3720  */
3721 
3722 /* Python wrapper */
3723 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self); /*proto*/
3724 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self) {
3725  PyObject *__pyx_r = 0;
3726  __Pyx_RefNannyDeclarations
3727  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3728  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3729 
3730  /* function exit code */
3731  __Pyx_RefNannyFinishContext();
3732  return __pyx_r;
3733 }
3734 
3735 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3736  PyObject *__pyx_r = NULL;
3737  __Pyx_TraceDeclarations
3738  __Pyx_RefNannyDeclarations
3739  PyObject *__pyx_t_1 = NULL;
3740  int __pyx_lineno = 0;
3741  const char *__pyx_filename = NULL;
3742  int __pyx_clineno = 0;
3743  __Pyx_RefNannySetupContext("__get__", 0);
3744  __Pyx_TraceCall("__get__", __pyx_f[2], 8, 0, __PYX_ERR(2, 8, __pyx_L1_error));
3745  __Pyx_XDECREF(__pyx_r);
3746  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nd); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
3747  __Pyx_GOTREF(__pyx_t_1);
3748  __pyx_r = __pyx_t_1;
3749  __pyx_t_1 = 0;
3750  goto __pyx_L0;
3751 
3752  /* function exit code */
3753  __pyx_L1_error:;
3754  __Pyx_XDECREF(__pyx_t_1);
3755  __Pyx_AddTraceback("BoundaryConditions.BC_Base.nd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3756  __pyx_r = NULL;
3757  __pyx_L0:;
3758  __Pyx_XGIVEREF(__pyx_r);
3759  __Pyx_TraceReturn(__pyx_r, 0);
3760  __Pyx_RefNannyFinishContext();
3761  return __pyx_r;
3762 }
3763 
3764 /* Python wrapper */
3765 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3766 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3767  int __pyx_r;
3768  __Pyx_RefNannyDeclarations
3769  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3770  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3771 
3772  /* function exit code */
3773  __Pyx_RefNannyFinishContext();
3774  return __pyx_r;
3775 }
3776 
3777 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3778  int __pyx_r;
3779  __Pyx_TraceDeclarations
3780  __Pyx_RefNannyDeclarations
3781  int __pyx_t_1;
3782  int __pyx_lineno = 0;
3783  const char *__pyx_filename = NULL;
3784  int __pyx_clineno = 0;
3785  __Pyx_RefNannySetupContext("__set__", 0);
3786  __Pyx_TraceCall("__set__", __pyx_f[2], 8, 0, __PYX_ERR(2, 8, __pyx_L1_error));
3787  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8, __pyx_L1_error)
3788  __pyx_v_self->nd = __pyx_t_1;
3789 
3790  /* function exit code */
3791  __pyx_r = 0;
3792  goto __pyx_L0;
3793  __pyx_L1_error:;
3794  __Pyx_AddTraceback("BoundaryConditions.BC_Base.nd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3795  __pyx_r = -1;
3796  __pyx_L0:;
3797  __Pyx_TraceReturn(Py_None, 0);
3798  __Pyx_RefNannyFinishContext();
3799  return __pyx_r;
3800 }
3801 
3802 /* "BoundaryConditions.pxd":9
3803  * cdef public:
3804  * cdef int nd
3805  * object Shape # <<<<<<<<<<<<<<
3806  * str name
3807  * str BC_type
3808  */
3809 
3810 /* Python wrapper */
3811 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self); /*proto*/
3812 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self) {
3813  PyObject *__pyx_r = 0;
3814  __Pyx_RefNannyDeclarations
3815  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3816  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3817 
3818  /* function exit code */
3819  __Pyx_RefNannyFinishContext();
3820  return __pyx_r;
3821 }
3822 
3823 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3824  PyObject *__pyx_r = NULL;
3825  __Pyx_TraceDeclarations
3826  __Pyx_RefNannyDeclarations
3827  int __pyx_lineno = 0;
3828  const char *__pyx_filename = NULL;
3829  int __pyx_clineno = 0;
3830  __Pyx_RefNannySetupContext("__get__", 0);
3831  __Pyx_TraceCall("__get__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3832  __Pyx_XDECREF(__pyx_r);
3833  __Pyx_INCREF(__pyx_v_self->Shape);
3834  __pyx_r = __pyx_v_self->Shape;
3835  goto __pyx_L0;
3836 
3837  /* function exit code */
3838  __pyx_L1_error:;
3839  __Pyx_AddTraceback("BoundaryConditions.BC_Base.Shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3840  __pyx_r = NULL;
3841  __pyx_L0:;
3842  __Pyx_XGIVEREF(__pyx_r);
3843  __Pyx_TraceReturn(__pyx_r, 0);
3844  __Pyx_RefNannyFinishContext();
3845  return __pyx_r;
3846 }
3847 
3848 /* Python wrapper */
3849 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3850 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3851  int __pyx_r;
3852  __Pyx_RefNannyDeclarations
3853  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3854  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3855 
3856  /* function exit code */
3857  __Pyx_RefNannyFinishContext();
3858  return __pyx_r;
3859 }
3860 
3861 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3862  int __pyx_r;
3863  __Pyx_TraceDeclarations
3864  __Pyx_RefNannyDeclarations
3865  int __pyx_lineno = 0;
3866  const char *__pyx_filename = NULL;
3867  int __pyx_clineno = 0;
3868  __Pyx_RefNannySetupContext("__set__", 0);
3869  __Pyx_TraceCall("__set__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3870  __Pyx_INCREF(__pyx_v_value);
3871  __Pyx_GIVEREF(__pyx_v_value);
3872  __Pyx_GOTREF(__pyx_v_self->Shape);
3873  __Pyx_DECREF(__pyx_v_self->Shape);
3874  __pyx_v_self->Shape = __pyx_v_value;
3875 
3876  /* function exit code */
3877  __pyx_r = 0;
3878  goto __pyx_L0;
3879  __pyx_L1_error:;
3880  __Pyx_AddTraceback("BoundaryConditions.BC_Base.Shape.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3881  __pyx_r = -1;
3882  __pyx_L0:;
3883  __Pyx_TraceReturn(Py_None, 0);
3884  __Pyx_RefNannyFinishContext();
3885  return __pyx_r;
3886 }
3887 
3888 /* Python wrapper */
3889 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self); /*proto*/
3890 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self) {
3891  int __pyx_r;
3892  __Pyx_RefNannyDeclarations
3893  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3894  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3895 
3896  /* function exit code */
3897  __Pyx_RefNannyFinishContext();
3898  return __pyx_r;
3899 }
3900 
3901 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3902  int __pyx_r;
3903  __Pyx_TraceDeclarations
3904  __Pyx_RefNannyDeclarations
3905  int __pyx_lineno = 0;
3906  const char *__pyx_filename = NULL;
3907  int __pyx_clineno = 0;
3908  __Pyx_RefNannySetupContext("__del__", 0);
3909  __Pyx_TraceCall("__del__", __pyx_f[2], 9, 0, __PYX_ERR(2, 9, __pyx_L1_error));
3910  __Pyx_INCREF(Py_None);
3911  __Pyx_GIVEREF(Py_None);
3912  __Pyx_GOTREF(__pyx_v_self->Shape);
3913  __Pyx_DECREF(__pyx_v_self->Shape);
3914  __pyx_v_self->Shape = Py_None;
3915 
3916  /* function exit code */
3917  __pyx_r = 0;
3918  goto __pyx_L0;
3919  __pyx_L1_error:;
3920  __Pyx_AddTraceback("BoundaryConditions.BC_Base.Shape.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3921  __pyx_r = -1;
3922  __pyx_L0:;
3923  __Pyx_TraceReturn(Py_None, 0);
3924  __Pyx_RefNannyFinishContext();
3925  return __pyx_r;
3926 }
3927 
3928 /* "BoundaryConditions.pxd":10
3929  * cdef int nd
3930  * object Shape
3931  * str name # <<<<<<<<<<<<<<
3932  * str BC_type
3933  * object ct
3934  */
3935 
3936 /* Python wrapper */
3937 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
3938 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self) {
3939  PyObject *__pyx_r = 0;
3940  __Pyx_RefNannyDeclarations
3941  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3942  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3943 
3944  /* function exit code */
3945  __Pyx_RefNannyFinishContext();
3946  return __pyx_r;
3947 }
3948 
3949 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3950  PyObject *__pyx_r = NULL;
3951  __Pyx_TraceDeclarations
3952  __Pyx_RefNannyDeclarations
3953  int __pyx_lineno = 0;
3954  const char *__pyx_filename = NULL;
3955  int __pyx_clineno = 0;
3956  __Pyx_RefNannySetupContext("__get__", 0);
3957  __Pyx_TraceCall("__get__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3958  __Pyx_XDECREF(__pyx_r);
3959  __Pyx_INCREF(__pyx_v_self->name);
3960  __pyx_r = __pyx_v_self->name;
3961  goto __pyx_L0;
3962 
3963  /* function exit code */
3964  __pyx_L1_error:;
3965  __Pyx_AddTraceback("BoundaryConditions.BC_Base.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3966  __pyx_r = NULL;
3967  __pyx_L0:;
3968  __Pyx_XGIVEREF(__pyx_r);
3969  __Pyx_TraceReturn(__pyx_r, 0);
3970  __Pyx_RefNannyFinishContext();
3971  return __pyx_r;
3972 }
3973 
3974 /* Python wrapper */
3975 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3976 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3977  int __pyx_r;
3978  __Pyx_RefNannyDeclarations
3979  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3980  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3981 
3982  /* function exit code */
3983  __Pyx_RefNannyFinishContext();
3984  return __pyx_r;
3985 }
3986 
3987 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3988  int __pyx_r;
3989  __Pyx_TraceDeclarations
3990  __Pyx_RefNannyDeclarations
3991  PyObject *__pyx_t_1 = NULL;
3992  int __pyx_lineno = 0;
3993  const char *__pyx_filename = NULL;
3994  int __pyx_clineno = 0;
3995  __Pyx_RefNannySetupContext("__set__", 0);
3996  __Pyx_TraceCall("__set__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
3997  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error)
3998  __pyx_t_1 = __pyx_v_value;
3999  __Pyx_INCREF(__pyx_t_1);
4000  __Pyx_GIVEREF(__pyx_t_1);
4001  __Pyx_GOTREF(__pyx_v_self->name);
4002  __Pyx_DECREF(__pyx_v_self->name);
4003  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
4004  __pyx_t_1 = 0;
4005 
4006  /* function exit code */
4007  __pyx_r = 0;
4008  goto __pyx_L0;
4009  __pyx_L1_error:;
4010  __Pyx_XDECREF(__pyx_t_1);
4011  __Pyx_AddTraceback("BoundaryConditions.BC_Base.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4012  __pyx_r = -1;
4013  __pyx_L0:;
4014  __Pyx_TraceReturn(Py_None, 0);
4015  __Pyx_RefNannyFinishContext();
4016  return __pyx_r;
4017 }
4018 
4019 /* Python wrapper */
4020 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
4021 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self) {
4022  int __pyx_r;
4023  __Pyx_RefNannyDeclarations
4024  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
4025  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4026 
4027  /* function exit code */
4028  __Pyx_RefNannyFinishContext();
4029  return __pyx_r;
4030 }
4031 
4032 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4033  int __pyx_r;
4034  __Pyx_TraceDeclarations
4035  __Pyx_RefNannyDeclarations
4036  int __pyx_lineno = 0;
4037  const char *__pyx_filename = NULL;
4038  int __pyx_clineno = 0;
4039  __Pyx_RefNannySetupContext("__del__", 0);
4040  __Pyx_TraceCall("__del__", __pyx_f[2], 10, 0, __PYX_ERR(2, 10, __pyx_L1_error));
4041  __Pyx_INCREF(Py_None);
4042  __Pyx_GIVEREF(Py_None);
4043  __Pyx_GOTREF(__pyx_v_self->name);
4044  __Pyx_DECREF(__pyx_v_self->name);
4045  __pyx_v_self->name = ((PyObject*)Py_None);
4046 
4047  /* function exit code */
4048  __pyx_r = 0;
4049  goto __pyx_L0;
4050  __pyx_L1_error:;
4051  __Pyx_AddTraceback("BoundaryConditions.BC_Base.name.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4052  __pyx_r = -1;
4053  __pyx_L0:;
4054  __Pyx_TraceReturn(Py_None, 0);
4055  __Pyx_RefNannyFinishContext();
4056  return __pyx_r;
4057 }
4058 
4059 /* "BoundaryConditions.pxd":11
4060  * object Shape
4061  * str name
4062  * str BC_type # <<<<<<<<<<<<<<
4063  * object ct
4064  * # cpdef void newGlobalBC(BC_Base cls, newstr name, object default_value)
4065  */
4066 
4067 /* Python wrapper */
4068 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self); /*proto*/
4069 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self) {
4070  PyObject *__pyx_r = 0;
4071  __Pyx_RefNannyDeclarations
4072  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4073  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4074 
4075  /* function exit code */
4076  __Pyx_RefNannyFinishContext();
4077  return __pyx_r;
4078 }
4079 
4080 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4081  PyObject *__pyx_r = NULL;
4082  __Pyx_TraceDeclarations
4083  __Pyx_RefNannyDeclarations
4084  int __pyx_lineno = 0;
4085  const char *__pyx_filename = NULL;
4086  int __pyx_clineno = 0;
4087  __Pyx_RefNannySetupContext("__get__", 0);
4088  __Pyx_TraceCall("__get__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
4089  __Pyx_XDECREF(__pyx_r);
4090  __Pyx_INCREF(__pyx_v_self->BC_type);
4091  __pyx_r = __pyx_v_self->BC_type;
4092  goto __pyx_L0;
4093 
4094  /* function exit code */
4095  __pyx_L1_error:;
4096  __Pyx_AddTraceback("BoundaryConditions.BC_Base.BC_type.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4097  __pyx_r = NULL;
4098  __pyx_L0:;
4099  __Pyx_XGIVEREF(__pyx_r);
4100  __Pyx_TraceReturn(__pyx_r, 0);
4101  __Pyx_RefNannyFinishContext();
4102  return __pyx_r;
4103 }
4104 
4105 /* Python wrapper */
4106 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
4107 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4108  int __pyx_r;
4109  __Pyx_RefNannyDeclarations
4110  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4111  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4112 
4113  /* function exit code */
4114  __Pyx_RefNannyFinishContext();
4115  return __pyx_r;
4116 }
4117 
4118 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
4119  int __pyx_r;
4120  __Pyx_TraceDeclarations
4121  __Pyx_RefNannyDeclarations
4122  PyObject *__pyx_t_1 = NULL;
4123  int __pyx_lineno = 0;
4124  const char *__pyx_filename = NULL;
4125  int __pyx_clineno = 0;
4126  __Pyx_RefNannySetupContext("__set__", 0);
4127  __Pyx_TraceCall("__set__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
4128  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 11, __pyx_L1_error)
4129  __pyx_t_1 = __pyx_v_value;
4130  __Pyx_INCREF(__pyx_t_1);
4131  __Pyx_GIVEREF(__pyx_t_1);
4132  __Pyx_GOTREF(__pyx_v_self->BC_type);
4133  __Pyx_DECREF(__pyx_v_self->BC_type);
4134  __pyx_v_self->BC_type = ((PyObject*)__pyx_t_1);
4135  __pyx_t_1 = 0;
4136 
4137  /* function exit code */
4138  __pyx_r = 0;
4139  goto __pyx_L0;
4140  __pyx_L1_error:;
4141  __Pyx_XDECREF(__pyx_t_1);
4142  __Pyx_AddTraceback("BoundaryConditions.BC_Base.BC_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4143  __pyx_r = -1;
4144  __pyx_L0:;
4145  __Pyx_TraceReturn(Py_None, 0);
4146  __Pyx_RefNannyFinishContext();
4147  return __pyx_r;
4148 }
4149 
4150 /* Python wrapper */
4151 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self); /*proto*/
4152 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self) {
4153  int __pyx_r;
4154  __Pyx_RefNannyDeclarations
4155  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
4156  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4157 
4158  /* function exit code */
4159  __Pyx_RefNannyFinishContext();
4160  return __pyx_r;
4161 }
4162 
4163 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4164  int __pyx_r;
4165  __Pyx_TraceDeclarations
4166  __Pyx_RefNannyDeclarations
4167  int __pyx_lineno = 0;
4168  const char *__pyx_filename = NULL;
4169  int __pyx_clineno = 0;
4170  __Pyx_RefNannySetupContext("__del__", 0);
4171  __Pyx_TraceCall("__del__", __pyx_f[2], 11, 0, __PYX_ERR(2, 11, __pyx_L1_error));
4172  __Pyx_INCREF(Py_None);
4173  __Pyx_GIVEREF(Py_None);
4174  __Pyx_GOTREF(__pyx_v_self->BC_type);
4175  __Pyx_DECREF(__pyx_v_self->BC_type);
4176  __pyx_v_self->BC_type = ((PyObject*)Py_None);
4177 
4178  /* function exit code */
4179  __pyx_r = 0;
4180  goto __pyx_L0;
4181  __pyx_L1_error:;
4182  __Pyx_AddTraceback("BoundaryConditions.BC_Base.BC_type.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4183  __pyx_r = -1;
4184  __pyx_L0:;
4185  __Pyx_TraceReturn(Py_None, 0);
4186  __Pyx_RefNannyFinishContext();
4187  return __pyx_r;
4188 }
4189 
4190 /* "BoundaryConditions.pxd":12
4191  * str name
4192  * str BC_type
4193  * object ct # <<<<<<<<<<<<<<
4194  * # cpdef void newGlobalBC(BC_Base cls, newstr name, object default_value)
4195  * # cpdef void getContext(BC_Base cls, object context=*)
4196  */
4197 
4198 /* Python wrapper */
4199 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self); /*proto*/
4200 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self) {
4201  PyObject *__pyx_r = 0;
4202  __Pyx_RefNannyDeclarations
4203  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4204  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4205 
4206  /* function exit code */
4207  __Pyx_RefNannyFinishContext();
4208  return __pyx_r;
4209 }
4210 
4211 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4212  PyObject *__pyx_r = NULL;
4213  __Pyx_TraceDeclarations
4214  __Pyx_RefNannyDeclarations
4215  int __pyx_lineno = 0;
4216  const char *__pyx_filename = NULL;
4217  int __pyx_clineno = 0;
4218  __Pyx_RefNannySetupContext("__get__", 0);
4219  __Pyx_TraceCall("__get__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4220  __Pyx_XDECREF(__pyx_r);
4221  __Pyx_INCREF(__pyx_v_self->ct);
4222  __pyx_r = __pyx_v_self->ct;
4223  goto __pyx_L0;
4224 
4225  /* function exit code */
4226  __pyx_L1_error:;
4227  __Pyx_AddTraceback("BoundaryConditions.BC_Base.ct.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4228  __pyx_r = NULL;
4229  __pyx_L0:;
4230  __Pyx_XGIVEREF(__pyx_r);
4231  __Pyx_TraceReturn(__pyx_r, 0);
4232  __Pyx_RefNannyFinishContext();
4233  return __pyx_r;
4234 }
4235 
4236 /* Python wrapper */
4237 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
4238 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4239  int __pyx_r;
4240  __Pyx_RefNannyDeclarations
4241  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4242  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4243 
4244  /* function exit code */
4245  __Pyx_RefNannyFinishContext();
4246  return __pyx_r;
4247 }
4248 
4249 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
4250  int __pyx_r;
4251  __Pyx_TraceDeclarations
4252  __Pyx_RefNannyDeclarations
4253  int __pyx_lineno = 0;
4254  const char *__pyx_filename = NULL;
4255  int __pyx_clineno = 0;
4256  __Pyx_RefNannySetupContext("__set__", 0);
4257  __Pyx_TraceCall("__set__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4258  __Pyx_INCREF(__pyx_v_value);
4259  __Pyx_GIVEREF(__pyx_v_value);
4260  __Pyx_GOTREF(__pyx_v_self->ct);
4261  __Pyx_DECREF(__pyx_v_self->ct);
4262  __pyx_v_self->ct = __pyx_v_value;
4263 
4264  /* function exit code */
4265  __pyx_r = 0;
4266  goto __pyx_L0;
4267  __pyx_L1_error:;
4268  __Pyx_AddTraceback("BoundaryConditions.BC_Base.ct.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4269  __pyx_r = -1;
4270  __pyx_L0:;
4271  __Pyx_TraceReturn(Py_None, 0);
4272  __Pyx_RefNannyFinishContext();
4273  return __pyx_r;
4274 }
4275 
4276 /* Python wrapper */
4277 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self); /*proto*/
4278 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self) {
4279  int __pyx_r;
4280  __Pyx_RefNannyDeclarations
4281  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
4282  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4283 
4284  /* function exit code */
4285  __Pyx_RefNannyFinishContext();
4286  return __pyx_r;
4287 }
4288 
4289 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4290  int __pyx_r;
4291  __Pyx_TraceDeclarations
4292  __Pyx_RefNannyDeclarations
4293  int __pyx_lineno = 0;
4294  const char *__pyx_filename = NULL;
4295  int __pyx_clineno = 0;
4296  __Pyx_RefNannySetupContext("__del__", 0);
4297  __Pyx_TraceCall("__del__", __pyx_f[2], 12, 0, __PYX_ERR(2, 12, __pyx_L1_error));
4298  __Pyx_INCREF(Py_None);
4299  __Pyx_GIVEREF(Py_None);
4300  __Pyx_GOTREF(__pyx_v_self->ct);
4301  __Pyx_DECREF(__pyx_v_self->ct);
4302  __pyx_v_self->ct = Py_None;
4303 
4304  /* function exit code */
4305  __pyx_r = 0;
4306  goto __pyx_L0;
4307  __pyx_L1_error:;
4308  __Pyx_AddTraceback("BoundaryConditions.BC_Base.ct.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4309  __pyx_r = -1;
4310  __pyx_L0:;
4311  __Pyx_TraceReturn(Py_None, 0);
4312  __Pyx_RefNannyFinishContext();
4313  return __pyx_r;
4314 }
4315 
4316 /* "(tree fragment)":1
4317  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4318  * cdef tuple state
4319  * cdef object _dict
4320  */
4321 
4322 /* Python wrapper */
4323 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4324 static char __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__[] = "BC_Base.__reduce_cython__(self)";
4325 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__};
4326 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4327  PyObject *__pyx_r = 0;
4328  __Pyx_RefNannyDeclarations
4329  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4330  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
4331 
4332  /* function exit code */
4333  __Pyx_RefNannyFinishContext();
4334  return __pyx_r;
4335 }
4336 
4337 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
4338  PyObject *__pyx_v_state = 0;
4339  PyObject *__pyx_v__dict = 0;
4340  int __pyx_v_use_setstate;
4341  PyObject *__pyx_r = NULL;
4342  __Pyx_TraceDeclarations
4343  __Pyx_RefNannyDeclarations
4344  PyObject *__pyx_t_1 = NULL;
4345  PyObject *__pyx_t_2 = NULL;
4346  PyObject *__pyx_t_3 = NULL;
4347  int __pyx_t_4;
4348  int __pyx_t_5;
4349  int __pyx_t_6;
4350  int __pyx_lineno = 0;
4351  const char *__pyx_filename = NULL;
4352  int __pyx_clineno = 0;
4353  __Pyx_TraceFrameInit(__pyx_codeobj__2)
4354  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4355  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
4356 
4357  /* "(tree fragment)":5
4358  * cdef object _dict
4359  * cdef bint use_setstate
4360  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd) # <<<<<<<<<<<<<<
4361  * _dict = getattr(self, '__dict__', None)
4362  * if _dict is not None:
4363  */
4364  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->_b_or, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
4365  __Pyx_GOTREF(__pyx_t_1);
4366  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nd); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
4367  __Pyx_GOTREF(__pyx_t_2);
4368  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
4369  __Pyx_GOTREF(__pyx_t_3);
4370  __Pyx_INCREF(__pyx_v_self->BC_type);
4371  __Pyx_GIVEREF(__pyx_v_self->BC_type);
4372  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->BC_type);
4373  __Pyx_INCREF(__pyx_v_self->Shape);
4374  __Pyx_GIVEREF(__pyx_v_self->Shape);
4375  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->Shape);
4376  __Pyx_GIVEREF(__pyx_t_1);
4377  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
4378  __Pyx_INCREF(__pyx_v_self->ct);
4379  __Pyx_GIVEREF(__pyx_v_self->ct);
4380  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->ct);
4381  __Pyx_INCREF(__pyx_v_self->name);
4382  __Pyx_GIVEREF(__pyx_v_self->name);
4383  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_self->name);
4384  __Pyx_GIVEREF(__pyx_t_2);
4385  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_2);
4386  __pyx_t_1 = 0;
4387  __pyx_t_2 = 0;
4388  __pyx_v_state = ((PyObject*)__pyx_t_3);
4389  __pyx_t_3 = 0;
4390 
4391  /* "(tree fragment)":6
4392  * cdef bint use_setstate
4393  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
4394  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
4395  * if _dict is not None:
4396  * state += (_dict,)
4397  */
4398  __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
4399  __Pyx_GOTREF(__pyx_t_3);
4400  __pyx_v__dict = __pyx_t_3;
4401  __pyx_t_3 = 0;
4402 
4403  /* "(tree fragment)":7
4404  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
4405  * _dict = getattr(self, '__dict__', None)
4406  * if _dict is not None: # <<<<<<<<<<<<<<
4407  * state += (_dict,)
4408  * use_setstate = True
4409  */
4410  __pyx_t_4 = (__pyx_v__dict != Py_None);
4411  __pyx_t_5 = (__pyx_t_4 != 0);
4412  if (__pyx_t_5) {
4413 
4414  /* "(tree fragment)":8
4415  * _dict = getattr(self, '__dict__', None)
4416  * if _dict is not None:
4417  * state += (_dict,) # <<<<<<<<<<<<<<
4418  * use_setstate = True
4419  * else:
4420  */
4421  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
4422  __Pyx_GOTREF(__pyx_t_3);
4423  __Pyx_INCREF(__pyx_v__dict);
4424  __Pyx_GIVEREF(__pyx_v__dict);
4425  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
4426  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
4427  __Pyx_GOTREF(__pyx_t_2);
4428  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4429  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
4430  __pyx_t_2 = 0;
4431 
4432  /* "(tree fragment)":9
4433  * if _dict is not None:
4434  * state += (_dict,)
4435  * use_setstate = True # <<<<<<<<<<<<<<
4436  * else:
4437  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
4438  */
4439  __pyx_v_use_setstate = 1;
4440 
4441  /* "(tree fragment)":7
4442  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
4443  * _dict = getattr(self, '__dict__', None)
4444  * if _dict is not None: # <<<<<<<<<<<<<<
4445  * state += (_dict,)
4446  * use_setstate = True
4447  */
4448  goto __pyx_L3;
4449  }
4450 
4451  /* "(tree fragment)":11
4452  * use_setstate = True
4453  * else:
4454  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None # <<<<<<<<<<<<<<
4455  * if use_setstate:
4456  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
4457  */
4458  /*else*/ {
4459  __pyx_t_4 = (__pyx_v_self->BC_type != ((PyObject*)Py_None));
4460  __pyx_t_6 = (__pyx_t_4 != 0);
4461  if (!__pyx_t_6) {
4462  } else {
4463  __pyx_t_5 = __pyx_t_6;
4464  goto __pyx_L4_bool_binop_done;
4465  }
4466  __pyx_t_6 = (__pyx_v_self->Shape != Py_None);
4467  __pyx_t_4 = (__pyx_t_6 != 0);
4468  if (!__pyx_t_4) {
4469  } else {
4470  __pyx_t_5 = __pyx_t_4;
4471  goto __pyx_L4_bool_binop_done;
4472  }
4473  __pyx_t_4 = (__pyx_v_self->ct != Py_None);
4474  __pyx_t_6 = (__pyx_t_4 != 0);
4475  if (!__pyx_t_6) {
4476  } else {
4477  __pyx_t_5 = __pyx_t_6;
4478  goto __pyx_L4_bool_binop_done;
4479  }
4480  __pyx_t_6 = (__pyx_v_self->name != ((PyObject*)Py_None));
4481  __pyx_t_4 = (__pyx_t_6 != 0);
4482  __pyx_t_5 = __pyx_t_4;
4483  __pyx_L4_bool_binop_done:;
4484  __pyx_v_use_setstate = __pyx_t_5;
4485  }
4486  __pyx_L3:;
4487 
4488  /* "(tree fragment)":12
4489  * else:
4490  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
4491  * if use_setstate: # <<<<<<<<<<<<<<
4492  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
4493  * else:
4494  */
4495  __pyx_t_5 = (__pyx_v_use_setstate != 0);
4496  if (__pyx_t_5) {
4497 
4498  /* "(tree fragment)":13
4499  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
4500  * if use_setstate:
4501  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state # <<<<<<<<<<<<<<
4502  * else:
4503  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4504  */
4505  __Pyx_XDECREF(__pyx_r);
4506  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_BC_Base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
4507  __Pyx_GOTREF(__pyx_t_2);
4508  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
4509  __Pyx_GOTREF(__pyx_t_3);
4510  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4511  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4512  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4513  __Pyx_INCREF(__pyx_int_158231071);
4514  __Pyx_GIVEREF(__pyx_int_158231071);
4515  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
4516  __Pyx_INCREF(Py_None);
4517  __Pyx_GIVEREF(Py_None);
4518  PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
4519  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
4520  __Pyx_GOTREF(__pyx_t_1);
4521  __Pyx_GIVEREF(__pyx_t_2);
4522  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
4523  __Pyx_GIVEREF(__pyx_t_3);
4524  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
4525  __Pyx_INCREF(__pyx_v_state);
4526  __Pyx_GIVEREF(__pyx_v_state);
4527  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
4528  __pyx_t_2 = 0;
4529  __pyx_t_3 = 0;
4530  __pyx_r = __pyx_t_1;
4531  __pyx_t_1 = 0;
4532  goto __pyx_L0;
4533 
4534  /* "(tree fragment)":12
4535  * else:
4536  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
4537  * if use_setstate: # <<<<<<<<<<<<<<
4538  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
4539  * else:
4540  */
4541  }
4542 
4543  /* "(tree fragment)":15
4544  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
4545  * else:
4546  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state) # <<<<<<<<<<<<<<
4547  * def __setstate_cython__(self, __pyx_state):
4548  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
4549  */
4550  /*else*/ {
4551  __Pyx_XDECREF(__pyx_r);
4552  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_BC_Base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
4553  __Pyx_GOTREF(__pyx_t_1);
4554  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
4555  __Pyx_GOTREF(__pyx_t_3);
4556  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4557  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4558  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4559  __Pyx_INCREF(__pyx_int_158231071);
4560  __Pyx_GIVEREF(__pyx_int_158231071);
4561  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
4562  __Pyx_INCREF(__pyx_v_state);
4563  __Pyx_GIVEREF(__pyx_v_state);
4564  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
4565  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
4566  __Pyx_GOTREF(__pyx_t_2);
4567  __Pyx_GIVEREF(__pyx_t_1);
4568  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4569  __Pyx_GIVEREF(__pyx_t_3);
4570  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
4571  __pyx_t_1 = 0;
4572  __pyx_t_3 = 0;
4573  __pyx_r = __pyx_t_2;
4574  __pyx_t_2 = 0;
4575  goto __pyx_L0;
4576  }
4577 
4578  /* "(tree fragment)":1
4579  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4580  * cdef tuple state
4581  * cdef object _dict
4582  */
4583 
4584  /* function exit code */
4585  __pyx_L1_error:;
4586  __Pyx_XDECREF(__pyx_t_1);
4587  __Pyx_XDECREF(__pyx_t_2);
4588  __Pyx_XDECREF(__pyx_t_3);
4589  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4590  __pyx_r = NULL;
4591  __pyx_L0:;
4592  __Pyx_XDECREF(__pyx_v_state);
4593  __Pyx_XDECREF(__pyx_v__dict);
4594  __Pyx_XGIVEREF(__pyx_r);
4595  __Pyx_TraceReturn(__pyx_r, 0);
4596  __Pyx_RefNannyFinishContext();
4597  return __pyx_r;
4598 }
4599 
4600 /* "(tree fragment)":16
4601  * else:
4602  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4603  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4604  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
4605  */
4606 
4607 /* Python wrapper */
4608 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
4609 static char __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__[] = "BC_Base.__setstate_cython__(self, __pyx_state)";
4610 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__};
4611 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4612  PyObject *__pyx_r = 0;
4613  __Pyx_RefNannyDeclarations
4614  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4615  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4616 
4617  /* function exit code */
4618  __Pyx_RefNannyFinishContext();
4619  return __pyx_r;
4620 }
4621 
4622 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4623  PyObject *__pyx_r = NULL;
4624  __Pyx_TraceDeclarations
4625  __Pyx_RefNannyDeclarations
4626  PyObject *__pyx_t_1 = NULL;
4627  int __pyx_lineno = 0;
4628  const char *__pyx_filename = NULL;
4629  int __pyx_clineno = 0;
4630  __Pyx_TraceFrameInit(__pyx_codeobj__3)
4631  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4632  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
4633 
4634  /* "(tree fragment)":17
4635  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4636  * def __setstate_cython__(self, __pyx_state):
4637  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
4638  */
4639  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
4640  __pyx_t_1 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
4641  __Pyx_GOTREF(__pyx_t_1);
4642  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4643 
4644  /* "(tree fragment)":16
4645  * else:
4646  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
4647  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4648  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
4649  */
4650 
4651  /* function exit code */
4652  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4653  goto __pyx_L0;
4654  __pyx_L1_error:;
4655  __Pyx_XDECREF(__pyx_t_1);
4656  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4657  __pyx_r = NULL;
4658  __pyx_L0:;
4659  __Pyx_XGIVEREF(__pyx_r);
4660  __Pyx_TraceReturn(__pyx_r, 0);
4661  __Pyx_RefNannyFinishContext();
4662  return __pyx_r;
4663 }
4664 
4665 /* "BoundaryConditions.py":78
4666  * no boundary condition
4667  * """
4668  * def __init__(self): # <<<<<<<<<<<<<<
4669  * self.uOfXT = None
4670  *
4671  */
4672 
4673 /* Python wrapper */
4674 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4675 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4676  int __pyx_r;
4677  __Pyx_RefNannyDeclarations
4678  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4679  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
4680  __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
4681  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
4682  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4683 
4684  /* function exit code */
4685  __Pyx_RefNannyFinishContext();
4686  return __pyx_r;
4687 }
4688 
4689 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4690  int __pyx_r;
4691  __Pyx_TraceDeclarations
4692  __Pyx_RefNannyDeclarations
4693  int __pyx_lineno = 0;
4694  const char *__pyx_filename = NULL;
4695  int __pyx_clineno = 0;
4696  __Pyx_RefNannySetupContext("__init__", 0);
4697  __Pyx_TraceCall("__init__", __pyx_f[0], 78, 0, __PYX_ERR(0, 78, __pyx_L1_error));
4698 
4699  /* "BoundaryConditions.py":79
4700  * """
4701  * def __init__(self):
4702  * self.uOfXT = None # <<<<<<<<<<<<<<
4703  *
4704  * def init_cython(self):
4705  */
4706  __Pyx_INCREF(Py_None);
4707  __Pyx_GIVEREF(Py_None);
4708  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4709  __Pyx_DECREF(__pyx_v_self->uOfXT);
4710  __pyx_v_self->uOfXT = Py_None;
4711 
4712  /* "BoundaryConditions.py":78
4713  * no boundary condition
4714  * """
4715  * def __init__(self): # <<<<<<<<<<<<<<
4716  * self.uOfXT = None
4717  *
4718  */
4719 
4720  /* function exit code */
4721  __pyx_r = 0;
4722  goto __pyx_L0;
4723  __pyx_L1_error:;
4724  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4725  __pyx_r = -1;
4726  __pyx_L0:;
4727  __Pyx_TraceReturn(Py_None, 0);
4728  __Pyx_RefNannyFinishContext();
4729  return __pyx_r;
4730 }
4731 
4732 /* "BoundaryConditions.py":81
4733  * self.uOfXT = None
4734  *
4735  * def init_cython(self): # <<<<<<<<<<<<<<
4736  * return self.uOfXT
4737  *
4738  */
4739 
4740 /* Python wrapper */
4741 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4742 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython[] = "BoundaryCondition.init_cython(self)";
4743 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython = {"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython};
4744 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4745  PyObject *__pyx_r = 0;
4746  __Pyx_RefNannyDeclarations
4747  __Pyx_RefNannySetupContext("init_cython (wrapper)", 0);
4748  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4749 
4750  /* function exit code */
4751  __Pyx_RefNannyFinishContext();
4752  return __pyx_r;
4753 }
4754 
4755 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4756  PyObject *__pyx_r = NULL;
4757  __Pyx_TraceDeclarations
4758  __Pyx_RefNannyDeclarations
4759  int __pyx_lineno = 0;
4760  const char *__pyx_filename = NULL;
4761  int __pyx_clineno = 0;
4762  __Pyx_TraceFrameInit(__pyx_codeobj__4)
4763  __Pyx_RefNannySetupContext("init_cython", 0);
4764  __Pyx_TraceCall("init_cython", __pyx_f[0], 81, 0, __PYX_ERR(0, 81, __pyx_L1_error));
4765 
4766  /* "BoundaryConditions.py":82
4767  *
4768  * def init_cython(self):
4769  * return self.uOfXT # <<<<<<<<<<<<<<
4770  *
4771  * def resetBC(self):
4772  */
4773  __Pyx_XDECREF(__pyx_r);
4774  __Pyx_INCREF(__pyx_v_self->uOfXT);
4775  __pyx_r = __pyx_v_self->uOfXT;
4776  goto __pyx_L0;
4777 
4778  /* "BoundaryConditions.py":81
4779  * self.uOfXT = None
4780  *
4781  * def init_cython(self): # <<<<<<<<<<<<<<
4782  * return self.uOfXT
4783  *
4784  */
4785 
4786  /* function exit code */
4787  __pyx_L1_error:;
4788  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.init_cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
4789  __pyx_r = NULL;
4790  __pyx_L0:;
4791  __Pyx_XGIVEREF(__pyx_r);
4792  __Pyx_TraceReturn(__pyx_r, 0);
4793  __Pyx_RefNannyFinishContext();
4794  return __pyx_r;
4795 }
4796 
4797 /* "BoundaryConditions.py":84
4798  * return self.uOfXT
4799  *
4800  * def resetBC(self): # <<<<<<<<<<<<<<
4801  * self.uOfXT = None
4802  *
4803  */
4804 
4805 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4806 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, int __pyx_skip_dispatch) {
4807  __Pyx_TraceDeclarations
4808  __Pyx_RefNannyDeclarations
4809  PyObject *__pyx_t_1 = NULL;
4810  PyObject *__pyx_t_2 = NULL;
4811  PyObject *__pyx_t_3 = NULL;
4812  PyObject *__pyx_t_4 = NULL;
4813  int __pyx_lineno = 0;
4814  const char *__pyx_filename = NULL;
4815  int __pyx_clineno = 0;
4816  __Pyx_TraceFrameInit(__pyx_codeobj__5)
4817  __Pyx_RefNannySetupContext("resetBC", 0);
4818  __Pyx_TraceCall("resetBC", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
4819  /* Check if called by wrapper */
4820  if (unlikely(__pyx_skip_dispatch)) ;
4821  /* Check if overridden in Python */
4822  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
4823  #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4824  static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4825  if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
4826  PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4827  #endif
4828  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resetBC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
4829  __Pyx_GOTREF(__pyx_t_1);
4830  if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC)) {
4831  __Pyx_INCREF(__pyx_t_1);
4832  __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
4833  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4834  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4835  if (likely(__pyx_t_4)) {
4836  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4837  __Pyx_INCREF(__pyx_t_4);
4838  __Pyx_INCREF(function);
4839  __Pyx_DECREF_SET(__pyx_t_3, function);
4840  }
4841  }
4842  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4843  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4844  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
4845  __Pyx_GOTREF(__pyx_t_2);
4846  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4847  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4848  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4849  goto __pyx_L0;
4850  }
4851  #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4852  __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4853  __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
4854  if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
4855  __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4856  }
4857  #endif
4858  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4859  #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4860  }
4861  #endif
4862  }
4863 
4864  /* "BoundaryConditions.py":85
4865  *
4866  * def resetBC(self):
4867  * self.uOfXT = None # <<<<<<<<<<<<<<
4868  *
4869  * def setConstantBC(self, value):
4870  */
4871  __Pyx_INCREF(Py_None);
4872  __Pyx_GIVEREF(Py_None);
4873  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4874  __Pyx_DECREF(__pyx_v_self->uOfXT);
4875  __pyx_v_self->uOfXT = Py_None;
4876 
4877  /* "BoundaryConditions.py":84
4878  * return self.uOfXT
4879  *
4880  * def resetBC(self): # <<<<<<<<<<<<<<
4881  * self.uOfXT = None
4882  *
4883  */
4884 
4885  /* function exit code */
4886  goto __pyx_L0;
4887  __pyx_L1_error:;
4888  __Pyx_XDECREF(__pyx_t_1);
4889  __Pyx_XDECREF(__pyx_t_2);
4890  __Pyx_XDECREF(__pyx_t_3);
4891  __Pyx_XDECREF(__pyx_t_4);
4892  __Pyx_WriteUnraisable("BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4893  __pyx_L0:;
4894  __Pyx_TraceReturn(Py_None, 0);
4895  __Pyx_RefNannyFinishContext();
4896 }
4897 
4898 /* Python wrapper */
4899 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4900 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_4resetBC[] = "BoundaryCondition.resetBC(self) -> void";
4901 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC = {"resetBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_4resetBC};
4902 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4903  PyObject *__pyx_r = 0;
4904  __Pyx_RefNannyDeclarations
4905  __Pyx_RefNannySetupContext("resetBC (wrapper)", 0);
4906  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4907 
4908  /* function exit code */
4909  __Pyx_RefNannyFinishContext();
4910  return __pyx_r;
4911 }
4912 
4913 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4914  PyObject *__pyx_r = NULL;
4915  __Pyx_TraceDeclarations
4916  __Pyx_RefNannyDeclarations
4917  PyObject *__pyx_t_1 = NULL;
4918  int __pyx_lineno = 0;
4919  const char *__pyx_filename = NULL;
4920  int __pyx_clineno = 0;
4921  __Pyx_TraceFrameInit(__pyx_codeobj__5)
4922  __Pyx_RefNannySetupContext("resetBC", 0);
4923  __Pyx_TraceCall("resetBC (wrapper)", __pyx_f[0], 84, 0, __PYX_ERR(0, 84, __pyx_L1_error));
4924  __Pyx_XDECREF(__pyx_r);
4925  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
4926  __Pyx_GOTREF(__pyx_t_1);
4927  __pyx_r = __pyx_t_1;
4928  __pyx_t_1 = 0;
4929  goto __pyx_L0;
4930 
4931  /* function exit code */
4932  __pyx_L1_error:;
4933  __Pyx_XDECREF(__pyx_t_1);
4934  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4935  __pyx_r = NULL;
4936  __pyx_L0:;
4937  __Pyx_XGIVEREF(__pyx_r);
4938  __Pyx_TraceReturn(__pyx_r, 0);
4939  __Pyx_RefNannyFinishContext();
4940  return __pyx_r;
4941 }
4942 
4943 /* "BoundaryConditions.py":87
4944  * self.uOfXT = None
4945  *
4946  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
4947  * """
4948  * function returning constant BC
4949  */
4950 
4951 /* Python wrapper */
4952 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
4953 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC[] = "BoundaryCondition.setConstantBC(self, value)\n\n function returning constant BC\n\n Parameters\n ----------\n value : float\n Constant value\n\n ";
4954 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC = {"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC};
4955 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4956  PyObject *__pyx_r = 0;
4957  __Pyx_RefNannyDeclarations
4958  __Pyx_RefNannySetupContext("setConstantBC (wrapper)", 0);
4959  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4960 
4961  /* function exit code */
4962  __Pyx_RefNannyFinishContext();
4963  return __pyx_r;
4964 }
4965 
4966 /* "BoundaryConditions.py":97
4967  *
4968  * """
4969  * self.uOfXT = lambda x, t, n=np.zeros(3,): value # <<<<<<<<<<<<<<
4970  *
4971  *
4972  */
4973 
4974 static PyObject *__pyx_pf_18BoundaryConditions_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
4975  PyObject *__pyx_r = NULL;
4976  __Pyx_TraceDeclarations
4977  __Pyx_RefNannyDeclarations
4978  PyObject *__pyx_t_1 = NULL;
4979  PyObject *__pyx_t_2 = NULL;
4980  int __pyx_lineno = 0;
4981  const char *__pyx_filename = NULL;
4982  int __pyx_clineno = 0;
4983  __Pyx_RefNannySetupContext("__defaults__", 0);
4984  __Pyx_TraceCall("__defaults__", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
4985  __Pyx_XDECREF(__pyx_r);
4986  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
4987  __Pyx_GOTREF(__pyx_t_1);
4988  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4989  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4990  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_n);
4991  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
4992  __Pyx_GOTREF(__pyx_t_2);
4993  __Pyx_GIVEREF(__pyx_t_1);
4994  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4995  __Pyx_INCREF(Py_None);
4996  __Pyx_GIVEREF(Py_None);
4997  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
4998  __pyx_t_1 = 0;
4999  __pyx_r = __pyx_t_2;
5000  __pyx_t_2 = 0;
5001  goto __pyx_L0;
5002 
5003  /* function exit code */
5004  __pyx_L1_error:;
5005  __Pyx_XDECREF(__pyx_t_1);
5006  __Pyx_XDECREF(__pyx_t_2);
5007  __Pyx_AddTraceback("BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5008  __pyx_r = NULL;
5009  __pyx_L0:;
5010  __Pyx_XGIVEREF(__pyx_r);
5011  __Pyx_TraceReturn(__pyx_r, 0);
5012  __Pyx_RefNannyFinishContext();
5013  return __pyx_r;
5014 }
5015 
5016 /* Python wrapper */
5017 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5018 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda = {"lambda", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, METH_VARARGS|METH_KEYWORDS, 0};
5019 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5020  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
5021  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
5022  CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5023  int __pyx_lineno = 0;
5024  const char *__pyx_filename = NULL;
5025  int __pyx_clineno = 0;
5026  PyObject *__pyx_r = 0;
5027  __Pyx_RefNannyDeclarations
5028  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
5029  {
5030  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5031  PyObject* values[3] = {0,0,0};
5032  __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
5033  values[2] = __pyx_dynamic_args->__pyx_arg_n;
5034  if (unlikely(__pyx_kwds)) {
5035  Py_ssize_t kw_args;
5036  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5037  switch (pos_args) {
5038  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5039  CYTHON_FALLTHROUGH;
5040  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5041  CYTHON_FALLTHROUGH;
5042  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5043  CYTHON_FALLTHROUGH;
5044  case 0: break;
5045  default: goto __pyx_L5_argtuple_error;
5046  }
5047  kw_args = PyDict_Size(__pyx_kwds);
5048  switch (pos_args) {
5049  case 0:
5050  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5051  else goto __pyx_L5_argtuple_error;
5052  CYTHON_FALLTHROUGH;
5053  case 1:
5054  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5055  else {
5056  __Pyx_RaiseArgtupleInvalid("lambda", 0, 2, 3, 1); __PYX_ERR(0, 97, __pyx_L3_error)
5057  }
5058  CYTHON_FALLTHROUGH;
5059  case 2:
5060  if (kw_args > 0) {
5061  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5062  if (value) { values[2] = value; kw_args--; }
5063  }
5064  }
5065  if (unlikely(kw_args > 0)) {
5066  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda") < 0)) __PYX_ERR(0, 97, __pyx_L3_error)
5067  }
5068  } else {
5069  switch (PyTuple_GET_SIZE(__pyx_args)) {
5070  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5071  CYTHON_FALLTHROUGH;
5072  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5073  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5074  break;
5075  default: goto __pyx_L5_argtuple_error;
5076  }
5077  }
5078  __pyx_v_x = values[0];
5079  __pyx_v_t = values[1];
5080  __pyx_v_n = values[2];
5081  }
5082  goto __pyx_L4_argument_unpacking_done;
5083  __pyx_L5_argtuple_error:;
5084  __Pyx_RaiseArgtupleInvalid("lambda", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 97, __pyx_L3_error)
5085  __pyx_L3_error:;
5086  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
5087  __Pyx_RefNannyFinishContext();
5088  return NULL;
5089  __pyx_L4_argument_unpacking_done:;
5090  __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5091 
5092  /* function exit code */
5093  __Pyx_RefNannyFinishContext();
5094  return __pyx_r;
5095 }
5096 
5097 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5098  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
5099  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_outer_scope;
5100  PyObject *__pyx_r = NULL;
5101  __Pyx_TraceDeclarations
5102  __Pyx_RefNannyDeclarations
5103  int __pyx_lineno = 0;
5104  const char *__pyx_filename = NULL;
5105  int __pyx_clineno = 0;
5106  __Pyx_RefNannySetupContext("lambda", 0);
5107  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
5108  __pyx_cur_scope = __pyx_outer_scope;
5109  __Pyx_TraceCall("lambda", __pyx_f[0], 97, 0, __PYX_ERR(0, 97, __pyx_L1_error));
5110  __Pyx_XDECREF(__pyx_r);
5111  if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 97, __pyx_L1_error) }
5112  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
5113  __pyx_r = __pyx_cur_scope->__pyx_v_value;
5114  goto __pyx_L0;
5115 
5116  /* function exit code */
5117  __pyx_L1_error:;
5118  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
5119  __pyx_r = NULL;
5120  __pyx_L0:;
5121  __Pyx_XGIVEREF(__pyx_r);
5122  __Pyx_TraceReturn(__pyx_r, 0);
5123  __Pyx_RefNannyFinishContext();
5124  return __pyx_r;
5125 }
5126 
5127 /* "BoundaryConditions.py":87
5128  * self.uOfXT = None
5129  *
5130  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
5131  * """
5132  * function returning constant BC
5133  */
5134 
5135 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
5136  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
5137  PyObject *__pyx_r = NULL;
5138  __Pyx_TraceDeclarations
5139  __Pyx_RefNannyDeclarations
5140  PyObject *__pyx_t_1 = NULL;
5141  PyObject *__pyx_t_2 = NULL;
5142  PyObject *__pyx_t_3 = NULL;
5143  PyObject *__pyx_t_4 = NULL;
5144  int __pyx_lineno = 0;
5145  const char *__pyx_filename = NULL;
5146  int __pyx_clineno = 0;
5147  __Pyx_TraceFrameInit(__pyx_codeobj__6)
5148  __Pyx_RefNannySetupContext("setConstantBC", 0);
5149  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC, __pyx_empty_tuple, NULL);
5150  if (unlikely(!__pyx_cur_scope)) {
5151  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)Py_None);
5152  __Pyx_INCREF(Py_None);
5153  __PYX_ERR(0, 87, __pyx_L1_error)
5154  } else {
5155  __Pyx_GOTREF(__pyx_cur_scope);
5156  }
5157  __Pyx_TraceCall("setConstantBC", __pyx_f[0], 87, 0, __PYX_ERR(0, 87, __pyx_L1_error));
5158  __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
5159  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
5160  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
5161 
5162  /* "BoundaryConditions.py":97
5163  *
5164  * """
5165  * self.uOfXT = lambda x, t, n=np.zeros(3,): value # <<<<<<<<<<<<<<
5166  *
5167  *
5168  */
5169  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, 0, __pyx_n_s_setConstantBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
5170  __Pyx_GOTREF(__pyx_t_1);
5171  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 97, __pyx_L1_error)
5172  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
5173  __Pyx_GOTREF(__pyx_t_3);
5174  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
5175  __Pyx_GOTREF(__pyx_t_4);
5176  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5177  __pyx_t_3 = NULL;
5178  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5179  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5180  if (likely(__pyx_t_3)) {
5181  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5182  __Pyx_INCREF(__pyx_t_3);
5183  __Pyx_INCREF(function);
5184  __Pyx_DECREF_SET(__pyx_t_4, function);
5185  }
5186  }
5187  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5188  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5189  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
5190  __Pyx_GOTREF(__pyx_t_2);
5191  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5192  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5193  __Pyx_GIVEREF(__pyx_t_2);
5194  __pyx_t_2 = 0;
5195  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_2__defaults__);
5196  __Pyx_GIVEREF(__pyx_t_1);
5197  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5198  __Pyx_DECREF(__pyx_v_self->uOfXT);
5199  __pyx_v_self->uOfXT = __pyx_t_1;
5200  __pyx_t_1 = 0;
5201 
5202  /* "BoundaryConditions.py":87
5203  * self.uOfXT = None
5204  *
5205  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
5206  * """
5207  * function returning constant BC
5208  */
5209 
5210  /* function exit code */
5211  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5212  goto __pyx_L0;
5213  __pyx_L1_error:;
5214  __Pyx_XDECREF(__pyx_t_1);
5215  __Pyx_XDECREF(__pyx_t_2);
5216  __Pyx_XDECREF(__pyx_t_3);
5217  __Pyx_XDECREF(__pyx_t_4);
5218  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5219  __pyx_r = NULL;
5220  __pyx_L0:;
5221  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5222  __Pyx_XGIVEREF(__pyx_r);
5223  __Pyx_TraceReturn(__pyx_r, 0);
5224  __Pyx_RefNannyFinishContext();
5225  return __pyx_r;
5226 }
5227 
5228 /* "BoundaryConditions.py":100
5229  *
5230  *
5231  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
5232  * """
5233  * function returning value=a0+ax*x+ay*y+az*z
5234  */
5235 
5236 /* Python wrapper */
5237 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5238 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC[] = "BoundaryCondition.setLinearBC(self, a0, a)\n\n function returning value=a0+ax*x+ay*y+az*z\n\n Parameters\n ----------\n a0 : float\n constant\n a: numpy.ndarray\n ax,ay,az\n\n ";
5239 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC = {"setLinearBC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC};
5240 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5241  PyObject *__pyx_v_a0 = 0;
5242  PyObject *__pyx_v_a = 0;
5243  int __pyx_lineno = 0;
5244  const char *__pyx_filename = NULL;
5245  int __pyx_clineno = 0;
5246  PyObject *__pyx_r = 0;
5247  __Pyx_RefNannyDeclarations
5248  __Pyx_RefNannySetupContext("setLinearBC (wrapper)", 0);
5249  {
5250  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a0,&__pyx_n_s_a,0};
5251  PyObject* values[2] = {0,0};
5252  if (unlikely(__pyx_kwds)) {
5253  Py_ssize_t kw_args;
5254  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5255  switch (pos_args) {
5256  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5257  CYTHON_FALLTHROUGH;
5258  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5259  CYTHON_FALLTHROUGH;
5260  case 0: break;
5261  default: goto __pyx_L5_argtuple_error;
5262  }
5263  kw_args = PyDict_Size(__pyx_kwds);
5264  switch (pos_args) {
5265  case 0:
5266  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a0)) != 0)) kw_args--;
5267  else goto __pyx_L5_argtuple_error;
5268  CYTHON_FALLTHROUGH;
5269  case 1:
5270  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
5271  else {
5272  __Pyx_RaiseArgtupleInvalid("setLinearBC", 1, 2, 2, 1); __PYX_ERR(0, 100, __pyx_L3_error)
5273  }
5274  }
5275  if (unlikely(kw_args > 0)) {
5276  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLinearBC") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
5277  }
5278  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5279  goto __pyx_L5_argtuple_error;
5280  } else {
5281  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5282  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5283  }
5284  __pyx_v_a0 = values[0];
5285  __pyx_v_a = values[1];
5286  }
5287  goto __pyx_L4_argument_unpacking_done;
5288  __pyx_L5_argtuple_error:;
5289  __Pyx_RaiseArgtupleInvalid("setLinearBC", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
5290  __pyx_L3_error:;
5291  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5292  __Pyx_RefNannyFinishContext();
5293  return NULL;
5294  __pyx_L4_argument_unpacking_done:;
5295  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_a0, __pyx_v_a);
5296 
5297  /* function exit code */
5298  __Pyx_RefNannyFinishContext();
5299  return __pyx_r;
5300 }
5301 
5302 /* "BoundaryConditions.py":113
5303  * """
5304  *
5305  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:]) # <<<<<<<<<<<<<<
5306  *
5307  * def setLinearRamp(self,t1,value):
5308  */
5309 
5310 static PyObject *__pyx_pf_18BoundaryConditions_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
5311  PyObject *__pyx_r = NULL;
5312  __Pyx_TraceDeclarations
5313  __Pyx_RefNannyDeclarations
5314  PyObject *__pyx_t_1 = NULL;
5315  PyObject *__pyx_t_2 = NULL;
5316  int __pyx_lineno = 0;
5317  const char *__pyx_filename = NULL;
5318  int __pyx_clineno = 0;
5319  __Pyx_RefNannySetupContext("__defaults__", 0);
5320  __Pyx_TraceCall("__defaults__", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
5321  __Pyx_XDECREF(__pyx_r);
5322  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5323  __Pyx_GOTREF(__pyx_t_1);
5324  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5325  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5326  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_n);
5327  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5328  __Pyx_GOTREF(__pyx_t_2);
5329  __Pyx_GIVEREF(__pyx_t_1);
5330  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5331  __Pyx_INCREF(Py_None);
5332  __Pyx_GIVEREF(Py_None);
5333  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
5334  __pyx_t_1 = 0;
5335  __pyx_r = __pyx_t_2;
5336  __pyx_t_2 = 0;
5337  goto __pyx_L0;
5338 
5339  /* function exit code */
5340  __pyx_L1_error:;
5341  __Pyx_XDECREF(__pyx_t_1);
5342  __Pyx_XDECREF(__pyx_t_2);
5343  __Pyx_AddTraceback("BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5344  __pyx_r = NULL;
5345  __pyx_L0:;
5346  __Pyx_XGIVEREF(__pyx_r);
5347  __Pyx_TraceReturn(__pyx_r, 0);
5348  __Pyx_RefNannyFinishContext();
5349  return __pyx_r;
5350 }
5351 
5352 /* Python wrapper */
5353 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5354 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1 = {"lambda1", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, METH_VARARGS|METH_KEYWORDS, 0};
5355 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5356  PyObject *__pyx_v_x = 0;
5357  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
5358  CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5359  int __pyx_lineno = 0;
5360  const char *__pyx_filename = NULL;
5361  int __pyx_clineno = 0;
5362  PyObject *__pyx_r = 0;
5363  __Pyx_RefNannyDeclarations
5364  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
5365  {
5366  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5367  PyObject* values[3] = {0,0,0};
5368  __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
5369  values[2] = __pyx_dynamic_args->__pyx_arg_n;
5370  if (unlikely(__pyx_kwds)) {
5371  Py_ssize_t kw_args;
5372  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5373  switch (pos_args) {
5374  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5375  CYTHON_FALLTHROUGH;
5376  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5377  CYTHON_FALLTHROUGH;
5378  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5379  CYTHON_FALLTHROUGH;
5380  case 0: break;
5381  default: goto __pyx_L5_argtuple_error;
5382  }
5383  kw_args = PyDict_Size(__pyx_kwds);
5384  switch (pos_args) {
5385  case 0:
5386  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5387  else goto __pyx_L5_argtuple_error;
5388  CYTHON_FALLTHROUGH;
5389  case 1:
5390  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5391  else {
5392  __Pyx_RaiseArgtupleInvalid("lambda1", 0, 2, 3, 1); __PYX_ERR(0, 113, __pyx_L3_error)
5393  }
5394  CYTHON_FALLTHROUGH;
5395  case 2:
5396  if (kw_args > 0) {
5397  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5398  if (value) { values[2] = value; kw_args--; }
5399  }
5400  }
5401  if (unlikely(kw_args > 0)) {
5402  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda1") < 0)) __PYX_ERR(0, 113, __pyx_L3_error)
5403  }
5404  } else {
5405  switch (PyTuple_GET_SIZE(__pyx_args)) {
5406  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5407  CYTHON_FALLTHROUGH;
5408  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5409  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5410  break;
5411  default: goto __pyx_L5_argtuple_error;
5412  }
5413  }
5414  __pyx_v_x = values[0];
5415  __pyx_v_t = values[1];
5416  __pyx_v_n = values[2];
5417  }
5418  goto __pyx_L4_argument_unpacking_done;
5419  __pyx_L5_argtuple_error:;
5420  __Pyx_RaiseArgtupleInvalid("lambda1", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 113, __pyx_L3_error)
5421  __pyx_L3_error:;
5422  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5423  __Pyx_RefNannyFinishContext();
5424  return NULL;
5425  __pyx_L4_argument_unpacking_done:;
5426  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5427 
5428  /* function exit code */
5429  __Pyx_RefNannyFinishContext();
5430  return __pyx_r;
5431 }
5432 
5433 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5434  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
5435  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_outer_scope;
5436  PyObject *__pyx_r = NULL;
5437  __Pyx_TraceDeclarations
5438  __Pyx_RefNannyDeclarations
5439  PyObject *__pyx_t_1 = NULL;
5440  PyObject *__pyx_t_2 = NULL;
5441  PyObject *__pyx_t_3 = NULL;
5442  int __pyx_lineno = 0;
5443  const char *__pyx_filename = NULL;
5444  int __pyx_clineno = 0;
5445  __Pyx_RefNannySetupContext("lambda1", 0);
5446  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
5447  __pyx_cur_scope = __pyx_outer_scope;
5448  __Pyx_TraceCall("lambda1", __pyx_f[0], 113, 0, __PYX_ERR(0, 113, __pyx_L1_error));
5449  __Pyx_XDECREF(__pyx_r);
5450  if (unlikely(!__pyx_cur_scope->__pyx_v_a0)) { __Pyx_RaiseClosureNameError("a0"); __PYX_ERR(0, 113, __pyx_L1_error) }
5451  if (unlikely(!__pyx_cur_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError("a"); __PYX_ERR(0, 113, __pyx_L1_error) }
5452  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_a, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5453  __Pyx_GOTREF(__pyx_t_1);
5454  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_x, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5455  __Pyx_GOTREF(__pyx_t_2);
5456  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5457  __Pyx_GOTREF(__pyx_t_3);
5458  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5459  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5460  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5461  __Pyx_GOTREF(__pyx_t_2);
5462  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5463  __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_a0, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5464  __Pyx_GOTREF(__pyx_t_3);
5465  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5466  __pyx_r = __pyx_t_3;
5467  __pyx_t_3 = 0;
5468  goto __pyx_L0;
5469 
5470  /* function exit code */
5471  __pyx_L1_error:;
5472  __Pyx_XDECREF(__pyx_t_1);
5473  __Pyx_XDECREF(__pyx_t_2);
5474  __Pyx_XDECREF(__pyx_t_3);
5475  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5476  __pyx_r = NULL;
5477  __pyx_L0:;
5478  __Pyx_XGIVEREF(__pyx_r);
5479  __Pyx_TraceReturn(__pyx_r, 0);
5480  __Pyx_RefNannyFinishContext();
5481  return __pyx_r;
5482 }
5483 
5484 /* "BoundaryConditions.py":100
5485  *
5486  *
5487  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
5488  * """
5489  * function returning value=a0+ax*x+ay*y+az*z
5490  */
5491 
5492 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a) {
5493  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
5494  PyObject *__pyx_r = NULL;
5495  __Pyx_TraceDeclarations
5496  __Pyx_RefNannyDeclarations
5497  PyObject *__pyx_t_1 = NULL;
5498  PyObject *__pyx_t_2 = NULL;
5499  PyObject *__pyx_t_3 = NULL;
5500  PyObject *__pyx_t_4 = NULL;
5501  int __pyx_lineno = 0;
5502  const char *__pyx_filename = NULL;
5503  int __pyx_clineno = 0;
5504  __Pyx_TraceFrameInit(__pyx_codeobj__8)
5505  __Pyx_RefNannySetupContext("setLinearBC", 0);
5506  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, __pyx_empty_tuple, NULL);
5507  if (unlikely(!__pyx_cur_scope)) {
5508  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)Py_None);
5509  __Pyx_INCREF(Py_None);
5510  __PYX_ERR(0, 100, __pyx_L1_error)
5511  } else {
5512  __Pyx_GOTREF(__pyx_cur_scope);
5513  }
5514  __Pyx_TraceCall("setLinearBC", __pyx_f[0], 100, 0, __PYX_ERR(0, 100, __pyx_L1_error));
5515  __pyx_cur_scope->__pyx_v_a0 = __pyx_v_a0;
5516  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a0);
5517  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a0);
5518  __pyx_cur_scope->__pyx_v_a = __pyx_v_a;
5519  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a);
5520  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a);
5521 
5522  /* "BoundaryConditions.py":113
5523  * """
5524  *
5525  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:]) # <<<<<<<<<<<<<<
5526  *
5527  * def setLinearRamp(self,t1,value):
5528  */
5529  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, 0, __pyx_n_s_setLinearBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5530  __Pyx_GOTREF(__pyx_t_1);
5531  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 113, __pyx_L1_error)
5532  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
5533  __Pyx_GOTREF(__pyx_t_3);
5534  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
5535  __Pyx_GOTREF(__pyx_t_4);
5536  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5537  __pyx_t_3 = NULL;
5538  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5539  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5540  if (likely(__pyx_t_3)) {
5541  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5542  __Pyx_INCREF(__pyx_t_3);
5543  __Pyx_INCREF(function);
5544  __Pyx_DECREF_SET(__pyx_t_4, function);
5545  }
5546  }
5547  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5548  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5549  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
5550  __Pyx_GOTREF(__pyx_t_2);
5551  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5552  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5553  __Pyx_GIVEREF(__pyx_t_2);
5554  __pyx_t_2 = 0;
5555  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_4__defaults__);
5556  __Pyx_GIVEREF(__pyx_t_1);
5557  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5558  __Pyx_DECREF(__pyx_v_self->uOfXT);
5559  __pyx_v_self->uOfXT = __pyx_t_1;
5560  __pyx_t_1 = 0;
5561 
5562  /* "BoundaryConditions.py":100
5563  *
5564  *
5565  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
5566  * """
5567  * function returning value=a0+ax*x+ay*y+az*z
5568  */
5569 
5570  /* function exit code */
5571  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5572  goto __pyx_L0;
5573  __pyx_L1_error:;
5574  __Pyx_XDECREF(__pyx_t_1);
5575  __Pyx_XDECREF(__pyx_t_2);
5576  __Pyx_XDECREF(__pyx_t_3);
5577  __Pyx_XDECREF(__pyx_t_4);
5578  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
5579  __pyx_r = NULL;
5580  __pyx_L0:;
5581  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5582  __Pyx_XGIVEREF(__pyx_r);
5583  __Pyx_TraceReturn(__pyx_r, 0);
5584  __Pyx_RefNannyFinishContext();
5585  return __pyx_r;
5586 }
5587 
5588 /* "BoundaryConditions.py":115
5589  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
5590  *
5591  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
5592  * """
5593  * function setting a linear ramp from t=0 to t=t1
5594  */
5595 
5596 /* Python wrapper */
5597 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5598 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp[] = "BoundaryCondition.setLinearRamp(self, t1, value)\n\n function setting a linear ramp from t=0 to t=t1\n\n Parameters\n -----------\n t1: float\n Ramp end time\n value: float\n Variable value\n ";
5599 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp = {"setLinearRamp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp};
5600 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5601  PyObject *__pyx_v_t1 = 0;
5602  PyObject *__pyx_v_value = 0;
5603  int __pyx_lineno = 0;
5604  const char *__pyx_filename = NULL;
5605  int __pyx_clineno = 0;
5606  PyObject *__pyx_r = 0;
5607  __Pyx_RefNannyDeclarations
5608  __Pyx_RefNannySetupContext("setLinearRamp (wrapper)", 0);
5609  {
5610  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t1,&__pyx_n_s_value,0};
5611  PyObject* values[2] = {0,0};
5612  if (unlikely(__pyx_kwds)) {
5613  Py_ssize_t kw_args;
5614  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5615  switch (pos_args) {
5616  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5617  CYTHON_FALLTHROUGH;
5618  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5619  CYTHON_FALLTHROUGH;
5620  case 0: break;
5621  default: goto __pyx_L5_argtuple_error;
5622  }
5623  kw_args = PyDict_Size(__pyx_kwds);
5624  switch (pos_args) {
5625  case 0:
5626  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t1)) != 0)) kw_args--;
5627  else goto __pyx_L5_argtuple_error;
5628  CYTHON_FALLTHROUGH;
5629  case 1:
5630  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
5631  else {
5632  __Pyx_RaiseArgtupleInvalid("setLinearRamp", 1, 2, 2, 1); __PYX_ERR(0, 115, __pyx_L3_error)
5633  }
5634  }
5635  if (unlikely(kw_args > 0)) {
5636  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLinearRamp") < 0)) __PYX_ERR(0, 115, __pyx_L3_error)
5637  }
5638  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5639  goto __pyx_L5_argtuple_error;
5640  } else {
5641  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5642  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5643  }
5644  __pyx_v_t1 = values[0];
5645  __pyx_v_value = values[1];
5646  }
5647  goto __pyx_L4_argument_unpacking_done;
5648  __pyx_L5_argtuple_error:;
5649  __Pyx_RaiseArgtupleInvalid("setLinearRamp", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 115, __pyx_L3_error)
5650  __pyx_L3_error:;
5651  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
5652  __Pyx_RefNannyFinishContext();
5653  return NULL;
5654  __pyx_L4_argument_unpacking_done:;
5655  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_t1, __pyx_v_value);
5656 
5657  /* function exit code */
5658  __Pyx_RefNannyFinishContext();
5659  return __pyx_r;
5660 }
5661 
5662 /* "BoundaryConditions.py":126
5663  * Variable value
5664  * """
5665  * self.uOfXT = lambda x, t, n=np.zeros(3,): min( t/t1, 1)*value # <<<<<<<<<<<<<<
5666  */
5667 
5668 static PyObject *__pyx_pf_18BoundaryConditions_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
5669  PyObject *__pyx_r = NULL;
5670  __Pyx_TraceDeclarations
5671  __Pyx_RefNannyDeclarations
5672  PyObject *__pyx_t_1 = NULL;
5673  PyObject *__pyx_t_2 = NULL;
5674  int __pyx_lineno = 0;
5675  const char *__pyx_filename = NULL;
5676  int __pyx_clineno = 0;
5677  __Pyx_RefNannySetupContext("__defaults__", 0);
5678  __Pyx_TraceCall("__defaults__", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));
5679  __Pyx_XDECREF(__pyx_r);
5680  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
5681  __Pyx_GOTREF(__pyx_t_1);
5682  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5683  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5684  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_n);
5685  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5686  __Pyx_GOTREF(__pyx_t_2);
5687  __Pyx_GIVEREF(__pyx_t_1);
5688  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5689  __Pyx_INCREF(Py_None);
5690  __Pyx_GIVEREF(Py_None);
5691  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
5692  __pyx_t_1 = 0;
5693  __pyx_r = __pyx_t_2;
5694  __pyx_t_2 = 0;
5695  goto __pyx_L0;
5696 
5697  /* function exit code */
5698  __pyx_L1_error:;
5699  __Pyx_XDECREF(__pyx_t_1);
5700  __Pyx_XDECREF(__pyx_t_2);
5701  __Pyx_AddTraceback("BoundaryConditions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5702  __pyx_r = NULL;
5703  __pyx_L0:;
5704  __Pyx_XGIVEREF(__pyx_r);
5705  __Pyx_TraceReturn(__pyx_r, 0);
5706  __Pyx_RefNannyFinishContext();
5707  return __pyx_r;
5708 }
5709 
5710 /* Python wrapper */
5711 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5712 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2 = {"lambda2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, METH_VARARGS|METH_KEYWORDS, 0};
5713 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5714  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
5715  PyObject *__pyx_v_t = 0;
5716  CYTHON_UNUSED PyObject *__pyx_v_n = 0;
5717  int __pyx_lineno = 0;
5718  const char *__pyx_filename = NULL;
5719  int __pyx_clineno = 0;
5720  PyObject *__pyx_r = 0;
5721  __Pyx_RefNannyDeclarations
5722  __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
5723  {
5724  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_n,0};
5725  PyObject* values[3] = {0,0,0};
5726  __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self);
5727  values[2] = __pyx_dynamic_args->__pyx_arg_n;
5728  if (unlikely(__pyx_kwds)) {
5729  Py_ssize_t kw_args;
5730  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5731  switch (pos_args) {
5732  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5733  CYTHON_FALLTHROUGH;
5734  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5735  CYTHON_FALLTHROUGH;
5736  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5737  CYTHON_FALLTHROUGH;
5738  case 0: break;
5739  default: goto __pyx_L5_argtuple_error;
5740  }
5741  kw_args = PyDict_Size(__pyx_kwds);
5742  switch (pos_args) {
5743  case 0:
5744  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5745  else goto __pyx_L5_argtuple_error;
5746  CYTHON_FALLTHROUGH;
5747  case 1:
5748  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5749  else {
5750  __Pyx_RaiseArgtupleInvalid("lambda2", 0, 2, 3, 1); __PYX_ERR(0, 126, __pyx_L3_error)
5751  }
5752  CYTHON_FALLTHROUGH;
5753  case 2:
5754  if (kw_args > 0) {
5755  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n);
5756  if (value) { values[2] = value; kw_args--; }
5757  }
5758  }
5759  if (unlikely(kw_args > 0)) {
5760  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda2") < 0)) __PYX_ERR(0, 126, __pyx_L3_error)
5761  }
5762  } else {
5763  switch (PyTuple_GET_SIZE(__pyx_args)) {
5764  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5765  CYTHON_FALLTHROUGH;
5766  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5767  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5768  break;
5769  default: goto __pyx_L5_argtuple_error;
5770  }
5771  }
5772  __pyx_v_x = values[0];
5773  __pyx_v_t = values[1];
5774  __pyx_v_n = values[2];
5775  }
5776  goto __pyx_L4_argument_unpacking_done;
5777  __pyx_L5_argtuple_error:;
5778  __Pyx_RaiseArgtupleInvalid("lambda2", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 126, __pyx_L3_error)
5779  __pyx_L3_error:;
5780  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5781  __Pyx_RefNannyFinishContext();
5782  return NULL;
5783  __pyx_L4_argument_unpacking_done:;
5784  __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_n);
5785 
5786  /* function exit code */
5787  __Pyx_RefNannyFinishContext();
5788  return __pyx_r;
5789 }
5790 
5791 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t, CYTHON_UNUSED PyObject *__pyx_v_n) {
5792  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
5793  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_outer_scope;
5794  PyObject *__pyx_r = NULL;
5795  __Pyx_TraceDeclarations
5796  __Pyx_RefNannyDeclarations
5797  long __pyx_t_1;
5798  PyObject *__pyx_t_2 = NULL;
5799  PyObject *__pyx_t_3 = NULL;
5800  PyObject *__pyx_t_4 = NULL;
5801  PyObject *__pyx_t_5 = NULL;
5802  int __pyx_t_6;
5803  int __pyx_lineno = 0;
5804  const char *__pyx_filename = NULL;
5805  int __pyx_clineno = 0;
5806  __Pyx_RefNannySetupContext("lambda2", 0);
5807  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *) __Pyx_CyFunction_GetClosure(__pyx_self);
5808  __pyx_cur_scope = __pyx_outer_scope;
5809  __Pyx_TraceCall("lambda2", __pyx_f[0], 126, 0, __PYX_ERR(0, 126, __pyx_L1_error));
5810  __Pyx_XDECREF(__pyx_r);
5811  __pyx_t_1 = 1;
5812  if (unlikely(!__pyx_cur_scope->__pyx_v_t1)) { __Pyx_RaiseClosureNameError("t1"); __PYX_ERR(0, 126, __pyx_L1_error) }
5813  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_t, __pyx_cur_scope->__pyx_v_t1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5814  __Pyx_GOTREF(__pyx_t_2);
5815  __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5816  __Pyx_GOTREF(__pyx_t_4);
5817  __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5818  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5819  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
5820  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5821  if (__pyx_t_6) {
5822  __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5823  __Pyx_GOTREF(__pyx_t_5);
5824  __pyx_t_3 = __pyx_t_5;
5825  __pyx_t_5 = 0;
5826  } else {
5827  __Pyx_INCREF(__pyx_t_2);
5828  __pyx_t_3 = __pyx_t_2;
5829  }
5830  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5831  if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 126, __pyx_L1_error) }
5832  __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_cur_scope->__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5833  __Pyx_GOTREF(__pyx_t_2);
5834  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5835  __pyx_r = __pyx_t_2;
5836  __pyx_t_2 = 0;
5837  goto __pyx_L0;
5838 
5839  /* function exit code */
5840  __pyx_L1_error:;
5841  __Pyx_XDECREF(__pyx_t_2);
5842  __Pyx_XDECREF(__pyx_t_3);
5843  __Pyx_XDECREF(__pyx_t_4);
5844  __Pyx_XDECREF(__pyx_t_5);
5845  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5846  __pyx_r = NULL;
5847  __pyx_L0:;
5848  __Pyx_XGIVEREF(__pyx_r);
5849  __Pyx_TraceReturn(__pyx_r, 0);
5850  __Pyx_RefNannyFinishContext();
5851  return __pyx_r;
5852 }
5853 
5854 /* "BoundaryConditions.py":115
5855  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
5856  *
5857  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
5858  * """
5859  * function setting a linear ramp from t=0 to t=t1
5860  */
5861 
5862 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value) {
5863  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
5864  PyObject *__pyx_r = NULL;
5865  __Pyx_TraceDeclarations
5866  __Pyx_RefNannyDeclarations
5867  PyObject *__pyx_t_1 = NULL;
5868  PyObject *__pyx_t_2 = NULL;
5869  PyObject *__pyx_t_3 = NULL;
5870  PyObject *__pyx_t_4 = NULL;
5871  int __pyx_lineno = 0;
5872  const char *__pyx_filename = NULL;
5873  int __pyx_clineno = 0;
5874  __Pyx_TraceFrameInit(__pyx_codeobj__9)
5875  __Pyx_RefNannySetupContext("setLinearRamp", 0);
5876  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, __pyx_empty_tuple, NULL);
5877  if (unlikely(!__pyx_cur_scope)) {
5878  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)Py_None);
5879  __Pyx_INCREF(Py_None);
5880  __PYX_ERR(0, 115, __pyx_L1_error)
5881  } else {
5882  __Pyx_GOTREF(__pyx_cur_scope);
5883  }
5884  __Pyx_TraceCall("setLinearRamp", __pyx_f[0], 115, 0, __PYX_ERR(0, 115, __pyx_L1_error));
5885  __pyx_cur_scope->__pyx_v_t1 = __pyx_v_t1;
5886  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t1);
5887  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t1);
5888  __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
5889  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
5890  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
5891 
5892  /* "BoundaryConditions.py":126
5893  * Variable value
5894  * """
5895  * self.uOfXT = lambda x, t, n=np.zeros(3,): min( t/t1, 1)*value # <<<<<<<<<<<<<<
5896  */
5897  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, 0, __pyx_n_s_setLinearRamp_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
5898  __Pyx_GOTREF(__pyx_t_1);
5899  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 126, __pyx_L1_error)
5900  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
5901  __Pyx_GOTREF(__pyx_t_3);
5902  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5903  __Pyx_GOTREF(__pyx_t_4);
5904  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5905  __pyx_t_3 = NULL;
5906  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5907  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5908  if (likely(__pyx_t_3)) {
5909  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5910  __Pyx_INCREF(__pyx_t_3);
5911  __Pyx_INCREF(function);
5912  __Pyx_DECREF_SET(__pyx_t_4, function);
5913  }
5914  }
5915  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
5916  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5917  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
5918  __Pyx_GOTREF(__pyx_t_2);
5919  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5920  __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_1)->__pyx_arg_n = __pyx_t_2;
5921  __Pyx_GIVEREF(__pyx_t_2);
5922  __pyx_t_2 = 0;
5923  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_18BoundaryConditions_6__defaults__);
5924  __Pyx_GIVEREF(__pyx_t_1);
5925  __Pyx_GOTREF(__pyx_v_self->uOfXT);
5926  __Pyx_DECREF(__pyx_v_self->uOfXT);
5927  __pyx_v_self->uOfXT = __pyx_t_1;
5928  __pyx_t_1 = 0;
5929 
5930  /* "BoundaryConditions.py":115
5931  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
5932  *
5933  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
5934  * """
5935  * function setting a linear ramp from t=0 to t=t1
5936  */
5937 
5938  /* function exit code */
5939  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5940  goto __pyx_L0;
5941  __pyx_L1_error:;
5942  __Pyx_XDECREF(__pyx_t_1);
5943  __Pyx_XDECREF(__pyx_t_2);
5944  __Pyx_XDECREF(__pyx_t_3);
5945  __Pyx_XDECREF(__pyx_t_4);
5946  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
5947  __pyx_r = NULL;
5948  __pyx_L0:;
5949  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5950  __Pyx_XGIVEREF(__pyx_r);
5951  __Pyx_TraceReturn(__pyx_r, 0);
5952  __Pyx_RefNannyFinishContext();
5953  return __pyx_r;
5954 }
5955 
5956 /* "BoundaryConditions.pxd":20
5957  * cdef cpp_uOfXT uuOfXT
5958  * cdef public:
5959  * object uOfXT # <<<<<<<<<<<<<<
5960  * cpdef void resetBC(self)
5961  * # cpdef void setConstantBC(self, double value)
5962  */
5963 
5964 /* Python wrapper */
5965 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self); /*proto*/
5966 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self) {
5967  PyObject *__pyx_r = 0;
5968  __Pyx_RefNannyDeclarations
5969  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5970  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5971 
5972  /* function exit code */
5973  __Pyx_RefNannyFinishContext();
5974  return __pyx_r;
5975 }
5976 
5977 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5978  PyObject *__pyx_r = NULL;
5979  __Pyx_TraceDeclarations
5980  __Pyx_RefNannyDeclarations
5981  int __pyx_lineno = 0;
5982  const char *__pyx_filename = NULL;
5983  int __pyx_clineno = 0;
5984  __Pyx_RefNannySetupContext("__get__", 0);
5985  __Pyx_TraceCall("__get__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
5986  __Pyx_XDECREF(__pyx_r);
5987  __Pyx_INCREF(__pyx_v_self->uOfXT);
5988  __pyx_r = __pyx_v_self->uOfXT;
5989  goto __pyx_L0;
5990 
5991  /* function exit code */
5992  __pyx_L1_error:;
5993  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.uOfXT.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5994  __pyx_r = NULL;
5995  __pyx_L0:;
5996  __Pyx_XGIVEREF(__pyx_r);
5997  __Pyx_TraceReturn(__pyx_r, 0);
5998  __Pyx_RefNannyFinishContext();
5999  return __pyx_r;
6000 }
6001 
6002 /* Python wrapper */
6003 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
6004 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
6005  int __pyx_r;
6006  __Pyx_RefNannyDeclarations
6007  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
6008  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
6009 
6010  /* function exit code */
6011  __Pyx_RefNannyFinishContext();
6012  return __pyx_r;
6013 }
6014 
6015 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
6016  int __pyx_r;
6017  __Pyx_TraceDeclarations
6018  __Pyx_RefNannyDeclarations
6019  int __pyx_lineno = 0;
6020  const char *__pyx_filename = NULL;
6021  int __pyx_clineno = 0;
6022  __Pyx_RefNannySetupContext("__set__", 0);
6023  __Pyx_TraceCall("__set__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
6024  __Pyx_INCREF(__pyx_v_value);
6025  __Pyx_GIVEREF(__pyx_v_value);
6026  __Pyx_GOTREF(__pyx_v_self->uOfXT);
6027  __Pyx_DECREF(__pyx_v_self->uOfXT);
6028  __pyx_v_self->uOfXT = __pyx_v_value;
6029 
6030  /* function exit code */
6031  __pyx_r = 0;
6032  goto __pyx_L0;
6033  __pyx_L1_error:;
6034  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.uOfXT.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6035  __pyx_r = -1;
6036  __pyx_L0:;
6037  __Pyx_TraceReturn(Py_None, 0);
6038  __Pyx_RefNannyFinishContext();
6039  return __pyx_r;
6040 }
6041 
6042 /* Python wrapper */
6043 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self); /*proto*/
6044 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self) {
6045  int __pyx_r;
6046  __Pyx_RefNannyDeclarations
6047  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
6048  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
6049 
6050  /* function exit code */
6051  __Pyx_RefNannyFinishContext();
6052  return __pyx_r;
6053 }
6054 
6055 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
6056  int __pyx_r;
6057  __Pyx_TraceDeclarations
6058  __Pyx_RefNannyDeclarations
6059  int __pyx_lineno = 0;
6060  const char *__pyx_filename = NULL;
6061  int __pyx_clineno = 0;
6062  __Pyx_RefNannySetupContext("__del__", 0);
6063  __Pyx_TraceCall("__del__", __pyx_f[2], 20, 0, __PYX_ERR(2, 20, __pyx_L1_error));
6064  __Pyx_INCREF(Py_None);
6065  __Pyx_GIVEREF(Py_None);
6066  __Pyx_GOTREF(__pyx_v_self->uOfXT);
6067  __Pyx_DECREF(__pyx_v_self->uOfXT);
6068  __pyx_v_self->uOfXT = Py_None;
6069 
6070  /* function exit code */
6071  __pyx_r = 0;
6072  goto __pyx_L0;
6073  __pyx_L1_error:;
6074  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.uOfXT.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6075  __pyx_r = -1;
6076  __pyx_L0:;
6077  __Pyx_TraceReturn(Py_None, 0);
6078  __Pyx_RefNannyFinishContext();
6079  return __pyx_r;
6080 }
6081 
6082 /* "(tree fragment)":1
6083  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6084  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6085  * def __setstate_cython__(self, __pyx_state):
6086  */
6087 
6088 /* Python wrapper */
6089 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6090 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__[] = "BoundaryCondition.__reduce_cython__(self)";
6091 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__};
6092 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6093  PyObject *__pyx_r = 0;
6094  __Pyx_RefNannyDeclarations
6095  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6096  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
6097 
6098  /* function exit code */
6099  __Pyx_RefNannyFinishContext();
6100  return __pyx_r;
6101 }
6102 
6103 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
6104  PyObject *__pyx_r = NULL;
6105  __Pyx_TraceDeclarations
6106  __Pyx_RefNannyDeclarations
6107  PyObject *__pyx_t_1 = NULL;
6108  int __pyx_lineno = 0;
6109  const char *__pyx_filename = NULL;
6110  int __pyx_clineno = 0;
6111  __Pyx_TraceFrameInit(__pyx_codeobj__10)
6112  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6113  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6114 
6115  /* "(tree fragment)":2
6116  * def __reduce_cython__(self):
6117  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
6118  * def __setstate_cython__(self, __pyx_state):
6119  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6120  */
6121  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
6122  __Pyx_GOTREF(__pyx_t_1);
6123  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6124  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6125  __PYX_ERR(1, 2, __pyx_L1_error)
6126 
6127  /* "(tree fragment)":1
6128  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6129  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6130  * def __setstate_cython__(self, __pyx_state):
6131  */
6132 
6133  /* function exit code */
6134  __pyx_L1_error:;
6135  __Pyx_XDECREF(__pyx_t_1);
6136  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6137  __pyx_r = NULL;
6138  __Pyx_XGIVEREF(__pyx_r);
6139  __Pyx_TraceReturn(__pyx_r, 0);
6140  __Pyx_RefNannyFinishContext();
6141  return __pyx_r;
6142 }
6143 
6144 /* "(tree fragment)":3
6145  * def __reduce_cython__(self):
6146  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6147  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6148  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6149  */
6150 
6151 /* Python wrapper */
6152 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
6153 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__[] = "BoundaryCondition.__setstate_cython__(self, __pyx_state)";
6154 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__};
6155 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6156  PyObject *__pyx_r = 0;
6157  __Pyx_RefNannyDeclarations
6158  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6159  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6160 
6161  /* function exit code */
6162  __Pyx_RefNannyFinishContext();
6163  return __pyx_r;
6164 }
6165 
6166 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6167  PyObject *__pyx_r = NULL;
6168  __Pyx_TraceDeclarations
6169  __Pyx_RefNannyDeclarations
6170  PyObject *__pyx_t_1 = NULL;
6171  int __pyx_lineno = 0;
6172  const char *__pyx_filename = NULL;
6173  int __pyx_clineno = 0;
6174  __Pyx_TraceFrameInit(__pyx_codeobj__12)
6175  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6176  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
6177 
6178  /* "(tree fragment)":4
6179  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6180  * def __setstate_cython__(self, __pyx_state):
6181  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
6182  */
6183  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6184  __Pyx_GOTREF(__pyx_t_1);
6185  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6186  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6187  __PYX_ERR(1, 4, __pyx_L1_error)
6188 
6189  /* "(tree fragment)":3
6190  * def __reduce_cython__(self):
6191  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6192  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6193  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
6194  */
6195 
6196  /* function exit code */
6197  __pyx_L1_error:;
6198  __Pyx_XDECREF(__pyx_t_1);
6199  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6200  __pyx_r = NULL;
6201  __Pyx_XGIVEREF(__pyx_r);
6202  __Pyx_TraceReturn(__pyx_r, 0);
6203  __Pyx_RefNannyFinishContext();
6204  return __pyx_r;
6205 }
6206 
6207 /* "(tree fragment)":1
6208  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
6209  * cdef object __pyx_PickleError
6210  * cdef object __pyx_result
6211  */
6212 
6213 /* Python wrapper */
6214 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6215 static char __pyx_doc_18BoundaryConditions___pyx_unpickle_BC_Base[] = "__pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state)";
6216 static PyMethodDef __pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base = {"__pyx_unpickle_BC_Base", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions___pyx_unpickle_BC_Base};
6217 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6218  PyObject *__pyx_v___pyx_type = 0;
6219  long __pyx_v___pyx_checksum;
6220  PyObject *__pyx_v___pyx_state = 0;
6221  int __pyx_lineno = 0;
6222  const char *__pyx_filename = NULL;
6223  int __pyx_clineno = 0;
6224  PyObject *__pyx_r = 0;
6225  __Pyx_RefNannyDeclarations
6226  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base (wrapper)", 0);
6227  {
6228  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
6229  PyObject* values[3] = {0,0,0};
6230  if (unlikely(__pyx_kwds)) {
6231  Py_ssize_t kw_args;
6232  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6233  switch (pos_args) {
6234  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6235  CYTHON_FALLTHROUGH;
6236  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6237  CYTHON_FALLTHROUGH;
6238  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6239  CYTHON_FALLTHROUGH;
6240  case 0: break;
6241  default: goto __pyx_L5_argtuple_error;
6242  }
6243  kw_args = PyDict_Size(__pyx_kwds);
6244  switch (pos_args) {
6245  case 0:
6246  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
6247  else goto __pyx_L5_argtuple_error;
6248  CYTHON_FALLTHROUGH;
6249  case 1:
6250  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
6251  else {
6252  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
6253  }
6254  CYTHON_FALLTHROUGH;
6255  case 2:
6256  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
6257  else {
6258  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
6259  }
6260  }
6261  if (unlikely(kw_args > 0)) {
6262  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_BC_Base") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
6263  }
6264  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6265  goto __pyx_L5_argtuple_error;
6266  } else {
6267  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6268  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6269  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6270  }
6271  __pyx_v___pyx_type = values[0];
6272  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
6273  __pyx_v___pyx_state = values[2];
6274  }
6275  goto __pyx_L4_argument_unpacking_done;
6276  __pyx_L5_argtuple_error:;
6277  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
6278  __pyx_L3_error:;
6279  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
6280  __Pyx_RefNannyFinishContext();
6281  return NULL;
6282  __pyx_L4_argument_unpacking_done:;
6283  __pyx_r = __pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
6284 
6285  /* function exit code */
6286  __Pyx_RefNannyFinishContext();
6287  return __pyx_r;
6288 }
6289 
6290 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
6291  PyObject *__pyx_v___pyx_PickleError = 0;
6292  PyObject *__pyx_v___pyx_result = 0;
6293  PyObject *__pyx_r = NULL;
6294  __Pyx_TraceDeclarations
6295  __Pyx_RefNannyDeclarations
6296  PyObject *__pyx_t_1 = NULL;
6297  int __pyx_t_2;
6298  int __pyx_t_3;
6299  PyObject *__pyx_t_4 = NULL;
6300  PyObject *__pyx_t_5 = NULL;
6301  PyObject *__pyx_t_6 = NULL;
6302  int __pyx_lineno = 0;
6303  const char *__pyx_filename = NULL;
6304  int __pyx_clineno = 0;
6305  __Pyx_TraceFrameInit(__pyx_codeobj__14)
6306  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base", 0);
6307  __Pyx_TraceCall("__pyx_unpickle_BC_Base", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6308 
6309  /* "(tree fragment)":4
6310  * cdef object __pyx_PickleError
6311  * cdef object __pyx_result
6312  * if __pyx_checksum not in (0x96e6a1f, 0x4d41573, 0x7d477a1): # <<<<<<<<<<<<<<
6313  * from pickle import PickleError as __pyx_PickleError
6314  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x96e6a1f, 0x4d41573, 0x7d477a1) = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6315  */
6316  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6317  __Pyx_GOTREF(__pyx_t_1);
6318  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__15, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
6319  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6320  __pyx_t_3 = (__pyx_t_2 != 0);
6321  if (__pyx_t_3) {
6322 
6323  /* "(tree fragment)":5
6324  * cdef object __pyx_result
6325  * if __pyx_checksum not in (0x96e6a1f, 0x4d41573, 0x7d477a1):
6326  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
6327  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x96e6a1f, 0x4d41573, 0x7d477a1) = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6328  * __pyx_result = BC_Base.__new__(__pyx_type)
6329  */
6330  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
6331  __Pyx_GOTREF(__pyx_t_1);
6332  __Pyx_INCREF(__pyx_n_s_PickleError);
6333  __Pyx_GIVEREF(__pyx_n_s_PickleError);
6334  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
6335  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
6336  __Pyx_GOTREF(__pyx_t_4);
6337  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6338  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
6339  __Pyx_GOTREF(__pyx_t_1);
6340  __Pyx_INCREF(__pyx_t_1);
6341  __pyx_v___pyx_PickleError = __pyx_t_1;
6342  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6343  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6344 
6345  /* "(tree fragment)":6
6346  * if __pyx_checksum not in (0x96e6a1f, 0x4d41573, 0x7d477a1):
6347  * from pickle import PickleError as __pyx_PickleError
6348  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x96e6a1f, 0x4d41573, 0x7d477a1) = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum) # <<<<<<<<<<<<<<
6349  * __pyx_result = BC_Base.__new__(__pyx_type)
6350  * if __pyx_state is not None:
6351  */
6352  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
6353  __Pyx_GOTREF(__pyx_t_1);
6354  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
6355  __Pyx_GOTREF(__pyx_t_5);
6356  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6357  __Pyx_INCREF(__pyx_v___pyx_PickleError);
6358  __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
6359  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
6360  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
6361  if (likely(__pyx_t_6)) {
6362  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
6363  __Pyx_INCREF(__pyx_t_6);
6364  __Pyx_INCREF(function);
6365  __Pyx_DECREF_SET(__pyx_t_1, function);
6366  }
6367  }
6368  __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);
6369  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6370  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6371  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
6372  __Pyx_GOTREF(__pyx_t_4);
6373  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6374  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
6375  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6376  __PYX_ERR(1, 6, __pyx_L1_error)
6377 
6378  /* "(tree fragment)":4
6379  * cdef object __pyx_PickleError
6380  * cdef object __pyx_result
6381  * if __pyx_checksum not in (0x96e6a1f, 0x4d41573, 0x7d477a1): # <<<<<<<<<<<<<<
6382  * from pickle import PickleError as __pyx_PickleError
6383  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x96e6a1f, 0x4d41573, 0x7d477a1) = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6384  */
6385  }
6386 
6387  /* "(tree fragment)":7
6388  * from pickle import PickleError as __pyx_PickleError
6389  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x96e6a1f, 0x4d41573, 0x7d477a1) = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6390  * __pyx_result = BC_Base.__new__(__pyx_type) # <<<<<<<<<<<<<<
6391  * if __pyx_state is not None:
6392  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6393  */
6394  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
6395  __Pyx_GOTREF(__pyx_t_1);
6396  __pyx_t_5 = NULL;
6397  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
6398  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
6399  if (likely(__pyx_t_5)) {
6400  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
6401  __Pyx_INCREF(__pyx_t_5);
6402  __Pyx_INCREF(function);
6403  __Pyx_DECREF_SET(__pyx_t_1, function);
6404  }
6405  }
6406  __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);
6407  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6408  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
6409  __Pyx_GOTREF(__pyx_t_4);
6410  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6411  __pyx_v___pyx_result = __pyx_t_4;
6412  __pyx_t_4 = 0;
6413 
6414  /* "(tree fragment)":8
6415  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x96e6a1f, 0x4d41573, 0x7d477a1) = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6416  * __pyx_result = BC_Base.__new__(__pyx_type)
6417  * if __pyx_state is not None: # <<<<<<<<<<<<<<
6418  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6419  * return __pyx_result
6420  */
6421  __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
6422  __pyx_t_2 = (__pyx_t_3 != 0);
6423  if (__pyx_t_2) {
6424 
6425  /* "(tree fragment)":9
6426  * __pyx_result = BC_Base.__new__(__pyx_type)
6427  * if __pyx_state is not None:
6428  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
6429  * return __pyx_result
6430  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6431  */
6432  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
6433  __pyx_t_4 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
6434  __Pyx_GOTREF(__pyx_t_4);
6435  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6436 
6437  /* "(tree fragment)":8
6438  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x96e6a1f, 0x4d41573, 0x7d477a1) = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
6439  * __pyx_result = BC_Base.__new__(__pyx_type)
6440  * if __pyx_state is not None: # <<<<<<<<<<<<<<
6441  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6442  * return __pyx_result
6443  */
6444  }
6445 
6446  /* "(tree fragment)":10
6447  * if __pyx_state is not None:
6448  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6449  * return __pyx_result # <<<<<<<<<<<<<<
6450  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6451  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6452  */
6453  __Pyx_XDECREF(__pyx_r);
6454  __Pyx_INCREF(__pyx_v___pyx_result);
6455  __pyx_r = __pyx_v___pyx_result;
6456  goto __pyx_L0;
6457 
6458  /* "(tree fragment)":1
6459  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
6460  * cdef object __pyx_PickleError
6461  * cdef object __pyx_result
6462  */
6463 
6464  /* function exit code */
6465  __pyx_L1_error:;
6466  __Pyx_XDECREF(__pyx_t_1);
6467  __Pyx_XDECREF(__pyx_t_4);
6468  __Pyx_XDECREF(__pyx_t_5);
6469  __Pyx_XDECREF(__pyx_t_6);
6470  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
6471  __pyx_r = NULL;
6472  __pyx_L0:;
6473  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
6474  __Pyx_XDECREF(__pyx_v___pyx_result);
6475  __Pyx_XGIVEREF(__pyx_r);
6476  __Pyx_TraceReturn(__pyx_r, 0);
6477  __Pyx_RefNannyFinishContext();
6478  return __pyx_r;
6479 }
6480 
6481 /* "(tree fragment)":11
6482  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6483  * return __pyx_result
6484  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
6485  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6486  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
6487  */
6488 
6489 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
6490  PyObject *__pyx_r = NULL;
6491  __Pyx_TraceDeclarations
6492  __Pyx_RefNannyDeclarations
6493  PyObject *__pyx_t_1 = NULL;
6494  __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
6495  int __pyx_t_3;
6496  int __pyx_t_4;
6497  Py_ssize_t __pyx_t_5;
6498  int __pyx_t_6;
6499  int __pyx_t_7;
6500  PyObject *__pyx_t_8 = NULL;
6501  PyObject *__pyx_t_9 = NULL;
6502  int __pyx_lineno = 0;
6503  const char *__pyx_filename = NULL;
6504  int __pyx_clineno = 0;
6505  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base__set_state", 0);
6506  __Pyx_TraceCall("__pyx_unpickle_BC_Base__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
6507 
6508  /* "(tree fragment)":12
6509  * return __pyx_result
6510  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6511  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5] # <<<<<<<<<<<<<<
6512  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
6513  * __pyx_result.__dict__.update(__pyx_state[6])
6514  */
6515  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6516  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6517  __PYX_ERR(1, 12, __pyx_L1_error)
6518  }
6519  if (!(likely(PyString_CheckExact(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)))||((PyTuple_GET_ITEM(__pyx_v___pyx_state, 0)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0))->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
6520  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 0);
6521  __Pyx_INCREF(__pyx_t_1);
6522  __Pyx_GIVEREF(__pyx_t_1);
6523  __Pyx_GOTREF(__pyx_v___pyx_result->BC_type);
6524  __Pyx_DECREF(__pyx_v___pyx_result->BC_type);
6525  __pyx_v___pyx_result->BC_type = ((PyObject*)__pyx_t_1);
6526  __pyx_t_1 = 0;
6527  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6528  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6529  __PYX_ERR(1, 12, __pyx_L1_error)
6530  }
6531  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 1);
6532  __Pyx_INCREF(__pyx_t_1);
6533  __Pyx_GIVEREF(__pyx_t_1);
6534  __Pyx_GOTREF(__pyx_v___pyx_result->Shape);
6535  __Pyx_DECREF(__pyx_v___pyx_result->Shape);
6536  __pyx_v___pyx_result->Shape = __pyx_t_1;
6537  __pyx_t_1 = 0;
6538  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6539  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6540  __PYX_ERR(1, 12, __pyx_L1_error)
6541  }
6542  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyTuple_GET_ITEM(__pyx_v___pyx_state, 2), PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 12, __pyx_L1_error)
6543  __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_b_or, 0);
6544  __pyx_v___pyx_result->_b_or = __pyx_t_2;
6545  __pyx_t_2.memview = NULL;
6546  __pyx_t_2.data = NULL;
6547  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6548  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6549  __PYX_ERR(1, 12, __pyx_L1_error)
6550  }
6551  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 3);
6552  __Pyx_INCREF(__pyx_t_1);
6553  __Pyx_GIVEREF(__pyx_t_1);
6554  __Pyx_GOTREF(__pyx_v___pyx_result->ct);
6555  __Pyx_DECREF(__pyx_v___pyx_result->ct);
6556  __pyx_v___pyx_result->ct = __pyx_t_1;
6557  __pyx_t_1 = 0;
6558  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6559  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6560  __PYX_ERR(1, 12, __pyx_L1_error)
6561  }
6562  if (!(likely(PyString_CheckExact(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)))||((PyTuple_GET_ITEM(__pyx_v___pyx_state, 4)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(PyTuple_GET_ITEM(__pyx_v___pyx_state, 4))->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
6563  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v___pyx_state, 4);
6564  __Pyx_INCREF(__pyx_t_1);
6565  __Pyx_GIVEREF(__pyx_t_1);
6566  __Pyx_GOTREF(__pyx_v___pyx_result->name);
6567  __Pyx_DECREF(__pyx_v___pyx_result->name);
6568  __pyx_v___pyx_result->name = ((PyObject*)__pyx_t_1);
6569  __pyx_t_1 = 0;
6570  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6571  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6572  __PYX_ERR(1, 12, __pyx_L1_error)
6573  }
6574  __pyx_t_3 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(__pyx_v___pyx_state, 5)); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
6575  __pyx_v___pyx_result->nd = __pyx_t_3;
6576 
6577  /* "(tree fragment)":13
6578  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6579  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6580  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
6581  * __pyx_result.__dict__.update(__pyx_state[6])
6582  */
6583  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6584  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
6585  __PYX_ERR(1, 13, __pyx_L1_error)
6586  }
6587  __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6588  __pyx_t_6 = ((__pyx_t_5 > 6) != 0);
6589  if (__pyx_t_6) {
6590  } else {
6591  __pyx_t_4 = __pyx_t_6;
6592  goto __pyx_L4_bool_binop_done;
6593  }
6594  __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
6595  __pyx_t_7 = (__pyx_t_6 != 0);
6596  __pyx_t_4 = __pyx_t_7;
6597  __pyx_L4_bool_binop_done:;
6598  if (__pyx_t_4) {
6599 
6600  /* "(tree fragment)":14
6601  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6602  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
6603  * __pyx_result.__dict__.update(__pyx_state[6]) # <<<<<<<<<<<<<<
6604  */
6605  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
6606  __Pyx_GOTREF(__pyx_t_8);
6607  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
6608  __Pyx_GOTREF(__pyx_t_9);
6609  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6610  if (unlikely(__pyx_v___pyx_state == Py_None)) {
6611  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6612  __PYX_ERR(1, 14, __pyx_L1_error)
6613  }
6614  __pyx_t_8 = NULL;
6615  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
6616  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
6617  if (likely(__pyx_t_8)) {
6618  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
6619  __Pyx_INCREF(__pyx_t_8);
6620  __Pyx_INCREF(function);
6621  __Pyx_DECREF_SET(__pyx_t_9, function);
6622  }
6623  }
6624  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, PyTuple_GET_ITEM(__pyx_v___pyx_state, 6)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, PyTuple_GET_ITEM(__pyx_v___pyx_state, 6));
6625  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6626  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
6627  __Pyx_GOTREF(__pyx_t_1);
6628  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6629  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6630 
6631  /* "(tree fragment)":13
6632  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
6633  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6634  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
6635  * __pyx_result.__dict__.update(__pyx_state[6])
6636  */
6637  }
6638 
6639  /* "(tree fragment)":11
6640  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
6641  * return __pyx_result
6642  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
6643  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
6644  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
6645  */
6646 
6647  /* function exit code */
6648  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6649  goto __pyx_L0;
6650  __pyx_L1_error:;
6651  __Pyx_XDECREF(__pyx_t_1);
6652  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
6653  __Pyx_XDECREF(__pyx_t_8);
6654  __Pyx_XDECREF(__pyx_t_9);
6655  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
6656  __pyx_r = 0;
6657  __pyx_L0:;
6658  __Pyx_XGIVEREF(__pyx_r);
6659  __Pyx_TraceReturn(__pyx_r, 0);
6660  __Pyx_RefNannyFinishContext();
6661  return __pyx_r;
6662 }
6663 
6664 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
6665  * ctypedef npy_cdouble complex_t
6666  *
6667  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6668  * return PyArray_MultiIterNew(1, <void*>a)
6669  *
6670  */
6671 
6672 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6673  PyObject *__pyx_r = NULL;
6674  __Pyx_TraceDeclarations
6675  __Pyx_RefNannyDeclarations
6676  PyObject *__pyx_t_1 = NULL;
6677  int __pyx_lineno = 0;
6678  const char *__pyx_filename = NULL;
6679  int __pyx_clineno = 0;
6680  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
6681  __Pyx_TraceCall("PyArray_MultiIterNew1", __pyx_f[3], 735, 0, __PYX_ERR(3, 735, __pyx_L1_error));
6682 
6683  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":736
6684  *
6685  * cdef inline object PyArray_MultiIterNew1(a):
6686  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
6687  *
6688  * cdef inline object PyArray_MultiIterNew2(a, b):
6689  */
6690  __Pyx_XDECREF(__pyx_r);
6691  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 736, __pyx_L1_error)
6692  __Pyx_GOTREF(__pyx_t_1);
6693  __pyx_r = __pyx_t_1;
6694  __pyx_t_1 = 0;
6695  goto __pyx_L0;
6696 
6697  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
6698  * ctypedef npy_cdouble complex_t
6699  *
6700  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6701  * return PyArray_MultiIterNew(1, <void*>a)
6702  *
6703  */
6704 
6705  /* function exit code */
6706  __pyx_L1_error:;
6707  __Pyx_XDECREF(__pyx_t_1);
6708  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6709  __pyx_r = 0;
6710  __pyx_L0:;
6711  __Pyx_XGIVEREF(__pyx_r);
6712  __Pyx_TraceReturn(__pyx_r, 0);
6713  __Pyx_RefNannyFinishContext();
6714  return __pyx_r;
6715 }
6716 
6717 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
6718  * return PyArray_MultiIterNew(1, <void*>a)
6719  *
6720  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6721  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6722  *
6723  */
6724 
6725 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6726  PyObject *__pyx_r = NULL;
6727  __Pyx_TraceDeclarations
6728  __Pyx_RefNannyDeclarations
6729  PyObject *__pyx_t_1 = NULL;
6730  int __pyx_lineno = 0;
6731  const char *__pyx_filename = NULL;
6732  int __pyx_clineno = 0;
6733  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
6734  __Pyx_TraceCall("PyArray_MultiIterNew2", __pyx_f[3], 738, 0, __PYX_ERR(3, 738, __pyx_L1_error));
6735 
6736  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":739
6737  *
6738  * cdef inline object PyArray_MultiIterNew2(a, b):
6739  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
6740  *
6741  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6742  */
6743  __Pyx_XDECREF(__pyx_r);
6744  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 739, __pyx_L1_error)
6745  __Pyx_GOTREF(__pyx_t_1);
6746  __pyx_r = __pyx_t_1;
6747  __pyx_t_1 = 0;
6748  goto __pyx_L0;
6749 
6750  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
6751  * return PyArray_MultiIterNew(1, <void*>a)
6752  *
6753  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6754  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6755  *
6756  */
6757 
6758  /* function exit code */
6759  __pyx_L1_error:;
6760  __Pyx_XDECREF(__pyx_t_1);
6761  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6762  __pyx_r = 0;
6763  __pyx_L0:;
6764  __Pyx_XGIVEREF(__pyx_r);
6765  __Pyx_TraceReturn(__pyx_r, 0);
6766  __Pyx_RefNannyFinishContext();
6767  return __pyx_r;
6768 }
6769 
6770 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
6771  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6772  *
6773  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6774  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6775  *
6776  */
6777 
6778 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6779  PyObject *__pyx_r = NULL;
6780  __Pyx_TraceDeclarations
6781  __Pyx_RefNannyDeclarations
6782  PyObject *__pyx_t_1 = NULL;
6783  int __pyx_lineno = 0;
6784  const char *__pyx_filename = NULL;
6785  int __pyx_clineno = 0;
6786  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
6787  __Pyx_TraceCall("PyArray_MultiIterNew3", __pyx_f[3], 741, 0, __PYX_ERR(3, 741, __pyx_L1_error));
6788 
6789  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":742
6790  *
6791  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6792  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
6793  *
6794  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6795  */
6796  __Pyx_XDECREF(__pyx_r);
6797  __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(3, 742, __pyx_L1_error)
6798  __Pyx_GOTREF(__pyx_t_1);
6799  __pyx_r = __pyx_t_1;
6800  __pyx_t_1 = 0;
6801  goto __pyx_L0;
6802 
6803  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
6804  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6805  *
6806  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6807  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6808  *
6809  */
6810 
6811  /* function exit code */
6812  __pyx_L1_error:;
6813  __Pyx_XDECREF(__pyx_t_1);
6814  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6815  __pyx_r = 0;
6816  __pyx_L0:;
6817  __Pyx_XGIVEREF(__pyx_r);
6818  __Pyx_TraceReturn(__pyx_r, 0);
6819  __Pyx_RefNannyFinishContext();
6820  return __pyx_r;
6821 }
6822 
6823 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
6824  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6825  *
6826  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6827  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6828  *
6829  */
6830 
6831 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) {
6832  PyObject *__pyx_r = NULL;
6833  __Pyx_TraceDeclarations
6834  __Pyx_RefNannyDeclarations
6835  PyObject *__pyx_t_1 = NULL;
6836  int __pyx_lineno = 0;
6837  const char *__pyx_filename = NULL;
6838  int __pyx_clineno = 0;
6839  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
6840  __Pyx_TraceCall("PyArray_MultiIterNew4", __pyx_f[3], 744, 0, __PYX_ERR(3, 744, __pyx_L1_error));
6841 
6842  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":745
6843  *
6844  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6845  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
6846  *
6847  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6848  */
6849  __Pyx_XDECREF(__pyx_r);
6850  __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(3, 745, __pyx_L1_error)
6851  __Pyx_GOTREF(__pyx_t_1);
6852  __pyx_r = __pyx_t_1;
6853  __pyx_t_1 = 0;
6854  goto __pyx_L0;
6855 
6856  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
6857  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6858  *
6859  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6860  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6861  *
6862  */
6863 
6864  /* function exit code */
6865  __pyx_L1_error:;
6866  __Pyx_XDECREF(__pyx_t_1);
6867  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6868  __pyx_r = 0;
6869  __pyx_L0:;
6870  __Pyx_XGIVEREF(__pyx_r);
6871  __Pyx_TraceReturn(__pyx_r, 0);
6872  __Pyx_RefNannyFinishContext();
6873  return __pyx_r;
6874 }
6875 
6876 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
6877  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6878  *
6879  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6880  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6881  *
6882  */
6883 
6884 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) {
6885  PyObject *__pyx_r = NULL;
6886  __Pyx_TraceDeclarations
6887  __Pyx_RefNannyDeclarations
6888  PyObject *__pyx_t_1 = NULL;
6889  int __pyx_lineno = 0;
6890  const char *__pyx_filename = NULL;
6891  int __pyx_clineno = 0;
6892  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
6893  __Pyx_TraceCall("PyArray_MultiIterNew5", __pyx_f[3], 747, 0, __PYX_ERR(3, 747, __pyx_L1_error));
6894 
6895  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":748
6896  *
6897  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6898  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
6899  *
6900  * cdef inline tuple PyDataType_SHAPE(dtype d):
6901  */
6902  __Pyx_XDECREF(__pyx_r);
6903  __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(3, 748, __pyx_L1_error)
6904  __Pyx_GOTREF(__pyx_t_1);
6905  __pyx_r = __pyx_t_1;
6906  __pyx_t_1 = 0;
6907  goto __pyx_L0;
6908 
6909  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
6910  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6911  *
6912  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6913  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6914  *
6915  */
6916 
6917  /* function exit code */
6918  __pyx_L1_error:;
6919  __Pyx_XDECREF(__pyx_t_1);
6920  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6921  __pyx_r = 0;
6922  __pyx_L0:;
6923  __Pyx_XGIVEREF(__pyx_r);
6924  __Pyx_TraceReturn(__pyx_r, 0);
6925  __Pyx_RefNannyFinishContext();
6926  return __pyx_r;
6927 }
6928 
6929 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
6930  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6931  *
6932  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6933  * if PyDataType_HASSUBARRAY(d):
6934  * return <tuple>d.subarray.shape
6935  */
6936 
6937 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6938  PyObject *__pyx_r = NULL;
6939  __Pyx_TraceDeclarations
6940  __Pyx_RefNannyDeclarations
6941  int __pyx_t_1;
6942  int __pyx_lineno = 0;
6943  const char *__pyx_filename = NULL;
6944  int __pyx_clineno = 0;
6945  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
6946  __Pyx_TraceCall("PyDataType_SHAPE", __pyx_f[3], 750, 0, __PYX_ERR(3, 750, __pyx_L1_error));
6947 
6948  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
6949  *
6950  * cdef inline tuple PyDataType_SHAPE(dtype d):
6951  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6952  * return <tuple>d.subarray.shape
6953  * else:
6954  */
6955  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6956  if (__pyx_t_1) {
6957 
6958  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":752
6959  * cdef inline tuple PyDataType_SHAPE(dtype d):
6960  * if PyDataType_HASSUBARRAY(d):
6961  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
6962  * else:
6963  * return ()
6964  */
6965  __Pyx_XDECREF(__pyx_r);
6966  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6967  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6968  goto __pyx_L0;
6969 
6970  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
6971  *
6972  * cdef inline tuple PyDataType_SHAPE(dtype d):
6973  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6974  * return <tuple>d.subarray.shape
6975  * else:
6976  */
6977  }
6978 
6979  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":754
6980  * return <tuple>d.subarray.shape
6981  * else:
6982  * return () # <<<<<<<<<<<<<<
6983  *
6984  *
6985  */
6986  /*else*/ {
6987  __Pyx_XDECREF(__pyx_r);
6988  __Pyx_INCREF(__pyx_empty_tuple);
6989  __pyx_r = __pyx_empty_tuple;
6990  goto __pyx_L0;
6991  }
6992 
6993  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
6994  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6995  *
6996  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6997  * if PyDataType_HASSUBARRAY(d):
6998  * return <tuple>d.subarray.shape
6999  */
7000 
7001  /* function exit code */
7002  __pyx_L1_error:;
7003  __Pyx_AddTraceback("numpy.PyDataType_SHAPE", __pyx_clineno, __pyx_lineno, __pyx_filename);
7004  __pyx_r = 0;
7005  __pyx_L0:;
7006  __Pyx_XGIVEREF(__pyx_r);
7007  __Pyx_TraceReturn(__pyx_r, 0);
7008  __Pyx_RefNannyFinishContext();
7009  return __pyx_r;
7010 }
7011 
7012 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
7013  * int _import_umath() except -1
7014  *
7015  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7016  * Py_INCREF(base) # important to do this before stealing the reference below!
7017  * PyArray_SetBaseObject(arr, base)
7018  */
7019 
7020 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7021  __Pyx_TraceDeclarations
7022  __Pyx_RefNannyDeclarations
7023  int __pyx_lineno = 0;
7024  const char *__pyx_filename = NULL;
7025  int __pyx_clineno = 0;
7026  __Pyx_RefNannySetupContext("set_array_base", 0);
7027  __Pyx_TraceCall("set_array_base", __pyx_f[3], 929, 0, __PYX_ERR(3, 929, __pyx_L1_error));
7028 
7029  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":930
7030  *
7031  * cdef inline void set_array_base(ndarray arr, object base):
7032  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
7033  * PyArray_SetBaseObject(arr, base)
7034  *
7035  */
7036  Py_INCREF(__pyx_v_base);
7037 
7038  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":931
7039  * cdef inline void set_array_base(ndarray arr, object base):
7040  * Py_INCREF(base) # important to do this before stealing the reference below!
7041  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
7042  *
7043  * cdef inline object get_array_base(ndarray arr):
7044  */
7045  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
7046 
7047  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
7048  * int _import_umath() except -1
7049  *
7050  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7051  * Py_INCREF(base) # important to do this before stealing the reference below!
7052  * PyArray_SetBaseObject(arr, base)
7053  */
7054 
7055  /* function exit code */
7056  goto __pyx_L0;
7057  __pyx_L1_error:;
7058  __Pyx_WriteUnraisable("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7059  __pyx_L0:;
7060  __Pyx_TraceReturn(Py_None, 0);
7061  __Pyx_RefNannyFinishContext();
7062 }
7063 
7064 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
7065  * PyArray_SetBaseObject(arr, base)
7066  *
7067  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7068  * base = PyArray_BASE(arr)
7069  * if base is NULL:
7070  */
7071 
7072 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7073  PyObject *__pyx_v_base;
7074  PyObject *__pyx_r = NULL;
7075  __Pyx_TraceDeclarations
7076  __Pyx_RefNannyDeclarations
7077  int __pyx_t_1;
7078  int __pyx_lineno = 0;
7079  const char *__pyx_filename = NULL;
7080  int __pyx_clineno = 0;
7081  __Pyx_RefNannySetupContext("get_array_base", 0);
7082  __Pyx_TraceCall("get_array_base", __pyx_f[3], 933, 0, __PYX_ERR(3, 933, __pyx_L1_error));
7083 
7084  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":934
7085  *
7086  * cdef inline object get_array_base(ndarray arr):
7087  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
7088  * if base is NULL:
7089  * return None
7090  */
7091  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
7092 
7093  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
7094  * cdef inline object get_array_base(ndarray arr):
7095  * base = PyArray_BASE(arr)
7096  * if base is NULL: # <<<<<<<<<<<<<<
7097  * return None
7098  * return <object>base
7099  */
7100  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7101  if (__pyx_t_1) {
7102 
7103  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":936
7104  * base = PyArray_BASE(arr)
7105  * if base is NULL:
7106  * return None # <<<<<<<<<<<<<<
7107  * return <object>base
7108  *
7109  */
7110  __Pyx_XDECREF(__pyx_r);
7111  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7112  goto __pyx_L0;
7113 
7114  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
7115  * cdef inline object get_array_base(ndarray arr):
7116  * base = PyArray_BASE(arr)
7117  * if base is NULL: # <<<<<<<<<<<<<<
7118  * return None
7119  * return <object>base
7120  */
7121  }
7122 
7123  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":937
7124  * if base is NULL:
7125  * return None
7126  * return <object>base # <<<<<<<<<<<<<<
7127  *
7128  * # Versions of the import_* functions which are more suitable for
7129  */
7130  __Pyx_XDECREF(__pyx_r);
7131  __Pyx_INCREF(((PyObject *)__pyx_v_base));
7132  __pyx_r = ((PyObject *)__pyx_v_base);
7133  goto __pyx_L0;
7134 
7135  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
7136  * PyArray_SetBaseObject(arr, base)
7137  *
7138  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7139  * base = PyArray_BASE(arr)
7140  * if base is NULL:
7141  */
7142 
7143  /* function exit code */
7144  __pyx_L1_error:;
7145  __Pyx_AddTraceback("numpy.get_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
7146  __pyx_r = 0;
7147  __pyx_L0:;
7148  __Pyx_XGIVEREF(__pyx_r);
7149  __Pyx_TraceReturn(__pyx_r, 0);
7150  __Pyx_RefNannyFinishContext();
7151  return __pyx_r;
7152 }
7153 
7154 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
7155  * # Versions of the import_* functions which are more suitable for
7156  * # Cython code.
7157  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7158  * try:
7159  * __pyx_import_array()
7160  */
7161 
7162 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
7163  int __pyx_r;
7164  __Pyx_TraceDeclarations
7165  __Pyx_RefNannyDeclarations
7166  PyObject *__pyx_t_1 = NULL;
7167  PyObject *__pyx_t_2 = NULL;
7168  PyObject *__pyx_t_3 = NULL;
7169  int __pyx_t_4;
7170  PyObject *__pyx_t_5 = NULL;
7171  PyObject *__pyx_t_6 = NULL;
7172  PyObject *__pyx_t_7 = NULL;
7173  PyObject *__pyx_t_8 = NULL;
7174  int __pyx_lineno = 0;
7175  const char *__pyx_filename = NULL;
7176  int __pyx_clineno = 0;
7177  __Pyx_RefNannySetupContext("import_array", 0);
7178  __Pyx_TraceCall("import_array", __pyx_f[3], 941, 0, __PYX_ERR(3, 941, __pyx_L1_error));
7179 
7180  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
7181  * # Cython code.
7182  * cdef inline int import_array() except -1:
7183  * try: # <<<<<<<<<<<<<<
7184  * __pyx_import_array()
7185  * except Exception:
7186  */
7187  {
7188  __Pyx_PyThreadState_declare
7189  __Pyx_PyThreadState_assign
7190  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7191  __Pyx_XGOTREF(__pyx_t_1);
7192  __Pyx_XGOTREF(__pyx_t_2);
7193  __Pyx_XGOTREF(__pyx_t_3);
7194  /*try:*/ {
7195 
7196  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":943
7197  * cdef inline int import_array() except -1:
7198  * try:
7199  * __pyx_import_array() # <<<<<<<<<<<<<<
7200  * except Exception:
7201  * raise ImportError("numpy.core.multiarray failed to import")
7202  */
7203  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 943, __pyx_L3_error)
7204 
7205  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
7206  * # Cython code.
7207  * cdef inline int import_array() except -1:
7208  * try: # <<<<<<<<<<<<<<
7209  * __pyx_import_array()
7210  * except Exception:
7211  */
7212  }
7213  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7214  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7215  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7216  goto __pyx_L8_try_end;
7217  __pyx_L3_error:;
7218 
7219  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":944
7220  * try:
7221  * __pyx_import_array()
7222  * except Exception: # <<<<<<<<<<<<<<
7223  * raise ImportError("numpy.core.multiarray failed to import")
7224  *
7225  */
7226  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7227  if (__pyx_t_4) {
7228  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7229  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 944, __pyx_L5_except_error)
7230  __Pyx_GOTREF(__pyx_t_5);
7231  __Pyx_GOTREF(__pyx_t_6);
7232  __Pyx_GOTREF(__pyx_t_7);
7233 
7234  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
7235  * __pyx_import_array()
7236  * except Exception:
7237  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
7238  *
7239  * cdef inline int import_umath() except -1:
7240  */
7241  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 945, __pyx_L5_except_error)
7242  __Pyx_GOTREF(__pyx_t_8);
7243  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7244  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7245  __PYX_ERR(3, 945, __pyx_L5_except_error)
7246  }
7247  goto __pyx_L5_except_error;
7248  __pyx_L5_except_error:;
7249 
7250  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
7251  * # Cython code.
7252  * cdef inline int import_array() except -1:
7253  * try: # <<<<<<<<<<<<<<
7254  * __pyx_import_array()
7255  * except Exception:
7256  */
7257  __Pyx_XGIVEREF(__pyx_t_1);
7258  __Pyx_XGIVEREF(__pyx_t_2);
7259  __Pyx_XGIVEREF(__pyx_t_3);
7260  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7261  goto __pyx_L1_error;
7262  __pyx_L8_try_end:;
7263  }
7264 
7265  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
7266  * # Versions of the import_* functions which are more suitable for
7267  * # Cython code.
7268  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7269  * try:
7270  * __pyx_import_array()
7271  */
7272 
7273  /* function exit code */
7274  __pyx_r = 0;
7275  goto __pyx_L0;
7276  __pyx_L1_error:;
7277  __Pyx_XDECREF(__pyx_t_5);
7278  __Pyx_XDECREF(__pyx_t_6);
7279  __Pyx_XDECREF(__pyx_t_7);
7280  __Pyx_XDECREF(__pyx_t_8);
7281  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7282  __pyx_r = -1;
7283  __pyx_L0:;
7284  __Pyx_TraceReturn(Py_None, 0);
7285  __Pyx_RefNannyFinishContext();
7286  return __pyx_r;
7287 }
7288 
7289 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
7290  * raise ImportError("numpy.core.multiarray failed to import")
7291  *
7292  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7293  * try:
7294  * _import_umath()
7295  */
7296 
7297 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
7298  int __pyx_r;
7299  __Pyx_TraceDeclarations
7300  __Pyx_RefNannyDeclarations
7301  PyObject *__pyx_t_1 = NULL;
7302  PyObject *__pyx_t_2 = NULL;
7303  PyObject *__pyx_t_3 = NULL;
7304  int __pyx_t_4;
7305  PyObject *__pyx_t_5 = NULL;
7306  PyObject *__pyx_t_6 = NULL;
7307  PyObject *__pyx_t_7 = NULL;
7308  PyObject *__pyx_t_8 = NULL;
7309  int __pyx_lineno = 0;
7310  const char *__pyx_filename = NULL;
7311  int __pyx_clineno = 0;
7312  __Pyx_RefNannySetupContext("import_umath", 0);
7313  __Pyx_TraceCall("import_umath", __pyx_f[3], 947, 0, __PYX_ERR(3, 947, __pyx_L1_error));
7314 
7315  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
7316  *
7317  * cdef inline int import_umath() except -1:
7318  * try: # <<<<<<<<<<<<<<
7319  * _import_umath()
7320  * except Exception:
7321  */
7322  {
7323  __Pyx_PyThreadState_declare
7324  __Pyx_PyThreadState_assign
7325  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7326  __Pyx_XGOTREF(__pyx_t_1);
7327  __Pyx_XGOTREF(__pyx_t_2);
7328  __Pyx_XGOTREF(__pyx_t_3);
7329  /*try:*/ {
7330 
7331  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":949
7332  * cdef inline int import_umath() except -1:
7333  * try:
7334  * _import_umath() # <<<<<<<<<<<<<<
7335  * except Exception:
7336  * raise ImportError("numpy.core.umath failed to import")
7337  */
7338  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 949, __pyx_L3_error)
7339 
7340  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
7341  *
7342  * cdef inline int import_umath() except -1:
7343  * try: # <<<<<<<<<<<<<<
7344  * _import_umath()
7345  * except Exception:
7346  */
7347  }
7348  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7349  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7350  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7351  goto __pyx_L8_try_end;
7352  __pyx_L3_error:;
7353 
7354  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":950
7355  * try:
7356  * _import_umath()
7357  * except Exception: # <<<<<<<<<<<<<<
7358  * raise ImportError("numpy.core.umath failed to import")
7359  *
7360  */
7361  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7362  if (__pyx_t_4) {
7363  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7364  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 950, __pyx_L5_except_error)
7365  __Pyx_GOTREF(__pyx_t_5);
7366  __Pyx_GOTREF(__pyx_t_6);
7367  __Pyx_GOTREF(__pyx_t_7);
7368 
7369  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
7370  * _import_umath()
7371  * except Exception:
7372  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7373  *
7374  * cdef inline int import_ufunc() except -1:
7375  */
7376  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 951, __pyx_L5_except_error)
7377  __Pyx_GOTREF(__pyx_t_8);
7378  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7379  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7380  __PYX_ERR(3, 951, __pyx_L5_except_error)
7381  }
7382  goto __pyx_L5_except_error;
7383  __pyx_L5_except_error:;
7384 
7385  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
7386  *
7387  * cdef inline int import_umath() except -1:
7388  * try: # <<<<<<<<<<<<<<
7389  * _import_umath()
7390  * except Exception:
7391  */
7392  __Pyx_XGIVEREF(__pyx_t_1);
7393  __Pyx_XGIVEREF(__pyx_t_2);
7394  __Pyx_XGIVEREF(__pyx_t_3);
7395  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7396  goto __pyx_L1_error;
7397  __pyx_L8_try_end:;
7398  }
7399 
7400  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
7401  * raise ImportError("numpy.core.multiarray failed to import")
7402  *
7403  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7404  * try:
7405  * _import_umath()
7406  */
7407 
7408  /* function exit code */
7409  __pyx_r = 0;
7410  goto __pyx_L0;
7411  __pyx_L1_error:;
7412  __Pyx_XDECREF(__pyx_t_5);
7413  __Pyx_XDECREF(__pyx_t_6);
7414  __Pyx_XDECREF(__pyx_t_7);
7415  __Pyx_XDECREF(__pyx_t_8);
7416  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7417  __pyx_r = -1;
7418  __pyx_L0:;
7419  __Pyx_TraceReturn(Py_None, 0);
7420  __Pyx_RefNannyFinishContext();
7421  return __pyx_r;
7422 }
7423 
7424 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
7425  * raise ImportError("numpy.core.umath failed to import")
7426  *
7427  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
7428  * try:
7429  * _import_umath()
7430  */
7431 
7432 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
7433  int __pyx_r;
7434  __Pyx_TraceDeclarations
7435  __Pyx_RefNannyDeclarations
7436  PyObject *__pyx_t_1 = NULL;
7437  PyObject *__pyx_t_2 = NULL;
7438  PyObject *__pyx_t_3 = NULL;
7439  int __pyx_t_4;
7440  PyObject *__pyx_t_5 = NULL;
7441  PyObject *__pyx_t_6 = NULL;
7442  PyObject *__pyx_t_7 = NULL;
7443  PyObject *__pyx_t_8 = NULL;
7444  int __pyx_lineno = 0;
7445  const char *__pyx_filename = NULL;
7446  int __pyx_clineno = 0;
7447  __Pyx_RefNannySetupContext("import_ufunc", 0);
7448  __Pyx_TraceCall("import_ufunc", __pyx_f[3], 953, 0, __PYX_ERR(3, 953, __pyx_L1_error));
7449 
7450  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
7451  *
7452  * cdef inline int import_ufunc() except -1:
7453  * try: # <<<<<<<<<<<<<<
7454  * _import_umath()
7455  * except Exception:
7456  */
7457  {
7458  __Pyx_PyThreadState_declare
7459  __Pyx_PyThreadState_assign
7460  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7461  __Pyx_XGOTREF(__pyx_t_1);
7462  __Pyx_XGOTREF(__pyx_t_2);
7463  __Pyx_XGOTREF(__pyx_t_3);
7464  /*try:*/ {
7465 
7466  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":955
7467  * cdef inline int import_ufunc() except -1:
7468  * try:
7469  * _import_umath() # <<<<<<<<<<<<<<
7470  * except Exception:
7471  * raise ImportError("numpy.core.umath failed to import")
7472  */
7473  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 955, __pyx_L3_error)
7474 
7475  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
7476  *
7477  * cdef inline int import_ufunc() except -1:
7478  * try: # <<<<<<<<<<<<<<
7479  * _import_umath()
7480  * except Exception:
7481  */
7482  }
7483  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7484  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7485  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7486  goto __pyx_L8_try_end;
7487  __pyx_L3_error:;
7488 
7489  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":956
7490  * try:
7491  * _import_umath()
7492  * except Exception: # <<<<<<<<<<<<<<
7493  * raise ImportError("numpy.core.umath failed to import")
7494  *
7495  */
7496  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7497  if (__pyx_t_4) {
7498  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7499  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 956, __pyx_L5_except_error)
7500  __Pyx_GOTREF(__pyx_t_5);
7501  __Pyx_GOTREF(__pyx_t_6);
7502  __Pyx_GOTREF(__pyx_t_7);
7503 
7504  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":957
7505  * _import_umath()
7506  * except Exception:
7507  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7508  *
7509  * cdef extern from *:
7510  */
7511  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 957, __pyx_L5_except_error)
7512  __Pyx_GOTREF(__pyx_t_8);
7513  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7514  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7515  __PYX_ERR(3, 957, __pyx_L5_except_error)
7516  }
7517  goto __pyx_L5_except_error;
7518  __pyx_L5_except_error:;
7519 
7520  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
7521  *
7522  * cdef inline int import_ufunc() except -1:
7523  * try: # <<<<<<<<<<<<<<
7524  * _import_umath()
7525  * except Exception:
7526  */
7527  __Pyx_XGIVEREF(__pyx_t_1);
7528  __Pyx_XGIVEREF(__pyx_t_2);
7529  __Pyx_XGIVEREF(__pyx_t_3);
7530  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7531  goto __pyx_L1_error;
7532  __pyx_L8_try_end:;
7533  }
7534 
7535  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
7536  * raise ImportError("numpy.core.umath failed to import")
7537  *
7538  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
7539  * try:
7540  * _import_umath()
7541  */
7542 
7543  /* function exit code */
7544  __pyx_r = 0;
7545  goto __pyx_L0;
7546  __pyx_L1_error:;
7547  __Pyx_XDECREF(__pyx_t_5);
7548  __Pyx_XDECREF(__pyx_t_6);
7549  __Pyx_XDECREF(__pyx_t_7);
7550  __Pyx_XDECREF(__pyx_t_8);
7551  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7552  __pyx_r = -1;
7553  __pyx_L0:;
7554  __Pyx_TraceReturn(Py_None, 0);
7555  __Pyx_RefNannyFinishContext();
7556  return __pyx_r;
7557 }
7558 
7559 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
7560  *
7561  *
7562  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
7563  * """
7564  * Cython equivalent of `isinstance(obj, np.timedelta64)`
7565  */
7566 
7567 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
7568  int __pyx_r;
7569  __Pyx_TraceDeclarations
7570  __Pyx_RefNannyDeclarations
7571  int __pyx_lineno = 0;
7572  const char *__pyx_filename = NULL;
7573  int __pyx_clineno = 0;
7574  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
7575  __Pyx_TraceCall("is_timedelta64_object", __pyx_f[3], 967, 0, __PYX_ERR(3, 967, __pyx_L1_error));
7576 
7577  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":979
7578  * bool
7579  * """
7580  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
7581  *
7582  *
7583  */
7584  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
7585  goto __pyx_L0;
7586 
7587  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
7588  *
7589  *
7590  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
7591  * """
7592  * Cython equivalent of `isinstance(obj, np.timedelta64)`
7593  */
7594 
7595  /* function exit code */
7596  __pyx_L1_error:;
7597  __Pyx_WriteUnraisable("numpy.is_timedelta64_object", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7598  __pyx_r = 0;
7599  __pyx_L0:;
7600  __Pyx_TraceReturn(Py_None, 0);
7601  __Pyx_RefNannyFinishContext();
7602  return __pyx_r;
7603 }
7604 
7605 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
7606  *
7607  *
7608  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
7609  * """
7610  * Cython equivalent of `isinstance(obj, np.datetime64)`
7611  */
7612 
7613 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
7614  int __pyx_r;
7615  __Pyx_TraceDeclarations
7616  __Pyx_RefNannyDeclarations
7617  int __pyx_lineno = 0;
7618  const char *__pyx_filename = NULL;
7619  int __pyx_clineno = 0;
7620  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
7621  __Pyx_TraceCall("is_datetime64_object", __pyx_f[3], 982, 0, __PYX_ERR(3, 982, __pyx_L1_error));
7622 
7623  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":994
7624  * bool
7625  * """
7626  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
7627  *
7628  *
7629  */
7630  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
7631  goto __pyx_L0;
7632 
7633  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
7634  *
7635  *
7636  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
7637  * """
7638  * Cython equivalent of `isinstance(obj, np.datetime64)`
7639  */
7640 
7641  /* function exit code */
7642  __pyx_L1_error:;
7643  __Pyx_WriteUnraisable("numpy.is_datetime64_object", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7644  __pyx_r = 0;
7645  __pyx_L0:;
7646  __Pyx_TraceReturn(Py_None, 0);
7647  __Pyx_RefNannyFinishContext();
7648  return __pyx_r;
7649 }
7650 
7651 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
7652  *
7653  *
7654  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
7655  * """
7656  * returns the int64 value underlying scalar numpy datetime64 object
7657  */
7658 
7659 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
7660  npy_datetime __pyx_r;
7661  __Pyx_TraceDeclarations
7662  int __pyx_lineno = 0;
7663  const char *__pyx_filename = NULL;
7664  int __pyx_clineno = 0;
7665  __Pyx_TraceCall("get_datetime64_value", __pyx_f[3], 997, 1, __PYX_ERR(3, 997, __pyx_L1_error));
7666 
7667  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1004
7668  * also needed. That can be found using `get_datetime64_unit`.
7669  * """
7670  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
7671  *
7672  *
7673  */
7674  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
7675  goto __pyx_L0;
7676 
7677  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
7678  *
7679  *
7680  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
7681  * """
7682  * returns the int64 value underlying scalar numpy datetime64 object
7683  */
7684 
7685  /* function exit code */
7686  __pyx_L1_error:;
7687  __Pyx_WriteUnraisable("numpy.get_datetime64_value", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
7688  __pyx_r = 0;
7689  __pyx_L0:;
7690  __Pyx_TraceReturn(Py_None, 1);
7691  return __pyx_r;
7692 }
7693 
7694 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
7695  *
7696  *
7697  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
7698  * """
7699  * returns the int64 value underlying scalar numpy timedelta64 object
7700  */
7701 
7702 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
7703  npy_timedelta __pyx_r;
7704  __Pyx_TraceDeclarations
7705  int __pyx_lineno = 0;
7706  const char *__pyx_filename = NULL;
7707  int __pyx_clineno = 0;
7708  __Pyx_TraceCall("get_timedelta64_value", __pyx_f[3], 1007, 1, __PYX_ERR(3, 1007, __pyx_L1_error));
7709 
7710  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1011
7711  * returns the int64 value underlying scalar numpy timedelta64 object
7712  * """
7713  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
7714  *
7715  *
7716  */
7717  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
7718  goto __pyx_L0;
7719 
7720  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
7721  *
7722  *
7723  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
7724  * """
7725  * returns the int64 value underlying scalar numpy timedelta64 object
7726  */
7727 
7728  /* function exit code */
7729  __pyx_L1_error:;
7730  __Pyx_WriteUnraisable("numpy.get_timedelta64_value", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
7731  __pyx_r = 0;
7732  __pyx_L0:;
7733  __Pyx_TraceReturn(Py_None, 1);
7734  return __pyx_r;
7735 }
7736 
7737 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
7738  *
7739  *
7740  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
7741  * """
7742  * returns the unit part of the dtype for a numpy datetime64 object.
7743  */
7744 
7745 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
7746  NPY_DATETIMEUNIT __pyx_r;
7747  __Pyx_TraceDeclarations
7748  int __pyx_lineno = 0;
7749  const char *__pyx_filename = NULL;
7750  int __pyx_clineno = 0;
7751  __Pyx_TraceCall("get_datetime64_unit", __pyx_f[3], 1014, 1, __PYX_ERR(3, 1014, __pyx_L1_error));
7752 
7753  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1018
7754  * returns the unit part of the dtype for a numpy datetime64 object.
7755  * """
7756  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
7757  */
7758  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
7759  goto __pyx_L0;
7760 
7761  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
7762  *
7763  *
7764  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
7765  * """
7766  * returns the unit part of the dtype for a numpy datetime64 object.
7767  */
7768 
7769  /* function exit code */
7770  __pyx_L1_error:;
7771  __Pyx_WriteUnraisable("numpy.get_datetime64_unit", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
7772  __pyx_r = (NPY_DATETIMEUNIT) 0;
7773  __pyx_L0:;
7774  __Pyx_TraceReturn(Py_None, 1);
7775  return __pyx_r;
7776 }
7777 
7778 /* "View.MemoryView":122
7779  * cdef bint dtype_is_object
7780  *
7781  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7782  * mode="c", bint allocate_buffer=True):
7783  *
7784  */
7785 
7786 /* Python wrapper */
7787 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7788 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7789  PyObject *__pyx_v_shape = 0;
7790  Py_ssize_t __pyx_v_itemsize;
7791  PyObject *__pyx_v_format = 0;
7792  PyObject *__pyx_v_mode = 0;
7793  int __pyx_v_allocate_buffer;
7794  int __pyx_lineno = 0;
7795  const char *__pyx_filename = NULL;
7796  int __pyx_clineno = 0;
7797  int __pyx_r;
7798  __Pyx_RefNannyDeclarations
7799  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7800  {
7801  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};
7802  PyObject* values[5] = {0,0,0,0,0};
7803  values[3] = ((PyObject *)__pyx_n_s_c);
7804  if (unlikely(__pyx_kwds)) {
7805  Py_ssize_t kw_args;
7806  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7807  switch (pos_args) {
7808  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7809  CYTHON_FALLTHROUGH;
7810  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7811  CYTHON_FALLTHROUGH;
7812  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7813  CYTHON_FALLTHROUGH;
7814  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7815  CYTHON_FALLTHROUGH;
7816  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7817  CYTHON_FALLTHROUGH;
7818  case 0: break;
7819  default: goto __pyx_L5_argtuple_error;
7820  }
7821  kw_args = PyDict_Size(__pyx_kwds);
7822  switch (pos_args) {
7823  case 0:
7824  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
7825  else goto __pyx_L5_argtuple_error;
7826  CYTHON_FALLTHROUGH;
7827  case 1:
7828  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
7829  else {
7830  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
7831  }
7832  CYTHON_FALLTHROUGH;
7833  case 2:
7834  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
7835  else {
7836  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
7837  }
7838  CYTHON_FALLTHROUGH;
7839  case 3:
7840  if (kw_args > 0) {
7841  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
7842  if (value) { values[3] = value; kw_args--; }
7843  }
7844  CYTHON_FALLTHROUGH;
7845  case 4:
7846  if (kw_args > 0) {
7847  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
7848  if (value) { values[4] = value; kw_args--; }
7849  }
7850  }
7851  if (unlikely(kw_args > 0)) {
7852  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
7853  }
7854  } else {
7855  switch (PyTuple_GET_SIZE(__pyx_args)) {
7856  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7857  CYTHON_FALLTHROUGH;
7858  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7859  CYTHON_FALLTHROUGH;
7860  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7861  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7862  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7863  break;
7864  default: goto __pyx_L5_argtuple_error;
7865  }
7866  }
7867  __pyx_v_shape = ((PyObject*)values[0]);
7868  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
7869  __pyx_v_format = values[2];
7870  __pyx_v_mode = values[3];
7871  if (values[4]) {
7872  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
7873  } else {
7874 
7875  /* "View.MemoryView":123
7876  *
7877  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
7878  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
7879  *
7880  * cdef int idx
7881  */
7882  __pyx_v_allocate_buffer = ((int)1);
7883  }
7884  }
7885  goto __pyx_L4_argument_unpacking_done;
7886  __pyx_L5_argtuple_error:;
7887  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
7888  __pyx_L3_error:;
7889  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7890  __Pyx_RefNannyFinishContext();
7891  return -1;
7892  __pyx_L4_argument_unpacking_done:;
7893  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
7894  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
7895  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
7896  }
7897  __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);
7898 
7899  /* "View.MemoryView":122
7900  * cdef bint dtype_is_object
7901  *
7902  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7903  * mode="c", bint allocate_buffer=True):
7904  *
7905  */
7906 
7907  /* function exit code */
7908  goto __pyx_L0;
7909  __pyx_L1_error:;
7910  __pyx_r = -1;
7911  __pyx_L0:;
7912  __Pyx_RefNannyFinishContext();
7913  return __pyx_r;
7914 }
7915 
7916 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) {
7917  int __pyx_v_idx;
7918  Py_ssize_t __pyx_v_i;
7919  Py_ssize_t __pyx_v_dim;
7920  PyObject **__pyx_v_p;
7921  char __pyx_v_order;
7922  int __pyx_r;
7923  __Pyx_TraceDeclarations
7924  __Pyx_RefNannyDeclarations
7925  Py_ssize_t __pyx_t_1;
7926  int __pyx_t_2;
7927  PyObject *__pyx_t_3 = NULL;
7928  int __pyx_t_4;
7929  PyObject *__pyx_t_5 = NULL;
7930  PyObject *__pyx_t_6 = NULL;
7931  char *__pyx_t_7;
7932  int __pyx_t_8;
7933  Py_ssize_t __pyx_t_9;
7934  PyObject *__pyx_t_10 = NULL;
7935  Py_ssize_t __pyx_t_11;
7936  int __pyx_lineno = 0;
7937  const char *__pyx_filename = NULL;
7938  int __pyx_clineno = 0;
7939  __Pyx_RefNannySetupContext("__cinit__", 0);
7940  __Pyx_TraceCall("__cinit__", __pyx_f[1], 122, 0, __PYX_ERR(1, 122, __pyx_L1_error));
7941  __Pyx_INCREF(__pyx_v_format);
7942 
7943  /* "View.MemoryView":129
7944  * cdef PyObject **p
7945  *
7946  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
7947  * self.itemsize = itemsize
7948  *
7949  */
7950  if (unlikely(__pyx_v_shape == Py_None)) {
7951  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
7952  __PYX_ERR(1, 129, __pyx_L1_error)
7953  }
7954  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
7955  __pyx_v_self->ndim = ((int)__pyx_t_1);
7956 
7957  /* "View.MemoryView":130
7958  *
7959  * self.ndim = <int> len(shape)
7960  * self.itemsize = itemsize # <<<<<<<<<<<<<<
7961  *
7962  * if not self.ndim:
7963  */
7964  __pyx_v_self->itemsize = __pyx_v_itemsize;
7965 
7966  /* "View.MemoryView":132
7967  * self.itemsize = itemsize
7968  *
7969  * if not self.ndim: # <<<<<<<<<<<<<<
7970  * raise ValueError("Empty shape tuple for cython.array")
7971  *
7972  */
7973  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
7974  if (unlikely(__pyx_t_2)) {
7975 
7976  /* "View.MemoryView":133
7977  *
7978  * if not self.ndim:
7979  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
7980  *
7981  * if itemsize <= 0:
7982  */
7983  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
7984  __Pyx_GOTREF(__pyx_t_3);
7985  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7986  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7987  __PYX_ERR(1, 133, __pyx_L1_error)
7988 
7989  /* "View.MemoryView":132
7990  * self.itemsize = itemsize
7991  *
7992  * if not self.ndim: # <<<<<<<<<<<<<<
7993  * raise ValueError("Empty shape tuple for cython.array")
7994  *
7995  */
7996  }
7997 
7998  /* "View.MemoryView":135
7999  * raise ValueError("Empty shape tuple for cython.array")
8000  *
8001  * if itemsize <= 0: # <<<<<<<<<<<<<<
8002  * raise ValueError("itemsize <= 0 for cython.array")
8003  *
8004  */
8005  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8006  if (unlikely(__pyx_t_2)) {
8007 
8008  /* "View.MemoryView":136
8009  *
8010  * if itemsize <= 0:
8011  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
8012  *
8013  * if not isinstance(format, bytes):
8014  */
8015  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
8016  __Pyx_GOTREF(__pyx_t_3);
8017  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8018  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8019  __PYX_ERR(1, 136, __pyx_L1_error)
8020 
8021  /* "View.MemoryView":135
8022  * raise ValueError("Empty shape tuple for cython.array")
8023  *
8024  * if itemsize <= 0: # <<<<<<<<<<<<<<
8025  * raise ValueError("itemsize <= 0 for cython.array")
8026  *
8027  */
8028  }
8029 
8030  /* "View.MemoryView":138
8031  * raise ValueError("itemsize <= 0 for cython.array")
8032  *
8033  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8034  * format = format.encode('ASCII')
8035  * self._format = format # keep a reference to the byte string
8036  */
8037  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8038  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8039  if (__pyx_t_4) {
8040 
8041  /* "View.MemoryView":139
8042  *
8043  * if not isinstance(format, bytes):
8044  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
8045  * self._format = format # keep a reference to the byte string
8046  * self.format = self._format
8047  */
8048  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
8049  __Pyx_GOTREF(__pyx_t_5);
8050  __pyx_t_6 = NULL;
8051  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8052  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8053  if (likely(__pyx_t_6)) {
8054  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8055  __Pyx_INCREF(__pyx_t_6);
8056  __Pyx_INCREF(function);
8057  __Pyx_DECREF_SET(__pyx_t_5, function);
8058  }
8059  }
8060  __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);
8061  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8062  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
8063  __Pyx_GOTREF(__pyx_t_3);
8064  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8065  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
8066  __pyx_t_3 = 0;
8067 
8068  /* "View.MemoryView":138
8069  * raise ValueError("itemsize <= 0 for cython.array")
8070  *
8071  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8072  * format = format.encode('ASCII')
8073  * self._format = format # keep a reference to the byte string
8074  */
8075  }
8076 
8077  /* "View.MemoryView":140
8078  * if not isinstance(format, bytes):
8079  * format = format.encode('ASCII')
8080  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
8081  * self.format = self._format
8082  *
8083  */
8084  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
8085  __pyx_t_3 = __pyx_v_format;
8086  __Pyx_INCREF(__pyx_t_3);
8087  __Pyx_GIVEREF(__pyx_t_3);
8088  __Pyx_GOTREF(__pyx_v_self->_format);
8089  __Pyx_DECREF(__pyx_v_self->_format);
8090  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
8091  __pyx_t_3 = 0;
8092 
8093  /* "View.MemoryView":141
8094  * format = format.encode('ASCII')
8095  * self._format = format # keep a reference to the byte string
8096  * self.format = self._format # <<<<<<<<<<<<<<
8097  *
8098  *
8099  */
8100  if (unlikely(__pyx_v_self->_format == Py_None)) {
8101  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
8102  __PYX_ERR(1, 141, __pyx_L1_error)
8103  }
8104  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
8105  __pyx_v_self->format = __pyx_t_7;
8106 
8107  /* "View.MemoryView":144
8108  *
8109  *
8110  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
8111  * self._strides = self._shape + self.ndim
8112  *
8113  */
8114  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8115 
8116  /* "View.MemoryView":145
8117  *
8118  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
8119  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
8120  *
8121  * if not self._shape:
8122  */
8123  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8124 
8125  /* "View.MemoryView":147
8126  * self._strides = self._shape + self.ndim
8127  *
8128  * if not self._shape: # <<<<<<<<<<<<<<
8129  * raise MemoryError("unable to allocate shape and strides.")
8130  *
8131  */
8132  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8133  if (unlikely(__pyx_t_4)) {
8134 
8135  /* "View.MemoryView":148
8136  *
8137  * if not self._shape:
8138  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
8139  *
8140  *
8141  */
8142  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
8143  __Pyx_GOTREF(__pyx_t_3);
8144  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8145  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8146  __PYX_ERR(1, 148, __pyx_L1_error)
8147 
8148  /* "View.MemoryView":147
8149  * self._strides = self._shape + self.ndim
8150  *
8151  * if not self._shape: # <<<<<<<<<<<<<<
8152  * raise MemoryError("unable to allocate shape and strides.")
8153  *
8154  */
8155  }
8156 
8157  /* "View.MemoryView":151
8158  *
8159  *
8160  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8161  * if dim <= 0:
8162  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8163  */
8164  __pyx_t_8 = 0;
8165  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8166  for (;;) {
8167  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
8168  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8169  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
8170  #else
8171  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
8172  __Pyx_GOTREF(__pyx_t_5);
8173  #endif
8174  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
8175  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8176  __pyx_v_dim = __pyx_t_9;
8177  __pyx_v_idx = __pyx_t_8;
8178  __pyx_t_8 = (__pyx_t_8 + 1);
8179 
8180  /* "View.MemoryView":152
8181  *
8182  * for idx, dim in enumerate(shape):
8183  * if dim <= 0: # <<<<<<<<<<<<<<
8184  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8185  * self._shape[idx] = dim
8186  */
8187  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8188  if (unlikely(__pyx_t_4)) {
8189 
8190  /* "View.MemoryView":153
8191  * for idx, dim in enumerate(shape):
8192  * if dim <= 0:
8193  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
8194  * self._shape[idx] = dim
8195  *
8196  */
8197  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
8198  __Pyx_GOTREF(__pyx_t_5);
8199  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8200  __Pyx_GOTREF(__pyx_t_6);
8201  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8202  __Pyx_GOTREF(__pyx_t_10);
8203  __Pyx_GIVEREF(__pyx_t_5);
8204  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
8205  __Pyx_GIVEREF(__pyx_t_6);
8206  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
8207  __pyx_t_5 = 0;
8208  __pyx_t_6 = 0;
8209  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8210  __Pyx_GOTREF(__pyx_t_6);
8211  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8212  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8213  __Pyx_GOTREF(__pyx_t_10);
8214  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8215  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8216  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8217  __PYX_ERR(1, 153, __pyx_L1_error)
8218 
8219  /* "View.MemoryView":152
8220  *
8221  * for idx, dim in enumerate(shape):
8222  * if dim <= 0: # <<<<<<<<<<<<<<
8223  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8224  * self._shape[idx] = dim
8225  */
8226  }
8227 
8228  /* "View.MemoryView":154
8229  * if dim <= 0:
8230  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8231  * self._shape[idx] = dim # <<<<<<<<<<<<<<
8232  *
8233  * cdef char order
8234  */
8235  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8236 
8237  /* "View.MemoryView":151
8238  *
8239  *
8240  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8241  * if dim <= 0:
8242  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8243  */
8244  }
8245  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8246 
8247  /* "View.MemoryView":157
8248  *
8249  * cdef char order
8250  * if mode == 'fortran': # <<<<<<<<<<<<<<
8251  * order = b'F'
8252  * self.mode = u'fortran'
8253  */
8254  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
8255  if (__pyx_t_4) {
8256 
8257  /* "View.MemoryView":158
8258  * cdef char order
8259  * if mode == 'fortran':
8260  * order = b'F' # <<<<<<<<<<<<<<
8261  * self.mode = u'fortran'
8262  * elif mode == 'c':
8263  */
8264  __pyx_v_order = 'F';
8265 
8266  /* "View.MemoryView":159
8267  * if mode == 'fortran':
8268  * order = b'F'
8269  * self.mode = u'fortran' # <<<<<<<<<<<<<<
8270  * elif mode == 'c':
8271  * order = b'C'
8272  */
8273  __Pyx_INCREF(__pyx_n_u_fortran);
8274  __Pyx_GIVEREF(__pyx_n_u_fortran);
8275  __Pyx_GOTREF(__pyx_v_self->mode);
8276  __Pyx_DECREF(__pyx_v_self->mode);
8277  __pyx_v_self->mode = __pyx_n_u_fortran;
8278 
8279  /* "View.MemoryView":157
8280  *
8281  * cdef char order
8282  * if mode == 'fortran': # <<<<<<<<<<<<<<
8283  * order = b'F'
8284  * self.mode = u'fortran'
8285  */
8286  goto __pyx_L10;
8287  }
8288 
8289  /* "View.MemoryView":160
8290  * order = b'F'
8291  * self.mode = u'fortran'
8292  * elif mode == 'c': # <<<<<<<<<<<<<<
8293  * order = b'C'
8294  * self.mode = u'c'
8295  */
8296  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
8297  if (likely(__pyx_t_4)) {
8298 
8299  /* "View.MemoryView":161
8300  * self.mode = u'fortran'
8301  * elif mode == 'c':
8302  * order = b'C' # <<<<<<<<<<<<<<
8303  * self.mode = u'c'
8304  * else:
8305  */
8306  __pyx_v_order = 'C';
8307 
8308  /* "View.MemoryView":162
8309  * elif mode == 'c':
8310  * order = b'C'
8311  * self.mode = u'c' # <<<<<<<<<<<<<<
8312  * else:
8313  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8314  */
8315  __Pyx_INCREF(__pyx_n_u_c);
8316  __Pyx_GIVEREF(__pyx_n_u_c);
8317  __Pyx_GOTREF(__pyx_v_self->mode);
8318  __Pyx_DECREF(__pyx_v_self->mode);
8319  __pyx_v_self->mode = __pyx_n_u_c;
8320 
8321  /* "View.MemoryView":160
8322  * order = b'F'
8323  * self.mode = u'fortran'
8324  * elif mode == 'c': # <<<<<<<<<<<<<<
8325  * order = b'C'
8326  * self.mode = u'c'
8327  */
8328  goto __pyx_L10;
8329  }
8330 
8331  /* "View.MemoryView":164
8332  * self.mode = u'c'
8333  * else:
8334  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
8335  *
8336  * self.len = fill_contig_strides_array(self._shape, self._strides,
8337  */
8338  /*else*/ {
8339  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
8340  __Pyx_GOTREF(__pyx_t_3);
8341  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
8342  __Pyx_GOTREF(__pyx_t_10);
8343  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8344  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8345  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8346  __PYX_ERR(1, 164, __pyx_L1_error)
8347  }
8348  __pyx_L10:;
8349 
8350  /* "View.MemoryView":166
8351  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8352  *
8353  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
8354  * itemsize, self.ndim, order)
8355  *
8356  */
8357  __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);
8358 
8359  /* "View.MemoryView":169
8360  * itemsize, self.ndim, order)
8361  *
8362  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
8363  * self.dtype_is_object = format == b'O'
8364  * if allocate_buffer:
8365  */
8366  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8367 
8368  /* "View.MemoryView":170
8369  *
8370  * self.free_data = allocate_buffer
8371  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
8372  * if allocate_buffer:
8373  *
8374  */
8375  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
8376  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
8377  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8378  __pyx_v_self->dtype_is_object = __pyx_t_4;
8379 
8380  /* "View.MemoryView":171
8381  * self.free_data = allocate_buffer
8382  * self.dtype_is_object = format == b'O'
8383  * if allocate_buffer: # <<<<<<<<<<<<<<
8384  *
8385  *
8386  */
8387  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8388  if (__pyx_t_4) {
8389 
8390  /* "View.MemoryView":174
8391  *
8392  *
8393  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
8394  * if not self.data:
8395  * raise MemoryError("unable to allocate array data.")
8396  */
8397  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
8398 
8399  /* "View.MemoryView":175
8400  *
8401  * self.data = <char *>malloc(self.len)
8402  * if not self.data: # <<<<<<<<<<<<<<
8403  * raise MemoryError("unable to allocate array data.")
8404  *
8405  */
8406  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8407  if (unlikely(__pyx_t_4)) {
8408 
8409  /* "View.MemoryView":176
8410  * self.data = <char *>malloc(self.len)
8411  * if not self.data:
8412  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
8413  *
8414  * if self.dtype_is_object:
8415  */
8416  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
8417  __Pyx_GOTREF(__pyx_t_10);
8418  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8419  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8420  __PYX_ERR(1, 176, __pyx_L1_error)
8421 
8422  /* "View.MemoryView":175
8423  *
8424  * self.data = <char *>malloc(self.len)
8425  * if not self.data: # <<<<<<<<<<<<<<
8426  * raise MemoryError("unable to allocate array data.")
8427  *
8428  */
8429  }
8430 
8431  /* "View.MemoryView":178
8432  * raise MemoryError("unable to allocate array data.")
8433  *
8434  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8435  * p = <PyObject **> self.data
8436  * for i in range(self.len / itemsize):
8437  */
8438  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8439  if (__pyx_t_4) {
8440 
8441  /* "View.MemoryView":179
8442  *
8443  * if self.dtype_is_object:
8444  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
8445  * for i in range(self.len / itemsize):
8446  * p[i] = Py_None
8447  */
8448  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8449 
8450  /* "View.MemoryView":180
8451  * if self.dtype_is_object:
8452  * p = <PyObject **> self.data
8453  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
8454  * p[i] = Py_None
8455  * Py_INCREF(Py_None)
8456  */
8457  if (unlikely(__pyx_v_itemsize == 0)) {
8458  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
8459  __PYX_ERR(1, 180, __pyx_L1_error)
8460  }
8461  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))) {
8462  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
8463  __PYX_ERR(1, 180, __pyx_L1_error)
8464  }
8465  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8466  __pyx_t_9 = __pyx_t_1;
8467  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
8468  __pyx_v_i = __pyx_t_11;
8469 
8470  /* "View.MemoryView":181
8471  * p = <PyObject **> self.data
8472  * for i in range(self.len / itemsize):
8473  * p[i] = Py_None # <<<<<<<<<<<<<<
8474  * Py_INCREF(Py_None)
8475  *
8476  */
8477  (__pyx_v_p[__pyx_v_i]) = Py_None;
8478 
8479  /* "View.MemoryView":182
8480  * for i in range(self.len / itemsize):
8481  * p[i] = Py_None
8482  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
8483  *
8484  * @cname('getbuffer')
8485  */
8486  Py_INCREF(Py_None);
8487  }
8488 
8489  /* "View.MemoryView":178
8490  * raise MemoryError("unable to allocate array data.")
8491  *
8492  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8493  * p = <PyObject **> self.data
8494  * for i in range(self.len / itemsize):
8495  */
8496  }
8497 
8498  /* "View.MemoryView":171
8499  * self.free_data = allocate_buffer
8500  * self.dtype_is_object = format == b'O'
8501  * if allocate_buffer: # <<<<<<<<<<<<<<
8502  *
8503  *
8504  */
8505  }
8506 
8507  /* "View.MemoryView":122
8508  * cdef bint dtype_is_object
8509  *
8510  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8511  * mode="c", bint allocate_buffer=True):
8512  *
8513  */
8514 
8515  /* function exit code */
8516  __pyx_r = 0;
8517  goto __pyx_L0;
8518  __pyx_L1_error:;
8519  __Pyx_XDECREF(__pyx_t_3);
8520  __Pyx_XDECREF(__pyx_t_5);
8521  __Pyx_XDECREF(__pyx_t_6);
8522  __Pyx_XDECREF(__pyx_t_10);
8523  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8524  __pyx_r = -1;
8525  __pyx_L0:;
8526  __Pyx_XDECREF(__pyx_v_format);
8527  __Pyx_TraceReturn(Py_None, 0);
8528  __Pyx_RefNannyFinishContext();
8529  return __pyx_r;
8530 }
8531 
8532 /* "View.MemoryView":185
8533  *
8534  * @cname('getbuffer')
8535  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8536  * cdef int bufmode = -1
8537  * if self.mode == u"c":
8538  */
8539 
8540 /* Python wrapper */
8541 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
8542 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8543  int __pyx_r;
8544  __Pyx_RefNannyDeclarations
8545  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
8546  __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));
8547 
8548  /* function exit code */
8549  __Pyx_RefNannyFinishContext();
8550  return __pyx_r;
8551 }
8552 
8553 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) {
8554  int __pyx_v_bufmode;
8555  int __pyx_r;
8556  __Pyx_TraceDeclarations
8557  __Pyx_RefNannyDeclarations
8558  int __pyx_t_1;
8559  int __pyx_t_2;
8560  PyObject *__pyx_t_3 = NULL;
8561  char *__pyx_t_4;
8562  Py_ssize_t __pyx_t_5;
8563  int __pyx_t_6;
8564  Py_ssize_t *__pyx_t_7;
8565  int __pyx_lineno = 0;
8566  const char *__pyx_filename = NULL;
8567  int __pyx_clineno = 0;
8568  if (__pyx_v_info == NULL) {
8569  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
8570  return -1;
8571  }
8572  __Pyx_RefNannySetupContext("__getbuffer__", 0);
8573  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8574  __Pyx_GIVEREF(__pyx_v_info->obj);
8575  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 185, 0, __PYX_ERR(1, 185, __pyx_L1_error));
8576 
8577  /* "View.MemoryView":186
8578  * @cname('getbuffer')
8579  * def __getbuffer__(self, Py_buffer *info, int flags):
8580  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
8581  * if self.mode == u"c":
8582  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8583  */
8584  __pyx_v_bufmode = -1;
8585 
8586  /* "View.MemoryView":187
8587  * def __getbuffer__(self, Py_buffer *info, int flags):
8588  * cdef int bufmode = -1
8589  * if self.mode == u"c": # <<<<<<<<<<<<<<
8590  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8591  * elif self.mode == u"fortran":
8592  */
8593  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
8594  __pyx_t_2 = (__pyx_t_1 != 0);
8595  if (__pyx_t_2) {
8596 
8597  /* "View.MemoryView":188
8598  * cdef int bufmode = -1
8599  * if self.mode == u"c":
8600  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
8601  * elif self.mode == u"fortran":
8602  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8603  */
8604  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8605 
8606  /* "View.MemoryView":187
8607  * def __getbuffer__(self, Py_buffer *info, int flags):
8608  * cdef int bufmode = -1
8609  * if self.mode == u"c": # <<<<<<<<<<<<<<
8610  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8611  * elif self.mode == u"fortran":
8612  */
8613  goto __pyx_L3;
8614  }
8615 
8616  /* "View.MemoryView":189
8617  * if self.mode == u"c":
8618  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8619  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
8620  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8621  * if not (flags & bufmode):
8622  */
8623  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
8624  __pyx_t_1 = (__pyx_t_2 != 0);
8625  if (__pyx_t_1) {
8626 
8627  /* "View.MemoryView":190
8628  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8629  * elif self.mode == u"fortran":
8630  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
8631  * if not (flags & bufmode):
8632  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8633  */
8634  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8635 
8636  /* "View.MemoryView":189
8637  * if self.mode == u"c":
8638  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8639  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
8640  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8641  * if not (flags & bufmode):
8642  */
8643  }
8644  __pyx_L3:;
8645 
8646  /* "View.MemoryView":191
8647  * elif self.mode == u"fortran":
8648  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8649  * if not (flags & bufmode): # <<<<<<<<<<<<<<
8650  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8651  * info.buf = self.data
8652  */
8653  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8654  if (unlikely(__pyx_t_1)) {
8655 
8656  /* "View.MemoryView":192
8657  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8658  * if not (flags & bufmode):
8659  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
8660  * info.buf = self.data
8661  * info.len = self.len
8662  */
8663  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
8664  __Pyx_GOTREF(__pyx_t_3);
8665  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8666  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8667  __PYX_ERR(1, 192, __pyx_L1_error)
8668 
8669  /* "View.MemoryView":191
8670  * elif self.mode == u"fortran":
8671  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8672  * if not (flags & bufmode): # <<<<<<<<<<<<<<
8673  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8674  * info.buf = self.data
8675  */
8676  }
8677 
8678  /* "View.MemoryView":193
8679  * if not (flags & bufmode):
8680  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8681  * info.buf = self.data # <<<<<<<<<<<<<<
8682  * info.len = self.len
8683  * info.ndim = self.ndim
8684  */
8685  __pyx_t_4 = __pyx_v_self->data;
8686  __pyx_v_info->buf = __pyx_t_4;
8687 
8688  /* "View.MemoryView":194
8689  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8690  * info.buf = self.data
8691  * info.len = self.len # <<<<<<<<<<<<<<
8692  * info.ndim = self.ndim
8693  * info.shape = self._shape
8694  */
8695  __pyx_t_5 = __pyx_v_self->len;
8696  __pyx_v_info->len = __pyx_t_5;
8697 
8698  /* "View.MemoryView":195
8699  * info.buf = self.data
8700  * info.len = self.len
8701  * info.ndim = self.ndim # <<<<<<<<<<<<<<
8702  * info.shape = self._shape
8703  * info.strides = self._strides
8704  */
8705  __pyx_t_6 = __pyx_v_self->ndim;
8706  __pyx_v_info->ndim = __pyx_t_6;
8707 
8708  /* "View.MemoryView":196
8709  * info.len = self.len
8710  * info.ndim = self.ndim
8711  * info.shape = self._shape # <<<<<<<<<<<<<<
8712  * info.strides = self._strides
8713  * info.suboffsets = NULL
8714  */
8715  __pyx_t_7 = __pyx_v_self->_shape;
8716  __pyx_v_info->shape = __pyx_t_7;
8717 
8718  /* "View.MemoryView":197
8719  * info.ndim = self.ndim
8720  * info.shape = self._shape
8721  * info.strides = self._strides # <<<<<<<<<<<<<<
8722  * info.suboffsets = NULL
8723  * info.itemsize = self.itemsize
8724  */
8725  __pyx_t_7 = __pyx_v_self->_strides;
8726  __pyx_v_info->strides = __pyx_t_7;
8727 
8728  /* "View.MemoryView":198
8729  * info.shape = self._shape
8730  * info.strides = self._strides
8731  * info.suboffsets = NULL # <<<<<<<<<<<<<<
8732  * info.itemsize = self.itemsize
8733  * info.readonly = 0
8734  */
8735  __pyx_v_info->suboffsets = NULL;
8736 
8737  /* "View.MemoryView":199
8738  * info.strides = self._strides
8739  * info.suboffsets = NULL
8740  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
8741  * info.readonly = 0
8742  *
8743  */
8744  __pyx_t_5 = __pyx_v_self->itemsize;
8745  __pyx_v_info->itemsize = __pyx_t_5;
8746 
8747  /* "View.MemoryView":200
8748  * info.suboffsets = NULL
8749  * info.itemsize = self.itemsize
8750  * info.readonly = 0 # <<<<<<<<<<<<<<
8751  *
8752  * if flags & PyBUF_FORMAT:
8753  */
8754  __pyx_v_info->readonly = 0;
8755 
8756  /* "View.MemoryView":202
8757  * info.readonly = 0
8758  *
8759  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8760  * info.format = self.format
8761  * else:
8762  */
8763  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8764  if (__pyx_t_1) {
8765 
8766  /* "View.MemoryView":203
8767  *
8768  * if flags & PyBUF_FORMAT:
8769  * info.format = self.format # <<<<<<<<<<<<<<
8770  * else:
8771  * info.format = NULL
8772  */
8773  __pyx_t_4 = __pyx_v_self->format;
8774  __pyx_v_info->format = __pyx_t_4;
8775 
8776  /* "View.MemoryView":202
8777  * info.readonly = 0
8778  *
8779  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8780  * info.format = self.format
8781  * else:
8782  */
8783  goto __pyx_L5;
8784  }
8785 
8786  /* "View.MemoryView":205
8787  * info.format = self.format
8788  * else:
8789  * info.format = NULL # <<<<<<<<<<<<<<
8790  *
8791  * info.obj = self
8792  */
8793  /*else*/ {
8794  __pyx_v_info->format = NULL;
8795  }
8796  __pyx_L5:;
8797 
8798  /* "View.MemoryView":207
8799  * info.format = NULL
8800  *
8801  * info.obj = self # <<<<<<<<<<<<<<
8802  *
8803  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8804  */
8805  __Pyx_INCREF(((PyObject *)__pyx_v_self));
8806  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8807  __Pyx_GOTREF(__pyx_v_info->obj);
8808  __Pyx_DECREF(__pyx_v_info->obj);
8809  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
8810 
8811  /* "View.MemoryView":185
8812  *
8813  * @cname('getbuffer')
8814  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8815  * cdef int bufmode = -1
8816  * if self.mode == u"c":
8817  */
8818 
8819  /* function exit code */
8820  __pyx_r = 0;
8821  goto __pyx_L0;
8822  __pyx_L1_error:;
8823  __Pyx_XDECREF(__pyx_t_3);
8824  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8825  __pyx_r = -1;
8826  if (__pyx_v_info->obj != NULL) {
8827  __Pyx_GOTREF(__pyx_v_info->obj);
8828  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8829  }
8830  goto __pyx_L2;
8831  __pyx_L0:;
8832  if (__pyx_v_info->obj == Py_None) {
8833  __Pyx_GOTREF(__pyx_v_info->obj);
8834  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8835  }
8836  __pyx_L2:;
8837  __Pyx_TraceReturn(Py_None, 0);
8838  __Pyx_RefNannyFinishContext();
8839  return __pyx_r;
8840 }
8841 
8842 /* "View.MemoryView":211
8843  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8844  *
8845  * def __dealloc__(array self): # <<<<<<<<<<<<<<
8846  * if self.callback_free_data != NULL:
8847  * self.callback_free_data(self.data)
8848  */
8849 
8850 /* Python wrapper */
8851 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
8852 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
8853  __Pyx_RefNannyDeclarations
8854  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
8855  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
8856 
8857  /* function exit code */
8858  __Pyx_RefNannyFinishContext();
8859 }
8860 
8861 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
8862  __Pyx_TraceDeclarations
8863  __Pyx_RefNannyDeclarations
8864  int __pyx_t_1;
8865  int __pyx_lineno = 0;
8866  const char *__pyx_filename = NULL;
8867  int __pyx_clineno = 0;
8868  __Pyx_RefNannySetupContext("__dealloc__", 0);
8869  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 211, 0, __PYX_ERR(1, 211, __pyx_L1_error));
8870 
8871  /* "View.MemoryView":212
8872  *
8873  * def __dealloc__(array self):
8874  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
8875  * self.callback_free_data(self.data)
8876  * elif self.free_data:
8877  */
8878  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
8879  if (__pyx_t_1) {
8880 
8881  /* "View.MemoryView":213
8882  * def __dealloc__(array self):
8883  * if self.callback_free_data != NULL:
8884  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
8885  * elif self.free_data:
8886  * if self.dtype_is_object:
8887  */
8888  __pyx_v_self->callback_free_data(__pyx_v_self->data);
8889 
8890  /* "View.MemoryView":212
8891  *
8892  * def __dealloc__(array self):
8893  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
8894  * self.callback_free_data(self.data)
8895  * elif self.free_data:
8896  */
8897  goto __pyx_L3;
8898  }
8899 
8900  /* "View.MemoryView":214
8901  * if self.callback_free_data != NULL:
8902  * self.callback_free_data(self.data)
8903  * elif self.free_data: # <<<<<<<<<<<<<<
8904  * if self.dtype_is_object:
8905  * refcount_objects_in_slice(self.data, self._shape,
8906  */
8907  __pyx_t_1 = (__pyx_v_self->free_data != 0);
8908  if (__pyx_t_1) {
8909 
8910  /* "View.MemoryView":215
8911  * self.callback_free_data(self.data)
8912  * elif self.free_data:
8913  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8914  * refcount_objects_in_slice(self.data, self._shape,
8915  * self._strides, self.ndim, False)
8916  */
8917  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
8918  if (__pyx_t_1) {
8919 
8920  /* "View.MemoryView":216
8921  * elif self.free_data:
8922  * if self.dtype_is_object:
8923  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
8924  * self._strides, self.ndim, False)
8925  * free(self.data)
8926  */
8927  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
8928 
8929  /* "View.MemoryView":215
8930  * self.callback_free_data(self.data)
8931  * elif self.free_data:
8932  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8933  * refcount_objects_in_slice(self.data, self._shape,
8934  * self._strides, self.ndim, False)
8935  */
8936  }
8937 
8938  /* "View.MemoryView":218
8939  * refcount_objects_in_slice(self.data, self._shape,
8940  * self._strides, self.ndim, False)
8941  * free(self.data) # <<<<<<<<<<<<<<
8942  * PyObject_Free(self._shape)
8943  *
8944  */
8945  free(__pyx_v_self->data);
8946 
8947  /* "View.MemoryView":214
8948  * if self.callback_free_data != NULL:
8949  * self.callback_free_data(self.data)
8950  * elif self.free_data: # <<<<<<<<<<<<<<
8951  * if self.dtype_is_object:
8952  * refcount_objects_in_slice(self.data, self._shape,
8953  */
8954  }
8955  __pyx_L3:;
8956 
8957  /* "View.MemoryView":219
8958  * self._strides, self.ndim, False)
8959  * free(self.data)
8960  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
8961  *
8962  * @property
8963  */
8964  PyObject_Free(__pyx_v_self->_shape);
8965 
8966  /* "View.MemoryView":211
8967  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8968  *
8969  * def __dealloc__(array self): # <<<<<<<<<<<<<<
8970  * if self.callback_free_data != NULL:
8971  * self.callback_free_data(self.data)
8972  */
8973 
8974  /* function exit code */
8975  goto __pyx_L0;
8976  __pyx_L1_error:;
8977  __Pyx_WriteUnraisable("View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
8978  __pyx_L0:;
8979  __Pyx_TraceReturn(Py_None, 0);
8980  __Pyx_RefNannyFinishContext();
8981 }
8982 
8983 /* "View.MemoryView":222
8984  *
8985  * @property
8986  * def memview(self): # <<<<<<<<<<<<<<
8987  * return self.get_memview()
8988  *
8989  */
8990 
8991 /* Python wrapper */
8992 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
8993 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
8994  PyObject *__pyx_r = 0;
8995  __Pyx_RefNannyDeclarations
8996  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
8997  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
8998 
8999  /* function exit code */
9000  __Pyx_RefNannyFinishContext();
9001  return __pyx_r;
9002 }
9003 
9004 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
9005  PyObject *__pyx_r = NULL;
9006  __Pyx_TraceDeclarations
9007  __Pyx_RefNannyDeclarations
9008  PyObject *__pyx_t_1 = NULL;
9009  int __pyx_lineno = 0;
9010  const char *__pyx_filename = NULL;
9011  int __pyx_clineno = 0;
9012  __Pyx_RefNannySetupContext("__get__", 0);
9013  __Pyx_TraceCall("__get__", __pyx_f[1], 222, 0, __PYX_ERR(1, 222, __pyx_L1_error));
9014 
9015  /* "View.MemoryView":223
9016  * @property
9017  * def memview(self):
9018  * return self.get_memview() # <<<<<<<<<<<<<<
9019  *
9020  * @cname('get_memview')
9021  */
9022  __Pyx_XDECREF(__pyx_r);
9023  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
9024  __Pyx_GOTREF(__pyx_t_1);
9025  __pyx_r = __pyx_t_1;
9026  __pyx_t_1 = 0;
9027  goto __pyx_L0;
9028 
9029  /* "View.MemoryView":222
9030  *
9031  * @property
9032  * def memview(self): # <<<<<<<<<<<<<<
9033  * return self.get_memview()
9034  *
9035  */
9036 
9037  /* function exit code */
9038  __pyx_L1_error:;
9039  __Pyx_XDECREF(__pyx_t_1);
9040  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9041  __pyx_r = NULL;
9042  __pyx_L0:;
9043  __Pyx_XGIVEREF(__pyx_r);
9044  __Pyx_TraceReturn(__pyx_r, 0);
9045  __Pyx_RefNannyFinishContext();
9046  return __pyx_r;
9047 }
9048 
9049 /* "View.MemoryView":226
9050  *
9051  * @cname('get_memview')
9052  * cdef get_memview(self): # <<<<<<<<<<<<<<
9053  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9054  * return memoryview(self, flags, self.dtype_is_object)
9055  */
9056 
9057 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
9058  int __pyx_v_flags;
9059  PyObject *__pyx_r = NULL;
9060  __Pyx_TraceDeclarations
9061  __Pyx_RefNannyDeclarations
9062  PyObject *__pyx_t_1 = NULL;
9063  PyObject *__pyx_t_2 = NULL;
9064  PyObject *__pyx_t_3 = NULL;
9065  int __pyx_lineno = 0;
9066  const char *__pyx_filename = NULL;
9067  int __pyx_clineno = 0;
9068  __Pyx_RefNannySetupContext("get_memview", 0);
9069  __Pyx_TraceCall("get_memview", __pyx_f[1], 226, 0, __PYX_ERR(1, 226, __pyx_L1_error));
9070 
9071  /* "View.MemoryView":227
9072  * @cname('get_memview')
9073  * cdef get_memview(self):
9074  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
9075  * return memoryview(self, flags, self.dtype_is_object)
9076  *
9077  */
9078  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9079 
9080  /* "View.MemoryView":228
9081  * cdef get_memview(self):
9082  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9083  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
9084  *
9085  * def __len__(self):
9086  */
9087  __Pyx_XDECREF(__pyx_r);
9088  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
9089  __Pyx_GOTREF(__pyx_t_1);
9090  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9091  __Pyx_GOTREF(__pyx_t_2);
9092  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
9093  __Pyx_GOTREF(__pyx_t_3);
9094  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9095  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9096  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9097  __Pyx_GIVEREF(__pyx_t_1);
9098  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9099  __Pyx_GIVEREF(__pyx_t_2);
9100  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9101  __pyx_t_1 = 0;
9102  __pyx_t_2 = 0;
9103  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9104  __Pyx_GOTREF(__pyx_t_2);
9105  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9106  __pyx_r = __pyx_t_2;
9107  __pyx_t_2 = 0;
9108  goto __pyx_L0;
9109 
9110  /* "View.MemoryView":226
9111  *
9112  * @cname('get_memview')
9113  * cdef get_memview(self): # <<<<<<<<<<<<<<
9114  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9115  * return memoryview(self, flags, self.dtype_is_object)
9116  */
9117 
9118  /* function exit code */
9119  __pyx_L1_error:;
9120  __Pyx_XDECREF(__pyx_t_1);
9121  __Pyx_XDECREF(__pyx_t_2);
9122  __Pyx_XDECREF(__pyx_t_3);
9123  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9124  __pyx_r = 0;
9125  __pyx_L0:;
9126  __Pyx_XGIVEREF(__pyx_r);
9127  __Pyx_TraceReturn(__pyx_r, 0);
9128  __Pyx_RefNannyFinishContext();
9129  return __pyx_r;
9130 }
9131 
9132 /* "View.MemoryView":230
9133  * return memoryview(self, flags, self.dtype_is_object)
9134  *
9135  * def __len__(self): # <<<<<<<<<<<<<<
9136  * return self._shape[0]
9137  *
9138  */
9139 
9140 /* Python wrapper */
9141 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
9142 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9143  Py_ssize_t __pyx_r;
9144  __Pyx_RefNannyDeclarations
9145  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
9146  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
9147 
9148  /* function exit code */
9149  __Pyx_RefNannyFinishContext();
9150  return __pyx_r;
9151 }
9152 
9153 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
9154  Py_ssize_t __pyx_r;
9155  __Pyx_TraceDeclarations
9156  __Pyx_RefNannyDeclarations
9157  int __pyx_lineno = 0;
9158  const char *__pyx_filename = NULL;
9159  int __pyx_clineno = 0;
9160  __Pyx_RefNannySetupContext("__len__", 0);
9161  __Pyx_TraceCall("__len__", __pyx_f[1], 230, 0, __PYX_ERR(1, 230, __pyx_L1_error));
9162 
9163  /* "View.MemoryView":231
9164  *
9165  * def __len__(self):
9166  * return self._shape[0] # <<<<<<<<<<<<<<
9167  *
9168  * def __getattr__(self, attr):
9169  */
9170  __pyx_r = (__pyx_v_self->_shape[0]);
9171  goto __pyx_L0;
9172 
9173  /* "View.MemoryView":230
9174  * return memoryview(self, flags, self.dtype_is_object)
9175  *
9176  * def __len__(self): # <<<<<<<<<<<<<<
9177  * return self._shape[0]
9178  *
9179  */
9180 
9181  /* function exit code */
9182  __pyx_L1_error:;
9183  __Pyx_AddTraceback("View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9184  __pyx_r = -1;
9185  __pyx_L0:;
9186  __Pyx_TraceReturn(Py_None, 0);
9187  __Pyx_RefNannyFinishContext();
9188  return __pyx_r;
9189 }
9190 
9191 /* "View.MemoryView":233
9192  * return self._shape[0]
9193  *
9194  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9195  * return getattr(self.memview, attr)
9196  *
9197  */
9198 
9199 /* Python wrapper */
9200 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
9201 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9202  PyObject *__pyx_r = 0;
9203  __Pyx_RefNannyDeclarations
9204  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
9205  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9206 
9207  /* function exit code */
9208  __Pyx_RefNannyFinishContext();
9209  return __pyx_r;
9210 }
9211 
9212 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9213  PyObject *__pyx_r = NULL;
9214  __Pyx_TraceDeclarations
9215  __Pyx_RefNannyDeclarations
9216  PyObject *__pyx_t_1 = NULL;
9217  PyObject *__pyx_t_2 = NULL;
9218  int __pyx_lineno = 0;
9219  const char *__pyx_filename = NULL;
9220  int __pyx_clineno = 0;
9221  __Pyx_RefNannySetupContext("__getattr__", 0);
9222  __Pyx_TraceCall("__getattr__", __pyx_f[1], 233, 0, __PYX_ERR(1, 233, __pyx_L1_error));
9223 
9224  /* "View.MemoryView":234
9225  *
9226  * def __getattr__(self, attr):
9227  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
9228  *
9229  * def __getitem__(self, item):
9230  */
9231  __Pyx_XDECREF(__pyx_r);
9232  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
9233  __Pyx_GOTREF(__pyx_t_1);
9234  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
9235  __Pyx_GOTREF(__pyx_t_2);
9236  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9237  __pyx_r = __pyx_t_2;
9238  __pyx_t_2 = 0;
9239  goto __pyx_L0;
9240 
9241  /* "View.MemoryView":233
9242  * return self._shape[0]
9243  *
9244  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9245  * return getattr(self.memview, attr)
9246  *
9247  */
9248 
9249  /* function exit code */
9250  __pyx_L1_error:;
9251  __Pyx_XDECREF(__pyx_t_1);
9252  __Pyx_XDECREF(__pyx_t_2);
9253  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9254  __pyx_r = NULL;
9255  __pyx_L0:;
9256  __Pyx_XGIVEREF(__pyx_r);
9257  __Pyx_TraceReturn(__pyx_r, 0);
9258  __Pyx_RefNannyFinishContext();
9259  return __pyx_r;
9260 }
9261 
9262 /* "View.MemoryView":236
9263  * return getattr(self.memview, attr)
9264  *
9265  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9266  * return self.memview[item]
9267  *
9268  */
9269 
9270 /* Python wrapper */
9271 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
9272 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9273  PyObject *__pyx_r = 0;
9274  __Pyx_RefNannyDeclarations
9275  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9276  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9277 
9278  /* function exit code */
9279  __Pyx_RefNannyFinishContext();
9280  return __pyx_r;
9281 }
9282 
9283 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9284  PyObject *__pyx_r = NULL;
9285  __Pyx_TraceDeclarations
9286  __Pyx_RefNannyDeclarations
9287  PyObject *__pyx_t_1 = NULL;
9288  PyObject *__pyx_t_2 = NULL;
9289  int __pyx_lineno = 0;
9290  const char *__pyx_filename = NULL;
9291  int __pyx_clineno = 0;
9292  __Pyx_RefNannySetupContext("__getitem__", 0);
9293  __Pyx_TraceCall("__getitem__", __pyx_f[1], 236, 0, __PYX_ERR(1, 236, __pyx_L1_error));
9294 
9295  /* "View.MemoryView":237
9296  *
9297  * def __getitem__(self, item):
9298  * return self.memview[item] # <<<<<<<<<<<<<<
9299  *
9300  * def __setitem__(self, item, value):
9301  */
9302  __Pyx_XDECREF(__pyx_r);
9303  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
9304  __Pyx_GOTREF(__pyx_t_1);
9305  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
9306  __Pyx_GOTREF(__pyx_t_2);
9307  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9308  __pyx_r = __pyx_t_2;
9309  __pyx_t_2 = 0;
9310  goto __pyx_L0;
9311 
9312  /* "View.MemoryView":236
9313  * return getattr(self.memview, attr)
9314  *
9315  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9316  * return self.memview[item]
9317  *
9318  */
9319 
9320  /* function exit code */
9321  __pyx_L1_error:;
9322  __Pyx_XDECREF(__pyx_t_1);
9323  __Pyx_XDECREF(__pyx_t_2);
9324  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9325  __pyx_r = NULL;
9326  __pyx_L0:;
9327  __Pyx_XGIVEREF(__pyx_r);
9328  __Pyx_TraceReturn(__pyx_r, 0);
9329  __Pyx_RefNannyFinishContext();
9330  return __pyx_r;
9331 }
9332 
9333 /* "View.MemoryView":239
9334  * return self.memview[item]
9335  *
9336  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9337  * self.memview[item] = value
9338  *
9339  */
9340 
9341 /* Python wrapper */
9342 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
9343 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9344  int __pyx_r;
9345  __Pyx_RefNannyDeclarations
9346  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9347  __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));
9348 
9349  /* function exit code */
9350  __Pyx_RefNannyFinishContext();
9351  return __pyx_r;
9352 }
9353 
9354 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) {
9355  int __pyx_r;
9356  __Pyx_TraceDeclarations
9357  __Pyx_RefNannyDeclarations
9358  PyObject *__pyx_t_1 = NULL;
9359  int __pyx_lineno = 0;
9360  const char *__pyx_filename = NULL;
9361  int __pyx_clineno = 0;
9362  __Pyx_RefNannySetupContext("__setitem__", 0);
9363  __Pyx_TraceCall("__setitem__", __pyx_f[1], 239, 0, __PYX_ERR(1, 239, __pyx_L1_error));
9364 
9365  /* "View.MemoryView":240
9366  *
9367  * def __setitem__(self, item, value):
9368  * self.memview[item] = value # <<<<<<<<<<<<<<
9369  *
9370  *
9371  */
9372  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
9373  __Pyx_GOTREF(__pyx_t_1);
9374  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
9375  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9376 
9377  /* "View.MemoryView":239
9378  * return self.memview[item]
9379  *
9380  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9381  * self.memview[item] = value
9382  *
9383  */
9384 
9385  /* function exit code */
9386  __pyx_r = 0;
9387  goto __pyx_L0;
9388  __pyx_L1_error:;
9389  __Pyx_XDECREF(__pyx_t_1);
9390  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9391  __pyx_r = -1;
9392  __pyx_L0:;
9393  __Pyx_TraceReturn(Py_None, 0);
9394  __Pyx_RefNannyFinishContext();
9395  return __pyx_r;
9396 }
9397 
9398 /* "(tree fragment)":1
9399  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9400  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9401  * def __setstate_cython__(self, __pyx_state):
9402  */
9403 
9404 /* Python wrapper */
9405 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9406 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
9407 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9408  PyObject *__pyx_r = 0;
9409  __Pyx_RefNannyDeclarations
9410  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9411  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
9412 
9413  /* function exit code */
9414  __Pyx_RefNannyFinishContext();
9415  return __pyx_r;
9416 }
9417 
9418 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
9419  PyObject *__pyx_r = NULL;
9420  __Pyx_TraceDeclarations
9421  __Pyx_RefNannyDeclarations
9422  PyObject *__pyx_t_1 = NULL;
9423  int __pyx_lineno = 0;
9424  const char *__pyx_filename = NULL;
9425  int __pyx_clineno = 0;
9426  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9427  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
9428 
9429  /* "(tree fragment)":2
9430  * def __reduce_cython__(self):
9431  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9432  * def __setstate_cython__(self, __pyx_state):
9433  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9434  */
9435  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9436  __Pyx_GOTREF(__pyx_t_1);
9437  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9438  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9439  __PYX_ERR(1, 2, __pyx_L1_error)
9440 
9441  /* "(tree fragment)":1
9442  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9443  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9444  * def __setstate_cython__(self, __pyx_state):
9445  */
9446 
9447  /* function exit code */
9448  __pyx_L1_error:;
9449  __Pyx_XDECREF(__pyx_t_1);
9450  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9451  __pyx_r = NULL;
9452  __Pyx_XGIVEREF(__pyx_r);
9453  __Pyx_TraceReturn(__pyx_r, 0);
9454  __Pyx_RefNannyFinishContext();
9455  return __pyx_r;
9456 }
9457 
9458 /* "(tree fragment)":3
9459  * def __reduce_cython__(self):
9460  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9461  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9462  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9463  */
9464 
9465 /* Python wrapper */
9466 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9467 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
9468 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9469  PyObject *__pyx_r = 0;
9470  __Pyx_RefNannyDeclarations
9471  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9472  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9473 
9474  /* function exit code */
9475  __Pyx_RefNannyFinishContext();
9476  return __pyx_r;
9477 }
9478 
9479 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) {
9480  PyObject *__pyx_r = NULL;
9481  __Pyx_TraceDeclarations
9482  __Pyx_RefNannyDeclarations
9483  PyObject *__pyx_t_1 = NULL;
9484  int __pyx_lineno = 0;
9485  const char *__pyx_filename = NULL;
9486  int __pyx_clineno = 0;
9487  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9488  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
9489 
9490  /* "(tree fragment)":4
9491  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9492  * def __setstate_cython__(self, __pyx_state):
9493  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9494  */
9495  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
9496  __Pyx_GOTREF(__pyx_t_1);
9497  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9498  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9499  __PYX_ERR(1, 4, __pyx_L1_error)
9500 
9501  /* "(tree fragment)":3
9502  * def __reduce_cython__(self):
9503  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9504  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9505  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9506  */
9507 
9508  /* function exit code */
9509  __pyx_L1_error:;
9510  __Pyx_XDECREF(__pyx_t_1);
9511  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9512  __pyx_r = NULL;
9513  __Pyx_XGIVEREF(__pyx_r);
9514  __Pyx_TraceReturn(__pyx_r, 0);
9515  __Pyx_RefNannyFinishContext();
9516  return __pyx_r;
9517 }
9518 
9519 /* "View.MemoryView":244
9520  *
9521  * @cname("__pyx_array_new")
9522  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9523  * char *mode, char *buf):
9524  * cdef array result
9525  */
9526 
9527 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) {
9528  struct __pyx_array_obj *__pyx_v_result = 0;
9529  struct __pyx_array_obj *__pyx_r = NULL;
9530  __Pyx_TraceDeclarations
9531  __Pyx_RefNannyDeclarations
9532  int __pyx_t_1;
9533  PyObject *__pyx_t_2 = NULL;
9534  PyObject *__pyx_t_3 = NULL;
9535  PyObject *__pyx_t_4 = NULL;
9536  PyObject *__pyx_t_5 = NULL;
9537  int __pyx_lineno = 0;
9538  const char *__pyx_filename = NULL;
9539  int __pyx_clineno = 0;
9540  __Pyx_RefNannySetupContext("array_cwrapper", 0);
9541  __Pyx_TraceCall("array_cwrapper", __pyx_f[1], 244, 0, __PYX_ERR(1, 244, __pyx_L1_error));
9542 
9543  /* "View.MemoryView":248
9544  * cdef array result
9545  *
9546  * if buf == NULL: # <<<<<<<<<<<<<<
9547  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9548  * else:
9549  */
9550  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9551  if (__pyx_t_1) {
9552 
9553  /* "View.MemoryView":249
9554  *
9555  * if buf == NULL:
9556  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
9557  * else:
9558  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9559  */
9560  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
9561  __Pyx_GOTREF(__pyx_t_2);
9562  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
9563  __Pyx_GOTREF(__pyx_t_3);
9564  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9565  __Pyx_GOTREF(__pyx_t_4);
9566  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
9567  __Pyx_GOTREF(__pyx_t_5);
9568  __Pyx_INCREF(__pyx_v_shape);
9569  __Pyx_GIVEREF(__pyx_v_shape);
9570  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
9571  __Pyx_GIVEREF(__pyx_t_2);
9572  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9573  __Pyx_GIVEREF(__pyx_t_3);
9574  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
9575  __Pyx_GIVEREF(__pyx_t_4);
9576  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
9577  __pyx_t_2 = 0;
9578  __pyx_t_3 = 0;
9579  __pyx_t_4 = 0;
9580  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9581  __Pyx_GOTREF(__pyx_t_4);
9582  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9583  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
9584  __pyx_t_4 = 0;
9585 
9586  /* "View.MemoryView":248
9587  * cdef array result
9588  *
9589  * if buf == NULL: # <<<<<<<<<<<<<<
9590  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9591  * else:
9592  */
9593  goto __pyx_L3;
9594  }
9595 
9596  /* "View.MemoryView":251
9597  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9598  * else:
9599  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9600  * allocate_buffer=False)
9601  * result.data = buf
9602  */
9603  /*else*/ {
9604  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
9605  __Pyx_GOTREF(__pyx_t_4);
9606  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
9607  __Pyx_GOTREF(__pyx_t_5);
9608  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
9609  __Pyx_GOTREF(__pyx_t_3);
9610  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
9611  __Pyx_GOTREF(__pyx_t_2);
9612  __Pyx_INCREF(__pyx_v_shape);
9613  __Pyx_GIVEREF(__pyx_v_shape);
9614  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
9615  __Pyx_GIVEREF(__pyx_t_4);
9616  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9617  __Pyx_GIVEREF(__pyx_t_5);
9618  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
9619  __Pyx_GIVEREF(__pyx_t_3);
9620  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
9621  __pyx_t_4 = 0;
9622  __pyx_t_5 = 0;
9623  __pyx_t_3 = 0;
9624 
9625  /* "View.MemoryView":252
9626  * else:
9627  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9628  * allocate_buffer=False) # <<<<<<<<<<<<<<
9629  * result.data = buf
9630  *
9631  */
9632  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
9633  __Pyx_GOTREF(__pyx_t_3);
9634  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
9635 
9636  /* "View.MemoryView":251
9637  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9638  * else:
9639  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9640  * allocate_buffer=False)
9641  * result.data = buf
9642  */
9643  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
9644  __Pyx_GOTREF(__pyx_t_5);
9645  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9646  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9647  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
9648  __pyx_t_5 = 0;
9649 
9650  /* "View.MemoryView":253
9651  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9652  * allocate_buffer=False)
9653  * result.data = buf # <<<<<<<<<<<<<<
9654  *
9655  * return result
9656  */
9657  __pyx_v_result->data = __pyx_v_buf;
9658  }
9659  __pyx_L3:;
9660 
9661  /* "View.MemoryView":255
9662  * result.data = buf
9663  *
9664  * return result # <<<<<<<<<<<<<<
9665  *
9666  *
9667  */
9668  __Pyx_XDECREF(((PyObject *)__pyx_r));
9669  __Pyx_INCREF(((PyObject *)__pyx_v_result));
9670  __pyx_r = __pyx_v_result;
9671  goto __pyx_L0;
9672 
9673  /* "View.MemoryView":244
9674  *
9675  * @cname("__pyx_array_new")
9676  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9677  * char *mode, char *buf):
9678  * cdef array result
9679  */
9680 
9681  /* function exit code */
9682  __pyx_L1_error:;
9683  __Pyx_XDECREF(__pyx_t_2);
9684  __Pyx_XDECREF(__pyx_t_3);
9685  __Pyx_XDECREF(__pyx_t_4);
9686  __Pyx_XDECREF(__pyx_t_5);
9687  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
9688  __pyx_r = 0;
9689  __pyx_L0:;
9690  __Pyx_XDECREF((PyObject *)__pyx_v_result);
9691  __Pyx_XGIVEREF((PyObject *)__pyx_r);
9692  __Pyx_TraceReturn(__pyx_r, 0);
9693  __Pyx_RefNannyFinishContext();
9694  return __pyx_r;
9695 }
9696 
9697 /* "View.MemoryView":281
9698  * cdef class Enum(object):
9699  * cdef object name
9700  * def __init__(self, name): # <<<<<<<<<<<<<<
9701  * self.name = name
9702  * def __repr__(self):
9703  */
9704 
9705 /* Python wrapper */
9706 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9707 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9708  PyObject *__pyx_v_name = 0;
9709  int __pyx_lineno = 0;
9710  const char *__pyx_filename = NULL;
9711  int __pyx_clineno = 0;
9712  int __pyx_r;
9713  __Pyx_RefNannyDeclarations
9714  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
9715  {
9716  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9717  PyObject* values[1] = {0};
9718  if (unlikely(__pyx_kwds)) {
9719  Py_ssize_t kw_args;
9720  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9721  switch (pos_args) {
9722  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9723  CYTHON_FALLTHROUGH;
9724  case 0: break;
9725  default: goto __pyx_L5_argtuple_error;
9726  }
9727  kw_args = PyDict_Size(__pyx_kwds);
9728  switch (pos_args) {
9729  case 0:
9730  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
9731  else goto __pyx_L5_argtuple_error;
9732  }
9733  if (unlikely(kw_args > 0)) {
9734  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
9735  }
9736  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9737  goto __pyx_L5_argtuple_error;
9738  } else {
9739  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9740  }
9741  __pyx_v_name = values[0];
9742  }
9743  goto __pyx_L4_argument_unpacking_done;
9744  __pyx_L5_argtuple_error:;
9745  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
9746  __pyx_L3_error:;
9747  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9748  __Pyx_RefNannyFinishContext();
9749  return -1;
9750  __pyx_L4_argument_unpacking_done:;
9751  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
9752 
9753  /* function exit code */
9754  __Pyx_RefNannyFinishContext();
9755  return __pyx_r;
9756 }
9757 
9758 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
9759  int __pyx_r;
9760  __Pyx_TraceDeclarations
9761  __Pyx_RefNannyDeclarations
9762  int __pyx_lineno = 0;
9763  const char *__pyx_filename = NULL;
9764  int __pyx_clineno = 0;
9765  __Pyx_RefNannySetupContext("__init__", 0);
9766  __Pyx_TraceCall("__init__", __pyx_f[1], 281, 0, __PYX_ERR(1, 281, __pyx_L1_error));
9767 
9768  /* "View.MemoryView":282
9769  * cdef object name
9770  * def __init__(self, name):
9771  * self.name = name # <<<<<<<<<<<<<<
9772  * def __repr__(self):
9773  * return self.name
9774  */
9775  __Pyx_INCREF(__pyx_v_name);
9776  __Pyx_GIVEREF(__pyx_v_name);
9777  __Pyx_GOTREF(__pyx_v_self->name);
9778  __Pyx_DECREF(__pyx_v_self->name);
9779  __pyx_v_self->name = __pyx_v_name;
9780 
9781  /* "View.MemoryView":281
9782  * cdef class Enum(object):
9783  * cdef object name
9784  * def __init__(self, name): # <<<<<<<<<<<<<<
9785  * self.name = name
9786  * def __repr__(self):
9787  */
9788 
9789  /* function exit code */
9790  __pyx_r = 0;
9791  goto __pyx_L0;
9792  __pyx_L1_error:;
9793  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9794  __pyx_r = -1;
9795  __pyx_L0:;
9796  __Pyx_TraceReturn(Py_None, 0);
9797  __Pyx_RefNannyFinishContext();
9798  return __pyx_r;
9799 }
9800 
9801 /* "View.MemoryView":283
9802  * def __init__(self, name):
9803  * self.name = name
9804  * def __repr__(self): # <<<<<<<<<<<<<<
9805  * return self.name
9806  *
9807  */
9808 
9809 /* Python wrapper */
9810 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
9811 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
9812  PyObject *__pyx_r = 0;
9813  __Pyx_RefNannyDeclarations
9814  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
9815  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9816 
9817  /* function exit code */
9818  __Pyx_RefNannyFinishContext();
9819  return __pyx_r;
9820 }
9821 
9822 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9823  PyObject *__pyx_r = NULL;
9824  __Pyx_TraceDeclarations
9825  __Pyx_RefNannyDeclarations
9826  int __pyx_lineno = 0;
9827  const char *__pyx_filename = NULL;
9828  int __pyx_clineno = 0;
9829  __Pyx_RefNannySetupContext("__repr__", 0);
9830  __Pyx_TraceCall("__repr__", __pyx_f[1], 283, 0, __PYX_ERR(1, 283, __pyx_L1_error));
9831 
9832  /* "View.MemoryView":284
9833  * self.name = name
9834  * def __repr__(self):
9835  * return self.name # <<<<<<<<<<<<<<
9836  *
9837  * cdef generic = Enum("<strided and direct or indirect>")
9838  */
9839  __Pyx_XDECREF(__pyx_r);
9840  __Pyx_INCREF(__pyx_v_self->name);
9841  __pyx_r = __pyx_v_self->name;
9842  goto __pyx_L0;
9843 
9844  /* "View.MemoryView":283
9845  * def __init__(self, name):
9846  * self.name = name
9847  * def __repr__(self): # <<<<<<<<<<<<<<
9848  * return self.name
9849  *
9850  */
9851 
9852  /* function exit code */
9853  __pyx_L1_error:;
9854  __Pyx_AddTraceback("View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9855  __pyx_r = NULL;
9856  __pyx_L0:;
9857  __Pyx_XGIVEREF(__pyx_r);
9858  __Pyx_TraceReturn(__pyx_r, 0);
9859  __Pyx_RefNannyFinishContext();
9860  return __pyx_r;
9861 }
9862 
9863 /* "(tree fragment)":1
9864  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9865  * cdef tuple state
9866  * cdef object _dict
9867  */
9868 
9869 /* Python wrapper */
9870 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9871 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
9872 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9873  PyObject *__pyx_r = 0;
9874  __Pyx_RefNannyDeclarations
9875  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9876  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9877 
9878  /* function exit code */
9879  __Pyx_RefNannyFinishContext();
9880  return __pyx_r;
9881 }
9882 
9883 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9884  PyObject *__pyx_v_state = 0;
9885  PyObject *__pyx_v__dict = 0;
9886  int __pyx_v_use_setstate;
9887  PyObject *__pyx_r = NULL;
9888  __Pyx_TraceDeclarations
9889  __Pyx_RefNannyDeclarations
9890  PyObject *__pyx_t_1 = NULL;
9891  int __pyx_t_2;
9892  int __pyx_t_3;
9893  PyObject *__pyx_t_4 = NULL;
9894  PyObject *__pyx_t_5 = NULL;
9895  int __pyx_lineno = 0;
9896  const char *__pyx_filename = NULL;
9897  int __pyx_clineno = 0;
9898  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9899  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
9900 
9901  /* "(tree fragment)":5
9902  * cdef object _dict
9903  * cdef bint use_setstate
9904  * state = (self.name,) # <<<<<<<<<<<<<<
9905  * _dict = getattr(self, '__dict__', None)
9906  * if _dict is not None:
9907  */
9908  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9909  __Pyx_GOTREF(__pyx_t_1);
9910  __Pyx_INCREF(__pyx_v_self->name);
9911  __Pyx_GIVEREF(__pyx_v_self->name);
9912  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
9913  __pyx_v_state = ((PyObject*)__pyx_t_1);
9914  __pyx_t_1 = 0;
9915 
9916  /* "(tree fragment)":6
9917  * cdef bint use_setstate
9918  * state = (self.name,)
9919  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
9920  * if _dict is not None:
9921  * state += (_dict,)
9922  */
9923  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
9924  __Pyx_GOTREF(__pyx_t_1);
9925  __pyx_v__dict = __pyx_t_1;
9926  __pyx_t_1 = 0;
9927 
9928  /* "(tree fragment)":7
9929  * state = (self.name,)
9930  * _dict = getattr(self, '__dict__', None)
9931  * if _dict is not None: # <<<<<<<<<<<<<<
9932  * state += (_dict,)
9933  * use_setstate = True
9934  */
9935  __pyx_t_2 = (__pyx_v__dict != Py_None);
9936  __pyx_t_3 = (__pyx_t_2 != 0);
9937  if (__pyx_t_3) {
9938 
9939  /* "(tree fragment)":8
9940  * _dict = getattr(self, '__dict__', None)
9941  * if _dict is not None:
9942  * state += (_dict,) # <<<<<<<<<<<<<<
9943  * use_setstate = True
9944  * else:
9945  */
9946  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
9947  __Pyx_GOTREF(__pyx_t_1);
9948  __Pyx_INCREF(__pyx_v__dict);
9949  __Pyx_GIVEREF(__pyx_v__dict);
9950  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
9951  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9952  __Pyx_GOTREF(__pyx_t_4);
9953  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9954  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9955  __pyx_t_4 = 0;
9956 
9957  /* "(tree fragment)":9
9958  * if _dict is not None:
9959  * state += (_dict,)
9960  * use_setstate = True # <<<<<<<<<<<<<<
9961  * else:
9962  * use_setstate = self.name is not None
9963  */
9964  __pyx_v_use_setstate = 1;
9965 
9966  /* "(tree fragment)":7
9967  * state = (self.name,)
9968  * _dict = getattr(self, '__dict__', None)
9969  * if _dict is not None: # <<<<<<<<<<<<<<
9970  * state += (_dict,)
9971  * use_setstate = True
9972  */
9973  goto __pyx_L3;
9974  }
9975 
9976  /* "(tree fragment)":11
9977  * use_setstate = True
9978  * else:
9979  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
9980  * if use_setstate:
9981  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9982  */
9983  /*else*/ {
9984  __pyx_t_3 = (__pyx_v_self->name != Py_None);
9985  __pyx_v_use_setstate = __pyx_t_3;
9986  }
9987  __pyx_L3:;
9988 
9989  /* "(tree fragment)":12
9990  * else:
9991  * use_setstate = self.name is not None
9992  * if use_setstate: # <<<<<<<<<<<<<<
9993  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9994  * else:
9995  */
9996  __pyx_t_3 = (__pyx_v_use_setstate != 0);
9997  if (__pyx_t_3) {
9998 
9999  /* "(tree fragment)":13
10000  * use_setstate = self.name is not None
10001  * if use_setstate:
10002  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
10003  * else:
10004  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10005  */
10006  __Pyx_XDECREF(__pyx_r);
10007  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
10008  __Pyx_GOTREF(__pyx_t_4);
10009  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
10010  __Pyx_GOTREF(__pyx_t_1);
10011  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10012  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10013  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10014  __Pyx_INCREF(__pyx_int_184977713);
10015  __Pyx_GIVEREF(__pyx_int_184977713);
10016  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10017  __Pyx_INCREF(Py_None);
10018  __Pyx_GIVEREF(Py_None);
10019  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10020  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
10021  __Pyx_GOTREF(__pyx_t_5);
10022  __Pyx_GIVEREF(__pyx_t_4);
10023  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10024  __Pyx_GIVEREF(__pyx_t_1);
10025  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10026  __Pyx_INCREF(__pyx_v_state);
10027  __Pyx_GIVEREF(__pyx_v_state);
10028  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10029  __pyx_t_4 = 0;
10030  __pyx_t_1 = 0;
10031  __pyx_r = __pyx_t_5;
10032  __pyx_t_5 = 0;
10033  goto __pyx_L0;
10034 
10035  /* "(tree fragment)":12
10036  * else:
10037  * use_setstate = self.name is not None
10038  * if use_setstate: # <<<<<<<<<<<<<<
10039  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10040  * else:
10041  */
10042  }
10043 
10044  /* "(tree fragment)":15
10045  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10046  * else:
10047  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
10048  * def __setstate_cython__(self, __pyx_state):
10049  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10050  */
10051  /*else*/ {
10052  __Pyx_XDECREF(__pyx_r);
10053  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
10054  __Pyx_GOTREF(__pyx_t_5);
10055  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
10056  __Pyx_GOTREF(__pyx_t_1);
10057  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10058  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10059  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10060  __Pyx_INCREF(__pyx_int_184977713);
10061  __Pyx_GIVEREF(__pyx_int_184977713);
10062  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10063  __Pyx_INCREF(__pyx_v_state);
10064  __Pyx_GIVEREF(__pyx_v_state);
10065  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10066  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
10067  __Pyx_GOTREF(__pyx_t_4);
10068  __Pyx_GIVEREF(__pyx_t_5);
10069  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10070  __Pyx_GIVEREF(__pyx_t_1);
10071  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10072  __pyx_t_5 = 0;
10073  __pyx_t_1 = 0;
10074  __pyx_r = __pyx_t_4;
10075  __pyx_t_4 = 0;
10076  goto __pyx_L0;
10077  }
10078 
10079  /* "(tree fragment)":1
10080  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10081  * cdef tuple state
10082  * cdef object _dict
10083  */
10084 
10085  /* function exit code */
10086  __pyx_L1_error:;
10087  __Pyx_XDECREF(__pyx_t_1);
10088  __Pyx_XDECREF(__pyx_t_4);
10089  __Pyx_XDECREF(__pyx_t_5);
10090  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10091  __pyx_r = NULL;
10092  __pyx_L0:;
10093  __Pyx_XDECREF(__pyx_v_state);
10094  __Pyx_XDECREF(__pyx_v__dict);
10095  __Pyx_XGIVEREF(__pyx_r);
10096  __Pyx_TraceReturn(__pyx_r, 0);
10097  __Pyx_RefNannyFinishContext();
10098  return __pyx_r;
10099 }
10100 
10101 /* "(tree fragment)":16
10102  * else:
10103  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10104  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10105  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10106  */
10107 
10108 /* Python wrapper */
10109 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10110 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
10111 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10112  PyObject *__pyx_r = 0;
10113  __Pyx_RefNannyDeclarations
10114  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10115  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10116 
10117  /* function exit code */
10118  __Pyx_RefNannyFinishContext();
10119  return __pyx_r;
10120 }
10121 
10122 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10123  PyObject *__pyx_r = NULL;
10124  __Pyx_TraceDeclarations
10125  __Pyx_RefNannyDeclarations
10126  PyObject *__pyx_t_1 = NULL;
10127  int __pyx_lineno = 0;
10128  const char *__pyx_filename = NULL;
10129  int __pyx_clineno = 0;
10130  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10131  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
10132 
10133  /* "(tree fragment)":17
10134  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10135  * def __setstate_cython__(self, __pyx_state):
10136  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
10137  */
10138  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
10139  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
10140  __Pyx_GOTREF(__pyx_t_1);
10141  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10142 
10143  /* "(tree fragment)":16
10144  * else:
10145  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10146  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10147  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10148  */
10149 
10150  /* function exit code */
10151  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10152  goto __pyx_L0;
10153  __pyx_L1_error:;
10154  __Pyx_XDECREF(__pyx_t_1);
10155  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10156  __pyx_r = NULL;
10157  __pyx_L0:;
10158  __Pyx_XGIVEREF(__pyx_r);
10159  __Pyx_TraceReturn(__pyx_r, 0);
10160  __Pyx_RefNannyFinishContext();
10161  return __pyx_r;
10162 }
10163 
10164 /* "View.MemoryView":298
10165  *
10166  * @cname('__pyx_align_pointer')
10167  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10168  * "Align pointer memory on a given boundary"
10169  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10170  */
10171 
10172 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
10173  Py_intptr_t __pyx_v_aligned_p;
10174  size_t __pyx_v_offset;
10175  void *__pyx_r;
10176  __Pyx_TraceDeclarations
10177  int __pyx_t_1;
10178  int __pyx_lineno = 0;
10179  const char *__pyx_filename = NULL;
10180  int __pyx_clineno = 0;
10181  __Pyx_TraceCall("align_pointer", __pyx_f[1], 298, 1, __PYX_ERR(1, 298, __pyx_L1_error));
10182 
10183  /* "View.MemoryView":300
10184  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
10185  * "Align pointer memory on a given boundary"
10186  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
10187  * cdef size_t offset
10188  *
10189  */
10190  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10191 
10192  /* "View.MemoryView":304
10193  *
10194  * with cython.cdivision(True):
10195  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
10196  *
10197  * if offset > 0:
10198  */
10199  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10200 
10201  /* "View.MemoryView":306
10202  * offset = aligned_p % alignment
10203  *
10204  * if offset > 0: # <<<<<<<<<<<<<<
10205  * aligned_p += alignment - offset
10206  *
10207  */
10208  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10209  if (__pyx_t_1) {
10210 
10211  /* "View.MemoryView":307
10212  *
10213  * if offset > 0:
10214  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
10215  *
10216  * return <void *> aligned_p
10217  */
10218  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10219 
10220  /* "View.MemoryView":306
10221  * offset = aligned_p % alignment
10222  *
10223  * if offset > 0: # <<<<<<<<<<<<<<
10224  * aligned_p += alignment - offset
10225  *
10226  */
10227  }
10228 
10229  /* "View.MemoryView":309
10230  * aligned_p += alignment - offset
10231  *
10232  * return <void *> aligned_p # <<<<<<<<<<<<<<
10233  *
10234  *
10235  */
10236  __pyx_r = ((void *)__pyx_v_aligned_p);
10237  goto __pyx_L0;
10238 
10239  /* "View.MemoryView":298
10240  *
10241  * @cname('__pyx_align_pointer')
10242  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10243  * "Align pointer memory on a given boundary"
10244  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10245  */
10246 
10247  /* function exit code */
10248  __pyx_L1_error:;
10249  __Pyx_WriteUnraisable("View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
10250  __pyx_r = 0;
10251  __pyx_L0:;
10252  __Pyx_TraceReturn(Py_None, 1);
10253  return __pyx_r;
10254 }
10255 
10256 /* "View.MemoryView":345
10257  * cdef __Pyx_TypeInfo *typeinfo
10258  *
10259  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10260  * self.obj = obj
10261  * self.flags = flags
10262  */
10263 
10264 /* Python wrapper */
10265 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10266 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10267  PyObject *__pyx_v_obj = 0;
10268  int __pyx_v_flags;
10269  int __pyx_v_dtype_is_object;
10270  int __pyx_lineno = 0;
10271  const char *__pyx_filename = NULL;
10272  int __pyx_clineno = 0;
10273  int __pyx_r;
10274  __Pyx_RefNannyDeclarations
10275  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10276  {
10277  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10278  PyObject* values[3] = {0,0,0};
10279  if (unlikely(__pyx_kwds)) {
10280  Py_ssize_t kw_args;
10281  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10282  switch (pos_args) {
10283  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10284  CYTHON_FALLTHROUGH;
10285  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10286  CYTHON_FALLTHROUGH;
10287  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10288  CYTHON_FALLTHROUGH;
10289  case 0: break;
10290  default: goto __pyx_L5_argtuple_error;
10291  }
10292  kw_args = PyDict_Size(__pyx_kwds);
10293  switch (pos_args) {
10294  case 0:
10295  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10296  else goto __pyx_L5_argtuple_error;
10297  CYTHON_FALLTHROUGH;
10298  case 1:
10299  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10300  else {
10301  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
10302  }
10303  CYTHON_FALLTHROUGH;
10304  case 2:
10305  if (kw_args > 0) {
10306  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10307  if (value) { values[2] = value; kw_args--; }
10308  }
10309  }
10310  if (unlikely(kw_args > 0)) {
10311  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
10312  }
10313  } else {
10314  switch (PyTuple_GET_SIZE(__pyx_args)) {
10315  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10316  CYTHON_FALLTHROUGH;
10317  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10318  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10319  break;
10320  default: goto __pyx_L5_argtuple_error;
10321  }
10322  }
10323  __pyx_v_obj = values[0];
10324  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10325  if (values[2]) {
10326  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10327  } else {
10328  __pyx_v_dtype_is_object = ((int)0);
10329  }
10330  }
10331  goto __pyx_L4_argument_unpacking_done;
10332  __pyx_L5_argtuple_error:;
10333  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
10334  __pyx_L3_error:;
10335  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10336  __Pyx_RefNannyFinishContext();
10337  return -1;
10338  __pyx_L4_argument_unpacking_done:;
10339  __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);
10340 
10341  /* function exit code */
10342  __Pyx_RefNannyFinishContext();
10343  return __pyx_r;
10344 }
10345 
10346 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) {
10347  int __pyx_r;
10348  __Pyx_TraceDeclarations
10349  __Pyx_RefNannyDeclarations
10350  int __pyx_t_1;
10351  int __pyx_t_2;
10352  int __pyx_t_3;
10353  int __pyx_t_4;
10354  int __pyx_lineno = 0;
10355  const char *__pyx_filename = NULL;
10356  int __pyx_clineno = 0;
10357  __Pyx_RefNannySetupContext("__cinit__", 0);
10358  __Pyx_TraceCall("__cinit__", __pyx_f[1], 345, 0, __PYX_ERR(1, 345, __pyx_L1_error));
10359 
10360  /* "View.MemoryView":346
10361  *
10362  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10363  * self.obj = obj # <<<<<<<<<<<<<<
10364  * self.flags = flags
10365  * if type(self) is memoryview or obj is not None:
10366  */
10367  __Pyx_INCREF(__pyx_v_obj);
10368  __Pyx_GIVEREF(__pyx_v_obj);
10369  __Pyx_GOTREF(__pyx_v_self->obj);
10370  __Pyx_DECREF(__pyx_v_self->obj);
10371  __pyx_v_self->obj = __pyx_v_obj;
10372 
10373  /* "View.MemoryView":347
10374  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10375  * self.obj = obj
10376  * self.flags = flags # <<<<<<<<<<<<<<
10377  * if type(self) is memoryview or obj is not None:
10378  * __Pyx_GetBuffer(obj, &self.view, flags)
10379  */
10380  __pyx_v_self->flags = __pyx_v_flags;
10381 
10382  /* "View.MemoryView":348
10383  * self.obj = obj
10384  * self.flags = flags
10385  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10386  * __Pyx_GetBuffer(obj, &self.view, flags)
10387  * if <PyObject *> self.view.obj == NULL:
10388  */
10389  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10390  __pyx_t_3 = (__pyx_t_2 != 0);
10391  if (!__pyx_t_3) {
10392  } else {
10393  __pyx_t_1 = __pyx_t_3;
10394  goto __pyx_L4_bool_binop_done;
10395  }
10396  __pyx_t_3 = (__pyx_v_obj != Py_None);
10397  __pyx_t_2 = (__pyx_t_3 != 0);
10398  __pyx_t_1 = __pyx_t_2;
10399  __pyx_L4_bool_binop_done:;
10400  if (__pyx_t_1) {
10401 
10402  /* "View.MemoryView":349
10403  * self.flags = flags
10404  * if type(self) is memoryview or obj is not None:
10405  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
10406  * if <PyObject *> self.view.obj == NULL:
10407  * (<__pyx_buffer *> &self.view).obj = Py_None
10408  */
10409  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
10410 
10411  /* "View.MemoryView":350
10412  * if type(self) is memoryview or obj is not None:
10413  * __Pyx_GetBuffer(obj, &self.view, flags)
10414  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10415  * (<__pyx_buffer *> &self.view).obj = Py_None
10416  * Py_INCREF(Py_None)
10417  */
10418  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10419  if (__pyx_t_1) {
10420 
10421  /* "View.MemoryView":351
10422  * __Pyx_GetBuffer(obj, &self.view, flags)
10423  * if <PyObject *> self.view.obj == NULL:
10424  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
10425  * Py_INCREF(Py_None)
10426  *
10427  */
10428  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10429 
10430  /* "View.MemoryView":352
10431  * if <PyObject *> self.view.obj == NULL:
10432  * (<__pyx_buffer *> &self.view).obj = Py_None
10433  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
10434  *
10435  * global __pyx_memoryview_thread_locks_used
10436  */
10437  Py_INCREF(Py_None);
10438 
10439  /* "View.MemoryView":350
10440  * if type(self) is memoryview or obj is not None:
10441  * __Pyx_GetBuffer(obj, &self.view, flags)
10442  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10443  * (<__pyx_buffer *> &self.view).obj = Py_None
10444  * Py_INCREF(Py_None)
10445  */
10446  }
10447 
10448  /* "View.MemoryView":348
10449  * self.obj = obj
10450  * self.flags = flags
10451  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10452  * __Pyx_GetBuffer(obj, &self.view, flags)
10453  * if <PyObject *> self.view.obj == NULL:
10454  */
10455  }
10456 
10457  /* "View.MemoryView":355
10458  *
10459  * global __pyx_memoryview_thread_locks_used
10460  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10461  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10462  * __pyx_memoryview_thread_locks_used += 1
10463  */
10464  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10465  if (__pyx_t_1) {
10466 
10467  /* "View.MemoryView":356
10468  * global __pyx_memoryview_thread_locks_used
10469  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10470  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
10471  * __pyx_memoryview_thread_locks_used += 1
10472  * if self.lock is NULL:
10473  */
10474  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10475 
10476  /* "View.MemoryView":357
10477  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10478  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10479  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
10480  * if self.lock is NULL:
10481  * self.lock = PyThread_allocate_lock()
10482  */
10483  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10484 
10485  /* "View.MemoryView":355
10486  *
10487  * global __pyx_memoryview_thread_locks_used
10488  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10489  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10490  * __pyx_memoryview_thread_locks_used += 1
10491  */
10492  }
10493 
10494  /* "View.MemoryView":358
10495  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10496  * __pyx_memoryview_thread_locks_used += 1
10497  * if self.lock is NULL: # <<<<<<<<<<<<<<
10498  * self.lock = PyThread_allocate_lock()
10499  * if self.lock is NULL:
10500  */
10501  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10502  if (__pyx_t_1) {
10503 
10504  /* "View.MemoryView":359
10505  * __pyx_memoryview_thread_locks_used += 1
10506  * if self.lock is NULL:
10507  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
10508  * if self.lock is NULL:
10509  * raise MemoryError
10510  */
10511  __pyx_v_self->lock = PyThread_allocate_lock();
10512 
10513  /* "View.MemoryView":360
10514  * if self.lock is NULL:
10515  * self.lock = PyThread_allocate_lock()
10516  * if self.lock is NULL: # <<<<<<<<<<<<<<
10517  * raise MemoryError
10518  *
10519  */
10520  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10521  if (unlikely(__pyx_t_1)) {
10522 
10523  /* "View.MemoryView":361
10524  * self.lock = PyThread_allocate_lock()
10525  * if self.lock is NULL:
10526  * raise MemoryError # <<<<<<<<<<<<<<
10527  *
10528  * if flags & PyBUF_FORMAT:
10529  */
10530  PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
10531 
10532  /* "View.MemoryView":360
10533  * if self.lock is NULL:
10534  * self.lock = PyThread_allocate_lock()
10535  * if self.lock is NULL: # <<<<<<<<<<<<<<
10536  * raise MemoryError
10537  *
10538  */
10539  }
10540 
10541  /* "View.MemoryView":358
10542  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10543  * __pyx_memoryview_thread_locks_used += 1
10544  * if self.lock is NULL: # <<<<<<<<<<<<<<
10545  * self.lock = PyThread_allocate_lock()
10546  * if self.lock is NULL:
10547  */
10548  }
10549 
10550  /* "View.MemoryView":363
10551  * raise MemoryError
10552  *
10553  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10554  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10555  * else:
10556  */
10557  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10558  if (__pyx_t_1) {
10559 
10560  /* "View.MemoryView":364
10561  *
10562  * if flags & PyBUF_FORMAT:
10563  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
10564  * else:
10565  * self.dtype_is_object = dtype_is_object
10566  */
10567  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
10568  if (__pyx_t_2) {
10569  } else {
10570  __pyx_t_1 = __pyx_t_2;
10571  goto __pyx_L11_bool_binop_done;
10572  }
10573  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
10574  __pyx_t_1 = __pyx_t_2;
10575  __pyx_L11_bool_binop_done:;
10576  __pyx_v_self->dtype_is_object = __pyx_t_1;
10577 
10578  /* "View.MemoryView":363
10579  * raise MemoryError
10580  *
10581  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10582  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10583  * else:
10584  */
10585  goto __pyx_L10;
10586  }
10587 
10588  /* "View.MemoryView":366
10589  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10590  * else:
10591  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
10592  *
10593  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10594  */
10595  /*else*/ {
10596  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10597  }
10598  __pyx_L10:;
10599 
10600  /* "View.MemoryView":368
10601  * self.dtype_is_object = dtype_is_object
10602  *
10603  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
10604  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10605  * self.typeinfo = NULL
10606  */
10607  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
10608 
10609  /* "View.MemoryView":370
10610  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10611  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10612  * self.typeinfo = NULL # <<<<<<<<<<<<<<
10613  *
10614  * def __dealloc__(memoryview self):
10615  */
10616  __pyx_v_self->typeinfo = NULL;
10617 
10618  /* "View.MemoryView":345
10619  * cdef __Pyx_TypeInfo *typeinfo
10620  *
10621  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10622  * self.obj = obj
10623  * self.flags = flags
10624  */
10625 
10626  /* function exit code */
10627  __pyx_r = 0;
10628  goto __pyx_L0;
10629  __pyx_L1_error:;
10630  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10631  __pyx_r = -1;
10632  __pyx_L0:;
10633  __Pyx_TraceReturn(Py_None, 0);
10634  __Pyx_RefNannyFinishContext();
10635  return __pyx_r;
10636 }
10637 
10638 /* "View.MemoryView":372
10639  * self.typeinfo = NULL
10640  *
10641  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10642  * if self.obj is not None:
10643  * __Pyx_ReleaseBuffer(&self.view)
10644  */
10645 
10646 /* Python wrapper */
10647 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
10648 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10649  __Pyx_RefNannyDeclarations
10650  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10651  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10652 
10653  /* function exit code */
10654  __Pyx_RefNannyFinishContext();
10655 }
10656 
10657 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
10658  int __pyx_v_i;
10659  __Pyx_TraceDeclarations
10660  __Pyx_RefNannyDeclarations
10661  int __pyx_t_1;
10662  int __pyx_t_2;
10663  int __pyx_t_3;
10664  int __pyx_t_4;
10665  int __pyx_t_5;
10666  PyThread_type_lock __pyx_t_6;
10667  PyThread_type_lock __pyx_t_7;
10668  int __pyx_lineno = 0;
10669  const char *__pyx_filename = NULL;
10670  int __pyx_clineno = 0;
10671  __Pyx_RefNannySetupContext("__dealloc__", 0);
10672  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 372, 0, __PYX_ERR(1, 372, __pyx_L1_error));
10673 
10674  /* "View.MemoryView":373
10675  *
10676  * def __dealloc__(memoryview self):
10677  * if self.obj is not None: # <<<<<<<<<<<<<<
10678  * __Pyx_ReleaseBuffer(&self.view)
10679  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10680  */
10681  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10682  __pyx_t_2 = (__pyx_t_1 != 0);
10683  if (__pyx_t_2) {
10684 
10685  /* "View.MemoryView":374
10686  * def __dealloc__(memoryview self):
10687  * if self.obj is not None:
10688  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
10689  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10690  *
10691  */
10692  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10693 
10694  /* "View.MemoryView":373
10695  *
10696  * def __dealloc__(memoryview self):
10697  * if self.obj is not None: # <<<<<<<<<<<<<<
10698  * __Pyx_ReleaseBuffer(&self.view)
10699  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10700  */
10701  goto __pyx_L3;
10702  }
10703 
10704  /* "View.MemoryView":375
10705  * if self.obj is not None:
10706  * __Pyx_ReleaseBuffer(&self.view)
10707  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
10708  *
10709  * (<__pyx_buffer *> &self.view).obj = NULL
10710  */
10711  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
10712  if (__pyx_t_2) {
10713 
10714  /* "View.MemoryView":377
10715  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10716  *
10717  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
10718  * Py_DECREF(Py_None)
10719  *
10720  */
10721  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
10722 
10723  /* "View.MemoryView":378
10724  *
10725  * (<__pyx_buffer *> &self.view).obj = NULL
10726  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
10727  *
10728  * cdef int i
10729  */
10730  Py_DECREF(Py_None);
10731 
10732  /* "View.MemoryView":375
10733  * if self.obj is not None:
10734  * __Pyx_ReleaseBuffer(&self.view)
10735  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
10736  *
10737  * (<__pyx_buffer *> &self.view).obj = NULL
10738  */
10739  }
10740  __pyx_L3:;
10741 
10742  /* "View.MemoryView":382
10743  * cdef int i
10744  * global __pyx_memoryview_thread_locks_used
10745  * if self.lock != NULL: # <<<<<<<<<<<<<<
10746  * for i in range(__pyx_memoryview_thread_locks_used):
10747  * if __pyx_memoryview_thread_locks[i] is self.lock:
10748  */
10749  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10750  if (__pyx_t_2) {
10751 
10752  /* "View.MemoryView":383
10753  * global __pyx_memoryview_thread_locks_used
10754  * if self.lock != NULL:
10755  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
10756  * if __pyx_memoryview_thread_locks[i] is self.lock:
10757  * __pyx_memoryview_thread_locks_used -= 1
10758  */
10759  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10760  __pyx_t_4 = __pyx_t_3;
10761  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10762  __pyx_v_i = __pyx_t_5;
10763 
10764  /* "View.MemoryView":384
10765  * if self.lock != NULL:
10766  * for i in range(__pyx_memoryview_thread_locks_used):
10767  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10768  * __pyx_memoryview_thread_locks_used -= 1
10769  * if i != __pyx_memoryview_thread_locks_used:
10770  */
10771  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10772  if (__pyx_t_2) {
10773 
10774  /* "View.MemoryView":385
10775  * for i in range(__pyx_memoryview_thread_locks_used):
10776  * if __pyx_memoryview_thread_locks[i] is self.lock:
10777  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
10778  * if i != __pyx_memoryview_thread_locks_used:
10779  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10780  */
10781  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10782 
10783  /* "View.MemoryView":386
10784  * if __pyx_memoryview_thread_locks[i] is self.lock:
10785  * __pyx_memoryview_thread_locks_used -= 1
10786  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10787  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10788  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10789  */
10790  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10791  if (__pyx_t_2) {
10792 
10793  /* "View.MemoryView":388
10794  * if i != __pyx_memoryview_thread_locks_used:
10795  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10796  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
10797  * break
10798  * else:
10799  */
10800  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10801  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10802 
10803  /* "View.MemoryView":387
10804  * __pyx_memoryview_thread_locks_used -= 1
10805  * if i != __pyx_memoryview_thread_locks_used:
10806  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
10807  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10808  * break
10809  */
10810  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10811  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10812 
10813  /* "View.MemoryView":386
10814  * if __pyx_memoryview_thread_locks[i] is self.lock:
10815  * __pyx_memoryview_thread_locks_used -= 1
10816  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10817  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10818  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10819  */
10820  }
10821 
10822  /* "View.MemoryView":389
10823  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10824  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10825  * break # <<<<<<<<<<<<<<
10826  * else:
10827  * PyThread_free_lock(self.lock)
10828  */
10829  goto __pyx_L6_break;
10830 
10831  /* "View.MemoryView":384
10832  * if self.lock != NULL:
10833  * for i in range(__pyx_memoryview_thread_locks_used):
10834  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10835  * __pyx_memoryview_thread_locks_used -= 1
10836  * if i != __pyx_memoryview_thread_locks_used:
10837  */
10838  }
10839  }
10840  /*else*/ {
10841 
10842  /* "View.MemoryView":391
10843  * break
10844  * else:
10845  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
10846  *
10847  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10848  */
10849  PyThread_free_lock(__pyx_v_self->lock);
10850  }
10851  __pyx_L6_break:;
10852 
10853  /* "View.MemoryView":382
10854  * cdef int i
10855  * global __pyx_memoryview_thread_locks_used
10856  * if self.lock != NULL: # <<<<<<<<<<<<<<
10857  * for i in range(__pyx_memoryview_thread_locks_used):
10858  * if __pyx_memoryview_thread_locks[i] is self.lock:
10859  */
10860  }
10861 
10862  /* "View.MemoryView":372
10863  * self.typeinfo = NULL
10864  *
10865  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10866  * if self.obj is not None:
10867  * __Pyx_ReleaseBuffer(&self.view)
10868  */
10869 
10870  /* function exit code */
10871  goto __pyx_L0;
10872  __pyx_L1_error:;
10873  __Pyx_WriteUnraisable("View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
10874  __pyx_L0:;
10875  __Pyx_TraceReturn(Py_None, 0);
10876  __Pyx_RefNannyFinishContext();
10877 }
10878 
10879 /* "View.MemoryView":393
10880  * PyThread_free_lock(self.lock)
10881  *
10882  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10883  * cdef Py_ssize_t dim
10884  * cdef char *itemp = <char *> self.view.buf
10885  */
10886 
10887 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10888  Py_ssize_t __pyx_v_dim;
10889  char *__pyx_v_itemp;
10890  PyObject *__pyx_v_idx = NULL;
10891  char *__pyx_r;
10892  __Pyx_TraceDeclarations
10893  __Pyx_RefNannyDeclarations
10894  Py_ssize_t __pyx_t_1;
10895  PyObject *__pyx_t_2 = NULL;
10896  Py_ssize_t __pyx_t_3;
10897  PyObject *(*__pyx_t_4)(PyObject *);
10898  PyObject *__pyx_t_5 = NULL;
10899  Py_ssize_t __pyx_t_6;
10900  char *__pyx_t_7;
10901  int __pyx_lineno = 0;
10902  const char *__pyx_filename = NULL;
10903  int __pyx_clineno = 0;
10904  __Pyx_RefNannySetupContext("get_item_pointer", 0);
10905  __Pyx_TraceCall("get_item_pointer", __pyx_f[1], 393, 0, __PYX_ERR(1, 393, __pyx_L1_error));
10906 
10907  /* "View.MemoryView":395
10908  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10909  * cdef Py_ssize_t dim
10910  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
10911  *
10912  * for dim, idx in enumerate(index):
10913  */
10914  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
10915 
10916  /* "View.MemoryView":397
10917  * cdef char *itemp = <char *> self.view.buf
10918  *
10919  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10920  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10921  *
10922  */
10923  __pyx_t_1 = 0;
10924  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
10925  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10926  __pyx_t_4 = NULL;
10927  } else {
10928  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
10929  __Pyx_GOTREF(__pyx_t_2);
10930  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
10931  }
10932  for (;;) {
10933  if (likely(!__pyx_t_4)) {
10934  if (likely(PyList_CheckExact(__pyx_t_2))) {
10935  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
10936  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10937  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
10938  #else
10939  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10940  __Pyx_GOTREF(__pyx_t_5);
10941  #endif
10942  } else {
10943  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
10944  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10945  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
10946  #else
10947  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10948  __Pyx_GOTREF(__pyx_t_5);
10949  #endif
10950  }
10951  } else {
10952  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10953  if (unlikely(!__pyx_t_5)) {
10954  PyObject* exc_type = PyErr_Occurred();
10955  if (exc_type) {
10956  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10957  else __PYX_ERR(1, 397, __pyx_L1_error)
10958  }
10959  break;
10960  }
10961  __Pyx_GOTREF(__pyx_t_5);
10962  }
10963  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10964  __pyx_t_5 = 0;
10965  __pyx_v_dim = __pyx_t_1;
10966  __pyx_t_1 = (__pyx_t_1 + 1);
10967 
10968  /* "View.MemoryView":398
10969  *
10970  * for dim, idx in enumerate(index):
10971  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
10972  *
10973  * return itemp
10974  */
10975  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
10976  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
10977  __pyx_v_itemp = __pyx_t_7;
10978 
10979  /* "View.MemoryView":397
10980  * cdef char *itemp = <char *> self.view.buf
10981  *
10982  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10983  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10984  *
10985  */
10986  }
10987  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10988 
10989  /* "View.MemoryView":400
10990  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10991  *
10992  * return itemp # <<<<<<<<<<<<<<
10993  *
10994  *
10995  */
10996  __pyx_r = __pyx_v_itemp;
10997  goto __pyx_L0;
10998 
10999  /* "View.MemoryView":393
11000  * PyThread_free_lock(self.lock)
11001  *
11002  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11003  * cdef Py_ssize_t dim
11004  * cdef char *itemp = <char *> self.view.buf
11005  */
11006 
11007  /* function exit code */
11008  __pyx_L1_error:;
11009  __Pyx_XDECREF(__pyx_t_2);
11010  __Pyx_XDECREF(__pyx_t_5);
11011  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11012  __pyx_r = NULL;
11013  __pyx_L0:;
11014  __Pyx_XDECREF(__pyx_v_idx);
11015  __Pyx_TraceReturn(Py_None, 0);
11016  __Pyx_RefNannyFinishContext();
11017  return __pyx_r;
11018 }
11019 
11020 /* "View.MemoryView":403
11021  *
11022  *
11023  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11024  * if index is Ellipsis:
11025  * return self
11026  */
11027 
11028 /* Python wrapper */
11029 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
11030 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11031  PyObject *__pyx_r = 0;
11032  __Pyx_RefNannyDeclarations
11033  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
11034  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11035 
11036  /* function exit code */
11037  __Pyx_RefNannyFinishContext();
11038  return __pyx_r;
11039 }
11040 
11041 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11042  PyObject *__pyx_v_have_slices = NULL;
11043  PyObject *__pyx_v_indices = NULL;
11044  char *__pyx_v_itemp;
11045  PyObject *__pyx_r = NULL;
11046  __Pyx_TraceDeclarations
11047  __Pyx_RefNannyDeclarations
11048  int __pyx_t_1;
11049  int __pyx_t_2;
11050  PyObject *__pyx_t_3 = NULL;
11051  PyObject *__pyx_t_4 = NULL;
11052  PyObject *__pyx_t_5 = NULL;
11053  char *__pyx_t_6;
11054  int __pyx_lineno = 0;
11055  const char *__pyx_filename = NULL;
11056  int __pyx_clineno = 0;
11057  __Pyx_RefNannySetupContext("__getitem__", 0);
11058  __Pyx_TraceCall("__getitem__", __pyx_f[1], 403, 0, __PYX_ERR(1, 403, __pyx_L1_error));
11059 
11060  /* "View.MemoryView":404
11061  *
11062  * def __getitem__(memoryview self, object index):
11063  * if index is Ellipsis: # <<<<<<<<<<<<<<
11064  * return self
11065  *
11066  */
11067  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11068  __pyx_t_2 = (__pyx_t_1 != 0);
11069  if (__pyx_t_2) {
11070 
11071  /* "View.MemoryView":405
11072  * def __getitem__(memoryview self, object index):
11073  * if index is Ellipsis:
11074  * return self # <<<<<<<<<<<<<<
11075  *
11076  * have_slices, indices = _unellipsify(index, self.view.ndim)
11077  */
11078  __Pyx_XDECREF(__pyx_r);
11079  __Pyx_INCREF(((PyObject *)__pyx_v_self));
11080  __pyx_r = ((PyObject *)__pyx_v_self);
11081  goto __pyx_L0;
11082 
11083  /* "View.MemoryView":404
11084  *
11085  * def __getitem__(memoryview self, object index):
11086  * if index is Ellipsis: # <<<<<<<<<<<<<<
11087  * return self
11088  *
11089  */
11090  }
11091 
11092  /* "View.MemoryView":407
11093  * return self
11094  *
11095  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11096  *
11097  * cdef char *itemp
11098  */
11099  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
11100  __Pyx_GOTREF(__pyx_t_3);
11101  if (likely(__pyx_t_3 != Py_None)) {
11102  PyObject* sequence = __pyx_t_3;
11103  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11104  if (unlikely(size != 2)) {
11105  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11106  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11107  __PYX_ERR(1, 407, __pyx_L1_error)
11108  }
11109  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11110  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11111  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11112  __Pyx_INCREF(__pyx_t_4);
11113  __Pyx_INCREF(__pyx_t_5);
11114  #else
11115  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
11116  __Pyx_GOTREF(__pyx_t_4);
11117  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
11118  __Pyx_GOTREF(__pyx_t_5);
11119  #endif
11120  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11121  } else {
11122  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
11123  }
11124  __pyx_v_have_slices = __pyx_t_4;
11125  __pyx_t_4 = 0;
11126  __pyx_v_indices = __pyx_t_5;
11127  __pyx_t_5 = 0;
11128 
11129  /* "View.MemoryView":410
11130  *
11131  * cdef char *itemp
11132  * if have_slices: # <<<<<<<<<<<<<<
11133  * return memview_slice(self, indices)
11134  * else:
11135  */
11136  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
11137  if (__pyx_t_2) {
11138 
11139  /* "View.MemoryView":411
11140  * cdef char *itemp
11141  * if have_slices:
11142  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
11143  * else:
11144  * itemp = self.get_item_pointer(indices)
11145  */
11146  __Pyx_XDECREF(__pyx_r);
11147  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
11148  __Pyx_GOTREF(__pyx_t_3);
11149  __pyx_r = __pyx_t_3;
11150  __pyx_t_3 = 0;
11151  goto __pyx_L0;
11152 
11153  /* "View.MemoryView":410
11154  *
11155  * cdef char *itemp
11156  * if have_slices: # <<<<<<<<<<<<<<
11157  * return memview_slice(self, indices)
11158  * else:
11159  */
11160  }
11161 
11162  /* "View.MemoryView":413
11163  * return memview_slice(self, indices)
11164  * else:
11165  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
11166  * return self.convert_item_to_object(itemp)
11167  *
11168  */
11169  /*else*/ {
11170  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
11171  __pyx_v_itemp = __pyx_t_6;
11172 
11173  /* "View.MemoryView":414
11174  * else:
11175  * itemp = self.get_item_pointer(indices)
11176  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
11177  *
11178  * def __setitem__(memoryview self, object index, object value):
11179  */
11180  __Pyx_XDECREF(__pyx_r);
11181  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
11182  __Pyx_GOTREF(__pyx_t_3);
11183  __pyx_r = __pyx_t_3;
11184  __pyx_t_3 = 0;
11185  goto __pyx_L0;
11186  }
11187 
11188  /* "View.MemoryView":403
11189  *
11190  *
11191  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11192  * if index is Ellipsis:
11193  * return self
11194  */
11195 
11196  /* function exit code */
11197  __pyx_L1_error:;
11198  __Pyx_XDECREF(__pyx_t_3);
11199  __Pyx_XDECREF(__pyx_t_4);
11200  __Pyx_XDECREF(__pyx_t_5);
11201  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11202  __pyx_r = NULL;
11203  __pyx_L0:;
11204  __Pyx_XDECREF(__pyx_v_have_slices);
11205  __Pyx_XDECREF(__pyx_v_indices);
11206  __Pyx_XGIVEREF(__pyx_r);
11207  __Pyx_TraceReturn(__pyx_r, 0);
11208  __Pyx_RefNannyFinishContext();
11209  return __pyx_r;
11210 }
11211 
11212 /* "View.MemoryView":416
11213  * return self.convert_item_to_object(itemp)
11214  *
11215  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11216  * if self.view.readonly:
11217  * raise TypeError("Cannot assign to read-only memoryview")
11218  */
11219 
11220 /* Python wrapper */
11221 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
11222 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11223  int __pyx_r;
11224  __Pyx_RefNannyDeclarations
11225  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
11226  __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));
11227 
11228  /* function exit code */
11229  __Pyx_RefNannyFinishContext();
11230  return __pyx_r;
11231 }
11232 
11233 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) {
11234  PyObject *__pyx_v_have_slices = NULL;
11235  PyObject *__pyx_v_obj = NULL;
11236  int __pyx_r;
11237  __Pyx_TraceDeclarations
11238  __Pyx_RefNannyDeclarations
11239  int __pyx_t_1;
11240  PyObject *__pyx_t_2 = NULL;
11241  PyObject *__pyx_t_3 = NULL;
11242  PyObject *__pyx_t_4 = NULL;
11243  int __pyx_lineno = 0;
11244  const char *__pyx_filename = NULL;
11245  int __pyx_clineno = 0;
11246  __Pyx_RefNannySetupContext("__setitem__", 0);
11247  __Pyx_TraceCall("__setitem__", __pyx_f[1], 416, 0, __PYX_ERR(1, 416, __pyx_L1_error));
11248  __Pyx_INCREF(__pyx_v_index);
11249 
11250  /* "View.MemoryView":417
11251  *
11252  * def __setitem__(memoryview self, object index, object value):
11253  * if self.view.readonly: # <<<<<<<<<<<<<<
11254  * raise TypeError("Cannot assign to read-only memoryview")
11255  *
11256  */
11257  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11258  if (unlikely(__pyx_t_1)) {
11259 
11260  /* "View.MemoryView":418
11261  * def __setitem__(memoryview self, object index, object value):
11262  * if self.view.readonly:
11263  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
11264  *
11265  * have_slices, index = _unellipsify(index, self.view.ndim)
11266  */
11267  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11268  __Pyx_GOTREF(__pyx_t_2);
11269  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11270  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11271  __PYX_ERR(1, 418, __pyx_L1_error)
11272 
11273  /* "View.MemoryView":417
11274  *
11275  * def __setitem__(memoryview self, object index, object value):
11276  * if self.view.readonly: # <<<<<<<<<<<<<<
11277  * raise TypeError("Cannot assign to read-only memoryview")
11278  *
11279  */
11280  }
11281 
11282  /* "View.MemoryView":420
11283  * raise TypeError("Cannot assign to read-only memoryview")
11284  *
11285  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11286  *
11287  * if have_slices:
11288  */
11289  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11290  __Pyx_GOTREF(__pyx_t_2);
11291  if (likely(__pyx_t_2 != Py_None)) {
11292  PyObject* sequence = __pyx_t_2;
11293  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11294  if (unlikely(size != 2)) {
11295  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11296  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11297  __PYX_ERR(1, 420, __pyx_L1_error)
11298  }
11299  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11300  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11301  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11302  __Pyx_INCREF(__pyx_t_3);
11303  __Pyx_INCREF(__pyx_t_4);
11304  #else
11305  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
11306  __Pyx_GOTREF(__pyx_t_3);
11307  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
11308  __Pyx_GOTREF(__pyx_t_4);
11309  #endif
11310  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11311  } else {
11312  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
11313  }
11314  __pyx_v_have_slices = __pyx_t_3;
11315  __pyx_t_3 = 0;
11316  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11317  __pyx_t_4 = 0;
11318 
11319  /* "View.MemoryView":422
11320  * have_slices, index = _unellipsify(index, self.view.ndim)
11321  *
11322  * if have_slices: # <<<<<<<<<<<<<<
11323  * obj = self.is_slice(value)
11324  * if obj:
11325  */
11326  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
11327  if (__pyx_t_1) {
11328 
11329  /* "View.MemoryView":423
11330  *
11331  * if have_slices:
11332  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
11333  * if obj:
11334  * self.setitem_slice_assignment(self[index], obj)
11335  */
11336  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
11337  __Pyx_GOTREF(__pyx_t_2);
11338  __pyx_v_obj = __pyx_t_2;
11339  __pyx_t_2 = 0;
11340 
11341  /* "View.MemoryView":424
11342  * if have_slices:
11343  * obj = self.is_slice(value)
11344  * if obj: # <<<<<<<<<<<<<<
11345  * self.setitem_slice_assignment(self[index], obj)
11346  * else:
11347  */
11348  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
11349  if (__pyx_t_1) {
11350 
11351  /* "View.MemoryView":425
11352  * obj = self.is_slice(value)
11353  * if obj:
11354  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
11355  * else:
11356  * self.setitem_slice_assign_scalar(self[index], value)
11357  */
11358  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
11359  __Pyx_GOTREF(__pyx_t_2);
11360  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
11361  __Pyx_GOTREF(__pyx_t_4);
11362  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11363  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11364 
11365  /* "View.MemoryView":424
11366  * if have_slices:
11367  * obj = self.is_slice(value)
11368  * if obj: # <<<<<<<<<<<<<<
11369  * self.setitem_slice_assignment(self[index], obj)
11370  * else:
11371  */
11372  goto __pyx_L5;
11373  }
11374 
11375  /* "View.MemoryView":427
11376  * self.setitem_slice_assignment(self[index], obj)
11377  * else:
11378  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
11379  * else:
11380  * self.setitem_indexed(index, value)
11381  */
11382  /*else*/ {
11383  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
11384  __Pyx_GOTREF(__pyx_t_4);
11385  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
11386  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
11387  __Pyx_GOTREF(__pyx_t_2);
11388  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11389  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11390  }
11391  __pyx_L5:;
11392 
11393  /* "View.MemoryView":422
11394  * have_slices, index = _unellipsify(index, self.view.ndim)
11395  *
11396  * if have_slices: # <<<<<<<<<<<<<<
11397  * obj = self.is_slice(value)
11398  * if obj:
11399  */
11400  goto __pyx_L4;
11401  }
11402 
11403  /* "View.MemoryView":429
11404  * self.setitem_slice_assign_scalar(self[index], value)
11405  * else:
11406  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
11407  *
11408  * cdef is_slice(self, obj):
11409  */
11410  /*else*/ {
11411  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
11412  __Pyx_GOTREF(__pyx_t_2);
11413  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11414  }
11415  __pyx_L4:;
11416 
11417  /* "View.MemoryView":416
11418  * return self.convert_item_to_object(itemp)
11419  *
11420  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11421  * if self.view.readonly:
11422  * raise TypeError("Cannot assign to read-only memoryview")
11423  */
11424 
11425  /* function exit code */
11426  __pyx_r = 0;
11427  goto __pyx_L0;
11428  __pyx_L1_error:;
11429  __Pyx_XDECREF(__pyx_t_2);
11430  __Pyx_XDECREF(__pyx_t_3);
11431  __Pyx_XDECREF(__pyx_t_4);
11432  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11433  __pyx_r = -1;
11434  __pyx_L0:;
11435  __Pyx_XDECREF(__pyx_v_have_slices);
11436  __Pyx_XDECREF(__pyx_v_obj);
11437  __Pyx_XDECREF(__pyx_v_index);
11438  __Pyx_TraceReturn(Py_None, 0);
11439  __Pyx_RefNannyFinishContext();
11440  return __pyx_r;
11441 }
11442 
11443 /* "View.MemoryView":431
11444  * self.setitem_indexed(index, value)
11445  *
11446  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11447  * if not isinstance(obj, memoryview):
11448  * try:
11449  */
11450 
11451 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11452  PyObject *__pyx_r = NULL;
11453  __Pyx_TraceDeclarations
11454  __Pyx_RefNannyDeclarations
11455  int __pyx_t_1;
11456  int __pyx_t_2;
11457  PyObject *__pyx_t_3 = NULL;
11458  PyObject *__pyx_t_4 = NULL;
11459  PyObject *__pyx_t_5 = NULL;
11460  PyObject *__pyx_t_6 = NULL;
11461  PyObject *__pyx_t_7 = NULL;
11462  PyObject *__pyx_t_8 = NULL;
11463  int __pyx_t_9;
11464  int __pyx_lineno = 0;
11465  const char *__pyx_filename = NULL;
11466  int __pyx_clineno = 0;
11467  __Pyx_RefNannySetupContext("is_slice", 0);
11468  __Pyx_TraceCall("is_slice", __pyx_f[1], 431, 0, __PYX_ERR(1, 431, __pyx_L1_error));
11469  __Pyx_INCREF(__pyx_v_obj);
11470 
11471  /* "View.MemoryView":432
11472  *
11473  * cdef is_slice(self, obj):
11474  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11475  * try:
11476  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11477  */
11478  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11479  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11480  if (__pyx_t_2) {
11481 
11482  /* "View.MemoryView":433
11483  * cdef is_slice(self, obj):
11484  * if not isinstance(obj, memoryview):
11485  * try: # <<<<<<<<<<<<<<
11486  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11487  * self.dtype_is_object)
11488  */
11489  {
11490  __Pyx_PyThreadState_declare
11491  __Pyx_PyThreadState_assign
11492  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11493  __Pyx_XGOTREF(__pyx_t_3);
11494  __Pyx_XGOTREF(__pyx_t_4);
11495  __Pyx_XGOTREF(__pyx_t_5);
11496  /*try:*/ {
11497 
11498  /* "View.MemoryView":434
11499  * if not isinstance(obj, memoryview):
11500  * try:
11501  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11502  * self.dtype_is_object)
11503  * except TypeError:
11504  */
11505  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
11506  __Pyx_GOTREF(__pyx_t_6);
11507 
11508  /* "View.MemoryView":435
11509  * try:
11510  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11511  * self.dtype_is_object) # <<<<<<<<<<<<<<
11512  * except TypeError:
11513  * return None
11514  */
11515  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
11516  __Pyx_GOTREF(__pyx_t_7);
11517 
11518  /* "View.MemoryView":434
11519  * if not isinstance(obj, memoryview):
11520  * try:
11521  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11522  * self.dtype_is_object)
11523  * except TypeError:
11524  */
11525  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
11526  __Pyx_GOTREF(__pyx_t_8);
11527  __Pyx_INCREF(__pyx_v_obj);
11528  __Pyx_GIVEREF(__pyx_v_obj);
11529  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11530  __Pyx_GIVEREF(__pyx_t_6);
11531  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11532  __Pyx_GIVEREF(__pyx_t_7);
11533  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11534  __pyx_t_6 = 0;
11535  __pyx_t_7 = 0;
11536  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
11537  __Pyx_GOTREF(__pyx_t_7);
11538  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11539  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11540  __pyx_t_7 = 0;
11541 
11542  /* "View.MemoryView":433
11543  * cdef is_slice(self, obj):
11544  * if not isinstance(obj, memoryview):
11545  * try: # <<<<<<<<<<<<<<
11546  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11547  * self.dtype_is_object)
11548  */
11549  }
11550  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11551  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11552  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11553  goto __pyx_L9_try_end;
11554  __pyx_L4_error:;
11555  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11556  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11557  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11558 
11559  /* "View.MemoryView":436
11560  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11561  * self.dtype_is_object)
11562  * except TypeError: # <<<<<<<<<<<<<<
11563  * return None
11564  *
11565  */
11566  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11567  if (__pyx_t_9) {
11568  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11569  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
11570  __Pyx_GOTREF(__pyx_t_7);
11571  __Pyx_GOTREF(__pyx_t_8);
11572  __Pyx_GOTREF(__pyx_t_6);
11573 
11574  /* "View.MemoryView":437
11575  * self.dtype_is_object)
11576  * except TypeError:
11577  * return None # <<<<<<<<<<<<<<
11578  *
11579  * return obj
11580  */
11581  __Pyx_XDECREF(__pyx_r);
11582  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11583  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11584  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11585  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11586  goto __pyx_L7_except_return;
11587  }
11588  goto __pyx_L6_except_error;
11589  __pyx_L6_except_error:;
11590 
11591  /* "View.MemoryView":433
11592  * cdef is_slice(self, obj):
11593  * if not isinstance(obj, memoryview):
11594  * try: # <<<<<<<<<<<<<<
11595  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11596  * self.dtype_is_object)
11597  */
11598  __Pyx_XGIVEREF(__pyx_t_3);
11599  __Pyx_XGIVEREF(__pyx_t_4);
11600  __Pyx_XGIVEREF(__pyx_t_5);
11601  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11602  goto __pyx_L1_error;
11603  __pyx_L7_except_return:;
11604  __Pyx_XGIVEREF(__pyx_t_3);
11605  __Pyx_XGIVEREF(__pyx_t_4);
11606  __Pyx_XGIVEREF(__pyx_t_5);
11607  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11608  goto __pyx_L0;
11609  __pyx_L9_try_end:;
11610  }
11611 
11612  /* "View.MemoryView":432
11613  *
11614  * cdef is_slice(self, obj):
11615  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11616  * try:
11617  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11618  */
11619  }
11620 
11621  /* "View.MemoryView":439
11622  * return None
11623  *
11624  * return obj # <<<<<<<<<<<<<<
11625  *
11626  * cdef setitem_slice_assignment(self, dst, src):
11627  */
11628  __Pyx_XDECREF(__pyx_r);
11629  __Pyx_INCREF(__pyx_v_obj);
11630  __pyx_r = __pyx_v_obj;
11631  goto __pyx_L0;
11632 
11633  /* "View.MemoryView":431
11634  * self.setitem_indexed(index, value)
11635  *
11636  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11637  * if not isinstance(obj, memoryview):
11638  * try:
11639  */
11640 
11641  /* function exit code */
11642  __pyx_L1_error:;
11643  __Pyx_XDECREF(__pyx_t_6);
11644  __Pyx_XDECREF(__pyx_t_7);
11645  __Pyx_XDECREF(__pyx_t_8);
11646  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11647  __pyx_r = 0;
11648  __pyx_L0:;
11649  __Pyx_XDECREF(__pyx_v_obj);
11650  __Pyx_XGIVEREF(__pyx_r);
11651  __Pyx_TraceReturn(__pyx_r, 0);
11652  __Pyx_RefNannyFinishContext();
11653  return __pyx_r;
11654 }
11655 
11656 /* "View.MemoryView":441
11657  * return obj
11658  *
11659  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11660  * cdef __Pyx_memviewslice dst_slice
11661  * cdef __Pyx_memviewslice src_slice
11662  */
11663 
11664 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11665  __Pyx_memviewslice __pyx_v_dst_slice;
11666  __Pyx_memviewslice __pyx_v_src_slice;
11667  PyObject *__pyx_r = NULL;
11668  __Pyx_TraceDeclarations
11669  __Pyx_RefNannyDeclarations
11670  __Pyx_memviewslice *__pyx_t_1;
11671  __Pyx_memviewslice *__pyx_t_2;
11672  PyObject *__pyx_t_3 = NULL;
11673  int __pyx_t_4;
11674  int __pyx_t_5;
11675  int __pyx_t_6;
11676  int __pyx_lineno = 0;
11677  const char *__pyx_filename = NULL;
11678  int __pyx_clineno = 0;
11679  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
11680  __Pyx_TraceCall("setitem_slice_assignment", __pyx_f[1], 441, 0, __PYX_ERR(1, 441, __pyx_L1_error));
11681 
11682  /* "View.MemoryView":445
11683  * cdef __Pyx_memviewslice src_slice
11684  *
11685  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11686  * get_slice_from_memview(dst, &dst_slice)[0],
11687  * src.ndim, dst.ndim, self.dtype_is_object)
11688  */
11689  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
11690  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
11691 
11692  /* "View.MemoryView":446
11693  *
11694  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11695  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
11696  * src.ndim, dst.ndim, self.dtype_is_object)
11697  *
11698  */
11699  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
11700  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
11701 
11702  /* "View.MemoryView":447
11703  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11704  * get_slice_from_memview(dst, &dst_slice)[0],
11705  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
11706  *
11707  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11708  */
11709  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
11710  __Pyx_GOTREF(__pyx_t_3);
11711  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
11712  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11713  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
11714  __Pyx_GOTREF(__pyx_t_3);
11715  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
11716  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11717 
11718  /* "View.MemoryView":445
11719  * cdef __Pyx_memviewslice src_slice
11720  *
11721  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11722  * get_slice_from_memview(dst, &dst_slice)[0],
11723  * src.ndim, dst.ndim, self.dtype_is_object)
11724  */
11725  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
11726 
11727  /* "View.MemoryView":441
11728  * return obj
11729  *
11730  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11731  * cdef __Pyx_memviewslice dst_slice
11732  * cdef __Pyx_memviewslice src_slice
11733  */
11734 
11735  /* function exit code */
11736  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11737  goto __pyx_L0;
11738  __pyx_L1_error:;
11739  __Pyx_XDECREF(__pyx_t_3);
11740  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11741  __pyx_r = 0;
11742  __pyx_L0:;
11743  __Pyx_XGIVEREF(__pyx_r);
11744  __Pyx_TraceReturn(__pyx_r, 0);
11745  __Pyx_RefNannyFinishContext();
11746  return __pyx_r;
11747 }
11748 
11749 /* "View.MemoryView":449
11750  * src.ndim, dst.ndim, self.dtype_is_object)
11751  *
11752  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11753  * cdef int array[128]
11754  * cdef void *tmp = NULL
11755  */
11756 
11757 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) {
11758  int __pyx_v_array[0x80];
11759  void *__pyx_v_tmp;
11760  void *__pyx_v_item;
11761  __Pyx_memviewslice *__pyx_v_dst_slice;
11762  __Pyx_memviewslice __pyx_v_tmp_slice;
11763  PyObject *__pyx_r = NULL;
11764  __Pyx_TraceDeclarations
11765  __Pyx_RefNannyDeclarations
11766  __Pyx_memviewslice *__pyx_t_1;
11767  int __pyx_t_2;
11768  PyObject *__pyx_t_3 = NULL;
11769  int __pyx_t_4;
11770  int __pyx_t_5;
11771  char const *__pyx_t_6;
11772  PyObject *__pyx_t_7 = NULL;
11773  PyObject *__pyx_t_8 = NULL;
11774  PyObject *__pyx_t_9 = NULL;
11775  PyObject *__pyx_t_10 = NULL;
11776  PyObject *__pyx_t_11 = NULL;
11777  PyObject *__pyx_t_12 = NULL;
11778  int __pyx_lineno = 0;
11779  const char *__pyx_filename = NULL;
11780  int __pyx_clineno = 0;
11781  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
11782  __Pyx_TraceCall("setitem_slice_assign_scalar", __pyx_f[1], 449, 0, __PYX_ERR(1, 449, __pyx_L1_error));
11783 
11784  /* "View.MemoryView":451
11785  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11786  * cdef int array[128]
11787  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
11788  * cdef void *item
11789  *
11790  */
11791  __pyx_v_tmp = NULL;
11792 
11793  /* "View.MemoryView":456
11794  * cdef __Pyx_memviewslice *dst_slice
11795  * cdef __Pyx_memviewslice tmp_slice
11796  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
11797  *
11798  * if <size_t>self.view.itemsize > sizeof(array):
11799  */
11800  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
11801  __pyx_v_dst_slice = __pyx_t_1;
11802 
11803  /* "View.MemoryView":458
11804  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11805  *
11806  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11807  * tmp = PyMem_Malloc(self.view.itemsize)
11808  * if tmp == NULL:
11809  */
11810  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
11811  if (__pyx_t_2) {
11812 
11813  /* "View.MemoryView":459
11814  *
11815  * if <size_t>self.view.itemsize > sizeof(array):
11816  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
11817  * if tmp == NULL:
11818  * raise MemoryError
11819  */
11820  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11821 
11822  /* "View.MemoryView":460
11823  * if <size_t>self.view.itemsize > sizeof(array):
11824  * tmp = PyMem_Malloc(self.view.itemsize)
11825  * if tmp == NULL: # <<<<<<<<<<<<<<
11826  * raise MemoryError
11827  * item = tmp
11828  */
11829  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
11830  if (unlikely(__pyx_t_2)) {
11831 
11832  /* "View.MemoryView":461
11833  * tmp = PyMem_Malloc(self.view.itemsize)
11834  * if tmp == NULL:
11835  * raise MemoryError # <<<<<<<<<<<<<<
11836  * item = tmp
11837  * else:
11838  */
11839  PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
11840 
11841  /* "View.MemoryView":460
11842  * if <size_t>self.view.itemsize > sizeof(array):
11843  * tmp = PyMem_Malloc(self.view.itemsize)
11844  * if tmp == NULL: # <<<<<<<<<<<<<<
11845  * raise MemoryError
11846  * item = tmp
11847  */
11848  }
11849 
11850  /* "View.MemoryView":462
11851  * if tmp == NULL:
11852  * raise MemoryError
11853  * item = tmp # <<<<<<<<<<<<<<
11854  * else:
11855  * item = <void *> array
11856  */
11857  __pyx_v_item = __pyx_v_tmp;
11858 
11859  /* "View.MemoryView":458
11860  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11861  *
11862  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11863  * tmp = PyMem_Malloc(self.view.itemsize)
11864  * if tmp == NULL:
11865  */
11866  goto __pyx_L3;
11867  }
11868 
11869  /* "View.MemoryView":464
11870  * item = tmp
11871  * else:
11872  * item = <void *> array # <<<<<<<<<<<<<<
11873  *
11874  * try:
11875  */
11876  /*else*/ {
11877  __pyx_v_item = ((void *)__pyx_v_array);
11878  }
11879  __pyx_L3:;
11880 
11881  /* "View.MemoryView":466
11882  * item = <void *> array
11883  *
11884  * try: # <<<<<<<<<<<<<<
11885  * if self.dtype_is_object:
11886  * (<PyObject **> item)[0] = <PyObject *> value
11887  */
11888  /*try:*/ {
11889 
11890  /* "View.MemoryView":467
11891  *
11892  * try:
11893  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11894  * (<PyObject **> item)[0] = <PyObject *> value
11895  * else:
11896  */
11897  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
11898  if (__pyx_t_2) {
11899 
11900  /* "View.MemoryView":468
11901  * try:
11902  * if self.dtype_is_object:
11903  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
11904  * else:
11905  * self.assign_item_from_object(<char *> item, value)
11906  */
11907  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11908 
11909  /* "View.MemoryView":467
11910  *
11911  * try:
11912  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11913  * (<PyObject **> item)[0] = <PyObject *> value
11914  * else:
11915  */
11916  goto __pyx_L8;
11917  }
11918 
11919  /* "View.MemoryView":470
11920  * (<PyObject **> item)[0] = <PyObject *> value
11921  * else:
11922  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
11923  *
11924  *
11925  */
11926  /*else*/ {
11927  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
11928  __Pyx_GOTREF(__pyx_t_3);
11929  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11930  }
11931  __pyx_L8:;
11932 
11933  /* "View.MemoryView":474
11934  *
11935  *
11936  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11937  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11938  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11939  */
11940  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11941  if (__pyx_t_2) {
11942 
11943  /* "View.MemoryView":475
11944  *
11945  * if self.view.suboffsets != NULL:
11946  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
11947  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11948  * item, self.dtype_is_object)
11949  */
11950  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
11951  __Pyx_GOTREF(__pyx_t_3);
11952  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11953 
11954  /* "View.MemoryView":474
11955  *
11956  *
11957  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11958  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11959  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11960  */
11961  }
11962 
11963  /* "View.MemoryView":476
11964  * if self.view.suboffsets != NULL:
11965  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11966  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
11967  * item, self.dtype_is_object)
11968  * finally:
11969  */
11970  __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);
11971  }
11972 
11973  /* "View.MemoryView":479
11974  * item, self.dtype_is_object)
11975  * finally:
11976  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
11977  *
11978  * cdef setitem_indexed(self, index, value):
11979  */
11980  /*finally:*/ {
11981  /*normal exit:*/{
11982  PyMem_Free(__pyx_v_tmp);
11983  goto __pyx_L7;
11984  }
11985  __pyx_L6_error:;
11986  /*exception exit:*/{
11987  __Pyx_PyThreadState_declare
11988  __Pyx_PyThreadState_assign
11989  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11990  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11991  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11992  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);
11993  __Pyx_XGOTREF(__pyx_t_7);
11994  __Pyx_XGOTREF(__pyx_t_8);
11995  __Pyx_XGOTREF(__pyx_t_9);
11996  __Pyx_XGOTREF(__pyx_t_10);
11997  __Pyx_XGOTREF(__pyx_t_11);
11998  __Pyx_XGOTREF(__pyx_t_12);
11999  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
12000  {
12001  PyMem_Free(__pyx_v_tmp);
12002  }
12003  if (PY_MAJOR_VERSION >= 3) {
12004  __Pyx_XGIVEREF(__pyx_t_10);
12005  __Pyx_XGIVEREF(__pyx_t_11);
12006  __Pyx_XGIVEREF(__pyx_t_12);
12007  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
12008  }
12009  __Pyx_XGIVEREF(__pyx_t_7);
12010  __Pyx_XGIVEREF(__pyx_t_8);
12011  __Pyx_XGIVEREF(__pyx_t_9);
12012  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
12013  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12014  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
12015  goto __pyx_L1_error;
12016  }
12017  __pyx_L7:;
12018  }
12019 
12020  /* "View.MemoryView":449
12021  * src.ndim, dst.ndim, self.dtype_is_object)
12022  *
12023  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12024  * cdef int array[128]
12025  * cdef void *tmp = NULL
12026  */
12027 
12028  /* function exit code */
12029  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12030  goto __pyx_L0;
12031  __pyx_L1_error:;
12032  __Pyx_XDECREF(__pyx_t_3);
12033  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12034  __pyx_r = 0;
12035  __pyx_L0:;
12036  __Pyx_XGIVEREF(__pyx_r);
12037  __Pyx_TraceReturn(__pyx_r, 0);
12038  __Pyx_RefNannyFinishContext();
12039  return __pyx_r;
12040 }
12041 
12042 /* "View.MemoryView":481
12043  * PyMem_Free(tmp)
12044  *
12045  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12046  * cdef char *itemp = self.get_item_pointer(index)
12047  * self.assign_item_from_object(itemp, value)
12048  */
12049 
12050 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12051  char *__pyx_v_itemp;
12052  PyObject *__pyx_r = NULL;
12053  __Pyx_TraceDeclarations
12054  __Pyx_RefNannyDeclarations
12055  char *__pyx_t_1;
12056  PyObject *__pyx_t_2 = NULL;
12057  int __pyx_lineno = 0;
12058  const char *__pyx_filename = NULL;
12059  int __pyx_clineno = 0;
12060  __Pyx_RefNannySetupContext("setitem_indexed", 0);
12061  __Pyx_TraceCall("setitem_indexed", __pyx_f[1], 481, 0, __PYX_ERR(1, 481, __pyx_L1_error));
12062 
12063  /* "View.MemoryView":482
12064  *
12065  * cdef setitem_indexed(self, index, value):
12066  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
12067  * self.assign_item_from_object(itemp, value)
12068  *
12069  */
12070  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
12071  __pyx_v_itemp = __pyx_t_1;
12072 
12073  /* "View.MemoryView":483
12074  * cdef setitem_indexed(self, index, value):
12075  * cdef char *itemp = self.get_item_pointer(index)
12076  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
12077  *
12078  * cdef convert_item_to_object(self, char *itemp):
12079  */
12080  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
12081  __Pyx_GOTREF(__pyx_t_2);
12082  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12083 
12084  /* "View.MemoryView":481
12085  * PyMem_Free(tmp)
12086  *
12087  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12088  * cdef char *itemp = self.get_item_pointer(index)
12089  * self.assign_item_from_object(itemp, value)
12090  */
12091 
12092  /* function exit code */
12093  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12094  goto __pyx_L0;
12095  __pyx_L1_error:;
12096  __Pyx_XDECREF(__pyx_t_2);
12097  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12098  __pyx_r = 0;
12099  __pyx_L0:;
12100  __Pyx_XGIVEREF(__pyx_r);
12101  __Pyx_TraceReturn(__pyx_r, 0);
12102  __Pyx_RefNannyFinishContext();
12103  return __pyx_r;
12104 }
12105 
12106 /* "View.MemoryView":485
12107  * self.assign_item_from_object(itemp, value)
12108  *
12109  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12110  * """Only used if instantiated manually by the user, or if Cython doesn't
12111  * know how to convert the type"""
12112  */
12113 
12114 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
12115  PyObject *__pyx_v_struct = NULL;
12116  PyObject *__pyx_v_bytesitem = 0;
12117  PyObject *__pyx_v_result = NULL;
12118  PyObject *__pyx_r = NULL;
12119  __Pyx_TraceDeclarations
12120  __Pyx_RefNannyDeclarations
12121  PyObject *__pyx_t_1 = NULL;
12122  PyObject *__pyx_t_2 = NULL;
12123  PyObject *__pyx_t_3 = NULL;
12124  PyObject *__pyx_t_4 = NULL;
12125  PyObject *__pyx_t_5 = NULL;
12126  PyObject *__pyx_t_6 = NULL;
12127  PyObject *__pyx_t_7 = NULL;
12128  int __pyx_t_8;
12129  PyObject *__pyx_t_9 = NULL;
12130  size_t __pyx_t_10;
12131  int __pyx_t_11;
12132  int __pyx_lineno = 0;
12133  const char *__pyx_filename = NULL;
12134  int __pyx_clineno = 0;
12135  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
12136  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 485, 0, __PYX_ERR(1, 485, __pyx_L1_error));
12137 
12138  /* "View.MemoryView":488
12139  * """Only used if instantiated manually by the user, or if Cython doesn't
12140  * know how to convert the type"""
12141  * import struct # <<<<<<<<<<<<<<
12142  * cdef bytes bytesitem
12143  *
12144  */
12145  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
12146  __Pyx_GOTREF(__pyx_t_1);
12147  __pyx_v_struct = __pyx_t_1;
12148  __pyx_t_1 = 0;
12149 
12150  /* "View.MemoryView":491
12151  * cdef bytes bytesitem
12152  *
12153  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
12154  * try:
12155  * result = struct.unpack(self.view.format, bytesitem)
12156  */
12157  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
12158  __Pyx_GOTREF(__pyx_t_1);
12159  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12160  __pyx_t_1 = 0;
12161 
12162  /* "View.MemoryView":492
12163  *
12164  * bytesitem = itemp[:self.view.itemsize]
12165  * try: # <<<<<<<<<<<<<<
12166  * result = struct.unpack(self.view.format, bytesitem)
12167  * except struct.error:
12168  */
12169  {
12170  __Pyx_PyThreadState_declare
12171  __Pyx_PyThreadState_assign
12172  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12173  __Pyx_XGOTREF(__pyx_t_2);
12174  __Pyx_XGOTREF(__pyx_t_3);
12175  __Pyx_XGOTREF(__pyx_t_4);
12176  /*try:*/ {
12177 
12178  /* "View.MemoryView":493
12179  * bytesitem = itemp[:self.view.itemsize]
12180  * try:
12181  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
12182  * except struct.error:
12183  * raise ValueError("Unable to convert item to object")
12184  */
12185  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
12186  __Pyx_GOTREF(__pyx_t_5);
12187  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
12188  __Pyx_GOTREF(__pyx_t_6);
12189  __pyx_t_7 = NULL;
12190  __pyx_t_8 = 0;
12191  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12192  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12193  if (likely(__pyx_t_7)) {
12194  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
12195  __Pyx_INCREF(__pyx_t_7);
12196  __Pyx_INCREF(function);
12197  __Pyx_DECREF_SET(__pyx_t_5, function);
12198  __pyx_t_8 = 1;
12199  }
12200  }
12201  #if CYTHON_FAST_PYCALL
12202  if (PyFunction_Check(__pyx_t_5)) {
12203  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12204  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12205  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12206  __Pyx_GOTREF(__pyx_t_1);
12207  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12208  } else
12209  #endif
12210  #if CYTHON_FAST_PYCCALL
12211  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12212  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12213  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12214  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12215  __Pyx_GOTREF(__pyx_t_1);
12216  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12217  } else
12218  #endif
12219  {
12220  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
12221  __Pyx_GOTREF(__pyx_t_9);
12222  if (__pyx_t_7) {
12223  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12224  }
12225  __Pyx_GIVEREF(__pyx_t_6);
12226  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12227  __Pyx_INCREF(__pyx_v_bytesitem);
12228  __Pyx_GIVEREF(__pyx_v_bytesitem);
12229  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12230  __pyx_t_6 = 0;
12231  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12232  __Pyx_GOTREF(__pyx_t_1);
12233  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12234  }
12235  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12236  __pyx_v_result = __pyx_t_1;
12237  __pyx_t_1 = 0;
12238 
12239  /* "View.MemoryView":492
12240  *
12241  * bytesitem = itemp[:self.view.itemsize]
12242  * try: # <<<<<<<<<<<<<<
12243  * result = struct.unpack(self.view.format, bytesitem)
12244  * except struct.error:
12245  */
12246  }
12247 
12248  /* "View.MemoryView":497
12249  * raise ValueError("Unable to convert item to object")
12250  * else:
12251  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12252  * return result[0]
12253  * return result
12254  */
12255  /*else:*/ {
12256  __pyx_t_10 = strlen(__pyx_v_self->view.format);
12257  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12258  if (__pyx_t_11) {
12259 
12260  /* "View.MemoryView":498
12261  * else:
12262  * if len(self.view.format) == 1:
12263  * return result[0] # <<<<<<<<<<<<<<
12264  * return result
12265  *
12266  */
12267  __Pyx_XDECREF(__pyx_r);
12268  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
12269  __Pyx_GOTREF(__pyx_t_1);
12270  __pyx_r = __pyx_t_1;
12271  __pyx_t_1 = 0;
12272  goto __pyx_L6_except_return;
12273 
12274  /* "View.MemoryView":497
12275  * raise ValueError("Unable to convert item to object")
12276  * else:
12277  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12278  * return result[0]
12279  * return result
12280  */
12281  }
12282 
12283  /* "View.MemoryView":499
12284  * if len(self.view.format) == 1:
12285  * return result[0]
12286  * return result # <<<<<<<<<<<<<<
12287  *
12288  * cdef assign_item_from_object(self, char *itemp, object value):
12289  */
12290  __Pyx_XDECREF(__pyx_r);
12291  __Pyx_INCREF(__pyx_v_result);
12292  __pyx_r = __pyx_v_result;
12293  goto __pyx_L6_except_return;
12294  }
12295  __pyx_L3_error:;
12296  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12297  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12298  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12299  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12300  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12301 
12302  /* "View.MemoryView":494
12303  * try:
12304  * result = struct.unpack(self.view.format, bytesitem)
12305  * except struct.error: # <<<<<<<<<<<<<<
12306  * raise ValueError("Unable to convert item to object")
12307  * else:
12308  */
12309  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12310  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
12311  __Pyx_GOTREF(__pyx_t_6);
12312  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12313  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12314  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12315  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12316  if (__pyx_t_8) {
12317  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12318  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
12319  __Pyx_GOTREF(__pyx_t_9);
12320  __Pyx_GOTREF(__pyx_t_5);
12321  __Pyx_GOTREF(__pyx_t_1);
12322 
12323  /* "View.MemoryView":495
12324  * result = struct.unpack(self.view.format, bytesitem)
12325  * except struct.error:
12326  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
12327  * else:
12328  * if len(self.view.format) == 1:
12329  */
12330  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
12331  __Pyx_GOTREF(__pyx_t_6);
12332  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12333  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12334  __PYX_ERR(1, 495, __pyx_L5_except_error)
12335  }
12336  goto __pyx_L5_except_error;
12337  __pyx_L5_except_error:;
12338 
12339  /* "View.MemoryView":492
12340  *
12341  * bytesitem = itemp[:self.view.itemsize]
12342  * try: # <<<<<<<<<<<<<<
12343  * result = struct.unpack(self.view.format, bytesitem)
12344  * except struct.error:
12345  */
12346  __Pyx_XGIVEREF(__pyx_t_2);
12347  __Pyx_XGIVEREF(__pyx_t_3);
12348  __Pyx_XGIVEREF(__pyx_t_4);
12349  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12350  goto __pyx_L1_error;
12351  __pyx_L6_except_return:;
12352  __Pyx_XGIVEREF(__pyx_t_2);
12353  __Pyx_XGIVEREF(__pyx_t_3);
12354  __Pyx_XGIVEREF(__pyx_t_4);
12355  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12356  goto __pyx_L0;
12357  }
12358 
12359  /* "View.MemoryView":485
12360  * self.assign_item_from_object(itemp, value)
12361  *
12362  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12363  * """Only used if instantiated manually by the user, or if Cython doesn't
12364  * know how to convert the type"""
12365  */
12366 
12367  /* function exit code */
12368  __pyx_L1_error:;
12369  __Pyx_XDECREF(__pyx_t_1);
12370  __Pyx_XDECREF(__pyx_t_5);
12371  __Pyx_XDECREF(__pyx_t_6);
12372  __Pyx_XDECREF(__pyx_t_7);
12373  __Pyx_XDECREF(__pyx_t_9);
12374  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12375  __pyx_r = 0;
12376  __pyx_L0:;
12377  __Pyx_XDECREF(__pyx_v_struct);
12378  __Pyx_XDECREF(__pyx_v_bytesitem);
12379  __Pyx_XDECREF(__pyx_v_result);
12380  __Pyx_XGIVEREF(__pyx_r);
12381  __Pyx_TraceReturn(__pyx_r, 0);
12382  __Pyx_RefNannyFinishContext();
12383  return __pyx_r;
12384 }
12385 
12386 /* "View.MemoryView":501
12387  * return result
12388  *
12389  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12390  * """Only used if instantiated manually by the user, or if Cython doesn't
12391  * know how to convert the type"""
12392  */
12393 
12394 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12395  PyObject *__pyx_v_struct = NULL;
12396  char __pyx_v_c;
12397  PyObject *__pyx_v_bytesvalue = 0;
12398  Py_ssize_t __pyx_v_i;
12399  PyObject *__pyx_r = NULL;
12400  __Pyx_TraceDeclarations
12401  __Pyx_RefNannyDeclarations
12402  PyObject *__pyx_t_1 = NULL;
12403  int __pyx_t_2;
12404  int __pyx_t_3;
12405  PyObject *__pyx_t_4 = NULL;
12406  PyObject *__pyx_t_5 = NULL;
12407  PyObject *__pyx_t_6 = NULL;
12408  int __pyx_t_7;
12409  PyObject *__pyx_t_8 = NULL;
12410  Py_ssize_t __pyx_t_9;
12411  PyObject *__pyx_t_10 = NULL;
12412  char *__pyx_t_11;
12413  char *__pyx_t_12;
12414  char *__pyx_t_13;
12415  char *__pyx_t_14;
12416  int __pyx_lineno = 0;
12417  const char *__pyx_filename = NULL;
12418  int __pyx_clineno = 0;
12419  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
12420  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 501, 0, __PYX_ERR(1, 501, __pyx_L1_error));
12421 
12422  /* "View.MemoryView":504
12423  * """Only used if instantiated manually by the user, or if Cython doesn't
12424  * know how to convert the type"""
12425  * import struct # <<<<<<<<<<<<<<
12426  * cdef char c
12427  * cdef bytes bytesvalue
12428  */
12429  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
12430  __Pyx_GOTREF(__pyx_t_1);
12431  __pyx_v_struct = __pyx_t_1;
12432  __pyx_t_1 = 0;
12433 
12434  /* "View.MemoryView":509
12435  * cdef Py_ssize_t i
12436  *
12437  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12438  * bytesvalue = struct.pack(self.view.format, *value)
12439  * else:
12440  */
12441  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12442  __pyx_t_3 = (__pyx_t_2 != 0);
12443  if (__pyx_t_3) {
12444 
12445  /* "View.MemoryView":510
12446  *
12447  * if isinstance(value, tuple):
12448  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
12449  * else:
12450  * bytesvalue = struct.pack(self.view.format, value)
12451  */
12452  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
12453  __Pyx_GOTREF(__pyx_t_1);
12454  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12455  __Pyx_GOTREF(__pyx_t_4);
12456  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
12457  __Pyx_GOTREF(__pyx_t_5);
12458  __Pyx_GIVEREF(__pyx_t_4);
12459  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12460  __pyx_t_4 = 0;
12461  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12462  __Pyx_GOTREF(__pyx_t_4);
12463  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
12464  __Pyx_GOTREF(__pyx_t_6);
12465  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12466  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12467  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12468  __Pyx_GOTREF(__pyx_t_4);
12469  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12470  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12471  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
12472  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12473  __pyx_t_4 = 0;
12474 
12475  /* "View.MemoryView":509
12476  * cdef Py_ssize_t i
12477  *
12478  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12479  * bytesvalue = struct.pack(self.view.format, *value)
12480  * else:
12481  */
12482  goto __pyx_L3;
12483  }
12484 
12485  /* "View.MemoryView":512
12486  * bytesvalue = struct.pack(self.view.format, *value)
12487  * else:
12488  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
12489  *
12490  * for i, c in enumerate(bytesvalue):
12491  */
12492  /*else*/ {
12493  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
12494  __Pyx_GOTREF(__pyx_t_6);
12495  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
12496  __Pyx_GOTREF(__pyx_t_1);
12497  __pyx_t_5 = NULL;
12498  __pyx_t_7 = 0;
12499  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12500  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12501  if (likely(__pyx_t_5)) {
12502  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12503  __Pyx_INCREF(__pyx_t_5);
12504  __Pyx_INCREF(function);
12505  __Pyx_DECREF_SET(__pyx_t_6, function);
12506  __pyx_t_7 = 1;
12507  }
12508  }
12509  #if CYTHON_FAST_PYCALL
12510  if (PyFunction_Check(__pyx_t_6)) {
12511  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12512  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12513  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12514  __Pyx_GOTREF(__pyx_t_4);
12515  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12516  } else
12517  #endif
12518  #if CYTHON_FAST_PYCCALL
12519  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12520  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12521  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12522  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12523  __Pyx_GOTREF(__pyx_t_4);
12524  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12525  } else
12526  #endif
12527  {
12528  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
12529  __Pyx_GOTREF(__pyx_t_8);
12530  if (__pyx_t_5) {
12531  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12532  }
12533  __Pyx_GIVEREF(__pyx_t_1);
12534  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12535  __Pyx_INCREF(__pyx_v_value);
12536  __Pyx_GIVEREF(__pyx_v_value);
12537  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12538  __pyx_t_1 = 0;
12539  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12540  __Pyx_GOTREF(__pyx_t_4);
12541  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12542  }
12543  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12544  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
12545  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12546  __pyx_t_4 = 0;
12547  }
12548  __pyx_L3:;
12549 
12550  /* "View.MemoryView":514
12551  * bytesvalue = struct.pack(self.view.format, value)
12552  *
12553  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12554  * itemp[i] = c
12555  *
12556  */
12557  __pyx_t_9 = 0;
12558  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12559  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
12560  __PYX_ERR(1, 514, __pyx_L1_error)
12561  }
12562  __Pyx_INCREF(__pyx_v_bytesvalue);
12563  __pyx_t_10 = __pyx_v_bytesvalue;
12564  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12565  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12566  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12567  __pyx_t_11 = __pyx_t_14;
12568  __pyx_v_c = (__pyx_t_11[0]);
12569 
12570  /* "View.MemoryView":515
12571  *
12572  * for i, c in enumerate(bytesvalue):
12573  * itemp[i] = c # <<<<<<<<<<<<<<
12574  *
12575  * @cname('getbuffer')
12576  */
12577  __pyx_v_i = __pyx_t_9;
12578 
12579  /* "View.MemoryView":514
12580  * bytesvalue = struct.pack(self.view.format, value)
12581  *
12582  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12583  * itemp[i] = c
12584  *
12585  */
12586  __pyx_t_9 = (__pyx_t_9 + 1);
12587 
12588  /* "View.MemoryView":515
12589  *
12590  * for i, c in enumerate(bytesvalue):
12591  * itemp[i] = c # <<<<<<<<<<<<<<
12592  *
12593  * @cname('getbuffer')
12594  */
12595  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12596  }
12597  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12598 
12599  /* "View.MemoryView":501
12600  * return result
12601  *
12602  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12603  * """Only used if instantiated manually by the user, or if Cython doesn't
12604  * know how to convert the type"""
12605  */
12606 
12607  /* function exit code */
12608  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12609  goto __pyx_L0;
12610  __pyx_L1_error:;
12611  __Pyx_XDECREF(__pyx_t_1);
12612  __Pyx_XDECREF(__pyx_t_4);
12613  __Pyx_XDECREF(__pyx_t_5);
12614  __Pyx_XDECREF(__pyx_t_6);
12615  __Pyx_XDECREF(__pyx_t_8);
12616  __Pyx_XDECREF(__pyx_t_10);
12617  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12618  __pyx_r = 0;
12619  __pyx_L0:;
12620  __Pyx_XDECREF(__pyx_v_struct);
12621  __Pyx_XDECREF(__pyx_v_bytesvalue);
12622  __Pyx_XGIVEREF(__pyx_r);
12623  __Pyx_TraceReturn(__pyx_r, 0);
12624  __Pyx_RefNannyFinishContext();
12625  return __pyx_r;
12626 }
12627 
12628 /* "View.MemoryView":518
12629  *
12630  * @cname('getbuffer')
12631  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12632  * if flags & PyBUF_WRITABLE and self.view.readonly:
12633  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12634  */
12635 
12636 /* Python wrapper */
12637 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
12638 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12639  int __pyx_r;
12640  __Pyx_RefNannyDeclarations
12641  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
12642  __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));
12643 
12644  /* function exit code */
12645  __Pyx_RefNannyFinishContext();
12646  return __pyx_r;
12647 }
12648 
12649 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) {
12650  int __pyx_r;
12651  __Pyx_TraceDeclarations
12652  __Pyx_RefNannyDeclarations
12653  int __pyx_t_1;
12654  int __pyx_t_2;
12655  PyObject *__pyx_t_3 = NULL;
12656  Py_ssize_t *__pyx_t_4;
12657  char *__pyx_t_5;
12658  void *__pyx_t_6;
12659  int __pyx_t_7;
12660  Py_ssize_t __pyx_t_8;
12661  int __pyx_lineno = 0;
12662  const char *__pyx_filename = NULL;
12663  int __pyx_clineno = 0;
12664  if (__pyx_v_info == NULL) {
12665  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
12666  return -1;
12667  }
12668  __Pyx_RefNannySetupContext("__getbuffer__", 0);
12669  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12670  __Pyx_GIVEREF(__pyx_v_info->obj);
12671  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 518, 0, __PYX_ERR(1, 518, __pyx_L1_error));
12672 
12673  /* "View.MemoryView":519
12674  * @cname('getbuffer')
12675  * def __getbuffer__(self, Py_buffer *info, int flags):
12676  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12677  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12678  *
12679  */
12680  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12681  if (__pyx_t_2) {
12682  } else {
12683  __pyx_t_1 = __pyx_t_2;
12684  goto __pyx_L4_bool_binop_done;
12685  }
12686  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12687  __pyx_t_1 = __pyx_t_2;
12688  __pyx_L4_bool_binop_done:;
12689  if (unlikely(__pyx_t_1)) {
12690 
12691  /* "View.MemoryView":520
12692  * def __getbuffer__(self, Py_buffer *info, int flags):
12693  * if flags & PyBUF_WRITABLE and self.view.readonly:
12694  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
12695  *
12696  * if flags & PyBUF_ND:
12697  */
12698  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
12699  __Pyx_GOTREF(__pyx_t_3);
12700  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12701  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12702  __PYX_ERR(1, 520, __pyx_L1_error)
12703 
12704  /* "View.MemoryView":519
12705  * @cname('getbuffer')
12706  * def __getbuffer__(self, Py_buffer *info, int flags):
12707  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12708  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12709  *
12710  */
12711  }
12712 
12713  /* "View.MemoryView":522
12714  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12715  *
12716  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
12717  * info.shape = self.view.shape
12718  * else:
12719  */
12720  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
12721  if (__pyx_t_1) {
12722 
12723  /* "View.MemoryView":523
12724  *
12725  * if flags & PyBUF_ND:
12726  * info.shape = self.view.shape # <<<<<<<<<<<<<<
12727  * else:
12728  * info.shape = NULL
12729  */
12730  __pyx_t_4 = __pyx_v_self->view.shape;
12731  __pyx_v_info->shape = __pyx_t_4;
12732 
12733  /* "View.MemoryView":522
12734  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12735  *
12736  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
12737  * info.shape = self.view.shape
12738  * else:
12739  */
12740  goto __pyx_L6;
12741  }
12742 
12743  /* "View.MemoryView":525
12744  * info.shape = self.view.shape
12745  * else:
12746  * info.shape = NULL # <<<<<<<<<<<<<<
12747  *
12748  * if flags & PyBUF_STRIDES:
12749  */
12750  /*else*/ {
12751  __pyx_v_info->shape = NULL;
12752  }
12753  __pyx_L6:;
12754 
12755  /* "View.MemoryView":527
12756  * info.shape = NULL
12757  *
12758  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12759  * info.strides = self.view.strides
12760  * else:
12761  */
12762  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12763  if (__pyx_t_1) {
12764 
12765  /* "View.MemoryView":528
12766  *
12767  * if flags & PyBUF_STRIDES:
12768  * info.strides = self.view.strides # <<<<<<<<<<<<<<
12769  * else:
12770  * info.strides = NULL
12771  */
12772  __pyx_t_4 = __pyx_v_self->view.strides;
12773  __pyx_v_info->strides = __pyx_t_4;
12774 
12775  /* "View.MemoryView":527
12776  * info.shape = NULL
12777  *
12778  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12779  * info.strides = self.view.strides
12780  * else:
12781  */
12782  goto __pyx_L7;
12783  }
12784 
12785  /* "View.MemoryView":530
12786  * info.strides = self.view.strides
12787  * else:
12788  * info.strides = NULL # <<<<<<<<<<<<<<
12789  *
12790  * if flags & PyBUF_INDIRECT:
12791  */
12792  /*else*/ {
12793  __pyx_v_info->strides = NULL;
12794  }
12795  __pyx_L7:;
12796 
12797  /* "View.MemoryView":532
12798  * info.strides = NULL
12799  *
12800  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12801  * info.suboffsets = self.view.suboffsets
12802  * else:
12803  */
12804  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12805  if (__pyx_t_1) {
12806 
12807  /* "View.MemoryView":533
12808  *
12809  * if flags & PyBUF_INDIRECT:
12810  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
12811  * else:
12812  * info.suboffsets = NULL
12813  */
12814  __pyx_t_4 = __pyx_v_self->view.suboffsets;
12815  __pyx_v_info->suboffsets = __pyx_t_4;
12816 
12817  /* "View.MemoryView":532
12818  * info.strides = NULL
12819  *
12820  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12821  * info.suboffsets = self.view.suboffsets
12822  * else:
12823  */
12824  goto __pyx_L8;
12825  }
12826 
12827  /* "View.MemoryView":535
12828  * info.suboffsets = self.view.suboffsets
12829  * else:
12830  * info.suboffsets = NULL # <<<<<<<<<<<<<<
12831  *
12832  * if flags & PyBUF_FORMAT:
12833  */
12834  /*else*/ {
12835  __pyx_v_info->suboffsets = NULL;
12836  }
12837  __pyx_L8:;
12838 
12839  /* "View.MemoryView":537
12840  * info.suboffsets = NULL
12841  *
12842  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12843  * info.format = self.view.format
12844  * else:
12845  */
12846  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12847  if (__pyx_t_1) {
12848 
12849  /* "View.MemoryView":538
12850  *
12851  * if flags & PyBUF_FORMAT:
12852  * info.format = self.view.format # <<<<<<<<<<<<<<
12853  * else:
12854  * info.format = NULL
12855  */
12856  __pyx_t_5 = __pyx_v_self->view.format;
12857  __pyx_v_info->format = __pyx_t_5;
12858 
12859  /* "View.MemoryView":537
12860  * info.suboffsets = NULL
12861  *
12862  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12863  * info.format = self.view.format
12864  * else:
12865  */
12866  goto __pyx_L9;
12867  }
12868 
12869  /* "View.MemoryView":540
12870  * info.format = self.view.format
12871  * else:
12872  * info.format = NULL # <<<<<<<<<<<<<<
12873  *
12874  * info.buf = self.view.buf
12875  */
12876  /*else*/ {
12877  __pyx_v_info->format = NULL;
12878  }
12879  __pyx_L9:;
12880 
12881  /* "View.MemoryView":542
12882  * info.format = NULL
12883  *
12884  * info.buf = self.view.buf # <<<<<<<<<<<<<<
12885  * info.ndim = self.view.ndim
12886  * info.itemsize = self.view.itemsize
12887  */
12888  __pyx_t_6 = __pyx_v_self->view.buf;
12889  __pyx_v_info->buf = __pyx_t_6;
12890 
12891  /* "View.MemoryView":543
12892  *
12893  * info.buf = self.view.buf
12894  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
12895  * info.itemsize = self.view.itemsize
12896  * info.len = self.view.len
12897  */
12898  __pyx_t_7 = __pyx_v_self->view.ndim;
12899  __pyx_v_info->ndim = __pyx_t_7;
12900 
12901  /* "View.MemoryView":544
12902  * info.buf = self.view.buf
12903  * info.ndim = self.view.ndim
12904  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
12905  * info.len = self.view.len
12906  * info.readonly = self.view.readonly
12907  */
12908  __pyx_t_8 = __pyx_v_self->view.itemsize;
12909  __pyx_v_info->itemsize = __pyx_t_8;
12910 
12911  /* "View.MemoryView":545
12912  * info.ndim = self.view.ndim
12913  * info.itemsize = self.view.itemsize
12914  * info.len = self.view.len # <<<<<<<<<<<<<<
12915  * info.readonly = self.view.readonly
12916  * info.obj = self
12917  */
12918  __pyx_t_8 = __pyx_v_self->view.len;
12919  __pyx_v_info->len = __pyx_t_8;
12920 
12921  /* "View.MemoryView":546
12922  * info.itemsize = self.view.itemsize
12923  * info.len = self.view.len
12924  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
12925  * info.obj = self
12926  *
12927  */
12928  __pyx_t_1 = __pyx_v_self->view.readonly;
12929  __pyx_v_info->readonly = __pyx_t_1;
12930 
12931  /* "View.MemoryView":547
12932  * info.len = self.view.len
12933  * info.readonly = self.view.readonly
12934  * info.obj = self # <<<<<<<<<<<<<<
12935  *
12936  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
12937  */
12938  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12939  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12940  __Pyx_GOTREF(__pyx_v_info->obj);
12941  __Pyx_DECREF(__pyx_v_info->obj);
12942  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12943 
12944  /* "View.MemoryView":518
12945  *
12946  * @cname('getbuffer')
12947  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12948  * if flags & PyBUF_WRITABLE and self.view.readonly:
12949  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12950  */
12951 
12952  /* function exit code */
12953  __pyx_r = 0;
12954  goto __pyx_L0;
12955  __pyx_L1_error:;
12956  __Pyx_XDECREF(__pyx_t_3);
12957  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12958  __pyx_r = -1;
12959  if (__pyx_v_info->obj != NULL) {
12960  __Pyx_GOTREF(__pyx_v_info->obj);
12961  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12962  }
12963  goto __pyx_L2;
12964  __pyx_L0:;
12965  if (__pyx_v_info->obj == Py_None) {
12966  __Pyx_GOTREF(__pyx_v_info->obj);
12967  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12968  }
12969  __pyx_L2:;
12970  __Pyx_TraceReturn(Py_None, 0);
12971  __Pyx_RefNannyFinishContext();
12972  return __pyx_r;
12973 }
12974 
12975 /* "View.MemoryView":553
12976  *
12977  * @property
12978  * def T(self): # <<<<<<<<<<<<<<
12979  * cdef _memoryviewslice result = memoryview_copy(self)
12980  * transpose_memslice(&result.from_slice)
12981  */
12982 
12983 /* Python wrapper */
12984 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
12985 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
12986  PyObject *__pyx_r = 0;
12987  __Pyx_RefNannyDeclarations
12988  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12989  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12990 
12991  /* function exit code */
12992  __Pyx_RefNannyFinishContext();
12993  return __pyx_r;
12994 }
12995 
12996 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12997  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
12998  PyObject *__pyx_r = NULL;
12999  __Pyx_TraceDeclarations
13000  __Pyx_RefNannyDeclarations
13001  PyObject *__pyx_t_1 = NULL;
13002  int __pyx_t_2;
13003  int __pyx_lineno = 0;
13004  const char *__pyx_filename = NULL;
13005  int __pyx_clineno = 0;
13006  __Pyx_RefNannySetupContext("__get__", 0);
13007  __Pyx_TraceCall("__get__", __pyx_f[1], 553, 0, __PYX_ERR(1, 553, __pyx_L1_error));
13008 
13009  /* "View.MemoryView":554
13010  * @property
13011  * def T(self):
13012  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
13013  * transpose_memslice(&result.from_slice)
13014  * return result
13015  */
13016  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
13017  __Pyx_GOTREF(__pyx_t_1);
13018  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
13019  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13020  __pyx_t_1 = 0;
13021 
13022  /* "View.MemoryView":555
13023  * def T(self):
13024  * cdef _memoryviewslice result = memoryview_copy(self)
13025  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
13026  * return result
13027  *
13028  */
13029  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
13030 
13031  /* "View.MemoryView":556
13032  * cdef _memoryviewslice result = memoryview_copy(self)
13033  * transpose_memslice(&result.from_slice)
13034  * return result # <<<<<<<<<<<<<<
13035  *
13036  * @property
13037  */
13038  __Pyx_XDECREF(__pyx_r);
13039  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13040  __pyx_r = ((PyObject *)__pyx_v_result);
13041  goto __pyx_L0;
13042 
13043  /* "View.MemoryView":553
13044  *
13045  * @property
13046  * def T(self): # <<<<<<<<<<<<<<
13047  * cdef _memoryviewslice result = memoryview_copy(self)
13048  * transpose_memslice(&result.from_slice)
13049  */
13050 
13051  /* function exit code */
13052  __pyx_L1_error:;
13053  __Pyx_XDECREF(__pyx_t_1);
13054  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13055  __pyx_r = NULL;
13056  __pyx_L0:;
13057  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13058  __Pyx_XGIVEREF(__pyx_r);
13059  __Pyx_TraceReturn(__pyx_r, 0);
13060  __Pyx_RefNannyFinishContext();
13061  return __pyx_r;
13062 }
13063 
13064 /* "View.MemoryView":559
13065  *
13066  * @property
13067  * def base(self): # <<<<<<<<<<<<<<
13068  * return self.obj
13069  *
13070  */
13071 
13072 /* Python wrapper */
13073 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
13074 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13075  PyObject *__pyx_r = 0;
13076  __Pyx_RefNannyDeclarations
13077  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13078  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13079 
13080  /* function exit code */
13081  __Pyx_RefNannyFinishContext();
13082  return __pyx_r;
13083 }
13084 
13085 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13086  PyObject *__pyx_r = NULL;
13087  __Pyx_TraceDeclarations
13088  __Pyx_RefNannyDeclarations
13089  int __pyx_lineno = 0;
13090  const char *__pyx_filename = NULL;
13091  int __pyx_clineno = 0;
13092  __Pyx_RefNannySetupContext("__get__", 0);
13093  __Pyx_TraceCall("__get__", __pyx_f[1], 559, 0, __PYX_ERR(1, 559, __pyx_L1_error));
13094 
13095  /* "View.MemoryView":560
13096  * @property
13097  * def base(self):
13098  * return self.obj # <<<<<<<<<<<<<<
13099  *
13100  * @property
13101  */
13102  __Pyx_XDECREF(__pyx_r);
13103  __Pyx_INCREF(__pyx_v_self->obj);
13104  __pyx_r = __pyx_v_self->obj;
13105  goto __pyx_L0;
13106 
13107  /* "View.MemoryView":559
13108  *
13109  * @property
13110  * def base(self): # <<<<<<<<<<<<<<
13111  * return self.obj
13112  *
13113  */
13114 
13115  /* function exit code */
13116  __pyx_L1_error:;
13117  __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13118  __pyx_r = NULL;
13119  __pyx_L0:;
13120  __Pyx_XGIVEREF(__pyx_r);
13121  __Pyx_TraceReturn(__pyx_r, 0);
13122  __Pyx_RefNannyFinishContext();
13123  return __pyx_r;
13124 }
13125 
13126 /* "View.MemoryView":563
13127  *
13128  * @property
13129  * def shape(self): # <<<<<<<<<<<<<<
13130  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13131  *
13132  */
13133 
13134 /* Python wrapper */
13135 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
13136 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13137  PyObject *__pyx_r = 0;
13138  __Pyx_RefNannyDeclarations
13139  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13140  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13141 
13142  /* function exit code */
13143  __Pyx_RefNannyFinishContext();
13144  return __pyx_r;
13145 }
13146 
13147 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13148  Py_ssize_t __pyx_v_length;
13149  PyObject *__pyx_r = NULL;
13150  __Pyx_TraceDeclarations
13151  __Pyx_RefNannyDeclarations
13152  PyObject *__pyx_t_1 = NULL;
13153  Py_ssize_t *__pyx_t_2;
13154  Py_ssize_t *__pyx_t_3;
13155  Py_ssize_t *__pyx_t_4;
13156  PyObject *__pyx_t_5 = NULL;
13157  int __pyx_lineno = 0;
13158  const char *__pyx_filename = NULL;
13159  int __pyx_clineno = 0;
13160  __Pyx_RefNannySetupContext("__get__", 0);
13161  __Pyx_TraceCall("__get__", __pyx_f[1], 563, 0, __PYX_ERR(1, 563, __pyx_L1_error));
13162 
13163  /* "View.MemoryView":564
13164  * @property
13165  * def shape(self):
13166  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
13167  *
13168  * @property
13169  */
13170  __Pyx_XDECREF(__pyx_r);
13171  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
13172  __Pyx_GOTREF(__pyx_t_1);
13173  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13174  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13175  __pyx_t_2 = __pyx_t_4;
13176  __pyx_v_length = (__pyx_t_2[0]);
13177  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13178  __Pyx_GOTREF(__pyx_t_5);
13179  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
13180  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13181  }
13182  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13183  __Pyx_GOTREF(__pyx_t_5);
13184  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13185  __pyx_r = __pyx_t_5;
13186  __pyx_t_5 = 0;
13187  goto __pyx_L0;
13188 
13189  /* "View.MemoryView":563
13190  *
13191  * @property
13192  * def shape(self): # <<<<<<<<<<<<<<
13193  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13194  *
13195  */
13196 
13197  /* function exit code */
13198  __pyx_L1_error:;
13199  __Pyx_XDECREF(__pyx_t_1);
13200  __Pyx_XDECREF(__pyx_t_5);
13201  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13202  __pyx_r = NULL;
13203  __pyx_L0:;
13204  __Pyx_XGIVEREF(__pyx_r);
13205  __Pyx_TraceReturn(__pyx_r, 0);
13206  __Pyx_RefNannyFinishContext();
13207  return __pyx_r;
13208 }
13209 
13210 /* "View.MemoryView":567
13211  *
13212  * @property
13213  * def strides(self): # <<<<<<<<<<<<<<
13214  * if self.view.strides == NULL:
13215  *
13216  */
13217 
13218 /* Python wrapper */
13219 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
13220 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13221  PyObject *__pyx_r = 0;
13222  __Pyx_RefNannyDeclarations
13223  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13224  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13225 
13226  /* function exit code */
13227  __Pyx_RefNannyFinishContext();
13228  return __pyx_r;
13229 }
13230 
13231 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13232  Py_ssize_t __pyx_v_stride;
13233  PyObject *__pyx_r = NULL;
13234  __Pyx_TraceDeclarations
13235  __Pyx_RefNannyDeclarations
13236  int __pyx_t_1;
13237  PyObject *__pyx_t_2 = NULL;
13238  Py_ssize_t *__pyx_t_3;
13239  Py_ssize_t *__pyx_t_4;
13240  Py_ssize_t *__pyx_t_5;
13241  PyObject *__pyx_t_6 = NULL;
13242  int __pyx_lineno = 0;
13243  const char *__pyx_filename = NULL;
13244  int __pyx_clineno = 0;
13245  __Pyx_RefNannySetupContext("__get__", 0);
13246  __Pyx_TraceCall("__get__", __pyx_f[1], 567, 0, __PYX_ERR(1, 567, __pyx_L1_error));
13247 
13248  /* "View.MemoryView":568
13249  * @property
13250  * def strides(self):
13251  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13252  *
13253  * raise ValueError("Buffer view does not expose strides")
13254  */
13255  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13256  if (unlikely(__pyx_t_1)) {
13257 
13258  /* "View.MemoryView":570
13259  * if self.view.strides == NULL:
13260  *
13261  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
13262  *
13263  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
13264  */
13265  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
13266  __Pyx_GOTREF(__pyx_t_2);
13267  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13268  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13269  __PYX_ERR(1, 570, __pyx_L1_error)
13270 
13271  /* "View.MemoryView":568
13272  * @property
13273  * def strides(self):
13274  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13275  *
13276  * raise ValueError("Buffer view does not expose strides")
13277  */
13278  }
13279 
13280  /* "View.MemoryView":572
13281  * raise ValueError("Buffer view does not expose strides")
13282  *
13283  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
13284  *
13285  * @property
13286  */
13287  __Pyx_XDECREF(__pyx_r);
13288  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13289  __Pyx_GOTREF(__pyx_t_2);
13290  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13291  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13292  __pyx_t_3 = __pyx_t_5;
13293  __pyx_v_stride = (__pyx_t_3[0]);
13294  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13295  __Pyx_GOTREF(__pyx_t_6);
13296  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
13297  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13298  }
13299  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13300  __Pyx_GOTREF(__pyx_t_6);
13301  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13302  __pyx_r = __pyx_t_6;
13303  __pyx_t_6 = 0;
13304  goto __pyx_L0;
13305 
13306  /* "View.MemoryView":567
13307  *
13308  * @property
13309  * def strides(self): # <<<<<<<<<<<<<<
13310  * if self.view.strides == NULL:
13311  *
13312  */
13313 
13314  /* function exit code */
13315  __pyx_L1_error:;
13316  __Pyx_XDECREF(__pyx_t_2);
13317  __Pyx_XDECREF(__pyx_t_6);
13318  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13319  __pyx_r = NULL;
13320  __pyx_L0:;
13321  __Pyx_XGIVEREF(__pyx_r);
13322  __Pyx_TraceReturn(__pyx_r, 0);
13323  __Pyx_RefNannyFinishContext();
13324  return __pyx_r;
13325 }
13326 
13327 /* "View.MemoryView":575
13328  *
13329  * @property
13330  * def suboffsets(self): # <<<<<<<<<<<<<<
13331  * if self.view.suboffsets == NULL:
13332  * return (-1,) * self.view.ndim
13333  */
13334 
13335 /* Python wrapper */
13336 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
13337 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13338  PyObject *__pyx_r = 0;
13339  __Pyx_RefNannyDeclarations
13340  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13341  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13342 
13343  /* function exit code */
13344  __Pyx_RefNannyFinishContext();
13345  return __pyx_r;
13346 }
13347 
13348 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13349  Py_ssize_t __pyx_v_suboffset;
13350  PyObject *__pyx_r = NULL;
13351  __Pyx_TraceDeclarations
13352  __Pyx_RefNannyDeclarations
13353  int __pyx_t_1;
13354  PyObject *__pyx_t_2 = NULL;
13355  PyObject *__pyx_t_3 = NULL;
13356  Py_ssize_t *__pyx_t_4;
13357  Py_ssize_t *__pyx_t_5;
13358  Py_ssize_t *__pyx_t_6;
13359  int __pyx_lineno = 0;
13360  const char *__pyx_filename = NULL;
13361  int __pyx_clineno = 0;
13362  __Pyx_RefNannySetupContext("__get__", 0);
13363  __Pyx_TraceCall("__get__", __pyx_f[1], 575, 0, __PYX_ERR(1, 575, __pyx_L1_error));
13364 
13365  /* "View.MemoryView":576
13366  * @property
13367  * def suboffsets(self):
13368  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13369  * return (-1,) * self.view.ndim
13370  *
13371  */
13372  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13373  if (__pyx_t_1) {
13374 
13375  /* "View.MemoryView":577
13376  * def suboffsets(self):
13377  * if self.view.suboffsets == NULL:
13378  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
13379  *
13380  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
13381  */
13382  __Pyx_XDECREF(__pyx_r);
13383  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
13384  __Pyx_GOTREF(__pyx_t_2);
13385  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__29, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
13386  __Pyx_GOTREF(__pyx_t_3);
13387  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13388  __pyx_r = __pyx_t_3;
13389  __pyx_t_3 = 0;
13390  goto __pyx_L0;
13391 
13392  /* "View.MemoryView":576
13393  * @property
13394  * def suboffsets(self):
13395  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13396  * return (-1,) * self.view.ndim
13397  *
13398  */
13399  }
13400 
13401  /* "View.MemoryView":579
13402  * return (-1,) * self.view.ndim
13403  *
13404  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
13405  *
13406  * @property
13407  */
13408  __Pyx_XDECREF(__pyx_r);
13409  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
13410  __Pyx_GOTREF(__pyx_t_3);
13411  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13412  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13413  __pyx_t_4 = __pyx_t_6;
13414  __pyx_v_suboffset = (__pyx_t_4[0]);
13415  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13416  __Pyx_GOTREF(__pyx_t_2);
13417  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
13418  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13419  }
13420  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13421  __Pyx_GOTREF(__pyx_t_2);
13422  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13423  __pyx_r = __pyx_t_2;
13424  __pyx_t_2 = 0;
13425  goto __pyx_L0;
13426 
13427  /* "View.MemoryView":575
13428  *
13429  * @property
13430  * def suboffsets(self): # <<<<<<<<<<<<<<
13431  * if self.view.suboffsets == NULL:
13432  * return (-1,) * self.view.ndim
13433  */
13434 
13435  /* function exit code */
13436  __pyx_L1_error:;
13437  __Pyx_XDECREF(__pyx_t_2);
13438  __Pyx_XDECREF(__pyx_t_3);
13439  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13440  __pyx_r = NULL;
13441  __pyx_L0:;
13442  __Pyx_XGIVEREF(__pyx_r);
13443  __Pyx_TraceReturn(__pyx_r, 0);
13444  __Pyx_RefNannyFinishContext();
13445  return __pyx_r;
13446 }
13447 
13448 /* "View.MemoryView":582
13449  *
13450  * @property
13451  * def ndim(self): # <<<<<<<<<<<<<<
13452  * return self.view.ndim
13453  *
13454  */
13455 
13456 /* Python wrapper */
13457 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
13458 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13459  PyObject *__pyx_r = 0;
13460  __Pyx_RefNannyDeclarations
13461  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13462  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13463 
13464  /* function exit code */
13465  __Pyx_RefNannyFinishContext();
13466  return __pyx_r;
13467 }
13468 
13469 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13470  PyObject *__pyx_r = NULL;
13471  __Pyx_TraceDeclarations
13472  __Pyx_RefNannyDeclarations
13473  PyObject *__pyx_t_1 = NULL;
13474  int __pyx_lineno = 0;
13475  const char *__pyx_filename = NULL;
13476  int __pyx_clineno = 0;
13477  __Pyx_RefNannySetupContext("__get__", 0);
13478  __Pyx_TraceCall("__get__", __pyx_f[1], 582, 0, __PYX_ERR(1, 582, __pyx_L1_error));
13479 
13480  /* "View.MemoryView":583
13481  * @property
13482  * def ndim(self):
13483  * return self.view.ndim # <<<<<<<<<<<<<<
13484  *
13485  * @property
13486  */
13487  __Pyx_XDECREF(__pyx_r);
13488  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
13489  __Pyx_GOTREF(__pyx_t_1);
13490  __pyx_r = __pyx_t_1;
13491  __pyx_t_1 = 0;
13492  goto __pyx_L0;
13493 
13494  /* "View.MemoryView":582
13495  *
13496  * @property
13497  * def ndim(self): # <<<<<<<<<<<<<<
13498  * return self.view.ndim
13499  *
13500  */
13501 
13502  /* function exit code */
13503  __pyx_L1_error:;
13504  __Pyx_XDECREF(__pyx_t_1);
13505  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13506  __pyx_r = NULL;
13507  __pyx_L0:;
13508  __Pyx_XGIVEREF(__pyx_r);
13509  __Pyx_TraceReturn(__pyx_r, 0);
13510  __Pyx_RefNannyFinishContext();
13511  return __pyx_r;
13512 }
13513 
13514 /* "View.MemoryView":586
13515  *
13516  * @property
13517  * def itemsize(self): # <<<<<<<<<<<<<<
13518  * return self.view.itemsize
13519  *
13520  */
13521 
13522 /* Python wrapper */
13523 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
13524 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13525  PyObject *__pyx_r = 0;
13526  __Pyx_RefNannyDeclarations
13527  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13528  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13529 
13530  /* function exit code */
13531  __Pyx_RefNannyFinishContext();
13532  return __pyx_r;
13533 }
13534 
13535 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13536  PyObject *__pyx_r = NULL;
13537  __Pyx_TraceDeclarations
13538  __Pyx_RefNannyDeclarations
13539  PyObject *__pyx_t_1 = NULL;
13540  int __pyx_lineno = 0;
13541  const char *__pyx_filename = NULL;
13542  int __pyx_clineno = 0;
13543  __Pyx_RefNannySetupContext("__get__", 0);
13544  __Pyx_TraceCall("__get__", __pyx_f[1], 586, 0, __PYX_ERR(1, 586, __pyx_L1_error));
13545 
13546  /* "View.MemoryView":587
13547  * @property
13548  * def itemsize(self):
13549  * return self.view.itemsize # <<<<<<<<<<<<<<
13550  *
13551  * @property
13552  */
13553  __Pyx_XDECREF(__pyx_r);
13554  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
13555  __Pyx_GOTREF(__pyx_t_1);
13556  __pyx_r = __pyx_t_1;
13557  __pyx_t_1 = 0;
13558  goto __pyx_L0;
13559 
13560  /* "View.MemoryView":586
13561  *
13562  * @property
13563  * def itemsize(self): # <<<<<<<<<<<<<<
13564  * return self.view.itemsize
13565  *
13566  */
13567 
13568  /* function exit code */
13569  __pyx_L1_error:;
13570  __Pyx_XDECREF(__pyx_t_1);
13571  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13572  __pyx_r = NULL;
13573  __pyx_L0:;
13574  __Pyx_XGIVEREF(__pyx_r);
13575  __Pyx_TraceReturn(__pyx_r, 0);
13576  __Pyx_RefNannyFinishContext();
13577  return __pyx_r;
13578 }
13579 
13580 /* "View.MemoryView":590
13581  *
13582  * @property
13583  * def nbytes(self): # <<<<<<<<<<<<<<
13584  * return self.size * self.view.itemsize
13585  *
13586  */
13587 
13588 /* Python wrapper */
13589 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
13590 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13591  PyObject *__pyx_r = 0;
13592  __Pyx_RefNannyDeclarations
13593  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13594  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13595 
13596  /* function exit code */
13597  __Pyx_RefNannyFinishContext();
13598  return __pyx_r;
13599 }
13600 
13601 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13602  PyObject *__pyx_r = NULL;
13603  __Pyx_TraceDeclarations
13604  __Pyx_RefNannyDeclarations
13605  PyObject *__pyx_t_1 = NULL;
13606  PyObject *__pyx_t_2 = NULL;
13607  PyObject *__pyx_t_3 = NULL;
13608  int __pyx_lineno = 0;
13609  const char *__pyx_filename = NULL;
13610  int __pyx_clineno = 0;
13611  __Pyx_RefNannySetupContext("__get__", 0);
13612  __Pyx_TraceCall("__get__", __pyx_f[1], 590, 0, __PYX_ERR(1, 590, __pyx_L1_error));
13613 
13614  /* "View.MemoryView":591
13615  * @property
13616  * def nbytes(self):
13617  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
13618  *
13619  * @property
13620  */
13621  __Pyx_XDECREF(__pyx_r);
13622  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
13623  __Pyx_GOTREF(__pyx_t_1);
13624  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
13625  __Pyx_GOTREF(__pyx_t_2);
13626  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
13627  __Pyx_GOTREF(__pyx_t_3);
13628  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13629  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13630  __pyx_r = __pyx_t_3;
13631  __pyx_t_3 = 0;
13632  goto __pyx_L0;
13633 
13634  /* "View.MemoryView":590
13635  *
13636  * @property
13637  * def nbytes(self): # <<<<<<<<<<<<<<
13638  * return self.size * self.view.itemsize
13639  *
13640  */
13641 
13642  /* function exit code */
13643  __pyx_L1_error:;
13644  __Pyx_XDECREF(__pyx_t_1);
13645  __Pyx_XDECREF(__pyx_t_2);
13646  __Pyx_XDECREF(__pyx_t_3);
13647  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13648  __pyx_r = NULL;
13649  __pyx_L0:;
13650  __Pyx_XGIVEREF(__pyx_r);
13651  __Pyx_TraceReturn(__pyx_r, 0);
13652  __Pyx_RefNannyFinishContext();
13653  return __pyx_r;
13654 }
13655 
13656 /* "View.MemoryView":594
13657  *
13658  * @property
13659  * def size(self): # <<<<<<<<<<<<<<
13660  * if self._size is None:
13661  * result = 1
13662  */
13663 
13664 /* Python wrapper */
13665 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
13666 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13667  PyObject *__pyx_r = 0;
13668  __Pyx_RefNannyDeclarations
13669  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13670  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13671 
13672  /* function exit code */
13673  __Pyx_RefNannyFinishContext();
13674  return __pyx_r;
13675 }
13676 
13677 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13678  PyObject *__pyx_v_result = NULL;
13679  PyObject *__pyx_v_length = NULL;
13680  PyObject *__pyx_r = NULL;
13681  __Pyx_TraceDeclarations
13682  __Pyx_RefNannyDeclarations
13683  int __pyx_t_1;
13684  int __pyx_t_2;
13685  Py_ssize_t *__pyx_t_3;
13686  Py_ssize_t *__pyx_t_4;
13687  Py_ssize_t *__pyx_t_5;
13688  PyObject *__pyx_t_6 = NULL;
13689  int __pyx_lineno = 0;
13690  const char *__pyx_filename = NULL;
13691  int __pyx_clineno = 0;
13692  __Pyx_RefNannySetupContext("__get__", 0);
13693  __Pyx_TraceCall("__get__", __pyx_f[1], 594, 0, __PYX_ERR(1, 594, __pyx_L1_error));
13694 
13695  /* "View.MemoryView":595
13696  * @property
13697  * def size(self):
13698  * if self._size is None: # <<<<<<<<<<<<<<
13699  * result = 1
13700  *
13701  */
13702  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13703  __pyx_t_2 = (__pyx_t_1 != 0);
13704  if (__pyx_t_2) {
13705 
13706  /* "View.MemoryView":596
13707  * def size(self):
13708  * if self._size is None:
13709  * result = 1 # <<<<<<<<<<<<<<
13710  *
13711  * for length in self.view.shape[:self.view.ndim]:
13712  */
13713  __Pyx_INCREF(__pyx_int_1);
13714  __pyx_v_result = __pyx_int_1;
13715 
13716  /* "View.MemoryView":598
13717  * result = 1
13718  *
13719  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
13720  * result *= length
13721  *
13722  */
13723  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13724  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13725  __pyx_t_3 = __pyx_t_5;
13726  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
13727  __Pyx_GOTREF(__pyx_t_6);
13728  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13729  __pyx_t_6 = 0;
13730 
13731  /* "View.MemoryView":599
13732  *
13733  * for length in self.view.shape[:self.view.ndim]:
13734  * result *= length # <<<<<<<<<<<<<<
13735  *
13736  * self._size = result
13737  */
13738  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
13739  __Pyx_GOTREF(__pyx_t_6);
13740  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13741  __pyx_t_6 = 0;
13742  }
13743 
13744  /* "View.MemoryView":601
13745  * result *= length
13746  *
13747  * self._size = result # <<<<<<<<<<<<<<
13748  *
13749  * return self._size
13750  */
13751  __Pyx_INCREF(__pyx_v_result);
13752  __Pyx_GIVEREF(__pyx_v_result);
13753  __Pyx_GOTREF(__pyx_v_self->_size);
13754  __Pyx_DECREF(__pyx_v_self->_size);
13755  __pyx_v_self->_size = __pyx_v_result;
13756 
13757  /* "View.MemoryView":595
13758  * @property
13759  * def size(self):
13760  * if self._size is None: # <<<<<<<<<<<<<<
13761  * result = 1
13762  *
13763  */
13764  }
13765 
13766  /* "View.MemoryView":603
13767  * self._size = result
13768  *
13769  * return self._size # <<<<<<<<<<<<<<
13770  *
13771  * def __len__(self):
13772  */
13773  __Pyx_XDECREF(__pyx_r);
13774  __Pyx_INCREF(__pyx_v_self->_size);
13775  __pyx_r = __pyx_v_self->_size;
13776  goto __pyx_L0;
13777 
13778  /* "View.MemoryView":594
13779  *
13780  * @property
13781  * def size(self): # <<<<<<<<<<<<<<
13782  * if self._size is None:
13783  * result = 1
13784  */
13785 
13786  /* function exit code */
13787  __pyx_L1_error:;
13788  __Pyx_XDECREF(__pyx_t_6);
13789  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13790  __pyx_r = NULL;
13791  __pyx_L0:;
13792  __Pyx_XDECREF(__pyx_v_result);
13793  __Pyx_XDECREF(__pyx_v_length);
13794  __Pyx_XGIVEREF(__pyx_r);
13795  __Pyx_TraceReturn(__pyx_r, 0);
13796  __Pyx_RefNannyFinishContext();
13797  return __pyx_r;
13798 }
13799 
13800 /* "View.MemoryView":605
13801  * return self._size
13802  *
13803  * def __len__(self): # <<<<<<<<<<<<<<
13804  * if self.view.ndim >= 1:
13805  * return self.view.shape[0]
13806  */
13807 
13808 /* Python wrapper */
13809 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
13810 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13811  Py_ssize_t __pyx_r;
13812  __Pyx_RefNannyDeclarations
13813  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
13814  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13815 
13816  /* function exit code */
13817  __Pyx_RefNannyFinishContext();
13818  return __pyx_r;
13819 }
13820 
13821 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
13822  Py_ssize_t __pyx_r;
13823  __Pyx_TraceDeclarations
13824  __Pyx_RefNannyDeclarations
13825  int __pyx_t_1;
13826  int __pyx_lineno = 0;
13827  const char *__pyx_filename = NULL;
13828  int __pyx_clineno = 0;
13829  __Pyx_RefNannySetupContext("__len__", 0);
13830  __Pyx_TraceCall("__len__", __pyx_f[1], 605, 0, __PYX_ERR(1, 605, __pyx_L1_error));
13831 
13832  /* "View.MemoryView":606
13833  *
13834  * def __len__(self):
13835  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13836  * return self.view.shape[0]
13837  *
13838  */
13839  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13840  if (__pyx_t_1) {
13841 
13842  /* "View.MemoryView":607
13843  * def __len__(self):
13844  * if self.view.ndim >= 1:
13845  * return self.view.shape[0] # <<<<<<<<<<<<<<
13846  *
13847  * return 0
13848  */
13849  __pyx_r = (__pyx_v_self->view.shape[0]);
13850  goto __pyx_L0;
13851 
13852  /* "View.MemoryView":606
13853  *
13854  * def __len__(self):
13855  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13856  * return self.view.shape[0]
13857  *
13858  */
13859  }
13860 
13861  /* "View.MemoryView":609
13862  * return self.view.shape[0]
13863  *
13864  * return 0 # <<<<<<<<<<<<<<
13865  *
13866  * def __repr__(self):
13867  */
13868  __pyx_r = 0;
13869  goto __pyx_L0;
13870 
13871  /* "View.MemoryView":605
13872  * return self._size
13873  *
13874  * def __len__(self): # <<<<<<<<<<<<<<
13875  * if self.view.ndim >= 1:
13876  * return self.view.shape[0]
13877  */
13878 
13879  /* function exit code */
13880  __pyx_L1_error:;
13881  __Pyx_AddTraceback("View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13882  __pyx_r = -1;
13883  __pyx_L0:;
13884  __Pyx_TraceReturn(Py_None, 0);
13885  __Pyx_RefNannyFinishContext();
13886  return __pyx_r;
13887 }
13888 
13889 /* "View.MemoryView":611
13890  * return 0
13891  *
13892  * def __repr__(self): # <<<<<<<<<<<<<<
13893  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13894  * id(self))
13895  */
13896 
13897 /* Python wrapper */
13898 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
13899 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13900  PyObject *__pyx_r = 0;
13901  __Pyx_RefNannyDeclarations
13902  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13903  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13904 
13905  /* function exit code */
13906  __Pyx_RefNannyFinishContext();
13907  return __pyx_r;
13908 }
13909 
13910 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
13911  PyObject *__pyx_r = NULL;
13912  __Pyx_TraceDeclarations
13913  __Pyx_RefNannyDeclarations
13914  PyObject *__pyx_t_1 = NULL;
13915  PyObject *__pyx_t_2 = NULL;
13916  PyObject *__pyx_t_3 = NULL;
13917  int __pyx_lineno = 0;
13918  const char *__pyx_filename = NULL;
13919  int __pyx_clineno = 0;
13920  __Pyx_RefNannySetupContext("__repr__", 0);
13921  __Pyx_TraceCall("__repr__", __pyx_f[1], 611, 0, __PYX_ERR(1, 611, __pyx_L1_error));
13922 
13923  /* "View.MemoryView":612
13924  *
13925  * def __repr__(self):
13926  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13927  * id(self))
13928  *
13929  */
13930  __Pyx_XDECREF(__pyx_r);
13931  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13932  __Pyx_GOTREF(__pyx_t_1);
13933  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13934  __Pyx_GOTREF(__pyx_t_2);
13935  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13936  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13937  __Pyx_GOTREF(__pyx_t_1);
13938  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13939 
13940  /* "View.MemoryView":613
13941  * def __repr__(self):
13942  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13943  * id(self)) # <<<<<<<<<<<<<<
13944  *
13945  * def __str__(self):
13946  */
13947  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
13948  __Pyx_GOTREF(__pyx_t_2);
13949 
13950  /* "View.MemoryView":612
13951  *
13952  * def __repr__(self):
13953  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13954  * id(self))
13955  *
13956  */
13957  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
13958  __Pyx_GOTREF(__pyx_t_3);
13959  __Pyx_GIVEREF(__pyx_t_1);
13960  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13961  __Pyx_GIVEREF(__pyx_t_2);
13962  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
13963  __pyx_t_1 = 0;
13964  __pyx_t_2 = 0;
13965  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13966  __Pyx_GOTREF(__pyx_t_2);
13967  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13968  __pyx_r = __pyx_t_2;
13969  __pyx_t_2 = 0;
13970  goto __pyx_L0;
13971 
13972  /* "View.MemoryView":611
13973  * return 0
13974  *
13975  * def __repr__(self): # <<<<<<<<<<<<<<
13976  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13977  * id(self))
13978  */
13979 
13980  /* function exit code */
13981  __pyx_L1_error:;
13982  __Pyx_XDECREF(__pyx_t_1);
13983  __Pyx_XDECREF(__pyx_t_2);
13984  __Pyx_XDECREF(__pyx_t_3);
13985  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13986  __pyx_r = NULL;
13987  __pyx_L0:;
13988  __Pyx_XGIVEREF(__pyx_r);
13989  __Pyx_TraceReturn(__pyx_r, 0);
13990  __Pyx_RefNannyFinishContext();
13991  return __pyx_r;
13992 }
13993 
13994 /* "View.MemoryView":615
13995  * id(self))
13996  *
13997  * def __str__(self): # <<<<<<<<<<<<<<
13998  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13999  *
14000  */
14001 
14002 /* Python wrapper */
14003 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
14004 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14005  PyObject *__pyx_r = 0;
14006  __Pyx_RefNannyDeclarations
14007  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
14008  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14009 
14010  /* function exit code */
14011  __Pyx_RefNannyFinishContext();
14012  return __pyx_r;
14013 }
14014 
14015 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
14016  PyObject *__pyx_r = NULL;
14017  __Pyx_TraceDeclarations
14018  __Pyx_RefNannyDeclarations
14019  PyObject *__pyx_t_1 = NULL;
14020  PyObject *__pyx_t_2 = NULL;
14021  int __pyx_lineno = 0;
14022  const char *__pyx_filename = NULL;
14023  int __pyx_clineno = 0;
14024  __Pyx_RefNannySetupContext("__str__", 0);
14025  __Pyx_TraceCall("__str__", __pyx_f[1], 615, 0, __PYX_ERR(1, 615, __pyx_L1_error));
14026 
14027  /* "View.MemoryView":616
14028  *
14029  * def __str__(self):
14030  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
14031  *
14032  *
14033  */
14034  __Pyx_XDECREF(__pyx_r);
14035  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14036  __Pyx_GOTREF(__pyx_t_1);
14037  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14038  __Pyx_GOTREF(__pyx_t_2);
14039  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14040  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14041  __Pyx_GOTREF(__pyx_t_1);
14042  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14043  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14044  __Pyx_GOTREF(__pyx_t_2);
14045  __Pyx_GIVEREF(__pyx_t_1);
14046  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14047  __pyx_t_1 = 0;
14048  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14049  __Pyx_GOTREF(__pyx_t_1);
14050  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14051  __pyx_r = __pyx_t_1;
14052  __pyx_t_1 = 0;
14053  goto __pyx_L0;
14054 
14055  /* "View.MemoryView":615
14056  * id(self))
14057  *
14058  * def __str__(self): # <<<<<<<<<<<<<<
14059  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14060  *
14061  */
14062 
14063  /* function exit code */
14064  __pyx_L1_error:;
14065  __Pyx_XDECREF(__pyx_t_1);
14066  __Pyx_XDECREF(__pyx_t_2);
14067  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14068  __pyx_r = NULL;
14069  __pyx_L0:;
14070  __Pyx_XGIVEREF(__pyx_r);
14071  __Pyx_TraceReturn(__pyx_r, 0);
14072  __Pyx_RefNannyFinishContext();
14073  return __pyx_r;
14074 }
14075 
14076 /* "View.MemoryView":619
14077  *
14078  *
14079  * def is_c_contig(self): # <<<<<<<<<<<<<<
14080  * cdef __Pyx_memviewslice *mslice
14081  * cdef __Pyx_memviewslice tmp
14082  */
14083 
14084 /* Python wrapper */
14085 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14086 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
14087 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14088  PyObject *__pyx_r = 0;
14089  __Pyx_RefNannyDeclarations
14090  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
14091  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14092 
14093  /* function exit code */
14094  __Pyx_RefNannyFinishContext();
14095  return __pyx_r;
14096 }
14097 
14098 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14099  __Pyx_memviewslice *__pyx_v_mslice;
14100  __Pyx_memviewslice __pyx_v_tmp;
14101  PyObject *__pyx_r = NULL;
14102  __Pyx_TraceDeclarations
14103  __Pyx_RefNannyDeclarations
14104  __Pyx_memviewslice *__pyx_t_1;
14105  PyObject *__pyx_t_2 = NULL;
14106  int __pyx_lineno = 0;
14107  const char *__pyx_filename = NULL;
14108  int __pyx_clineno = 0;
14109  __Pyx_RefNannySetupContext("is_c_contig", 0);
14110  __Pyx_TraceCall("is_c_contig", __pyx_f[1], 619, 0, __PYX_ERR(1, 619, __pyx_L1_error));
14111 
14112  /* "View.MemoryView":622
14113  * cdef __Pyx_memviewslice *mslice
14114  * cdef __Pyx_memviewslice tmp
14115  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14116  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14117  *
14118  */
14119  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
14120  __pyx_v_mslice = __pyx_t_1;
14121 
14122  /* "View.MemoryView":623
14123  * cdef __Pyx_memviewslice tmp
14124  * mslice = get_slice_from_memview(self, &tmp)
14125  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
14126  *
14127  * def is_f_contig(self):
14128  */
14129  __Pyx_XDECREF(__pyx_r);
14130  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
14131  __Pyx_GOTREF(__pyx_t_2);
14132  __pyx_r = __pyx_t_2;
14133  __pyx_t_2 = 0;
14134  goto __pyx_L0;
14135 
14136  /* "View.MemoryView":619
14137  *
14138  *
14139  * def is_c_contig(self): # <<<<<<<<<<<<<<
14140  * cdef __Pyx_memviewslice *mslice
14141  * cdef __Pyx_memviewslice tmp
14142  */
14143 
14144  /* function exit code */
14145  __pyx_L1_error:;
14146  __Pyx_XDECREF(__pyx_t_2);
14147  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14148  __pyx_r = NULL;
14149  __pyx_L0:;
14150  __Pyx_XGIVEREF(__pyx_r);
14151  __Pyx_TraceReturn(__pyx_r, 0);
14152  __Pyx_RefNannyFinishContext();
14153  return __pyx_r;
14154 }
14155 
14156 /* "View.MemoryView":625
14157  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14158  *
14159  * def is_f_contig(self): # <<<<<<<<<<<<<<
14160  * cdef __Pyx_memviewslice *mslice
14161  * cdef __Pyx_memviewslice tmp
14162  */
14163 
14164 /* Python wrapper */
14165 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14166 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
14167 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14168  PyObject *__pyx_r = 0;
14169  __Pyx_RefNannyDeclarations
14170  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
14171  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14172 
14173  /* function exit code */
14174  __Pyx_RefNannyFinishContext();
14175  return __pyx_r;
14176 }
14177 
14178 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14179  __Pyx_memviewslice *__pyx_v_mslice;
14180  __Pyx_memviewslice __pyx_v_tmp;
14181  PyObject *__pyx_r = NULL;
14182  __Pyx_TraceDeclarations
14183  __Pyx_RefNannyDeclarations
14184  __Pyx_memviewslice *__pyx_t_1;
14185  PyObject *__pyx_t_2 = NULL;
14186  int __pyx_lineno = 0;
14187  const char *__pyx_filename = NULL;
14188  int __pyx_clineno = 0;
14189  __Pyx_RefNannySetupContext("is_f_contig", 0);
14190  __Pyx_TraceCall("is_f_contig", __pyx_f[1], 625, 0, __PYX_ERR(1, 625, __pyx_L1_error));
14191 
14192  /* "View.MemoryView":628
14193  * cdef __Pyx_memviewslice *mslice
14194  * cdef __Pyx_memviewslice tmp
14195  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14196  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14197  *
14198  */
14199  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
14200  __pyx_v_mslice = __pyx_t_1;
14201 
14202  /* "View.MemoryView":629
14203  * cdef __Pyx_memviewslice tmp
14204  * mslice = get_slice_from_memview(self, &tmp)
14205  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
14206  *
14207  * def copy(self):
14208  */
14209  __Pyx_XDECREF(__pyx_r);
14210  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
14211  __Pyx_GOTREF(__pyx_t_2);
14212  __pyx_r = __pyx_t_2;
14213  __pyx_t_2 = 0;
14214  goto __pyx_L0;
14215 
14216  /* "View.MemoryView":625
14217  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14218  *
14219  * def is_f_contig(self): # <<<<<<<<<<<<<<
14220  * cdef __Pyx_memviewslice *mslice
14221  * cdef __Pyx_memviewslice tmp
14222  */
14223 
14224  /* function exit code */
14225  __pyx_L1_error:;
14226  __Pyx_XDECREF(__pyx_t_2);
14227  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14228  __pyx_r = NULL;
14229  __pyx_L0:;
14230  __Pyx_XGIVEREF(__pyx_r);
14231  __Pyx_TraceReturn(__pyx_r, 0);
14232  __Pyx_RefNannyFinishContext();
14233  return __pyx_r;
14234 }
14235 
14236 /* "View.MemoryView":631
14237  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14238  *
14239  * def copy(self): # <<<<<<<<<<<<<<
14240  * cdef __Pyx_memviewslice mslice
14241  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14242  */
14243 
14244 /* Python wrapper */
14245 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14246 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
14247 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14248  PyObject *__pyx_r = 0;
14249  __Pyx_RefNannyDeclarations
14250  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
14251  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
14252 
14253  /* function exit code */
14254  __Pyx_RefNannyFinishContext();
14255  return __pyx_r;
14256 }
14257 
14258 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
14259  __Pyx_memviewslice __pyx_v_mslice;
14260  int __pyx_v_flags;
14261  PyObject *__pyx_r = NULL;
14262  __Pyx_TraceDeclarations
14263  __Pyx_RefNannyDeclarations
14264  __Pyx_memviewslice __pyx_t_1;
14265  PyObject *__pyx_t_2 = NULL;
14266  int __pyx_lineno = 0;
14267  const char *__pyx_filename = NULL;
14268  int __pyx_clineno = 0;
14269  __Pyx_RefNannySetupContext("copy", 0);
14270  __Pyx_TraceCall("copy", __pyx_f[1], 631, 0, __PYX_ERR(1, 631, __pyx_L1_error));
14271 
14272  /* "View.MemoryView":633
14273  * def copy(self):
14274  * cdef __Pyx_memviewslice mslice
14275  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
14276  *
14277  * slice_copy(self, &mslice)
14278  */
14279  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14280 
14281  /* "View.MemoryView":635
14282  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14283  *
14284  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
14285  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
14286  * self.view.itemsize,
14287  */
14288  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14289 
14290  /* "View.MemoryView":636
14291  *
14292  * slice_copy(self, &mslice)
14293  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
14294  * self.view.itemsize,
14295  * flags|PyBUF_C_CONTIGUOUS,
14296  */
14297  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
14298  __pyx_v_mslice = __pyx_t_1;
14299 
14300  /* "View.MemoryView":641
14301  * self.dtype_is_object)
14302  *
14303  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
14304  *
14305  * def copy_fortran(self):
14306  */
14307  __Pyx_XDECREF(__pyx_r);
14308  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
14309  __Pyx_GOTREF(__pyx_t_2);
14310  __pyx_r = __pyx_t_2;
14311  __pyx_t_2 = 0;
14312  goto __pyx_L0;
14313 
14314  /* "View.MemoryView":631
14315  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14316  *
14317  * def copy(self): # <<<<<<<<<<<<<<
14318  * cdef __Pyx_memviewslice mslice
14319  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14320  */
14321 
14322  /* function exit code */
14323  __pyx_L1_error:;
14324  __Pyx_XDECREF(__pyx_t_2);
14325  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14326  __pyx_r = NULL;
14327  __pyx_L0:;
14328  __Pyx_XGIVEREF(__pyx_r);
14329  __Pyx_TraceReturn(__pyx_r, 0);
14330  __Pyx_RefNannyFinishContext();
14331  return __pyx_r;
14332 }
14333 
14334 /* "View.MemoryView":643
14335  * return memoryview_copy_from_slice(self, &mslice)
14336  *
14337  * def copy_fortran(self): # <<<<<<<<<<<<<<
14338  * cdef __Pyx_memviewslice src, dst
14339  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14340  */
14341 
14342 /* Python wrapper */
14343 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14344 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
14345 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14346  PyObject *__pyx_r = 0;
14347  __Pyx_RefNannyDeclarations
14348  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
14349  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
14350 
14351  /* function exit code */
14352  __Pyx_RefNannyFinishContext();
14353  return __pyx_r;
14354 }
14355 
14356 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
14357  __Pyx_memviewslice __pyx_v_src;
14358  __Pyx_memviewslice __pyx_v_dst;
14359  int __pyx_v_flags;
14360  PyObject *__pyx_r = NULL;
14361  __Pyx_TraceDeclarations
14362  __Pyx_RefNannyDeclarations
14363  __Pyx_memviewslice __pyx_t_1;
14364  PyObject *__pyx_t_2 = NULL;
14365  int __pyx_lineno = 0;
14366  const char *__pyx_filename = NULL;
14367  int __pyx_clineno = 0;
14368  __Pyx_RefNannySetupContext("copy_fortran", 0);
14369  __Pyx_TraceCall("copy_fortran", __pyx_f[1], 643, 0, __PYX_ERR(1, 643, __pyx_L1_error));
14370 
14371  /* "View.MemoryView":645
14372  * def copy_fortran(self):
14373  * cdef __Pyx_memviewslice src, dst
14374  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
14375  *
14376  * slice_copy(self, &src)
14377  */
14378  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14379 
14380  /* "View.MemoryView":647
14381  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14382  *
14383  * slice_copy(self, &src) # <<<<<<<<<<<<<<
14384  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
14385  * self.view.itemsize,
14386  */
14387  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14388 
14389  /* "View.MemoryView":648
14390  *
14391  * slice_copy(self, &src)
14392  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
14393  * self.view.itemsize,
14394  * flags|PyBUF_F_CONTIGUOUS,
14395  */
14396  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
14397  __pyx_v_dst = __pyx_t_1;
14398 
14399  /* "View.MemoryView":653
14400  * self.dtype_is_object)
14401  *
14402  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
14403  *
14404  *
14405  */
14406  __Pyx_XDECREF(__pyx_r);
14407  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14408  __Pyx_GOTREF(__pyx_t_2);
14409  __pyx_r = __pyx_t_2;
14410  __pyx_t_2 = 0;
14411  goto __pyx_L0;
14412 
14413  /* "View.MemoryView":643
14414  * return memoryview_copy_from_slice(self, &mslice)
14415  *
14416  * def copy_fortran(self): # <<<<<<<<<<<<<<
14417  * cdef __Pyx_memviewslice src, dst
14418  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14419  */
14420 
14421  /* function exit code */
14422  __pyx_L1_error:;
14423  __Pyx_XDECREF(__pyx_t_2);
14424  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14425  __pyx_r = NULL;
14426  __pyx_L0:;
14427  __Pyx_XGIVEREF(__pyx_r);
14428  __Pyx_TraceReturn(__pyx_r, 0);
14429  __Pyx_RefNannyFinishContext();
14430  return __pyx_r;
14431 }
14432 
14433 /* "(tree fragment)":1
14434  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14435  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14436  * def __setstate_cython__(self, __pyx_state):
14437  */
14438 
14439 /* Python wrapper */
14440 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14441 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
14442 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14443  PyObject *__pyx_r = 0;
14444  __Pyx_RefNannyDeclarations
14445  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14446  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14447 
14448  /* function exit code */
14449  __Pyx_RefNannyFinishContext();
14450  return __pyx_r;
14451 }
14452 
14453 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
14454  PyObject *__pyx_r = NULL;
14455  __Pyx_TraceDeclarations
14456  __Pyx_RefNannyDeclarations
14457  PyObject *__pyx_t_1 = NULL;
14458  int __pyx_lineno = 0;
14459  const char *__pyx_filename = NULL;
14460  int __pyx_clineno = 0;
14461  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14462  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
14463 
14464  /* "(tree fragment)":2
14465  * def __reduce_cython__(self):
14466  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14467  * def __setstate_cython__(self, __pyx_state):
14468  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14469  */
14470  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14471  __Pyx_GOTREF(__pyx_t_1);
14472  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14473  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14474  __PYX_ERR(1, 2, __pyx_L1_error)
14475 
14476  /* "(tree fragment)":1
14477  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14478  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14479  * def __setstate_cython__(self, __pyx_state):
14480  */
14481 
14482  /* function exit code */
14483  __pyx_L1_error:;
14484  __Pyx_XDECREF(__pyx_t_1);
14485  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14486  __pyx_r = NULL;
14487  __Pyx_XGIVEREF(__pyx_r);
14488  __Pyx_TraceReturn(__pyx_r, 0);
14489  __Pyx_RefNannyFinishContext();
14490  return __pyx_r;
14491 }
14492 
14493 /* "(tree fragment)":3
14494  * def __reduce_cython__(self):
14495  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14496  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14497  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14498  */
14499 
14500 /* Python wrapper */
14501 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
14502 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
14503 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14504  PyObject *__pyx_r = 0;
14505  __Pyx_RefNannyDeclarations
14506  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14507  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14508 
14509  /* function exit code */
14510  __Pyx_RefNannyFinishContext();
14511  return __pyx_r;
14512 }
14513 
14514 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) {
14515  PyObject *__pyx_r = NULL;
14516  __Pyx_TraceDeclarations
14517  __Pyx_RefNannyDeclarations
14518  PyObject *__pyx_t_1 = NULL;
14519  int __pyx_lineno = 0;
14520  const char *__pyx_filename = NULL;
14521  int __pyx_clineno = 0;
14522  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14523  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
14524 
14525  /* "(tree fragment)":4
14526  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14527  * def __setstate_cython__(self, __pyx_state):
14528  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14529  */
14530  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14531  __Pyx_GOTREF(__pyx_t_1);
14532  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14533  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14534  __PYX_ERR(1, 4, __pyx_L1_error)
14535 
14536  /* "(tree fragment)":3
14537  * def __reduce_cython__(self):
14538  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14539  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14540  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14541  */
14542 
14543  /* function exit code */
14544  __pyx_L1_error:;
14545  __Pyx_XDECREF(__pyx_t_1);
14546  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14547  __pyx_r = NULL;
14548  __Pyx_XGIVEREF(__pyx_r);
14549  __Pyx_TraceReturn(__pyx_r, 0);
14550  __Pyx_RefNannyFinishContext();
14551  return __pyx_r;
14552 }
14553 
14554 /* "View.MemoryView":657
14555  *
14556  * @cname('__pyx_memoryview_new')
14557  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14558  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14559  * result.typeinfo = typeinfo
14560  */
14561 
14562 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14563  struct __pyx_memoryview_obj *__pyx_v_result = 0;
14564  PyObject *__pyx_r = NULL;
14565  __Pyx_TraceDeclarations
14566  __Pyx_RefNannyDeclarations
14567  PyObject *__pyx_t_1 = NULL;
14568  PyObject *__pyx_t_2 = NULL;
14569  PyObject *__pyx_t_3 = NULL;
14570  int __pyx_lineno = 0;
14571  const char *__pyx_filename = NULL;
14572  int __pyx_clineno = 0;
14573  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
14574  __Pyx_TraceCall("memoryview_cwrapper", __pyx_f[1], 657, 0, __PYX_ERR(1, 657, __pyx_L1_error));
14575 
14576  /* "View.MemoryView":658
14577  * @cname('__pyx_memoryview_new')
14578  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14579  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
14580  * result.typeinfo = typeinfo
14581  * return result
14582  */
14583  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
14584  __Pyx_GOTREF(__pyx_t_1);
14585  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14586  __Pyx_GOTREF(__pyx_t_2);
14587  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
14588  __Pyx_GOTREF(__pyx_t_3);
14589  __Pyx_INCREF(__pyx_v_o);
14590  __Pyx_GIVEREF(__pyx_v_o);
14591  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14592  __Pyx_GIVEREF(__pyx_t_1);
14593  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14594  __Pyx_GIVEREF(__pyx_t_2);
14595  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14596  __pyx_t_1 = 0;
14597  __pyx_t_2 = 0;
14598  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14599  __Pyx_GOTREF(__pyx_t_2);
14600  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14601  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14602  __pyx_t_2 = 0;
14603 
14604  /* "View.MemoryView":659
14605  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14606  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14607  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
14608  * return result
14609  *
14610  */
14611  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14612 
14613  /* "View.MemoryView":660
14614  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14615  * result.typeinfo = typeinfo
14616  * return result # <<<<<<<<<<<<<<
14617  *
14618  * @cname('__pyx_memoryview_check')
14619  */
14620  __Pyx_XDECREF(__pyx_r);
14621  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14622  __pyx_r = ((PyObject *)__pyx_v_result);
14623  goto __pyx_L0;
14624 
14625  /* "View.MemoryView":657
14626  *
14627  * @cname('__pyx_memoryview_new')
14628  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14629  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14630  * result.typeinfo = typeinfo
14631  */
14632 
14633  /* function exit code */
14634  __pyx_L1_error:;
14635  __Pyx_XDECREF(__pyx_t_1);
14636  __Pyx_XDECREF(__pyx_t_2);
14637  __Pyx_XDECREF(__pyx_t_3);
14638  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14639  __pyx_r = 0;
14640  __pyx_L0:;
14641  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14642  __Pyx_XGIVEREF(__pyx_r);
14643  __Pyx_TraceReturn(__pyx_r, 0);
14644  __Pyx_RefNannyFinishContext();
14645  return __pyx_r;
14646 }
14647 
14648 /* "View.MemoryView":663
14649  *
14650  * @cname('__pyx_memoryview_check')
14651  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14652  * return isinstance(o, memoryview)
14653  *
14654  */
14655 
14656 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14657  int __pyx_r;
14658  __Pyx_TraceDeclarations
14659  __Pyx_RefNannyDeclarations
14660  int __pyx_t_1;
14661  int __pyx_lineno = 0;
14662  const char *__pyx_filename = NULL;
14663  int __pyx_clineno = 0;
14664  __Pyx_RefNannySetupContext("memoryview_check", 0);
14665  __Pyx_TraceCall("memoryview_check", __pyx_f[1], 663, 0, __PYX_ERR(1, 663, __pyx_L1_error));
14666 
14667  /* "View.MemoryView":664
14668  * @cname('__pyx_memoryview_check')
14669  * cdef inline bint memoryview_check(object o):
14670  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
14671  *
14672  * cdef tuple _unellipsify(object index, int ndim):
14673  */
14674  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14675  __pyx_r = __pyx_t_1;
14676  goto __pyx_L0;
14677 
14678  /* "View.MemoryView":663
14679  *
14680  * @cname('__pyx_memoryview_check')
14681  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14682  * return isinstance(o, memoryview)
14683  *
14684  */
14685 
14686  /* function exit code */
14687  __pyx_L1_error:;
14688  __Pyx_WriteUnraisable("View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
14689  __pyx_r = 0;
14690  __pyx_L0:;
14691  __Pyx_TraceReturn(Py_None, 0);
14692  __Pyx_RefNannyFinishContext();
14693  return __pyx_r;
14694 }
14695 
14696 /* "View.MemoryView":666
14697  * return isinstance(o, memoryview)
14698  *
14699  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14700  * """
14701  * Replace all ellipses with full slices and fill incomplete indices with
14702  */
14703 
14704 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
14705  PyObject *__pyx_v_tup = NULL;
14706  PyObject *__pyx_v_result = NULL;
14707  int __pyx_v_have_slices;
14708  int __pyx_v_seen_ellipsis;
14709  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14710  PyObject *__pyx_v_item = NULL;
14711  Py_ssize_t __pyx_v_nslices;
14712  PyObject *__pyx_r = NULL;
14713  __Pyx_TraceDeclarations
14714  __Pyx_RefNannyDeclarations
14715  int __pyx_t_1;
14716  int __pyx_t_2;
14717  PyObject *__pyx_t_3 = NULL;
14718  PyObject *__pyx_t_4 = NULL;
14719  Py_ssize_t __pyx_t_5;
14720  PyObject *(*__pyx_t_6)(PyObject *);
14721  PyObject *__pyx_t_7 = NULL;
14722  Py_ssize_t __pyx_t_8;
14723  int __pyx_t_9;
14724  int __pyx_t_10;
14725  PyObject *__pyx_t_11 = NULL;
14726  int __pyx_lineno = 0;
14727  const char *__pyx_filename = NULL;
14728  int __pyx_clineno = 0;
14729  __Pyx_RefNannySetupContext("_unellipsify", 0);
14730  __Pyx_TraceCall("_unellipsify", __pyx_f[1], 666, 0, __PYX_ERR(1, 666, __pyx_L1_error));
14731 
14732  /* "View.MemoryView":671
14733  * full slices.
14734  * """
14735  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14736  * tup = (index,)
14737  * else:
14738  */
14739  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14740  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14741  if (__pyx_t_2) {
14742 
14743  /* "View.MemoryView":672
14744  * """
14745  * if not isinstance(index, tuple):
14746  * tup = (index,) # <<<<<<<<<<<<<<
14747  * else:
14748  * tup = index
14749  */
14750  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
14751  __Pyx_GOTREF(__pyx_t_3);
14752  __Pyx_INCREF(__pyx_v_index);
14753  __Pyx_GIVEREF(__pyx_v_index);
14754  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14755  __pyx_v_tup = __pyx_t_3;
14756  __pyx_t_3 = 0;
14757 
14758  /* "View.MemoryView":671
14759  * full slices.
14760  * """
14761  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14762  * tup = (index,)
14763  * else:
14764  */
14765  goto __pyx_L3;
14766  }
14767 
14768  /* "View.MemoryView":674
14769  * tup = (index,)
14770  * else:
14771  * tup = index # <<<<<<<<<<<<<<
14772  *
14773  * result = []
14774  */
14775  /*else*/ {
14776  __Pyx_INCREF(__pyx_v_index);
14777  __pyx_v_tup = __pyx_v_index;
14778  }
14779  __pyx_L3:;
14780 
14781  /* "View.MemoryView":676
14782  * tup = index
14783  *
14784  * result = [] # <<<<<<<<<<<<<<
14785  * have_slices = False
14786  * seen_ellipsis = False
14787  */
14788  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
14789  __Pyx_GOTREF(__pyx_t_3);
14790  __pyx_v_result = ((PyObject*)__pyx_t_3);
14791  __pyx_t_3 = 0;
14792 
14793  /* "View.MemoryView":677
14794  *
14795  * result = []
14796  * have_slices = False # <<<<<<<<<<<<<<
14797  * seen_ellipsis = False
14798  * for idx, item in enumerate(tup):
14799  */
14800  __pyx_v_have_slices = 0;
14801 
14802  /* "View.MemoryView":678
14803  * result = []
14804  * have_slices = False
14805  * seen_ellipsis = False # <<<<<<<<<<<<<<
14806  * for idx, item in enumerate(tup):
14807  * if item is Ellipsis:
14808  */
14809  __pyx_v_seen_ellipsis = 0;
14810 
14811  /* "View.MemoryView":679
14812  * have_slices = False
14813  * seen_ellipsis = False
14814  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14815  * if item is Ellipsis:
14816  * if not seen_ellipsis:
14817  */
14818  __Pyx_INCREF(__pyx_int_0);
14819  __pyx_t_3 = __pyx_int_0;
14820  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14821  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14822  __pyx_t_6 = NULL;
14823  } else {
14824  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
14825  __Pyx_GOTREF(__pyx_t_4);
14826  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
14827  }
14828  for (;;) {
14829  if (likely(!__pyx_t_6)) {
14830  if (likely(PyList_CheckExact(__pyx_t_4))) {
14831  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
14832  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14833  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14834  #else
14835  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14836  __Pyx_GOTREF(__pyx_t_7);
14837  #endif
14838  } else {
14839  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
14840  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14841  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14842  #else
14843  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14844  __Pyx_GOTREF(__pyx_t_7);
14845  #endif
14846  }
14847  } else {
14848  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14849  if (unlikely(!__pyx_t_7)) {
14850  PyObject* exc_type = PyErr_Occurred();
14851  if (exc_type) {
14852  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14853  else __PYX_ERR(1, 679, __pyx_L1_error)
14854  }
14855  break;
14856  }
14857  __Pyx_GOTREF(__pyx_t_7);
14858  }
14859  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14860  __pyx_t_7 = 0;
14861  __Pyx_INCREF(__pyx_t_3);
14862  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14863  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14864  __Pyx_GOTREF(__pyx_t_7);
14865  __Pyx_DECREF(__pyx_t_3);
14866  __pyx_t_3 = __pyx_t_7;
14867  __pyx_t_7 = 0;
14868 
14869  /* "View.MemoryView":680
14870  * seen_ellipsis = False
14871  * for idx, item in enumerate(tup):
14872  * if item is Ellipsis: # <<<<<<<<<<<<<<
14873  * if not seen_ellipsis:
14874  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14875  */
14876  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14877  __pyx_t_1 = (__pyx_t_2 != 0);
14878  if (__pyx_t_1) {
14879 
14880  /* "View.MemoryView":681
14881  * for idx, item in enumerate(tup):
14882  * if item is Ellipsis:
14883  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14884  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14885  * seen_ellipsis = True
14886  */
14887  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14888  if (__pyx_t_1) {
14889 
14890  /* "View.MemoryView":682
14891  * if item is Ellipsis:
14892  * if not seen_ellipsis:
14893  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
14894  * seen_ellipsis = True
14895  * else:
14896  */
14897  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14898  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
14899  __Pyx_GOTREF(__pyx_t_7);
14900  { Py_ssize_t __pyx_temp;
14901  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14902  __Pyx_INCREF(__pyx_slice__7);
14903  __Pyx_GIVEREF(__pyx_slice__7);
14904  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__7);
14905  }
14906  }
14907  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14908  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14909 
14910  /* "View.MemoryView":683
14911  * if not seen_ellipsis:
14912  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14913  * seen_ellipsis = True # <<<<<<<<<<<<<<
14914  * else:
14915  * result.append(slice(None))
14916  */
14917  __pyx_v_seen_ellipsis = 1;
14918 
14919  /* "View.MemoryView":681
14920  * for idx, item in enumerate(tup):
14921  * if item is Ellipsis:
14922  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14923  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14924  * seen_ellipsis = True
14925  */
14926  goto __pyx_L7;
14927  }
14928 
14929  /* "View.MemoryView":685
14930  * seen_ellipsis = True
14931  * else:
14932  * result.append(slice(None)) # <<<<<<<<<<<<<<
14933  * have_slices = True
14934  * else:
14935  */
14936  /*else*/ {
14937  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
14938  }
14939  __pyx_L7:;
14940 
14941  /* "View.MemoryView":686
14942  * else:
14943  * result.append(slice(None))
14944  * have_slices = True # <<<<<<<<<<<<<<
14945  * else:
14946  * if not isinstance(item, slice) and not PyIndex_Check(item):
14947  */
14948  __pyx_v_have_slices = 1;
14949 
14950  /* "View.MemoryView":680
14951  * seen_ellipsis = False
14952  * for idx, item in enumerate(tup):
14953  * if item is Ellipsis: # <<<<<<<<<<<<<<
14954  * if not seen_ellipsis:
14955  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14956  */
14957  goto __pyx_L6;
14958  }
14959 
14960  /* "View.MemoryView":688
14961  * have_slices = True
14962  * else:
14963  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14964  * raise TypeError("Cannot index with type '%s'" % type(item))
14965  *
14966  */
14967  /*else*/ {
14968  __pyx_t_2 = PySlice_Check(__pyx_v_item);
14969  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14970  if (__pyx_t_10) {
14971  } else {
14972  __pyx_t_1 = __pyx_t_10;
14973  goto __pyx_L9_bool_binop_done;
14974  }
14975  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14976  __pyx_t_1 = __pyx_t_10;
14977  __pyx_L9_bool_binop_done:;
14978  if (unlikely(__pyx_t_1)) {
14979 
14980  /* "View.MemoryView":689
14981  * else:
14982  * if not isinstance(item, slice) and not PyIndex_Check(item):
14983  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
14984  *
14985  * have_slices = have_slices or isinstance(item, slice)
14986  */
14987  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
14988  __Pyx_GOTREF(__pyx_t_7);
14989  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
14990  __Pyx_GOTREF(__pyx_t_11);
14991  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14992  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14993  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14994  __PYX_ERR(1, 689, __pyx_L1_error)
14995 
14996  /* "View.MemoryView":688
14997  * have_slices = True
14998  * else:
14999  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15000  * raise TypeError("Cannot index with type '%s'" % type(item))
15001  *
15002  */
15003  }
15004 
15005  /* "View.MemoryView":691
15006  * raise TypeError("Cannot index with type '%s'" % type(item))
15007  *
15008  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
15009  * result.append(item)
15010  *
15011  */
15012  __pyx_t_10 = (__pyx_v_have_slices != 0);
15013  if (!__pyx_t_10) {
15014  } else {
15015  __pyx_t_1 = __pyx_t_10;
15016  goto __pyx_L11_bool_binop_done;
15017  }
15018  __pyx_t_10 = PySlice_Check(__pyx_v_item);
15019  __pyx_t_2 = (__pyx_t_10 != 0);
15020  __pyx_t_1 = __pyx_t_2;
15021  __pyx_L11_bool_binop_done:;
15022  __pyx_v_have_slices = __pyx_t_1;
15023 
15024  /* "View.MemoryView":692
15025  *
15026  * have_slices = have_slices or isinstance(item, slice)
15027  * result.append(item) # <<<<<<<<<<<<<<
15028  *
15029  * nslices = ndim - len(result)
15030  */
15031  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
15032  }
15033  __pyx_L6:;
15034 
15035  /* "View.MemoryView":679
15036  * have_slices = False
15037  * seen_ellipsis = False
15038  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15039  * if item is Ellipsis:
15040  * if not seen_ellipsis:
15041  */
15042  }
15043  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15044  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15045 
15046  /* "View.MemoryView":694
15047  * result.append(item)
15048  *
15049  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
15050  * if nslices:
15051  * result.extend([slice(None)] * nslices)
15052  */
15053  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
15054  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15055 
15056  /* "View.MemoryView":695
15057  *
15058  * nslices = ndim - len(result)
15059  * if nslices: # <<<<<<<<<<<<<<
15060  * result.extend([slice(None)] * nslices)
15061  *
15062  */
15063  __pyx_t_1 = (__pyx_v_nslices != 0);
15064  if (__pyx_t_1) {
15065 
15066  /* "View.MemoryView":696
15067  * nslices = ndim - len(result)
15068  * if nslices:
15069  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
15070  *
15071  * return have_slices or nslices, tuple(result)
15072  */
15073  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
15074  __Pyx_GOTREF(__pyx_t_3);
15075  { Py_ssize_t __pyx_temp;
15076  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15077  __Pyx_INCREF(__pyx_slice__7);
15078  __Pyx_GIVEREF(__pyx_slice__7);
15079  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__7);
15080  }
15081  }
15082  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
15083  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15084 
15085  /* "View.MemoryView":695
15086  *
15087  * nslices = ndim - len(result)
15088  * if nslices: # <<<<<<<<<<<<<<
15089  * result.extend([slice(None)] * nslices)
15090  *
15091  */
15092  }
15093 
15094  /* "View.MemoryView":698
15095  * result.extend([slice(None)] * nslices)
15096  *
15097  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
15098  *
15099  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15100  */
15101  __Pyx_XDECREF(__pyx_r);
15102  if (!__pyx_v_have_slices) {
15103  } else {
15104  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15105  __Pyx_GOTREF(__pyx_t_4);
15106  __pyx_t_3 = __pyx_t_4;
15107  __pyx_t_4 = 0;
15108  goto __pyx_L14_bool_binop_done;
15109  }
15110  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15111  __Pyx_GOTREF(__pyx_t_4);
15112  __pyx_t_3 = __pyx_t_4;
15113  __pyx_t_4 = 0;
15114  __pyx_L14_bool_binop_done:;
15115  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15116  __Pyx_GOTREF(__pyx_t_4);
15117  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
15118  __Pyx_GOTREF(__pyx_t_11);
15119  __Pyx_GIVEREF(__pyx_t_3);
15120  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15121  __Pyx_GIVEREF(__pyx_t_4);
15122  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15123  __pyx_t_3 = 0;
15124  __pyx_t_4 = 0;
15125  __pyx_r = ((PyObject*)__pyx_t_11);
15126  __pyx_t_11 = 0;
15127  goto __pyx_L0;
15128 
15129  /* "View.MemoryView":666
15130  * return isinstance(o, memoryview)
15131  *
15132  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15133  * """
15134  * Replace all ellipses with full slices and fill incomplete indices with
15135  */
15136 
15137  /* function exit code */
15138  __pyx_L1_error:;
15139  __Pyx_XDECREF(__pyx_t_3);
15140  __Pyx_XDECREF(__pyx_t_4);
15141  __Pyx_XDECREF(__pyx_t_7);
15142  __Pyx_XDECREF(__pyx_t_11);
15143  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15144  __pyx_r = 0;
15145  __pyx_L0:;
15146  __Pyx_XDECREF(__pyx_v_tup);
15147  __Pyx_XDECREF(__pyx_v_result);
15148  __Pyx_XDECREF(__pyx_v_idx);
15149  __Pyx_XDECREF(__pyx_v_item);
15150  __Pyx_XGIVEREF(__pyx_r);
15151  __Pyx_TraceReturn(__pyx_r, 0);
15152  __Pyx_RefNannyFinishContext();
15153  return __pyx_r;
15154 }
15155 
15156 /* "View.MemoryView":700
15157  * return have_slices or nslices, tuple(result)
15158  *
15159  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15160  * for suboffset in suboffsets[:ndim]:
15161  * if suboffset >= 0:
15162  */
15163 
15164 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
15165  Py_ssize_t __pyx_v_suboffset;
15166  PyObject *__pyx_r = NULL;
15167  __Pyx_TraceDeclarations
15168  __Pyx_RefNannyDeclarations
15169  Py_ssize_t *__pyx_t_1;
15170  Py_ssize_t *__pyx_t_2;
15171  Py_ssize_t *__pyx_t_3;
15172  int __pyx_t_4;
15173  PyObject *__pyx_t_5 = NULL;
15174  int __pyx_lineno = 0;
15175  const char *__pyx_filename = NULL;
15176  int __pyx_clineno = 0;
15177  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
15178  __Pyx_TraceCall("assert_direct_dimensions", __pyx_f[1], 700, 0, __PYX_ERR(1, 700, __pyx_L1_error));
15179 
15180  /* "View.MemoryView":701
15181  *
15182  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15183  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
15184  * if suboffset >= 0:
15185  * raise ValueError("Indirect dimensions not supported")
15186  */
15187  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15188  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15189  __pyx_t_1 = __pyx_t_3;
15190  __pyx_v_suboffset = (__pyx_t_1[0]);
15191 
15192  /* "View.MemoryView":702
15193  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15194  * for suboffset in suboffsets[:ndim]:
15195  * if suboffset >= 0: # <<<<<<<<<<<<<<
15196  * raise ValueError("Indirect dimensions not supported")
15197  *
15198  */
15199  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15200  if (unlikely(__pyx_t_4)) {
15201 
15202  /* "View.MemoryView":703
15203  * for suboffset in suboffsets[:ndim]:
15204  * if suboffset >= 0:
15205  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
15206  *
15207  *
15208  */
15209  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
15210  __Pyx_GOTREF(__pyx_t_5);
15211  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15212  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15213  __PYX_ERR(1, 703, __pyx_L1_error)
15214 
15215  /* "View.MemoryView":702
15216  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15217  * for suboffset in suboffsets[:ndim]:
15218  * if suboffset >= 0: # <<<<<<<<<<<<<<
15219  * raise ValueError("Indirect dimensions not supported")
15220  *
15221  */
15222  }
15223  }
15224 
15225  /* "View.MemoryView":700
15226  * return have_slices or nslices, tuple(result)
15227  *
15228  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15229  * for suboffset in suboffsets[:ndim]:
15230  * if suboffset >= 0:
15231  */
15232 
15233  /* function exit code */
15234  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15235  goto __pyx_L0;
15236  __pyx_L1_error:;
15237  __Pyx_XDECREF(__pyx_t_5);
15238  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15239  __pyx_r = 0;
15240  __pyx_L0:;
15241  __Pyx_XGIVEREF(__pyx_r);
15242  __Pyx_TraceReturn(__pyx_r, 0);
15243  __Pyx_RefNannyFinishContext();
15244  return __pyx_r;
15245 }
15246 
15247 /* "View.MemoryView":710
15248  *
15249  * @cname('__pyx_memview_slice')
15250  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15251  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15252  * cdef bint negative_step
15253  */
15254 
15255 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15256  int __pyx_v_new_ndim;
15257  int __pyx_v_suboffset_dim;
15258  int __pyx_v_dim;
15259  __Pyx_memviewslice __pyx_v_src;
15260  __Pyx_memviewslice __pyx_v_dst;
15261  __Pyx_memviewslice *__pyx_v_p_src;
15262  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15263  __Pyx_memviewslice *__pyx_v_p_dst;
15264  int *__pyx_v_p_suboffset_dim;
15265  Py_ssize_t __pyx_v_start;
15266  Py_ssize_t __pyx_v_stop;
15267  Py_ssize_t __pyx_v_step;
15268  int __pyx_v_have_start;
15269  int __pyx_v_have_stop;
15270  int __pyx_v_have_step;
15271  PyObject *__pyx_v_index = NULL;
15272  struct __pyx_memoryview_obj *__pyx_r = NULL;
15273  __Pyx_TraceDeclarations
15274  __Pyx_RefNannyDeclarations
15275  int __pyx_t_1;
15276  int __pyx_t_2;
15277  PyObject *__pyx_t_3 = NULL;
15278  struct __pyx_memoryview_obj *__pyx_t_4;
15279  char *__pyx_t_5;
15280  int __pyx_t_6;
15281  Py_ssize_t __pyx_t_7;
15282  PyObject *(*__pyx_t_8)(PyObject *);
15283  PyObject *__pyx_t_9 = NULL;
15284  Py_ssize_t __pyx_t_10;
15285  int __pyx_t_11;
15286  Py_ssize_t __pyx_t_12;
15287  int __pyx_lineno = 0;
15288  const char *__pyx_filename = NULL;
15289  int __pyx_clineno = 0;
15290  __Pyx_RefNannySetupContext("memview_slice", 0);
15291  __Pyx_TraceCall("memview_slice", __pyx_f[1], 710, 0, __PYX_ERR(1, 710, __pyx_L1_error));
15292 
15293  /* "View.MemoryView":711
15294  * @cname('__pyx_memview_slice')
15295  * cdef memoryview memview_slice(memoryview memview, object indices):
15296  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
15297  * cdef bint negative_step
15298  * cdef __Pyx_memviewslice src, dst
15299  */
15300  __pyx_v_new_ndim = 0;
15301  __pyx_v_suboffset_dim = -1;
15302 
15303  /* "View.MemoryView":718
15304  *
15305  *
15306  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
15307  *
15308  * cdef _memoryviewslice memviewsliceobj
15309  */
15310  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
15311 
15312  /* "View.MemoryView":722
15313  * cdef _memoryviewslice memviewsliceobj
15314  *
15315  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
15316  *
15317  * if isinstance(memview, _memoryviewslice):
15318  */
15319  #ifndef CYTHON_WITHOUT_ASSERTIONS
15320  if (unlikely(!Py_OptimizeFlag)) {
15321  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15322  PyErr_SetNone(PyExc_AssertionError);
15323  __PYX_ERR(1, 722, __pyx_L1_error)
15324  }
15325  }
15326  #endif
15327 
15328  /* "View.MemoryView":724
15329  * assert memview.view.ndim > 0
15330  *
15331  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15332  * memviewsliceobj = memview
15333  * p_src = &memviewsliceobj.from_slice
15334  */
15335  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15336  __pyx_t_2 = (__pyx_t_1 != 0);
15337  if (__pyx_t_2) {
15338 
15339  /* "View.MemoryView":725
15340  *
15341  * if isinstance(memview, _memoryviewslice):
15342  * memviewsliceobj = memview # <<<<<<<<<<<<<<
15343  * p_src = &memviewsliceobj.from_slice
15344  * else:
15345  */
15346  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
15347  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15348  __Pyx_INCREF(__pyx_t_3);
15349  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15350  __pyx_t_3 = 0;
15351 
15352  /* "View.MemoryView":726
15353  * if isinstance(memview, _memoryviewslice):
15354  * memviewsliceobj = memview
15355  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
15356  * else:
15357  * slice_copy(memview, &src)
15358  */
15359  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15360 
15361  /* "View.MemoryView":724
15362  * assert memview.view.ndim > 0
15363  *
15364  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15365  * memviewsliceobj = memview
15366  * p_src = &memviewsliceobj.from_slice
15367  */
15368  goto __pyx_L3;
15369  }
15370 
15371  /* "View.MemoryView":728
15372  * p_src = &memviewsliceobj.from_slice
15373  * else:
15374  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
15375  * p_src = &src
15376  *
15377  */
15378  /*else*/ {
15379  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15380 
15381  /* "View.MemoryView":729
15382  * else:
15383  * slice_copy(memview, &src)
15384  * p_src = &src # <<<<<<<<<<<<<<
15385  *
15386  *
15387  */
15388  __pyx_v_p_src = (&__pyx_v_src);
15389  }
15390  __pyx_L3:;
15391 
15392  /* "View.MemoryView":735
15393  *
15394  *
15395  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
15396  * dst.data = p_src.data
15397  *
15398  */
15399  __pyx_t_4 = __pyx_v_p_src->memview;
15400  __pyx_v_dst.memview = __pyx_t_4;
15401 
15402  /* "View.MemoryView":736
15403  *
15404  * dst.memview = p_src.memview
15405  * dst.data = p_src.data # <<<<<<<<<<<<<<
15406  *
15407  *
15408  */
15409  __pyx_t_5 = __pyx_v_p_src->data;
15410  __pyx_v_dst.data = __pyx_t_5;
15411 
15412  /* "View.MemoryView":741
15413  *
15414  *
15415  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
15416  * cdef int *p_suboffset_dim = &suboffset_dim
15417  * cdef Py_ssize_t start, stop, step
15418  */
15419  __pyx_v_p_dst = (&__pyx_v_dst);
15420 
15421  /* "View.MemoryView":742
15422  *
15423  * cdef __Pyx_memviewslice *p_dst = &dst
15424  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
15425  * cdef Py_ssize_t start, stop, step
15426  * cdef bint have_start, have_stop, have_step
15427  */
15428  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15429 
15430  /* "View.MemoryView":746
15431  * cdef bint have_start, have_stop, have_step
15432  *
15433  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15434  * if PyIndex_Check(index):
15435  * slice_memviewslice(
15436  */
15437  __pyx_t_6 = 0;
15438  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15439  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15440  __pyx_t_8 = NULL;
15441  } else {
15442  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
15443  __Pyx_GOTREF(__pyx_t_3);
15444  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
15445  }
15446  for (;;) {
15447  if (likely(!__pyx_t_8)) {
15448  if (likely(PyList_CheckExact(__pyx_t_3))) {
15449  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
15450  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15451  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15452  #else
15453  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15454  __Pyx_GOTREF(__pyx_t_9);
15455  #endif
15456  } else {
15457  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
15458  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15459  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15460  #else
15461  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15462  __Pyx_GOTREF(__pyx_t_9);
15463  #endif
15464  }
15465  } else {
15466  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15467  if (unlikely(!__pyx_t_9)) {
15468  PyObject* exc_type = PyErr_Occurred();
15469  if (exc_type) {
15470  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15471  else __PYX_ERR(1, 746, __pyx_L1_error)
15472  }
15473  break;
15474  }
15475  __Pyx_GOTREF(__pyx_t_9);
15476  }
15477  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15478  __pyx_t_9 = 0;
15479  __pyx_v_dim = __pyx_t_6;
15480  __pyx_t_6 = (__pyx_t_6 + 1);
15481 
15482  /* "View.MemoryView":747
15483  *
15484  * for dim, index in enumerate(indices):
15485  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15486  * slice_memviewslice(
15487  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15488  */
15489  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15490  if (__pyx_t_2) {
15491 
15492  /* "View.MemoryView":751
15493  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15494  * dim, new_ndim, p_suboffset_dim,
15495  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
15496  * 0, 0, 0, # have_{start,stop,step}
15497  * False)
15498  */
15499  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
15500 
15501  /* "View.MemoryView":748
15502  * for dim, index in enumerate(indices):
15503  * if PyIndex_Check(index):
15504  * slice_memviewslice( # <<<<<<<<<<<<<<
15505  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15506  * dim, new_ndim, p_suboffset_dim,
15507  */
15508  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
15509 
15510  /* "View.MemoryView":747
15511  *
15512  * for dim, index in enumerate(indices):
15513  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15514  * slice_memviewslice(
15515  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15516  */
15517  goto __pyx_L6;
15518  }
15519 
15520  /* "View.MemoryView":754
15521  * 0, 0, 0, # have_{start,stop,step}
15522  * False)
15523  * elif index is None: # <<<<<<<<<<<<<<
15524  * p_dst.shape[new_ndim] = 1
15525  * p_dst.strides[new_ndim] = 0
15526  */
15527  __pyx_t_2 = (__pyx_v_index == Py_None);
15528  __pyx_t_1 = (__pyx_t_2 != 0);
15529  if (__pyx_t_1) {
15530 
15531  /* "View.MemoryView":755
15532  * False)
15533  * elif index is None:
15534  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
15535  * p_dst.strides[new_ndim] = 0
15536  * p_dst.suboffsets[new_ndim] = -1
15537  */
15538  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15539 
15540  /* "View.MemoryView":756
15541  * elif index is None:
15542  * p_dst.shape[new_ndim] = 1
15543  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
15544  * p_dst.suboffsets[new_ndim] = -1
15545  * new_ndim += 1
15546  */
15547  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15548 
15549  /* "View.MemoryView":757
15550  * p_dst.shape[new_ndim] = 1
15551  * p_dst.strides[new_ndim] = 0
15552  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
15553  * new_ndim += 1
15554  * else:
15555  */
15556  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15557 
15558  /* "View.MemoryView":758
15559  * p_dst.strides[new_ndim] = 0
15560  * p_dst.suboffsets[new_ndim] = -1
15561  * new_ndim += 1 # <<<<<<<<<<<<<<
15562  * else:
15563  * start = index.start or 0
15564  */
15565  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15566 
15567  /* "View.MemoryView":754
15568  * 0, 0, 0, # have_{start,stop,step}
15569  * False)
15570  * elif index is None: # <<<<<<<<<<<<<<
15571  * p_dst.shape[new_ndim] = 1
15572  * p_dst.strides[new_ndim] = 0
15573  */
15574  goto __pyx_L6;
15575  }
15576 
15577  /* "View.MemoryView":760
15578  * new_ndim += 1
15579  * else:
15580  * start = index.start or 0 # <<<<<<<<<<<<<<
15581  * stop = index.stop or 0
15582  * step = index.step or 0
15583  */
15584  /*else*/ {
15585  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
15586  __Pyx_GOTREF(__pyx_t_9);
15587  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
15588  if (!__pyx_t_1) {
15589  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15590  } else {
15591  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
15592  __pyx_t_10 = __pyx_t_12;
15593  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15594  goto __pyx_L7_bool_binop_done;
15595  }
15596  __pyx_t_10 = 0;
15597  __pyx_L7_bool_binop_done:;
15598  __pyx_v_start = __pyx_t_10;
15599 
15600  /* "View.MemoryView":761
15601  * else:
15602  * start = index.start or 0
15603  * stop = index.stop or 0 # <<<<<<<<<<<<<<
15604  * step = index.step or 0
15605  *
15606  */
15607  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
15608  __Pyx_GOTREF(__pyx_t_9);
15609  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
15610  if (!__pyx_t_1) {
15611  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15612  } else {
15613  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
15614  __pyx_t_10 = __pyx_t_12;
15615  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15616  goto __pyx_L9_bool_binop_done;
15617  }
15618  __pyx_t_10 = 0;
15619  __pyx_L9_bool_binop_done:;
15620  __pyx_v_stop = __pyx_t_10;
15621 
15622  /* "View.MemoryView":762
15623  * start = index.start or 0
15624  * stop = index.stop or 0
15625  * step = index.step or 0 # <<<<<<<<<<<<<<
15626  *
15627  * have_start = index.start is not None
15628  */
15629  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
15630  __Pyx_GOTREF(__pyx_t_9);
15631  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
15632  if (!__pyx_t_1) {
15633  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15634  } else {
15635  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
15636  __pyx_t_10 = __pyx_t_12;
15637  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15638  goto __pyx_L11_bool_binop_done;
15639  }
15640  __pyx_t_10 = 0;
15641  __pyx_L11_bool_binop_done:;
15642  __pyx_v_step = __pyx_t_10;
15643 
15644  /* "View.MemoryView":764
15645  * step = index.step or 0
15646  *
15647  * have_start = index.start is not None # <<<<<<<<<<<<<<
15648  * have_stop = index.stop is not None
15649  * have_step = index.step is not None
15650  */
15651  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
15652  __Pyx_GOTREF(__pyx_t_9);
15653  __pyx_t_1 = (__pyx_t_9 != Py_None);
15654  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15655  __pyx_v_have_start = __pyx_t_1;
15656 
15657  /* "View.MemoryView":765
15658  *
15659  * have_start = index.start is not None
15660  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
15661  * have_step = index.step is not None
15662  *
15663  */
15664  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
15665  __Pyx_GOTREF(__pyx_t_9);
15666  __pyx_t_1 = (__pyx_t_9 != Py_None);
15667  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15668  __pyx_v_have_stop = __pyx_t_1;
15669 
15670  /* "View.MemoryView":766
15671  * have_start = index.start is not None
15672  * have_stop = index.stop is not None
15673  * have_step = index.step is not None # <<<<<<<<<<<<<<
15674  *
15675  * slice_memviewslice(
15676  */
15677  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
15678  __Pyx_GOTREF(__pyx_t_9);
15679  __pyx_t_1 = (__pyx_t_9 != Py_None);
15680  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15681  __pyx_v_have_step = __pyx_t_1;
15682 
15683  /* "View.MemoryView":768
15684  * have_step = index.step is not None
15685  *
15686  * slice_memviewslice( # <<<<<<<<<<<<<<
15687  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15688  * dim, new_ndim, p_suboffset_dim,
15689  */
15690  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
15691 
15692  /* "View.MemoryView":774
15693  * have_start, have_stop, have_step,
15694  * True)
15695  * new_ndim += 1 # <<<<<<<<<<<<<<
15696  *
15697  * if isinstance(memview, _memoryviewslice):
15698  */
15699  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15700  }
15701  __pyx_L6:;
15702 
15703  /* "View.MemoryView":746
15704  * cdef bint have_start, have_stop, have_step
15705  *
15706  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15707  * if PyIndex_Check(index):
15708  * slice_memviewslice(
15709  */
15710  }
15711  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15712 
15713  /* "View.MemoryView":776
15714  * new_ndim += 1
15715  *
15716  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15717  * return memoryview_fromslice(dst, new_ndim,
15718  * memviewsliceobj.to_object_func,
15719  */
15720  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15721  __pyx_t_2 = (__pyx_t_1 != 0);
15722  if (__pyx_t_2) {
15723 
15724  /* "View.MemoryView":777
15725  *
15726  * if isinstance(memview, _memoryviewslice):
15727  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15728  * memviewsliceobj.to_object_func,
15729  * memviewsliceobj.to_dtype_func,
15730  */
15731  __Pyx_XDECREF(((PyObject *)__pyx_r));
15732 
15733  /* "View.MemoryView":778
15734  * if isinstance(memview, _memoryviewslice):
15735  * return memoryview_fromslice(dst, new_ndim,
15736  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
15737  * memviewsliceobj.to_dtype_func,
15738  * memview.dtype_is_object)
15739  */
15740  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
15741 
15742  /* "View.MemoryView":779
15743  * return memoryview_fromslice(dst, new_ndim,
15744  * memviewsliceobj.to_object_func,
15745  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
15746  * memview.dtype_is_object)
15747  * else:
15748  */
15749  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
15750 
15751  /* "View.MemoryView":777
15752  *
15753  * if isinstance(memview, _memoryviewslice):
15754  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15755  * memviewsliceobj.to_object_func,
15756  * memviewsliceobj.to_dtype_func,
15757  */
15758  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
15759  __Pyx_GOTREF(__pyx_t_3);
15760  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
15761  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15762  __pyx_t_3 = 0;
15763  goto __pyx_L0;
15764 
15765  /* "View.MemoryView":776
15766  * new_ndim += 1
15767  *
15768  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15769  * return memoryview_fromslice(dst, new_ndim,
15770  * memviewsliceobj.to_object_func,
15771  */
15772  }
15773 
15774  /* "View.MemoryView":782
15775  * memview.dtype_is_object)
15776  * else:
15777  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15778  * memview.dtype_is_object)
15779  *
15780  */
15781  /*else*/ {
15782  __Pyx_XDECREF(((PyObject *)__pyx_r));
15783 
15784  /* "View.MemoryView":783
15785  * else:
15786  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
15787  * memview.dtype_is_object) # <<<<<<<<<<<<<<
15788  *
15789  *
15790  */
15791  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
15792  __Pyx_GOTREF(__pyx_t_3);
15793 
15794  /* "View.MemoryView":782
15795  * memview.dtype_is_object)
15796  * else:
15797  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15798  * memview.dtype_is_object)
15799  *
15800  */
15801  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
15802  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15803  __pyx_t_3 = 0;
15804  goto __pyx_L0;
15805  }
15806 
15807  /* "View.MemoryView":710
15808  *
15809  * @cname('__pyx_memview_slice')
15810  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15811  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15812  * cdef bint negative_step
15813  */
15814 
15815  /* function exit code */
15816  __pyx_L1_error:;
15817  __Pyx_XDECREF(__pyx_t_3);
15818  __Pyx_XDECREF(__pyx_t_9);
15819  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15820  __pyx_r = 0;
15821  __pyx_L0:;
15822  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15823  __Pyx_XDECREF(__pyx_v_index);
15824  __Pyx_XGIVEREF((PyObject *)__pyx_r);
15825  __Pyx_TraceReturn(__pyx_r, 0);
15826  __Pyx_RefNannyFinishContext();
15827  return __pyx_r;
15828 }
15829 
15830 /* "View.MemoryView":807
15831  *
15832  * @cname('__pyx_memoryview_slice_memviewslice')
15833  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15834  * __Pyx_memviewslice *dst,
15835  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15836  */
15837 
15838 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) {
15839  Py_ssize_t __pyx_v_new_shape;
15840  int __pyx_v_negative_step;
15841  int __pyx_r;
15842  __Pyx_TraceDeclarations
15843  int __pyx_t_1;
15844  int __pyx_t_2;
15845  int __pyx_t_3;
15846  int __pyx_lineno = 0;
15847  const char *__pyx_filename = NULL;
15848  int __pyx_clineno = 0;
15849  __Pyx_TraceCall("slice_memviewslice", __pyx_f[1], 807, 1, __PYX_ERR(1, 807, __pyx_L1_error));
15850 
15851  /* "View.MemoryView":827
15852  * cdef bint negative_step
15853  *
15854  * if not is_slice: # <<<<<<<<<<<<<<
15855  *
15856  * if start < 0:
15857  */
15858  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15859  if (__pyx_t_1) {
15860 
15861  /* "View.MemoryView":829
15862  * if not is_slice:
15863  *
15864  * if start < 0: # <<<<<<<<<<<<<<
15865  * start += shape
15866  * if not 0 <= start < shape:
15867  */
15868  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15869  if (__pyx_t_1) {
15870 
15871  /* "View.MemoryView":830
15872  *
15873  * if start < 0:
15874  * start += shape # <<<<<<<<<<<<<<
15875  * if not 0 <= start < shape:
15876  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15877  */
15878  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15879 
15880  /* "View.MemoryView":829
15881  * if not is_slice:
15882  *
15883  * if start < 0: # <<<<<<<<<<<<<<
15884  * start += shape
15885  * if not 0 <= start < shape:
15886  */
15887  }
15888 
15889  /* "View.MemoryView":831
15890  * if start < 0:
15891  * start += shape
15892  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15893  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15894  * else:
15895  */
15896  __pyx_t_1 = (0 <= __pyx_v_start);
15897  if (__pyx_t_1) {
15898  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15899  }
15900  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15901  if (__pyx_t_2) {
15902 
15903  /* "View.MemoryView":832
15904  * start += shape
15905  * if not 0 <= start < shape:
15906  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
15907  * else:
15908  *
15909  */
15910  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
15911 
15912  /* "View.MemoryView":831
15913  * if start < 0:
15914  * start += shape
15915  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15916  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15917  * else:
15918  */
15919  }
15920 
15921  /* "View.MemoryView":827
15922  * cdef bint negative_step
15923  *
15924  * if not is_slice: # <<<<<<<<<<<<<<
15925  *
15926  * if start < 0:
15927  */
15928  goto __pyx_L3;
15929  }
15930 
15931  /* "View.MemoryView":835
15932  * else:
15933  *
15934  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
15935  *
15936  * if have_step and step == 0:
15937  */
15938  /*else*/ {
15939  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15940  if (__pyx_t_1) {
15941  } else {
15942  __pyx_t_2 = __pyx_t_1;
15943  goto __pyx_L6_bool_binop_done;
15944  }
15945  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15946  __pyx_t_2 = __pyx_t_1;
15947  __pyx_L6_bool_binop_done:;
15948  __pyx_v_negative_step = __pyx_t_2;
15949 
15950  /* "View.MemoryView":837
15951  * negative_step = have_step != 0 and step < 0
15952  *
15953  * if have_step and step == 0: # <<<<<<<<<<<<<<
15954  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15955  *
15956  */
15957  __pyx_t_1 = (__pyx_v_have_step != 0);
15958  if (__pyx_t_1) {
15959  } else {
15960  __pyx_t_2 = __pyx_t_1;
15961  goto __pyx_L9_bool_binop_done;
15962  }
15963  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15964  __pyx_t_2 = __pyx_t_1;
15965  __pyx_L9_bool_binop_done:;
15966  if (__pyx_t_2) {
15967 
15968  /* "View.MemoryView":838
15969  *
15970  * if have_step and step == 0:
15971  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
15972  *
15973  *
15974  */
15975  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
15976 
15977  /* "View.MemoryView":837
15978  * negative_step = have_step != 0 and step < 0
15979  *
15980  * if have_step and step == 0: # <<<<<<<<<<<<<<
15981  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15982  *
15983  */
15984  }
15985 
15986  /* "View.MemoryView":841
15987  *
15988  *
15989  * if have_start: # <<<<<<<<<<<<<<
15990  * if start < 0:
15991  * start += shape
15992  */
15993  __pyx_t_2 = (__pyx_v_have_start != 0);
15994  if (__pyx_t_2) {
15995 
15996  /* "View.MemoryView":842
15997  *
15998  * if have_start:
15999  * if start < 0: # <<<<<<<<<<<<<<
16000  * start += shape
16001  * if start < 0:
16002  */
16003  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16004  if (__pyx_t_2) {
16005 
16006  /* "View.MemoryView":843
16007  * if have_start:
16008  * if start < 0:
16009  * start += shape # <<<<<<<<<<<<<<
16010  * if start < 0:
16011  * start = 0
16012  */
16013  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16014 
16015  /* "View.MemoryView":844
16016  * if start < 0:
16017  * start += shape
16018  * if start < 0: # <<<<<<<<<<<<<<
16019  * start = 0
16020  * elif start >= shape:
16021  */
16022  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16023  if (__pyx_t_2) {
16024 
16025  /* "View.MemoryView":845
16026  * start += shape
16027  * if start < 0:
16028  * start = 0 # <<<<<<<<<<<<<<
16029  * elif start >= shape:
16030  * if negative_step:
16031  */
16032  __pyx_v_start = 0;
16033 
16034  /* "View.MemoryView":844
16035  * if start < 0:
16036  * start += shape
16037  * if start < 0: # <<<<<<<<<<<<<<
16038  * start = 0
16039  * elif start >= shape:
16040  */
16041  }
16042 
16043  /* "View.MemoryView":842
16044  *
16045  * if have_start:
16046  * if start < 0: # <<<<<<<<<<<<<<
16047  * start += shape
16048  * if start < 0:
16049  */
16050  goto __pyx_L12;
16051  }
16052 
16053  /* "View.MemoryView":846
16054  * if start < 0:
16055  * start = 0
16056  * elif start >= shape: # <<<<<<<<<<<<<<
16057  * if negative_step:
16058  * start = shape - 1
16059  */
16060  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16061  if (__pyx_t_2) {
16062 
16063  /* "View.MemoryView":847
16064  * start = 0
16065  * elif start >= shape:
16066  * if negative_step: # <<<<<<<<<<<<<<
16067  * start = shape - 1
16068  * else:
16069  */
16070  __pyx_t_2 = (__pyx_v_negative_step != 0);
16071  if (__pyx_t_2) {
16072 
16073  /* "View.MemoryView":848
16074  * elif start >= shape:
16075  * if negative_step:
16076  * start = shape - 1 # <<<<<<<<<<<<<<
16077  * else:
16078  * start = shape
16079  */
16080  __pyx_v_start = (__pyx_v_shape - 1);
16081 
16082  /* "View.MemoryView":847
16083  * start = 0
16084  * elif start >= shape:
16085  * if negative_step: # <<<<<<<<<<<<<<
16086  * start = shape - 1
16087  * else:
16088  */
16089  goto __pyx_L14;
16090  }
16091 
16092  /* "View.MemoryView":850
16093  * start = shape - 1
16094  * else:
16095  * start = shape # <<<<<<<<<<<<<<
16096  * else:
16097  * if negative_step:
16098  */
16099  /*else*/ {
16100  __pyx_v_start = __pyx_v_shape;
16101  }
16102  __pyx_L14:;
16103 
16104  /* "View.MemoryView":846
16105  * if start < 0:
16106  * start = 0
16107  * elif start >= shape: # <<<<<<<<<<<<<<
16108  * if negative_step:
16109  * start = shape - 1
16110  */
16111  }
16112  __pyx_L12:;
16113 
16114  /* "View.MemoryView":841
16115  *
16116  *
16117  * if have_start: # <<<<<<<<<<<<<<
16118  * if start < 0:
16119  * start += shape
16120  */
16121  goto __pyx_L11;
16122  }
16123 
16124  /* "View.MemoryView":852
16125  * start = shape
16126  * else:
16127  * if negative_step: # <<<<<<<<<<<<<<
16128  * start = shape - 1
16129  * else:
16130  */
16131  /*else*/ {
16132  __pyx_t_2 = (__pyx_v_negative_step != 0);
16133  if (__pyx_t_2) {
16134 
16135  /* "View.MemoryView":853
16136  * else:
16137  * if negative_step:
16138  * start = shape - 1 # <<<<<<<<<<<<<<
16139  * else:
16140  * start = 0
16141  */
16142  __pyx_v_start = (__pyx_v_shape - 1);
16143 
16144  /* "View.MemoryView":852
16145  * start = shape
16146  * else:
16147  * if negative_step: # <<<<<<<<<<<<<<
16148  * start = shape - 1
16149  * else:
16150  */
16151  goto __pyx_L15;
16152  }
16153 
16154  /* "View.MemoryView":855
16155  * start = shape - 1
16156  * else:
16157  * start = 0 # <<<<<<<<<<<<<<
16158  *
16159  * if have_stop:
16160  */
16161  /*else*/ {
16162  __pyx_v_start = 0;
16163  }
16164  __pyx_L15:;
16165  }
16166  __pyx_L11:;
16167 
16168  /* "View.MemoryView":857
16169  * start = 0
16170  *
16171  * if have_stop: # <<<<<<<<<<<<<<
16172  * if stop < 0:
16173  * stop += shape
16174  */
16175  __pyx_t_2 = (__pyx_v_have_stop != 0);
16176  if (__pyx_t_2) {
16177 
16178  /* "View.MemoryView":858
16179  *
16180  * if have_stop:
16181  * if stop < 0: # <<<<<<<<<<<<<<
16182  * stop += shape
16183  * if stop < 0:
16184  */
16185  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16186  if (__pyx_t_2) {
16187 
16188  /* "View.MemoryView":859
16189  * if have_stop:
16190  * if stop < 0:
16191  * stop += shape # <<<<<<<<<<<<<<
16192  * if stop < 0:
16193  * stop = 0
16194  */
16195  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16196 
16197  /* "View.MemoryView":860
16198  * if stop < 0:
16199  * stop += shape
16200  * if stop < 0: # <<<<<<<<<<<<<<
16201  * stop = 0
16202  * elif stop > shape:
16203  */
16204  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16205  if (__pyx_t_2) {
16206 
16207  /* "View.MemoryView":861
16208  * stop += shape
16209  * if stop < 0:
16210  * stop = 0 # <<<<<<<<<<<<<<
16211  * elif stop > shape:
16212  * stop = shape
16213  */
16214  __pyx_v_stop = 0;
16215 
16216  /* "View.MemoryView":860
16217  * if stop < 0:
16218  * stop += shape
16219  * if stop < 0: # <<<<<<<<<<<<<<
16220  * stop = 0
16221  * elif stop > shape:
16222  */
16223  }
16224 
16225  /* "View.MemoryView":858
16226  *
16227  * if have_stop:
16228  * if stop < 0: # <<<<<<<<<<<<<<
16229  * stop += shape
16230  * if stop < 0:
16231  */
16232  goto __pyx_L17;
16233  }
16234 
16235  /* "View.MemoryView":862
16236  * if stop < 0:
16237  * stop = 0
16238  * elif stop > shape: # <<<<<<<<<<<<<<
16239  * stop = shape
16240  * else:
16241  */
16242  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16243  if (__pyx_t_2) {
16244 
16245  /* "View.MemoryView":863
16246  * stop = 0
16247  * elif stop > shape:
16248  * stop = shape # <<<<<<<<<<<<<<
16249  * else:
16250  * if negative_step:
16251  */
16252  __pyx_v_stop = __pyx_v_shape;
16253 
16254  /* "View.MemoryView":862
16255  * if stop < 0:
16256  * stop = 0
16257  * elif stop > shape: # <<<<<<<<<<<<<<
16258  * stop = shape
16259  * else:
16260  */
16261  }
16262  __pyx_L17:;
16263 
16264  /* "View.MemoryView":857
16265  * start = 0
16266  *
16267  * if have_stop: # <<<<<<<<<<<<<<
16268  * if stop < 0:
16269  * stop += shape
16270  */
16271  goto __pyx_L16;
16272  }
16273 
16274  /* "View.MemoryView":865
16275  * stop = shape
16276  * else:
16277  * if negative_step: # <<<<<<<<<<<<<<
16278  * stop = -1
16279  * else:
16280  */
16281  /*else*/ {
16282  __pyx_t_2 = (__pyx_v_negative_step != 0);
16283  if (__pyx_t_2) {
16284 
16285  /* "View.MemoryView":866
16286  * else:
16287  * if negative_step:
16288  * stop = -1 # <<<<<<<<<<<<<<
16289  * else:
16290  * stop = shape
16291  */
16292  __pyx_v_stop = -1L;
16293 
16294  /* "View.MemoryView":865
16295  * stop = shape
16296  * else:
16297  * if negative_step: # <<<<<<<<<<<<<<
16298  * stop = -1
16299  * else:
16300  */
16301  goto __pyx_L19;
16302  }
16303 
16304  /* "View.MemoryView":868
16305  * stop = -1
16306  * else:
16307  * stop = shape # <<<<<<<<<<<<<<
16308  *
16309  * if not have_step:
16310  */
16311  /*else*/ {
16312  __pyx_v_stop = __pyx_v_shape;
16313  }
16314  __pyx_L19:;
16315  }
16316  __pyx_L16:;
16317 
16318  /* "View.MemoryView":870
16319  * stop = shape
16320  *
16321  * if not have_step: # <<<<<<<<<<<<<<
16322  * step = 1
16323  *
16324  */
16325  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16326  if (__pyx_t_2) {
16327 
16328  /* "View.MemoryView":871
16329  *
16330  * if not have_step:
16331  * step = 1 # <<<<<<<<<<<<<<
16332  *
16333  *
16334  */
16335  __pyx_v_step = 1;
16336 
16337  /* "View.MemoryView":870
16338  * stop = shape
16339  *
16340  * if not have_step: # <<<<<<<<<<<<<<
16341  * step = 1
16342  *
16343  */
16344  }
16345 
16346  /* "View.MemoryView":875
16347  *
16348  * with cython.cdivision(True):
16349  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
16350  *
16351  * if (stop - start) - step * new_shape:
16352  */
16353  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16354 
16355  /* "View.MemoryView":877
16356  * new_shape = (stop - start) // step
16357  *
16358  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16359  * new_shape += 1
16360  *
16361  */
16362  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16363  if (__pyx_t_2) {
16364 
16365  /* "View.MemoryView":878
16366  *
16367  * if (stop - start) - step * new_shape:
16368  * new_shape += 1 # <<<<<<<<<<<<<<
16369  *
16370  * if new_shape < 0:
16371  */
16372  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16373 
16374  /* "View.MemoryView":877
16375  * new_shape = (stop - start) // step
16376  *
16377  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16378  * new_shape += 1
16379  *
16380  */
16381  }
16382 
16383  /* "View.MemoryView":880
16384  * new_shape += 1
16385  *
16386  * if new_shape < 0: # <<<<<<<<<<<<<<
16387  * new_shape = 0
16388  *
16389  */
16390  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16391  if (__pyx_t_2) {
16392 
16393  /* "View.MemoryView":881
16394  *
16395  * if new_shape < 0:
16396  * new_shape = 0 # <<<<<<<<<<<<<<
16397  *
16398  *
16399  */
16400  __pyx_v_new_shape = 0;
16401 
16402  /* "View.MemoryView":880
16403  * new_shape += 1
16404  *
16405  * if new_shape < 0: # <<<<<<<<<<<<<<
16406  * new_shape = 0
16407  *
16408  */
16409  }
16410 
16411  /* "View.MemoryView":884
16412  *
16413  *
16414  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
16415  * dst.shape[new_ndim] = new_shape
16416  * dst.suboffsets[new_ndim] = suboffset
16417  */
16418  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16419 
16420  /* "View.MemoryView":885
16421  *
16422  * dst.strides[new_ndim] = stride * step
16423  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
16424  * dst.suboffsets[new_ndim] = suboffset
16425  *
16426  */
16427  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16428 
16429  /* "View.MemoryView":886
16430  * dst.strides[new_ndim] = stride * step
16431  * dst.shape[new_ndim] = new_shape
16432  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
16433  *
16434  *
16435  */
16436  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16437  }
16438  __pyx_L3:;
16439 
16440  /* "View.MemoryView":889
16441  *
16442  *
16443  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16444  * dst.data += start * stride
16445  * else:
16446  */
16447  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16448  if (__pyx_t_2) {
16449 
16450  /* "View.MemoryView":890
16451  *
16452  * if suboffset_dim[0] < 0:
16453  * dst.data += start * stride # <<<<<<<<<<<<<<
16454  * else:
16455  * dst.suboffsets[suboffset_dim[0]] += start * stride
16456  */
16457  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16458 
16459  /* "View.MemoryView":889
16460  *
16461  *
16462  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16463  * dst.data += start * stride
16464  * else:
16465  */
16466  goto __pyx_L23;
16467  }
16468 
16469  /* "View.MemoryView":892
16470  * dst.data += start * stride
16471  * else:
16472  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
16473  *
16474  * if suboffset >= 0:
16475  */
16476  /*else*/ {
16477  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16478  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16479  }
16480  __pyx_L23:;
16481 
16482  /* "View.MemoryView":894
16483  * dst.suboffsets[suboffset_dim[0]] += start * stride
16484  *
16485  * if suboffset >= 0: # <<<<<<<<<<<<<<
16486  * if not is_slice:
16487  * if new_ndim == 0:
16488  */
16489  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16490  if (__pyx_t_2) {
16491 
16492  /* "View.MemoryView":895
16493  *
16494  * if suboffset >= 0:
16495  * if not is_slice: # <<<<<<<<<<<<<<
16496  * if new_ndim == 0:
16497  * dst.data = (<char **> dst.data)[0] + suboffset
16498  */
16499  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16500  if (__pyx_t_2) {
16501 
16502  /* "View.MemoryView":896
16503  * if suboffset >= 0:
16504  * if not is_slice:
16505  * if new_ndim == 0: # <<<<<<<<<<<<<<
16506  * dst.data = (<char **> dst.data)[0] + suboffset
16507  * else:
16508  */
16509  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16510  if (__pyx_t_2) {
16511 
16512  /* "View.MemoryView":897
16513  * if not is_slice:
16514  * if new_ndim == 0:
16515  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
16516  * else:
16517  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16518  */
16519  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16520 
16521  /* "View.MemoryView":896
16522  * if suboffset >= 0:
16523  * if not is_slice:
16524  * if new_ndim == 0: # <<<<<<<<<<<<<<
16525  * dst.data = (<char **> dst.data)[0] + suboffset
16526  * else:
16527  */
16528  goto __pyx_L26;
16529  }
16530 
16531  /* "View.MemoryView":899
16532  * dst.data = (<char **> dst.data)[0] + suboffset
16533  * else:
16534  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
16535  * "must be indexed and not sliced", dim)
16536  * else:
16537  */
16538  /*else*/ {
16539 
16540  /* "View.MemoryView":900
16541  * else:
16542  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16543  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
16544  * else:
16545  * suboffset_dim[0] = new_ndim
16546  */
16547  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
16548  }
16549  __pyx_L26:;
16550 
16551  /* "View.MemoryView":895
16552  *
16553  * if suboffset >= 0:
16554  * if not is_slice: # <<<<<<<<<<<<<<
16555  * if new_ndim == 0:
16556  * dst.data = (<char **> dst.data)[0] + suboffset
16557  */
16558  goto __pyx_L25;
16559  }
16560 
16561  /* "View.MemoryView":902
16562  * "must be indexed and not sliced", dim)
16563  * else:
16564  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
16565  *
16566  * return 0
16567  */
16568  /*else*/ {
16569  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16570  }
16571  __pyx_L25:;
16572 
16573  /* "View.MemoryView":894
16574  * dst.suboffsets[suboffset_dim[0]] += start * stride
16575  *
16576  * if suboffset >= 0: # <<<<<<<<<<<<<<
16577  * if not is_slice:
16578  * if new_ndim == 0:
16579  */
16580  }
16581 
16582  /* "View.MemoryView":904
16583  * suboffset_dim[0] = new_ndim
16584  *
16585  * return 0 # <<<<<<<<<<<<<<
16586  *
16587  *
16588  */
16589  __pyx_r = 0;
16590  goto __pyx_L0;
16591 
16592  /* "View.MemoryView":807
16593  *
16594  * @cname('__pyx_memoryview_slice_memviewslice')
16595  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16596  * __Pyx_memviewslice *dst,
16597  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16598  */
16599 
16600  /* function exit code */
16601  __pyx_L1_error:;
16602  {
16603  #ifdef WITH_THREAD
16604  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16605  #endif
16606  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16607  #ifdef WITH_THREAD
16608  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16609  #endif
16610  }
16611  __pyx_r = -1;
16612  __pyx_L0:;
16613  __Pyx_TraceReturn(Py_None, 1);
16614  return __pyx_r;
16615 }
16616 
16617 /* "View.MemoryView":910
16618  *
16619  * @cname('__pyx_pybuffer_index')
16620  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16621  * Py_ssize_t dim) except NULL:
16622  * cdef Py_ssize_t shape, stride, suboffset = -1
16623  */
16624 
16625 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) {
16626  Py_ssize_t __pyx_v_shape;
16627  Py_ssize_t __pyx_v_stride;
16628  Py_ssize_t __pyx_v_suboffset;
16629  Py_ssize_t __pyx_v_itemsize;
16630  char *__pyx_v_resultp;
16631  char *__pyx_r;
16632  __Pyx_TraceDeclarations
16633  __Pyx_RefNannyDeclarations
16634  Py_ssize_t __pyx_t_1;
16635  int __pyx_t_2;
16636  PyObject *__pyx_t_3 = NULL;
16637  PyObject *__pyx_t_4 = NULL;
16638  int __pyx_lineno = 0;
16639  const char *__pyx_filename = NULL;
16640  int __pyx_clineno = 0;
16641  __Pyx_RefNannySetupContext("pybuffer_index", 0);
16642  __Pyx_TraceCall("pybuffer_index", __pyx_f[1], 910, 0, __PYX_ERR(1, 910, __pyx_L1_error));
16643 
16644  /* "View.MemoryView":912
16645  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
16646  * Py_ssize_t dim) except NULL:
16647  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
16648  * cdef Py_ssize_t itemsize = view.itemsize
16649  * cdef char *resultp
16650  */
16651  __pyx_v_suboffset = -1L;
16652 
16653  /* "View.MemoryView":913
16654  * Py_ssize_t dim) except NULL:
16655  * cdef Py_ssize_t shape, stride, suboffset = -1
16656  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
16657  * cdef char *resultp
16658  *
16659  */
16660  __pyx_t_1 = __pyx_v_view->itemsize;
16661  __pyx_v_itemsize = __pyx_t_1;
16662 
16663  /* "View.MemoryView":916
16664  * cdef char *resultp
16665  *
16666  * if view.ndim == 0: # <<<<<<<<<<<<<<
16667  * shape = view.len / itemsize
16668  * stride = itemsize
16669  */
16670  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16671  if (__pyx_t_2) {
16672 
16673  /* "View.MemoryView":917
16674  *
16675  * if view.ndim == 0:
16676  * shape = view.len / itemsize # <<<<<<<<<<<<<<
16677  * stride = itemsize
16678  * else:
16679  */
16680  if (unlikely(__pyx_v_itemsize == 0)) {
16681  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
16682  __PYX_ERR(1, 917, __pyx_L1_error)
16683  }
16684  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))) {
16685  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
16686  __PYX_ERR(1, 917, __pyx_L1_error)
16687  }
16688  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16689 
16690  /* "View.MemoryView":918
16691  * if view.ndim == 0:
16692  * shape = view.len / itemsize
16693  * stride = itemsize # <<<<<<<<<<<<<<
16694  * else:
16695  * shape = view.shape[dim]
16696  */
16697  __pyx_v_stride = __pyx_v_itemsize;
16698 
16699  /* "View.MemoryView":916
16700  * cdef char *resultp
16701  *
16702  * if view.ndim == 0: # <<<<<<<<<<<<<<
16703  * shape = view.len / itemsize
16704  * stride = itemsize
16705  */
16706  goto __pyx_L3;
16707  }
16708 
16709  /* "View.MemoryView":920
16710  * stride = itemsize
16711  * else:
16712  * shape = view.shape[dim] # <<<<<<<<<<<<<<
16713  * stride = view.strides[dim]
16714  * if view.suboffsets != NULL:
16715  */
16716  /*else*/ {
16717  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16718 
16719  /* "View.MemoryView":921
16720  * else:
16721  * shape = view.shape[dim]
16722  * stride = view.strides[dim] # <<<<<<<<<<<<<<
16723  * if view.suboffsets != NULL:
16724  * suboffset = view.suboffsets[dim]
16725  */
16726  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16727 
16728  /* "View.MemoryView":922
16729  * shape = view.shape[dim]
16730  * stride = view.strides[dim]
16731  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16732  * suboffset = view.suboffsets[dim]
16733  *
16734  */
16735  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16736  if (__pyx_t_2) {
16737 
16738  /* "View.MemoryView":923
16739  * stride = view.strides[dim]
16740  * if view.suboffsets != NULL:
16741  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
16742  *
16743  * if index < 0:
16744  */
16745  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16746 
16747  /* "View.MemoryView":922
16748  * shape = view.shape[dim]
16749  * stride = view.strides[dim]
16750  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16751  * suboffset = view.suboffsets[dim]
16752  *
16753  */
16754  }
16755  }
16756  __pyx_L3:;
16757 
16758  /* "View.MemoryView":925
16759  * suboffset = view.suboffsets[dim]
16760  *
16761  * if index < 0: # <<<<<<<<<<<<<<
16762  * index += view.shape[dim]
16763  * if index < 0:
16764  */
16765  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16766  if (__pyx_t_2) {
16767 
16768  /* "View.MemoryView":926
16769  *
16770  * if index < 0:
16771  * index += view.shape[dim] # <<<<<<<<<<<<<<
16772  * if index < 0:
16773  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16774  */
16775  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16776 
16777  /* "View.MemoryView":927
16778  * if index < 0:
16779  * index += view.shape[dim]
16780  * if index < 0: # <<<<<<<<<<<<<<
16781  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16782  *
16783  */
16784  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16785  if (unlikely(__pyx_t_2)) {
16786 
16787  /* "View.MemoryView":928
16788  * index += view.shape[dim]
16789  * if index < 0:
16790  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16791  *
16792  * if index >= shape:
16793  */
16794  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16795  __Pyx_GOTREF(__pyx_t_3);
16796  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
16797  __Pyx_GOTREF(__pyx_t_4);
16798  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16799  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16800  __Pyx_GOTREF(__pyx_t_3);
16801  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16802  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16803  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16804  __PYX_ERR(1, 928, __pyx_L1_error)
16805 
16806  /* "View.MemoryView":927
16807  * if index < 0:
16808  * index += view.shape[dim]
16809  * if index < 0: # <<<<<<<<<<<<<<
16810  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16811  *
16812  */
16813  }
16814 
16815  /* "View.MemoryView":925
16816  * suboffset = view.suboffsets[dim]
16817  *
16818  * if index < 0: # <<<<<<<<<<<<<<
16819  * index += view.shape[dim]
16820  * if index < 0:
16821  */
16822  }
16823 
16824  /* "View.MemoryView":930
16825  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16826  *
16827  * if index >= shape: # <<<<<<<<<<<<<<
16828  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16829  *
16830  */
16831  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16832  if (unlikely(__pyx_t_2)) {
16833 
16834  /* "View.MemoryView":931
16835  *
16836  * if index >= shape:
16837  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16838  *
16839  * resultp = bufp + index * stride
16840  */
16841  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16842  __Pyx_GOTREF(__pyx_t_3);
16843  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
16844  __Pyx_GOTREF(__pyx_t_4);
16845  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16846  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16847  __Pyx_GOTREF(__pyx_t_3);
16848  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16849  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16850  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16851  __PYX_ERR(1, 931, __pyx_L1_error)
16852 
16853  /* "View.MemoryView":930
16854  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16855  *
16856  * if index >= shape: # <<<<<<<<<<<<<<
16857  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16858  *
16859  */
16860  }
16861 
16862  /* "View.MemoryView":933
16863  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16864  *
16865  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
16866  * if suboffset >= 0:
16867  * resultp = (<char **> resultp)[0] + suboffset
16868  */
16869  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16870 
16871  /* "View.MemoryView":934
16872  *
16873  * resultp = bufp + index * stride
16874  * if suboffset >= 0: # <<<<<<<<<<<<<<
16875  * resultp = (<char **> resultp)[0] + suboffset
16876  *
16877  */
16878  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16879  if (__pyx_t_2) {
16880 
16881  /* "View.MemoryView":935
16882  * resultp = bufp + index * stride
16883  * if suboffset >= 0:
16884  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
16885  *
16886  * return resultp
16887  */
16888  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16889 
16890  /* "View.MemoryView":934
16891  *
16892  * resultp = bufp + index * stride
16893  * if suboffset >= 0: # <<<<<<<<<<<<<<
16894  * resultp = (<char **> resultp)[0] + suboffset
16895  *
16896  */
16897  }
16898 
16899  /* "View.MemoryView":937
16900  * resultp = (<char **> resultp)[0] + suboffset
16901  *
16902  * return resultp # <<<<<<<<<<<<<<
16903  *
16904  *
16905  */
16906  __pyx_r = __pyx_v_resultp;
16907  goto __pyx_L0;
16908 
16909  /* "View.MemoryView":910
16910  *
16911  * @cname('__pyx_pybuffer_index')
16912  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16913  * Py_ssize_t dim) except NULL:
16914  * cdef Py_ssize_t shape, stride, suboffset = -1
16915  */
16916 
16917  /* function exit code */
16918  __pyx_L1_error:;
16919  __Pyx_XDECREF(__pyx_t_3);
16920  __Pyx_XDECREF(__pyx_t_4);
16921  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16922  __pyx_r = NULL;
16923  __pyx_L0:;
16924  __Pyx_TraceReturn(Py_None, 0);
16925  __Pyx_RefNannyFinishContext();
16926  return __pyx_r;
16927 }
16928 
16929 /* "View.MemoryView":943
16930  *
16931  * @cname('__pyx_memslice_transpose')
16932  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16933  * cdef int ndim = memslice.memview.view.ndim
16934  *
16935  */
16936 
16937 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16938  int __pyx_v_ndim;
16939  Py_ssize_t *__pyx_v_shape;
16940  Py_ssize_t *__pyx_v_strides;
16941  int __pyx_v_i;
16942  int __pyx_v_j;
16943  int __pyx_r;
16944  __Pyx_TraceDeclarations
16945  int __pyx_t_1;
16946  Py_ssize_t *__pyx_t_2;
16947  long __pyx_t_3;
16948  long __pyx_t_4;
16949  Py_ssize_t __pyx_t_5;
16950  Py_ssize_t __pyx_t_6;
16951  int __pyx_t_7;
16952  int __pyx_t_8;
16953  int __pyx_t_9;
16954  int __pyx_lineno = 0;
16955  const char *__pyx_filename = NULL;
16956  int __pyx_clineno = 0;
16957  __Pyx_TraceCall("transpose_memslice", __pyx_f[1], 943, 1, __PYX_ERR(1, 943, __pyx_L1_error));
16958 
16959  /* "View.MemoryView":944
16960  * @cname('__pyx_memslice_transpose')
16961  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
16962  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
16963  *
16964  * cdef Py_ssize_t *shape = memslice.shape
16965  */
16966  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16967  __pyx_v_ndim = __pyx_t_1;
16968 
16969  /* "View.MemoryView":946
16970  * cdef int ndim = memslice.memview.view.ndim
16971  *
16972  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
16973  * cdef Py_ssize_t *strides = memslice.strides
16974  *
16975  */
16976  __pyx_t_2 = __pyx_v_memslice->shape;
16977  __pyx_v_shape = __pyx_t_2;
16978 
16979  /* "View.MemoryView":947
16980  *
16981  * cdef Py_ssize_t *shape = memslice.shape
16982  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
16983  *
16984  *
16985  */
16986  __pyx_t_2 = __pyx_v_memslice->strides;
16987  __pyx_v_strides = __pyx_t_2;
16988 
16989  /* "View.MemoryView":951
16990  *
16991  * cdef int i, j
16992  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
16993  * j = ndim - 1 - i
16994  * strides[i], strides[j] = strides[j], strides[i]
16995  */
16996  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
16997  __pyx_t_4 = __pyx_t_3;
16998  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16999  __pyx_v_i = __pyx_t_1;
17000 
17001  /* "View.MemoryView":952
17002  * cdef int i, j
17003  * for i in range(ndim / 2):
17004  * j = ndim - 1 - i # <<<<<<<<<<<<<<
17005  * strides[i], strides[j] = strides[j], strides[i]
17006  * shape[i], shape[j] = shape[j], shape[i]
17007  */
17008  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17009 
17010  /* "View.MemoryView":953
17011  * for i in range(ndim / 2):
17012  * j = ndim - 1 - i
17013  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
17014  * shape[i], shape[j] = shape[j], shape[i]
17015  *
17016  */
17017  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17018  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17019  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17020  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17021 
17022  /* "View.MemoryView":954
17023  * j = ndim - 1 - i
17024  * strides[i], strides[j] = strides[j], strides[i]
17025  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
17026  *
17027  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17028  */
17029  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17030  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17031  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17032  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17033 
17034  /* "View.MemoryView":956
17035  * shape[i], shape[j] = shape[j], shape[i]
17036  *
17037  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17038  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17039  *
17040  */
17041  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17042  if (!__pyx_t_8) {
17043  } else {
17044  __pyx_t_7 = __pyx_t_8;
17045  goto __pyx_L6_bool_binop_done;
17046  }
17047  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17048  __pyx_t_7 = __pyx_t_8;
17049  __pyx_L6_bool_binop_done:;
17050  if (__pyx_t_7) {
17051 
17052  /* "View.MemoryView":957
17053  *
17054  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17055  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
17056  *
17057  * return 1
17058  */
17059  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
17060 
17061  /* "View.MemoryView":956
17062  * shape[i], shape[j] = shape[j], shape[i]
17063  *
17064  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17065  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17066  *
17067  */
17068  }
17069  }
17070 
17071  /* "View.MemoryView":959
17072  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17073  *
17074  * return 1 # <<<<<<<<<<<<<<
17075  *
17076  *
17077  */
17078  __pyx_r = 1;
17079  goto __pyx_L0;
17080 
17081  /* "View.MemoryView":943
17082  *
17083  * @cname('__pyx_memslice_transpose')
17084  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17085  * cdef int ndim = memslice.memview.view.ndim
17086  *
17087  */
17088 
17089  /* function exit code */
17090  __pyx_L1_error:;
17091  {
17092  #ifdef WITH_THREAD
17093  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17094  #endif
17095  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17096  #ifdef WITH_THREAD
17097  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17098  #endif
17099  }
17100  __pyx_r = 0;
17101  __pyx_L0:;
17102  __Pyx_TraceReturn(Py_None, 1);
17103  return __pyx_r;
17104 }
17105 
17106 /* "View.MemoryView":976
17107  * cdef int (*to_dtype_func)(char *, object) except 0
17108  *
17109  * def __dealloc__(self): # <<<<<<<<<<<<<<
17110  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17111  *
17112  */
17113 
17114 /* Python wrapper */
17115 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
17116 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17117  __Pyx_RefNannyDeclarations
17118  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
17119  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17120 
17121  /* function exit code */
17122  __Pyx_RefNannyFinishContext();
17123 }
17124 
17125 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17126  __Pyx_TraceDeclarations
17127  __Pyx_RefNannyDeclarations
17128  int __pyx_lineno = 0;
17129  const char *__pyx_filename = NULL;
17130  int __pyx_clineno = 0;
17131  __Pyx_RefNannySetupContext("__dealloc__", 0);
17132  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 976, 0, __PYX_ERR(1, 976, __pyx_L1_error));
17133 
17134  /* "View.MemoryView":977
17135  *
17136  * def __dealloc__(self):
17137  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
17138  *
17139  * cdef convert_item_to_object(self, char *itemp):
17140  */
17141  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17142 
17143  /* "View.MemoryView":976
17144  * cdef int (*to_dtype_func)(char *, object) except 0
17145  *
17146  * def __dealloc__(self): # <<<<<<<<<<<<<<
17147  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17148  *
17149  */
17150 
17151  /* function exit code */
17152  goto __pyx_L0;
17153  __pyx_L1_error:;
17154  __Pyx_WriteUnraisable("View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17155  __pyx_L0:;
17156  __Pyx_TraceReturn(Py_None, 0);
17157  __Pyx_RefNannyFinishContext();
17158 }
17159 
17160 /* "View.MemoryView":979
17161  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17162  *
17163  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17164  * if self.to_object_func != NULL:
17165  * return self.to_object_func(itemp)
17166  */
17167 
17168 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
17169  PyObject *__pyx_r = NULL;
17170  __Pyx_TraceDeclarations
17171  __Pyx_RefNannyDeclarations
17172  int __pyx_t_1;
17173  PyObject *__pyx_t_2 = NULL;
17174  int __pyx_lineno = 0;
17175  const char *__pyx_filename = NULL;
17176  int __pyx_clineno = 0;
17177  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
17178  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error));
17179 
17180  /* "View.MemoryView":980
17181  *
17182  * cdef convert_item_to_object(self, char *itemp):
17183  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17184  * return self.to_object_func(itemp)
17185  * else:
17186  */
17187  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17188  if (__pyx_t_1) {
17189 
17190  /* "View.MemoryView":981
17191  * cdef convert_item_to_object(self, char *itemp):
17192  * if self.to_object_func != NULL:
17193  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
17194  * else:
17195  * return memoryview.convert_item_to_object(self, itemp)
17196  */
17197  __Pyx_XDECREF(__pyx_r);
17198  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
17199  __Pyx_GOTREF(__pyx_t_2);
17200  __pyx_r = __pyx_t_2;
17201  __pyx_t_2 = 0;
17202  goto __pyx_L0;
17203 
17204  /* "View.MemoryView":980
17205  *
17206  * cdef convert_item_to_object(self, char *itemp):
17207  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17208  * return self.to_object_func(itemp)
17209  * else:
17210  */
17211  }
17212 
17213  /* "View.MemoryView":983
17214  * return self.to_object_func(itemp)
17215  * else:
17216  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
17217  *
17218  * cdef assign_item_from_object(self, char *itemp, object value):
17219  */
17220  /*else*/ {
17221  __Pyx_XDECREF(__pyx_r);
17222  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
17223  __Pyx_GOTREF(__pyx_t_2);
17224  __pyx_r = __pyx_t_2;
17225  __pyx_t_2 = 0;
17226  goto __pyx_L0;
17227  }
17228 
17229  /* "View.MemoryView":979
17230  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17231  *
17232  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17233  * if self.to_object_func != NULL:
17234  * return self.to_object_func(itemp)
17235  */
17236 
17237  /* function exit code */
17238  __pyx_L1_error:;
17239  __Pyx_XDECREF(__pyx_t_2);
17240  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17241  __pyx_r = 0;
17242  __pyx_L0:;
17243  __Pyx_XGIVEREF(__pyx_r);
17244  __Pyx_TraceReturn(__pyx_r, 0);
17245  __Pyx_RefNannyFinishContext();
17246  return __pyx_r;
17247 }
17248 
17249 /* "View.MemoryView":985
17250  * return memoryview.convert_item_to_object(self, itemp)
17251  *
17252  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17253  * if self.to_dtype_func != NULL:
17254  * self.to_dtype_func(itemp, value)
17255  */
17256 
17257 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17258  PyObject *__pyx_r = NULL;
17259  __Pyx_TraceDeclarations
17260  __Pyx_RefNannyDeclarations
17261  int __pyx_t_1;
17262  int __pyx_t_2;
17263  PyObject *__pyx_t_3 = NULL;
17264  int __pyx_lineno = 0;
17265  const char *__pyx_filename = NULL;
17266  int __pyx_clineno = 0;
17267  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
17268  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error));
17269 
17270  /* "View.MemoryView":986
17271  *
17272  * cdef assign_item_from_object(self, char *itemp, object value):
17273  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17274  * self.to_dtype_func(itemp, value)
17275  * else:
17276  */
17277  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17278  if (__pyx_t_1) {
17279 
17280  /* "View.MemoryView":987
17281  * cdef assign_item_from_object(self, char *itemp, object value):
17282  * if self.to_dtype_func != NULL:
17283  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
17284  * else:
17285  * memoryview.assign_item_from_object(self, itemp, value)
17286  */
17287  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
17288 
17289  /* "View.MemoryView":986
17290  *
17291  * cdef assign_item_from_object(self, char *itemp, object value):
17292  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17293  * self.to_dtype_func(itemp, value)
17294  * else:
17295  */
17296  goto __pyx_L3;
17297  }
17298 
17299  /* "View.MemoryView":989
17300  * self.to_dtype_func(itemp, value)
17301  * else:
17302  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
17303  *
17304  * @property
17305  */
17306  /*else*/ {
17307  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
17308  __Pyx_GOTREF(__pyx_t_3);
17309  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17310  }
17311  __pyx_L3:;
17312 
17313  /* "View.MemoryView":985
17314  * return memoryview.convert_item_to_object(self, itemp)
17315  *
17316  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17317  * if self.to_dtype_func != NULL:
17318  * self.to_dtype_func(itemp, value)
17319  */
17320 
17321  /* function exit code */
17322  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17323  goto __pyx_L0;
17324  __pyx_L1_error:;
17325  __Pyx_XDECREF(__pyx_t_3);
17326  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17327  __pyx_r = 0;
17328  __pyx_L0:;
17329  __Pyx_XGIVEREF(__pyx_r);
17330  __Pyx_TraceReturn(__pyx_r, 0);
17331  __Pyx_RefNannyFinishContext();
17332  return __pyx_r;
17333 }
17334 
17335 /* "View.MemoryView":992
17336  *
17337  * @property
17338  * def base(self): # <<<<<<<<<<<<<<
17339  * return self.from_object
17340  *
17341  */
17342 
17343 /* Python wrapper */
17344 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
17345 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17346  PyObject *__pyx_r = 0;
17347  __Pyx_RefNannyDeclarations
17348  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17349  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17350 
17351  /* function exit code */
17352  __Pyx_RefNannyFinishContext();
17353  return __pyx_r;
17354 }
17355 
17356 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17357  PyObject *__pyx_r = NULL;
17358  __Pyx_TraceDeclarations
17359  __Pyx_RefNannyDeclarations
17360  int __pyx_lineno = 0;
17361  const char *__pyx_filename = NULL;
17362  int __pyx_clineno = 0;
17363  __Pyx_RefNannySetupContext("__get__", 0);
17364  __Pyx_TraceCall("__get__", __pyx_f[1], 992, 0, __PYX_ERR(1, 992, __pyx_L1_error));
17365 
17366  /* "View.MemoryView":993
17367  * @property
17368  * def base(self):
17369  * return self.from_object # <<<<<<<<<<<<<<
17370  *
17371  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
17372  */
17373  __Pyx_XDECREF(__pyx_r);
17374  __Pyx_INCREF(__pyx_v_self->from_object);
17375  __pyx_r = __pyx_v_self->from_object;
17376  goto __pyx_L0;
17377 
17378  /* "View.MemoryView":992
17379  *
17380  * @property
17381  * def base(self): # <<<<<<<<<<<<<<
17382  * return self.from_object
17383  *
17384  */
17385 
17386  /* function exit code */
17387  __pyx_L1_error:;
17388  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17389  __pyx_r = NULL;
17390  __pyx_L0:;
17391  __Pyx_XGIVEREF(__pyx_r);
17392  __Pyx_TraceReturn(__pyx_r, 0);
17393  __Pyx_RefNannyFinishContext();
17394  return __pyx_r;
17395 }
17396 
17397 /* "(tree fragment)":1
17398  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17399  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17400  * def __setstate_cython__(self, __pyx_state):
17401  */
17402 
17403 /* Python wrapper */
17404 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17405 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
17406 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17407  PyObject *__pyx_r = 0;
17408  __Pyx_RefNannyDeclarations
17409  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17410  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17411 
17412  /* function exit code */
17413  __Pyx_RefNannyFinishContext();
17414  return __pyx_r;
17415 }
17416 
17417 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17418  PyObject *__pyx_r = NULL;
17419  __Pyx_TraceDeclarations
17420  __Pyx_RefNannyDeclarations
17421  PyObject *__pyx_t_1 = NULL;
17422  int __pyx_lineno = 0;
17423  const char *__pyx_filename = NULL;
17424  int __pyx_clineno = 0;
17425  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17426  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
17427 
17428  /* "(tree fragment)":2
17429  * def __reduce_cython__(self):
17430  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17431  * def __setstate_cython__(self, __pyx_state):
17432  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17433  */
17434  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17435  __Pyx_GOTREF(__pyx_t_1);
17436  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17437  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17438  __PYX_ERR(1, 2, __pyx_L1_error)
17439 
17440  /* "(tree fragment)":1
17441  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17442  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17443  * def __setstate_cython__(self, __pyx_state):
17444  */
17445 
17446  /* function exit code */
17447  __pyx_L1_error:;
17448  __Pyx_XDECREF(__pyx_t_1);
17449  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17450  __pyx_r = NULL;
17451  __Pyx_XGIVEREF(__pyx_r);
17452  __Pyx_TraceReturn(__pyx_r, 0);
17453  __Pyx_RefNannyFinishContext();
17454  return __pyx_r;
17455 }
17456 
17457 /* "(tree fragment)":3
17458  * def __reduce_cython__(self):
17459  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17460  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17461  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17462  */
17463 
17464 /* Python wrapper */
17465 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
17466 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
17467 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17468  PyObject *__pyx_r = 0;
17469  __Pyx_RefNannyDeclarations
17470  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17471  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17472 
17473  /* function exit code */
17474  __Pyx_RefNannyFinishContext();
17475  return __pyx_r;
17476 }
17477 
17478 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) {
17479  PyObject *__pyx_r = NULL;
17480  __Pyx_TraceDeclarations
17481  __Pyx_RefNannyDeclarations
17482  PyObject *__pyx_t_1 = NULL;
17483  int __pyx_lineno = 0;
17484  const char *__pyx_filename = NULL;
17485  int __pyx_clineno = 0;
17486  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17487  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
17488 
17489  /* "(tree fragment)":4
17490  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17491  * def __setstate_cython__(self, __pyx_state):
17492  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17493  */
17494  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17495  __Pyx_GOTREF(__pyx_t_1);
17496  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17497  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17498  __PYX_ERR(1, 4, __pyx_L1_error)
17499 
17500  /* "(tree fragment)":3
17501  * def __reduce_cython__(self):
17502  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17503  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17504  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17505  */
17506 
17507  /* function exit code */
17508  __pyx_L1_error:;
17509  __Pyx_XDECREF(__pyx_t_1);
17510  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17511  __pyx_r = NULL;
17512  __Pyx_XGIVEREF(__pyx_r);
17513  __Pyx_TraceReturn(__pyx_r, 0);
17514  __Pyx_RefNannyFinishContext();
17515  return __pyx_r;
17516 }
17517 
17518 /* "View.MemoryView":999
17519  *
17520  * @cname('__pyx_memoryview_fromslice')
17521  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17522  * int ndim,
17523  * object (*to_object_func)(char *),
17524  */
17525 
17526 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) {
17527  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17528  Py_ssize_t __pyx_v_suboffset;
17529  PyObject *__pyx_v_length = NULL;
17530  PyObject *__pyx_r = NULL;
17531  __Pyx_TraceDeclarations
17532  __Pyx_RefNannyDeclarations
17533  int __pyx_t_1;
17534  PyObject *__pyx_t_2 = NULL;
17535  PyObject *__pyx_t_3 = NULL;
17536  __Pyx_TypeInfo *__pyx_t_4;
17537  Py_buffer __pyx_t_5;
17538  Py_ssize_t *__pyx_t_6;
17539  Py_ssize_t *__pyx_t_7;
17540  Py_ssize_t *__pyx_t_8;
17541  Py_ssize_t __pyx_t_9;
17542  int __pyx_lineno = 0;
17543  const char *__pyx_filename = NULL;
17544  int __pyx_clineno = 0;
17545  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
17546  __Pyx_TraceCall("memoryview_fromslice", __pyx_f[1], 999, 0, __PYX_ERR(1, 999, __pyx_L1_error));
17547 
17548  /* "View.MemoryView":1007
17549  * cdef _memoryviewslice result
17550  *
17551  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17552  * return None
17553  *
17554  */
17555  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17556  if (__pyx_t_1) {
17557 
17558  /* "View.MemoryView":1008
17559  *
17560  * if <PyObject *> memviewslice.memview == Py_None:
17561  * return None # <<<<<<<<<<<<<<
17562  *
17563  *
17564  */
17565  __Pyx_XDECREF(__pyx_r);
17566  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17567  goto __pyx_L0;
17568 
17569  /* "View.MemoryView":1007
17570  * cdef _memoryviewslice result
17571  *
17572  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17573  * return None
17574  *
17575  */
17576  }
17577 
17578  /* "View.MemoryView":1013
17579  *
17580  *
17581  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
17582  *
17583  * result.from_slice = memviewslice
17584  */
17585  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17586  __Pyx_GOTREF(__pyx_t_2);
17587  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
17588  __Pyx_GOTREF(__pyx_t_3);
17589  __Pyx_INCREF(Py_None);
17590  __Pyx_GIVEREF(Py_None);
17591  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17592  __Pyx_INCREF(__pyx_int_0);
17593  __Pyx_GIVEREF(__pyx_int_0);
17594  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17595  __Pyx_GIVEREF(__pyx_t_2);
17596  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17597  __pyx_t_2 = 0;
17598  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17599  __Pyx_GOTREF(__pyx_t_2);
17600  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17601  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17602  __pyx_t_2 = 0;
17603 
17604  /* "View.MemoryView":1015
17605  * result = _memoryviewslice(None, 0, dtype_is_object)
17606  *
17607  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
17608  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17609  *
17610  */
17611  __pyx_v_result->from_slice = __pyx_v_memviewslice;
17612 
17613  /* "View.MemoryView":1016
17614  *
17615  * result.from_slice = memviewslice
17616  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
17617  *
17618  * result.from_object = (<memoryview> memviewslice.memview).base
17619  */
17620  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17621 
17622  /* "View.MemoryView":1018
17623  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17624  *
17625  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
17626  * result.typeinfo = memviewslice.memview.typeinfo
17627  *
17628  */
17629  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
17630  __Pyx_GOTREF(__pyx_t_2);
17631  __Pyx_GIVEREF(__pyx_t_2);
17632  __Pyx_GOTREF(__pyx_v_result->from_object);
17633  __Pyx_DECREF(__pyx_v_result->from_object);
17634  __pyx_v_result->from_object = __pyx_t_2;
17635  __pyx_t_2 = 0;
17636 
17637  /* "View.MemoryView":1019
17638  *
17639  * result.from_object = (<memoryview> memviewslice.memview).base
17640  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
17641  *
17642  * result.view = memviewslice.memview.view
17643  */
17644  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17645  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17646 
17647  /* "View.MemoryView":1021
17648  * result.typeinfo = memviewslice.memview.typeinfo
17649  *
17650  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
17651  * result.view.buf = <void *> memviewslice.data
17652  * result.view.ndim = ndim
17653  */
17654  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17655  __pyx_v_result->__pyx_base.view = __pyx_t_5;
17656 
17657  /* "View.MemoryView":1022
17658  *
17659  * result.view = memviewslice.memview.view
17660  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
17661  * result.view.ndim = ndim
17662  * (<__pyx_buffer *> &result.view).obj = Py_None
17663  */
17664  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
17665 
17666  /* "View.MemoryView":1023
17667  * result.view = memviewslice.memview.view
17668  * result.view.buf = <void *> memviewslice.data
17669  * result.view.ndim = ndim # <<<<<<<<<<<<<<
17670  * (<__pyx_buffer *> &result.view).obj = Py_None
17671  * Py_INCREF(Py_None)
17672  */
17673  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17674 
17675  /* "View.MemoryView":1024
17676  * result.view.buf = <void *> memviewslice.data
17677  * result.view.ndim = ndim
17678  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
17679  * Py_INCREF(Py_None)
17680  *
17681  */
17682  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17683 
17684  /* "View.MemoryView":1025
17685  * result.view.ndim = ndim
17686  * (<__pyx_buffer *> &result.view).obj = Py_None
17687  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
17688  *
17689  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17690  */
17691  Py_INCREF(Py_None);
17692 
17693  /* "View.MemoryView":1027
17694  * Py_INCREF(Py_None)
17695  *
17696  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17697  * result.flags = PyBUF_RECORDS
17698  * else:
17699  */
17700  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17701  if (__pyx_t_1) {
17702 
17703  /* "View.MemoryView":1028
17704  *
17705  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17706  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
17707  * else:
17708  * result.flags = PyBUF_RECORDS_RO
17709  */
17710  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17711 
17712  /* "View.MemoryView":1027
17713  * Py_INCREF(Py_None)
17714  *
17715  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17716  * result.flags = PyBUF_RECORDS
17717  * else:
17718  */
17719  goto __pyx_L4;
17720  }
17721 
17722  /* "View.MemoryView":1030
17723  * result.flags = PyBUF_RECORDS
17724  * else:
17725  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
17726  *
17727  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17728  */
17729  /*else*/ {
17730  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17731  }
17732  __pyx_L4:;
17733 
17734  /* "View.MemoryView":1032
17735  * result.flags = PyBUF_RECORDS_RO
17736  *
17737  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
17738  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
17739  *
17740  */
17741  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17742 
17743  /* "View.MemoryView":1033
17744  *
17745  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17746  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
17747  *
17748  *
17749  */
17750  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17751 
17752  /* "View.MemoryView":1036
17753  *
17754  *
17755  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
17756  * for suboffset in result.from_slice.suboffsets[:ndim]:
17757  * if suboffset >= 0:
17758  */
17759  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17760 
17761  /* "View.MemoryView":1037
17762  *
17763  * result.view.suboffsets = NULL
17764  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
17765  * if suboffset >= 0:
17766  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17767  */
17768  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17769  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17770  __pyx_t_6 = __pyx_t_8;
17771  __pyx_v_suboffset = (__pyx_t_6[0]);
17772 
17773  /* "View.MemoryView":1038
17774  * result.view.suboffsets = NULL
17775  * for suboffset in result.from_slice.suboffsets[:ndim]:
17776  * if suboffset >= 0: # <<<<<<<<<<<<<<
17777  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17778  * break
17779  */
17780  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17781  if (__pyx_t_1) {
17782 
17783  /* "View.MemoryView":1039
17784  * for suboffset in result.from_slice.suboffsets[:ndim]:
17785  * if suboffset >= 0:
17786  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
17787  * break
17788  *
17789  */
17790  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17791 
17792  /* "View.MemoryView":1040
17793  * if suboffset >= 0:
17794  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17795  * break # <<<<<<<<<<<<<<
17796  *
17797  * result.view.len = result.view.itemsize
17798  */
17799  goto __pyx_L6_break;
17800 
17801  /* "View.MemoryView":1038
17802  * result.view.suboffsets = NULL
17803  * for suboffset in result.from_slice.suboffsets[:ndim]:
17804  * if suboffset >= 0: # <<<<<<<<<<<<<<
17805  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17806  * break
17807  */
17808  }
17809  }
17810  __pyx_L6_break:;
17811 
17812  /* "View.MemoryView":1042
17813  * break
17814  *
17815  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
17816  * for length in result.view.shape[:ndim]:
17817  * result.view.len *= length
17818  */
17819  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17820  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17821 
17822  /* "View.MemoryView":1043
17823  *
17824  * result.view.len = result.view.itemsize
17825  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
17826  * result.view.len *= length
17827  *
17828  */
17829  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17830  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17831  __pyx_t_6 = __pyx_t_8;
17832  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
17833  __Pyx_GOTREF(__pyx_t_2);
17834  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17835  __pyx_t_2 = 0;
17836 
17837  /* "View.MemoryView":1044
17838  * result.view.len = result.view.itemsize
17839  * for length in result.view.shape[:ndim]:
17840  * result.view.len *= length # <<<<<<<<<<<<<<
17841  *
17842  * result.to_object_func = to_object_func
17843  */
17844  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
17845  __Pyx_GOTREF(__pyx_t_2);
17846  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
17847  __Pyx_GOTREF(__pyx_t_3);
17848  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17849  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
17850  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17851  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17852  }
17853 
17854  /* "View.MemoryView":1046
17855  * result.view.len *= length
17856  *
17857  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
17858  * result.to_dtype_func = to_dtype_func
17859  *
17860  */
17861  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17862 
17863  /* "View.MemoryView":1047
17864  *
17865  * result.to_object_func = to_object_func
17866  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
17867  *
17868  * return result
17869  */
17870  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17871 
17872  /* "View.MemoryView":1049
17873  * result.to_dtype_func = to_dtype_func
17874  *
17875  * return result # <<<<<<<<<<<<<<
17876  *
17877  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17878  */
17879  __Pyx_XDECREF(__pyx_r);
17880  __Pyx_INCREF(((PyObject *)__pyx_v_result));
17881  __pyx_r = ((PyObject *)__pyx_v_result);
17882  goto __pyx_L0;
17883 
17884  /* "View.MemoryView":999
17885  *
17886  * @cname('__pyx_memoryview_fromslice')
17887  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17888  * int ndim,
17889  * object (*to_object_func)(char *),
17890  */
17891 
17892  /* function exit code */
17893  __pyx_L1_error:;
17894  __Pyx_XDECREF(__pyx_t_2);
17895  __Pyx_XDECREF(__pyx_t_3);
17896  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17897  __pyx_r = 0;
17898  __pyx_L0:;
17899  __Pyx_XDECREF((PyObject *)__pyx_v_result);
17900  __Pyx_XDECREF(__pyx_v_length);
17901  __Pyx_XGIVEREF(__pyx_r);
17902  __Pyx_TraceReturn(__pyx_r, 0);
17903  __Pyx_RefNannyFinishContext();
17904  return __pyx_r;
17905 }
17906 
17907 /* "View.MemoryView":1052
17908  *
17909  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17910  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17911  * __Pyx_memviewslice *mslice) except NULL:
17912  * cdef _memoryviewslice obj
17913  */
17914 
17915 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17916  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17917  __Pyx_memviewslice *__pyx_r;
17918  __Pyx_TraceDeclarations
17919  __Pyx_RefNannyDeclarations
17920  int __pyx_t_1;
17921  int __pyx_t_2;
17922  PyObject *__pyx_t_3 = NULL;
17923  int __pyx_lineno = 0;
17924  const char *__pyx_filename = NULL;
17925  int __pyx_clineno = 0;
17926  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
17927  __Pyx_TraceCall("get_slice_from_memview", __pyx_f[1], 1052, 0, __PYX_ERR(1, 1052, __pyx_L1_error));
17928 
17929  /* "View.MemoryView":1055
17930  * __Pyx_memviewslice *mslice) except NULL:
17931  * cdef _memoryviewslice obj
17932  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17933  * obj = memview
17934  * return &obj.from_slice
17935  */
17936  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17937  __pyx_t_2 = (__pyx_t_1 != 0);
17938  if (__pyx_t_2) {
17939 
17940  /* "View.MemoryView":1056
17941  * cdef _memoryviewslice obj
17942  * if isinstance(memview, _memoryviewslice):
17943  * obj = memview # <<<<<<<<<<<<<<
17944  * return &obj.from_slice
17945  * else:
17946  */
17947  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
17948  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17949  __Pyx_INCREF(__pyx_t_3);
17950  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17951  __pyx_t_3 = 0;
17952 
17953  /* "View.MemoryView":1057
17954  * if isinstance(memview, _memoryviewslice):
17955  * obj = memview
17956  * return &obj.from_slice # <<<<<<<<<<<<<<
17957  * else:
17958  * slice_copy(memview, mslice)
17959  */
17960  __pyx_r = (&__pyx_v_obj->from_slice);
17961  goto __pyx_L0;
17962 
17963  /* "View.MemoryView":1055
17964  * __Pyx_memviewslice *mslice) except NULL:
17965  * cdef _memoryviewslice obj
17966  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17967  * obj = memview
17968  * return &obj.from_slice
17969  */
17970  }
17971 
17972  /* "View.MemoryView":1059
17973  * return &obj.from_slice
17974  * else:
17975  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
17976  * return mslice
17977  *
17978  */
17979  /*else*/ {
17980  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17981 
17982  /* "View.MemoryView":1060
17983  * else:
17984  * slice_copy(memview, mslice)
17985  * return mslice # <<<<<<<<<<<<<<
17986  *
17987  * @cname('__pyx_memoryview_slice_copy')
17988  */
17989  __pyx_r = __pyx_v_mslice;
17990  goto __pyx_L0;
17991  }
17992 
17993  /* "View.MemoryView":1052
17994  *
17995  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17996  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17997  * __Pyx_memviewslice *mslice) except NULL:
17998  * cdef _memoryviewslice obj
17999  */
18000 
18001  /* function exit code */
18002  __pyx_L1_error:;
18003  __Pyx_XDECREF(__pyx_t_3);
18004  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
18005  __pyx_r = NULL;
18006  __pyx_L0:;
18007  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18008  __Pyx_TraceReturn(Py_None, 0);
18009  __Pyx_RefNannyFinishContext();
18010  return __pyx_r;
18011 }
18012 
18013 /* "View.MemoryView":1063
18014  *
18015  * @cname('__pyx_memoryview_slice_copy')
18016  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18017  * cdef int dim
18018  * cdef (Py_ssize_t*) shape, strides, suboffsets
18019  */
18020 
18021 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18022  int __pyx_v_dim;
18023  Py_ssize_t *__pyx_v_shape;
18024  Py_ssize_t *__pyx_v_strides;
18025  Py_ssize_t *__pyx_v_suboffsets;
18026  __Pyx_TraceDeclarations
18027  __Pyx_RefNannyDeclarations
18028  Py_ssize_t *__pyx_t_1;
18029  int __pyx_t_2;
18030  int __pyx_t_3;
18031  int __pyx_t_4;
18032  Py_ssize_t __pyx_t_5;
18033  int __pyx_lineno = 0;
18034  const char *__pyx_filename = NULL;
18035  int __pyx_clineno = 0;
18036  __Pyx_RefNannySetupContext("slice_copy", 0);
18037  __Pyx_TraceCall("slice_copy", __pyx_f[1], 1063, 0, __PYX_ERR(1, 1063, __pyx_L1_error));
18038 
18039  /* "View.MemoryView":1067
18040  * cdef (Py_ssize_t*) shape, strides, suboffsets
18041  *
18042  * shape = memview.view.shape # <<<<<<<<<<<<<<
18043  * strides = memview.view.strides
18044  * suboffsets = memview.view.suboffsets
18045  */
18046  __pyx_t_1 = __pyx_v_memview->view.shape;
18047  __pyx_v_shape = __pyx_t_1;
18048 
18049  /* "View.MemoryView":1068
18050  *
18051  * shape = memview.view.shape
18052  * strides = memview.view.strides # <<<<<<<<<<<<<<
18053  * suboffsets = memview.view.suboffsets
18054  *
18055  */
18056  __pyx_t_1 = __pyx_v_memview->view.strides;
18057  __pyx_v_strides = __pyx_t_1;
18058 
18059  /* "View.MemoryView":1069
18060  * shape = memview.view.shape
18061  * strides = memview.view.strides
18062  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
18063  *
18064  * dst.memview = <__pyx_memoryview *> memview
18065  */
18066  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18067  __pyx_v_suboffsets = __pyx_t_1;
18068 
18069  /* "View.MemoryView":1071
18070  * suboffsets = memview.view.suboffsets
18071  *
18072  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
18073  * dst.data = <char *> memview.view.buf
18074  *
18075  */
18076  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
18077 
18078  /* "View.MemoryView":1072
18079  *
18080  * dst.memview = <__pyx_memoryview *> memview
18081  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
18082  *
18083  * for dim in range(memview.view.ndim):
18084  */
18085  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
18086 
18087  /* "View.MemoryView":1074
18088  * dst.data = <char *> memview.view.buf
18089  *
18090  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
18091  * dst.shape[dim] = shape[dim]
18092  * dst.strides[dim] = strides[dim]
18093  */
18094  __pyx_t_2 = __pyx_v_memview->view.ndim;
18095  __pyx_t_3 = __pyx_t_2;
18096  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18097  __pyx_v_dim = __pyx_t_4;
18098 
18099  /* "View.MemoryView":1075
18100  *
18101  * for dim in range(memview.view.ndim):
18102  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
18103  * dst.strides[dim] = strides[dim]
18104  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18105  */
18106  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18107 
18108  /* "View.MemoryView":1076
18109  * for dim in range(memview.view.ndim):
18110  * dst.shape[dim] = shape[dim]
18111  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
18112  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18113  *
18114  */
18115  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18116 
18117  /* "View.MemoryView":1077
18118  * dst.shape[dim] = shape[dim]
18119  * dst.strides[dim] = strides[dim]
18120  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
18121  *
18122  * @cname('__pyx_memoryview_copy_object')
18123  */
18124  if ((__pyx_v_suboffsets != 0)) {
18125  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18126  } else {
18127  __pyx_t_5 = -1L;
18128  }
18129  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18130  }
18131 
18132  /* "View.MemoryView":1063
18133  *
18134  * @cname('__pyx_memoryview_slice_copy')
18135  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18136  * cdef int dim
18137  * cdef (Py_ssize_t*) shape, strides, suboffsets
18138  */
18139 
18140  /* function exit code */
18141  goto __pyx_L0;
18142  __pyx_L1_error:;
18143  __Pyx_WriteUnraisable("View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
18144  __pyx_L0:;
18145  __Pyx_TraceReturn(Py_None, 0);
18146  __Pyx_RefNannyFinishContext();
18147 }
18148 
18149 /* "View.MemoryView":1080
18150  *
18151  * @cname('__pyx_memoryview_copy_object')
18152  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18153  * "Create a new memoryview object"
18154  * cdef __Pyx_memviewslice memviewslice
18155  */
18156 
18157 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
18158  __Pyx_memviewslice __pyx_v_memviewslice;
18159  PyObject *__pyx_r = NULL;
18160  __Pyx_TraceDeclarations
18161  __Pyx_RefNannyDeclarations
18162  PyObject *__pyx_t_1 = NULL;
18163  int __pyx_lineno = 0;
18164  const char *__pyx_filename = NULL;
18165  int __pyx_clineno = 0;
18166  __Pyx_RefNannySetupContext("memoryview_copy", 0);
18167  __Pyx_TraceCall("memoryview_copy", __pyx_f[1], 1080, 0, __PYX_ERR(1, 1080, __pyx_L1_error));
18168 
18169  /* "View.MemoryView":1083
18170  * "Create a new memoryview object"
18171  * cdef __Pyx_memviewslice memviewslice
18172  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
18173  * return memoryview_copy_from_slice(memview, &memviewslice)
18174  *
18175  */
18176  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18177 
18178  /* "View.MemoryView":1084
18179  * cdef __Pyx_memviewslice memviewslice
18180  * slice_copy(memview, &memviewslice)
18181  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
18182  *
18183  * @cname('__pyx_memoryview_copy_object_from_slice')
18184  */
18185  __Pyx_XDECREF(__pyx_r);
18186  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
18187  __Pyx_GOTREF(__pyx_t_1);
18188  __pyx_r = __pyx_t_1;
18189  __pyx_t_1 = 0;
18190  goto __pyx_L0;
18191 
18192  /* "View.MemoryView":1080
18193  *
18194  * @cname('__pyx_memoryview_copy_object')
18195  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18196  * "Create a new memoryview object"
18197  * cdef __Pyx_memviewslice memviewslice
18198  */
18199 
18200  /* function exit code */
18201  __pyx_L1_error:;
18202  __Pyx_XDECREF(__pyx_t_1);
18203  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18204  __pyx_r = 0;
18205  __pyx_L0:;
18206  __Pyx_XGIVEREF(__pyx_r);
18207  __Pyx_TraceReturn(__pyx_r, 0);
18208  __Pyx_RefNannyFinishContext();
18209  return __pyx_r;
18210 }
18211 
18212 /* "View.MemoryView":1087
18213  *
18214  * @cname('__pyx_memoryview_copy_object_from_slice')
18215  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18216  * """
18217  * Create a new memoryview object from a given memoryview object and slice.
18218  */
18219 
18220 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18221  PyObject *(*__pyx_v_to_object_func)(char *);
18222  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
18223  PyObject *__pyx_r = NULL;
18224  __Pyx_TraceDeclarations
18225  __Pyx_RefNannyDeclarations
18226  int __pyx_t_1;
18227  int __pyx_t_2;
18228  PyObject *(*__pyx_t_3)(char *);
18229  int (*__pyx_t_4)(char *, PyObject *);
18230  PyObject *__pyx_t_5 = NULL;
18231  int __pyx_lineno = 0;
18232  const char *__pyx_filename = NULL;
18233  int __pyx_clineno = 0;
18234  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
18235  __Pyx_TraceCall("memoryview_copy_from_slice", __pyx_f[1], 1087, 0, __PYX_ERR(1, 1087, __pyx_L1_error));
18236 
18237  /* "View.MemoryView":1094
18238  * cdef int (*to_dtype_func)(char *, object) except 0
18239  *
18240  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18241  * to_object_func = (<_memoryviewslice> memview).to_object_func
18242  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18243  */
18244  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18245  __pyx_t_2 = (__pyx_t_1 != 0);
18246  if (__pyx_t_2) {
18247 
18248  /* "View.MemoryView":1095
18249  *
18250  * if isinstance(memview, _memoryviewslice):
18251  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
18252  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18253  * else:
18254  */
18255  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18256  __pyx_v_to_object_func = __pyx_t_3;
18257 
18258  /* "View.MemoryView":1096
18259  * if isinstance(memview, _memoryviewslice):
18260  * to_object_func = (<_memoryviewslice> memview).to_object_func
18261  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
18262  * else:
18263  * to_object_func = NULL
18264  */
18265  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18266  __pyx_v_to_dtype_func = __pyx_t_4;
18267 
18268  /* "View.MemoryView":1094
18269  * cdef int (*to_dtype_func)(char *, object) except 0
18270  *
18271  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18272  * to_object_func = (<_memoryviewslice> memview).to_object_func
18273  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18274  */
18275  goto __pyx_L3;
18276  }
18277 
18278  /* "View.MemoryView":1098
18279  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18280  * else:
18281  * to_object_func = NULL # <<<<<<<<<<<<<<
18282  * to_dtype_func = NULL
18283  *
18284  */
18285  /*else*/ {
18286  __pyx_v_to_object_func = NULL;
18287 
18288  /* "View.MemoryView":1099
18289  * else:
18290  * to_object_func = NULL
18291  * to_dtype_func = NULL # <<<<<<<<<<<<<<
18292  *
18293  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18294  */
18295  __pyx_v_to_dtype_func = NULL;
18296  }
18297  __pyx_L3:;
18298 
18299  /* "View.MemoryView":1101
18300  * to_dtype_func = NULL
18301  *
18302  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
18303  * to_object_func, to_dtype_func,
18304  * memview.dtype_is_object)
18305  */
18306  __Pyx_XDECREF(__pyx_r);
18307 
18308  /* "View.MemoryView":1103
18309  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18310  * to_object_func, to_dtype_func,
18311  * memview.dtype_is_object) # <<<<<<<<<<<<<<
18312  *
18313  *
18314  */
18315  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
18316  __Pyx_GOTREF(__pyx_t_5);
18317  __pyx_r = __pyx_t_5;
18318  __pyx_t_5 = 0;
18319  goto __pyx_L0;
18320 
18321  /* "View.MemoryView":1087
18322  *
18323  * @cname('__pyx_memoryview_copy_object_from_slice')
18324  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18325  * """
18326  * Create a new memoryview object from a given memoryview object and slice.
18327  */
18328 
18329  /* function exit code */
18330  __pyx_L1_error:;
18331  __Pyx_XDECREF(__pyx_t_5);
18332  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18333  __pyx_r = 0;
18334  __pyx_L0:;
18335  __Pyx_XGIVEREF(__pyx_r);
18336  __Pyx_TraceReturn(__pyx_r, 0);
18337  __Pyx_RefNannyFinishContext();
18338  return __pyx_r;
18339 }
18340 
18341 /* "View.MemoryView":1109
18342  *
18343  *
18344  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18345  * if arg < 0:
18346  * return -arg
18347  */
18348 
18349 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18350  Py_ssize_t __pyx_r;
18351  __Pyx_TraceDeclarations
18352  int __pyx_t_1;
18353  int __pyx_lineno = 0;
18354  const char *__pyx_filename = NULL;
18355  int __pyx_clineno = 0;
18356  __Pyx_TraceCall("abs_py_ssize_t", __pyx_f[1], 1109, 1, __PYX_ERR(1, 1109, __pyx_L1_error));
18357 
18358  /* "View.MemoryView":1110
18359  *
18360  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18361  * if arg < 0: # <<<<<<<<<<<<<<
18362  * return -arg
18363  * else:
18364  */
18365  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18366  if (__pyx_t_1) {
18367 
18368  /* "View.MemoryView":1111
18369  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18370  * if arg < 0:
18371  * return -arg # <<<<<<<<<<<<<<
18372  * else:
18373  * return arg
18374  */
18375  __pyx_r = (-__pyx_v_arg);
18376  goto __pyx_L0;
18377 
18378  /* "View.MemoryView":1110
18379  *
18380  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18381  * if arg < 0: # <<<<<<<<<<<<<<
18382  * return -arg
18383  * else:
18384  */
18385  }
18386 
18387  /* "View.MemoryView":1113
18388  * return -arg
18389  * else:
18390  * return arg # <<<<<<<<<<<<<<
18391  *
18392  * @cname('__pyx_get_best_slice_order')
18393  */
18394  /*else*/ {
18395  __pyx_r = __pyx_v_arg;
18396  goto __pyx_L0;
18397  }
18398 
18399  /* "View.MemoryView":1109
18400  *
18401  *
18402  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18403  * if arg < 0:
18404  * return -arg
18405  */
18406 
18407  /* function exit code */
18408  __pyx_L1_error:;
18409  __Pyx_WriteUnraisable("View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18410  __pyx_r = 0;
18411  __pyx_L0:;
18412  __Pyx_TraceReturn(Py_None, 1);
18413  return __pyx_r;
18414 }
18415 
18416 /* "View.MemoryView":1116
18417  *
18418  * @cname('__pyx_get_best_slice_order')
18419  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18420  * """
18421  * Figure out the best memory access order for a given slice.
18422  */
18423 
18424 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
18425  int __pyx_v_i;
18426  Py_ssize_t __pyx_v_c_stride;
18427  Py_ssize_t __pyx_v_f_stride;
18428  char __pyx_r;
18429  __Pyx_TraceDeclarations
18430  int __pyx_t_1;
18431  int __pyx_t_2;
18432  int __pyx_t_3;
18433  int __pyx_t_4;
18434  int __pyx_lineno = 0;
18435  const char *__pyx_filename = NULL;
18436  int __pyx_clineno = 0;
18437  __Pyx_TraceCall("get_best_order", __pyx_f[1], 1116, 1, __PYX_ERR(1, 1116, __pyx_L1_error));
18438 
18439  /* "View.MemoryView":1121
18440  * """
18441  * cdef int i
18442  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
18443  * cdef Py_ssize_t f_stride = 0
18444  *
18445  */
18446  __pyx_v_c_stride = 0;
18447 
18448  /* "View.MemoryView":1122
18449  * cdef int i
18450  * cdef Py_ssize_t c_stride = 0
18451  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
18452  *
18453  * for i in range(ndim - 1, -1, -1):
18454  */
18455  __pyx_v_f_stride = 0;
18456 
18457  /* "View.MemoryView":1124
18458  * cdef Py_ssize_t f_stride = 0
18459  *
18460  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18461  * if mslice.shape[i] > 1:
18462  * c_stride = mslice.strides[i]
18463  */
18464  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18465  __pyx_v_i = __pyx_t_1;
18466 
18467  /* "View.MemoryView":1125
18468  *
18469  * for i in range(ndim - 1, -1, -1):
18470  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18471  * c_stride = mslice.strides[i]
18472  * break
18473  */
18474  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18475  if (__pyx_t_2) {
18476 
18477  /* "View.MemoryView":1126
18478  * for i in range(ndim - 1, -1, -1):
18479  * if mslice.shape[i] > 1:
18480  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18481  * break
18482  *
18483  */
18484  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18485 
18486  /* "View.MemoryView":1127
18487  * if mslice.shape[i] > 1:
18488  * c_stride = mslice.strides[i]
18489  * break # <<<<<<<<<<<<<<
18490  *
18491  * for i in range(ndim):
18492  */
18493  goto __pyx_L4_break;
18494 
18495  /* "View.MemoryView":1125
18496  *
18497  * for i in range(ndim - 1, -1, -1):
18498  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18499  * c_stride = mslice.strides[i]
18500  * break
18501  */
18502  }
18503  }
18504  __pyx_L4_break:;
18505 
18506  /* "View.MemoryView":1129
18507  * break
18508  *
18509  * for i in range(ndim): # <<<<<<<<<<<<<<
18510  * if mslice.shape[i] > 1:
18511  * f_stride = mslice.strides[i]
18512  */
18513  __pyx_t_1 = __pyx_v_ndim;
18514  __pyx_t_3 = __pyx_t_1;
18515  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18516  __pyx_v_i = __pyx_t_4;
18517 
18518  /* "View.MemoryView":1130
18519  *
18520  * for i in range(ndim):
18521  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18522  * f_stride = mslice.strides[i]
18523  * break
18524  */
18525  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18526  if (__pyx_t_2) {
18527 
18528  /* "View.MemoryView":1131
18529  * for i in range(ndim):
18530  * if mslice.shape[i] > 1:
18531  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18532  * break
18533  *
18534  */
18535  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18536 
18537  /* "View.MemoryView":1132
18538  * if mslice.shape[i] > 1:
18539  * f_stride = mslice.strides[i]
18540  * break # <<<<<<<<<<<<<<
18541  *
18542  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18543  */
18544  goto __pyx_L7_break;
18545 
18546  /* "View.MemoryView":1130
18547  *
18548  * for i in range(ndim):
18549  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18550  * f_stride = mslice.strides[i]
18551  * break
18552  */
18553  }
18554  }
18555  __pyx_L7_break:;
18556 
18557  /* "View.MemoryView":1134
18558  * break
18559  *
18560  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18561  * return 'C'
18562  * else:
18563  */
18564  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18565  if (__pyx_t_2) {
18566 
18567  /* "View.MemoryView":1135
18568  *
18569  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18570  * return 'C' # <<<<<<<<<<<<<<
18571  * else:
18572  * return 'F'
18573  */
18574  __pyx_r = 'C';
18575  goto __pyx_L0;
18576 
18577  /* "View.MemoryView":1134
18578  * break
18579  *
18580  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18581  * return 'C'
18582  * else:
18583  */
18584  }
18585 
18586  /* "View.MemoryView":1137
18587  * return 'C'
18588  * else:
18589  * return 'F' # <<<<<<<<<<<<<<
18590  *
18591  * @cython.cdivision(True)
18592  */
18593  /*else*/ {
18594  __pyx_r = 'F';
18595  goto __pyx_L0;
18596  }
18597 
18598  /* "View.MemoryView":1116
18599  *
18600  * @cname('__pyx_get_best_slice_order')
18601  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18602  * """
18603  * Figure out the best memory access order for a given slice.
18604  */
18605 
18606  /* function exit code */
18607  __pyx_L1_error:;
18608  __Pyx_WriteUnraisable("View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18609  __pyx_r = 0;
18610  __pyx_L0:;
18611  __Pyx_TraceReturn(Py_None, 1);
18612  return __pyx_r;
18613 }
18614 
18615 /* "View.MemoryView":1140
18616  *
18617  * @cython.cdivision(True)
18618  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18619  * char *dst_data, Py_ssize_t *dst_strides,
18620  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18621  */
18622 
18623 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) {
18624  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18625  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18626  Py_ssize_t __pyx_v_dst_extent;
18627  Py_ssize_t __pyx_v_src_stride;
18628  Py_ssize_t __pyx_v_dst_stride;
18629  int __pyx_t_1;
18630  int __pyx_t_2;
18631  int __pyx_t_3;
18632  Py_ssize_t __pyx_t_4;
18633  Py_ssize_t __pyx_t_5;
18634  Py_ssize_t __pyx_t_6;
18635 
18636  /* "View.MemoryView":1147
18637  *
18638  * cdef Py_ssize_t i
18639  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
18640  * cdef Py_ssize_t dst_extent = dst_shape[0]
18641  * cdef Py_ssize_t src_stride = src_strides[0]
18642  */
18643  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18644 
18645  /* "View.MemoryView":1148
18646  * cdef Py_ssize_t i
18647  * cdef Py_ssize_t src_extent = src_shape[0]
18648  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
18649  * cdef Py_ssize_t src_stride = src_strides[0]
18650  * cdef Py_ssize_t dst_stride = dst_strides[0]
18651  */
18652  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18653 
18654  /* "View.MemoryView":1149
18655  * cdef Py_ssize_t src_extent = src_shape[0]
18656  * cdef Py_ssize_t dst_extent = dst_shape[0]
18657  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
18658  * cdef Py_ssize_t dst_stride = dst_strides[0]
18659  *
18660  */
18661  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18662 
18663  /* "View.MemoryView":1150
18664  * cdef Py_ssize_t dst_extent = dst_shape[0]
18665  * cdef Py_ssize_t src_stride = src_strides[0]
18666  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
18667  *
18668  * if ndim == 1:
18669  */
18670  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18671 
18672  /* "View.MemoryView":1152
18673  * cdef Py_ssize_t dst_stride = dst_strides[0]
18674  *
18675  * if ndim == 1: # <<<<<<<<<<<<<<
18676  * if (src_stride > 0 and dst_stride > 0 and
18677  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18678  */
18679  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18680  if (__pyx_t_1) {
18681 
18682  /* "View.MemoryView":1153
18683  *
18684  * if ndim == 1:
18685  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18686  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18687  * memcpy(dst_data, src_data, itemsize * dst_extent)
18688  */
18689  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18690  if (__pyx_t_2) {
18691  } else {
18692  __pyx_t_1 = __pyx_t_2;
18693  goto __pyx_L5_bool_binop_done;
18694  }
18695  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18696  if (__pyx_t_2) {
18697  } else {
18698  __pyx_t_1 = __pyx_t_2;
18699  goto __pyx_L5_bool_binop_done;
18700  }
18701 
18702  /* "View.MemoryView":1154
18703  * if ndim == 1:
18704  * if (src_stride > 0 and dst_stride > 0 and
18705  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
18706  * memcpy(dst_data, src_data, itemsize * dst_extent)
18707  * else:
18708  */
18709  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18710  if (__pyx_t_2) {
18711  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18712  }
18713  __pyx_t_3 = (__pyx_t_2 != 0);
18714  __pyx_t_1 = __pyx_t_3;
18715  __pyx_L5_bool_binop_done:;
18716 
18717  /* "View.MemoryView":1153
18718  *
18719  * if ndim == 1:
18720  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18721  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18722  * memcpy(dst_data, src_data, itemsize * dst_extent)
18723  */
18724  if (__pyx_t_1) {
18725 
18726  /* "View.MemoryView":1155
18727  * if (src_stride > 0 and dst_stride > 0 and
18728  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18729  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
18730  * else:
18731  * for i in range(dst_extent):
18732  */
18733  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18734 
18735  /* "View.MemoryView":1153
18736  *
18737  * if ndim == 1:
18738  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18739  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18740  * memcpy(dst_data, src_data, itemsize * dst_extent)
18741  */
18742  goto __pyx_L4;
18743  }
18744 
18745  /* "View.MemoryView":1157
18746  * memcpy(dst_data, src_data, itemsize * dst_extent)
18747  * else:
18748  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18749  * memcpy(dst_data, src_data, itemsize)
18750  * src_data += src_stride
18751  */
18752  /*else*/ {
18753  __pyx_t_4 = __pyx_v_dst_extent;
18754  __pyx_t_5 = __pyx_t_4;
18755  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18756  __pyx_v_i = __pyx_t_6;
18757 
18758  /* "View.MemoryView":1158
18759  * else:
18760  * for i in range(dst_extent):
18761  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
18762  * src_data += src_stride
18763  * dst_data += dst_stride
18764  */
18765  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18766 
18767  /* "View.MemoryView":1159
18768  * for i in range(dst_extent):
18769  * memcpy(dst_data, src_data, itemsize)
18770  * src_data += src_stride # <<<<<<<<<<<<<<
18771  * dst_data += dst_stride
18772  * else:
18773  */
18774  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18775 
18776  /* "View.MemoryView":1160
18777  * memcpy(dst_data, src_data, itemsize)
18778  * src_data += src_stride
18779  * dst_data += dst_stride # <<<<<<<<<<<<<<
18780  * else:
18781  * for i in range(dst_extent):
18782  */
18783  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18784  }
18785  }
18786  __pyx_L4:;
18787 
18788  /* "View.MemoryView":1152
18789  * cdef Py_ssize_t dst_stride = dst_strides[0]
18790  *
18791  * if ndim == 1: # <<<<<<<<<<<<<<
18792  * if (src_stride > 0 and dst_stride > 0 and
18793  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18794  */
18795  goto __pyx_L3;
18796  }
18797 
18798  /* "View.MemoryView":1162
18799  * dst_data += dst_stride
18800  * else:
18801  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18802  * _copy_strided_to_strided(src_data, src_strides + 1,
18803  * dst_data, dst_strides + 1,
18804  */
18805  /*else*/ {
18806  __pyx_t_4 = __pyx_v_dst_extent;
18807  __pyx_t_5 = __pyx_t_4;
18808  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18809  __pyx_v_i = __pyx_t_6;
18810 
18811  /* "View.MemoryView":1163
18812  * else:
18813  * for i in range(dst_extent):
18814  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
18815  * dst_data, dst_strides + 1,
18816  * src_shape + 1, dst_shape + 1,
18817  */
18818  _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);
18819 
18820  /* "View.MemoryView":1167
18821  * src_shape + 1, dst_shape + 1,
18822  * ndim - 1, itemsize)
18823  * src_data += src_stride # <<<<<<<<<<<<<<
18824  * dst_data += dst_stride
18825  *
18826  */
18827  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18828 
18829  /* "View.MemoryView":1168
18830  * ndim - 1, itemsize)
18831  * src_data += src_stride
18832  * dst_data += dst_stride # <<<<<<<<<<<<<<
18833  *
18834  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
18835  */
18836  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18837  }
18838  }
18839  __pyx_L3:;
18840 
18841  /* "View.MemoryView":1140
18842  *
18843  * @cython.cdivision(True)
18844  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18845  * char *dst_data, Py_ssize_t *dst_strides,
18846  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18847  */
18848 
18849  /* function exit code */
18850 }
18851 
18852 /* "View.MemoryView":1170
18853  * dst_data += dst_stride
18854  *
18855  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18856  * __Pyx_memviewslice *dst,
18857  * int ndim, size_t itemsize) nogil:
18858  */
18859 
18860 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) {
18861  __Pyx_TraceDeclarations
18862  int __pyx_lineno = 0;
18863  const char *__pyx_filename = NULL;
18864  int __pyx_clineno = 0;
18865  __Pyx_TraceCall("copy_strided_to_strided", __pyx_f[1], 1170, 1, __PYX_ERR(1, 1170, __pyx_L1_error));
18866 
18867  /* "View.MemoryView":1173
18868  * __Pyx_memviewslice *dst,
18869  * int ndim, size_t itemsize) nogil:
18870  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
18871  * src.shape, dst.shape, ndim, itemsize)
18872  *
18873  */
18874  _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);
18875 
18876  /* "View.MemoryView":1170
18877  * dst_data += dst_stride
18878  *
18879  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18880  * __Pyx_memviewslice *dst,
18881  * int ndim, size_t itemsize) nogil:
18882  */
18883 
18884  /* function exit code */
18885  goto __pyx_L0;
18886  __pyx_L1_error:;
18887  __Pyx_WriteUnraisable("View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18888  __pyx_L0:;
18889  __Pyx_TraceReturn(Py_None, 1);
18890 }
18891 
18892 /* "View.MemoryView":1177
18893  *
18894  * @cname('__pyx_memoryview_slice_get_size')
18895  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18896  * "Return the size of the memory occupied by the slice in number of bytes"
18897  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18898  */
18899 
18900 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
18901  Py_ssize_t __pyx_v_shape;
18902  Py_ssize_t __pyx_v_size;
18903  Py_ssize_t __pyx_r;
18904  __Pyx_TraceDeclarations
18905  Py_ssize_t __pyx_t_1;
18906  Py_ssize_t *__pyx_t_2;
18907  Py_ssize_t *__pyx_t_3;
18908  Py_ssize_t *__pyx_t_4;
18909  int __pyx_lineno = 0;
18910  const char *__pyx_filename = NULL;
18911  int __pyx_clineno = 0;
18912  __Pyx_TraceCall("slice_get_size", __pyx_f[1], 1177, 1, __PYX_ERR(1, 1177, __pyx_L1_error));
18913 
18914  /* "View.MemoryView":1179
18915  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
18916  * "Return the size of the memory occupied by the slice in number of bytes"
18917  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
18918  *
18919  * for shape in src.shape[:ndim]:
18920  */
18921  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18922  __pyx_v_size = __pyx_t_1;
18923 
18924  /* "View.MemoryView":1181
18925  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18926  *
18927  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
18928  * size *= shape
18929  *
18930  */
18931  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
18932  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18933  __pyx_t_2 = __pyx_t_4;
18934  __pyx_v_shape = (__pyx_t_2[0]);
18935 
18936  /* "View.MemoryView":1182
18937  *
18938  * for shape in src.shape[:ndim]:
18939  * size *= shape # <<<<<<<<<<<<<<
18940  *
18941  * return size
18942  */
18943  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18944  }
18945 
18946  /* "View.MemoryView":1184
18947  * size *= shape
18948  *
18949  * return size # <<<<<<<<<<<<<<
18950  *
18951  * @cname('__pyx_fill_contig_strides_array')
18952  */
18953  __pyx_r = __pyx_v_size;
18954  goto __pyx_L0;
18955 
18956  /* "View.MemoryView":1177
18957  *
18958  * @cname('__pyx_memoryview_slice_get_size')
18959  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18960  * "Return the size of the memory occupied by the slice in number of bytes"
18961  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18962  */
18963 
18964  /* function exit code */
18965  __pyx_L1_error:;
18966  __Pyx_WriteUnraisable("View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18967  __pyx_r = 0;
18968  __pyx_L0:;
18969  __Pyx_TraceReturn(Py_None, 1);
18970  return __pyx_r;
18971 }
18972 
18973 /* "View.MemoryView":1187
18974  *
18975  * @cname('__pyx_fill_contig_strides_array')
18976  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18977  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18978  * int ndim, char order) nogil:
18979  */
18980 
18981 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) {
18982  int __pyx_v_idx;
18983  Py_ssize_t __pyx_r;
18984  __Pyx_TraceDeclarations
18985  int __pyx_t_1;
18986  int __pyx_t_2;
18987  int __pyx_t_3;
18988  int __pyx_t_4;
18989  int __pyx_lineno = 0;
18990  const char *__pyx_filename = NULL;
18991  int __pyx_clineno = 0;
18992  __Pyx_TraceCall("fill_contig_strides_array", __pyx_f[1], 1187, 1, __PYX_ERR(1, 1187, __pyx_L1_error));
18993 
18994  /* "View.MemoryView":1196
18995  * cdef int idx
18996  *
18997  * if order == 'F': # <<<<<<<<<<<<<<
18998  * for idx in range(ndim):
18999  * strides[idx] = stride
19000  */
19001  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
19002  if (__pyx_t_1) {
19003 
19004  /* "View.MemoryView":1197
19005  *
19006  * if order == 'F':
19007  * for idx in range(ndim): # <<<<<<<<<<<<<<
19008  * strides[idx] = stride
19009  * stride *= shape[idx]
19010  */
19011  __pyx_t_2 = __pyx_v_ndim;
19012  __pyx_t_3 = __pyx_t_2;
19013  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19014  __pyx_v_idx = __pyx_t_4;
19015 
19016  /* "View.MemoryView":1198
19017  * if order == 'F':
19018  * for idx in range(ndim):
19019  * strides[idx] = stride # <<<<<<<<<<<<<<
19020  * stride *= shape[idx]
19021  * else:
19022  */
19023  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19024 
19025  /* "View.MemoryView":1199
19026  * for idx in range(ndim):
19027  * strides[idx] = stride
19028  * stride *= shape[idx] # <<<<<<<<<<<<<<
19029  * else:
19030  * for idx in range(ndim - 1, -1, -1):
19031  */
19032  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19033  }
19034 
19035  /* "View.MemoryView":1196
19036  * cdef int idx
19037  *
19038  * if order == 'F': # <<<<<<<<<<<<<<
19039  * for idx in range(ndim):
19040  * strides[idx] = stride
19041  */
19042  goto __pyx_L3;
19043  }
19044 
19045  /* "View.MemoryView":1201
19046  * stride *= shape[idx]
19047  * else:
19048  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19049  * strides[idx] = stride
19050  * stride *= shape[idx]
19051  */
19052  /*else*/ {
19053  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19054  __pyx_v_idx = __pyx_t_2;
19055 
19056  /* "View.MemoryView":1202
19057  * else:
19058  * for idx in range(ndim - 1, -1, -1):
19059  * strides[idx] = stride # <<<<<<<<<<<<<<
19060  * stride *= shape[idx]
19061  *
19062  */
19063  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19064 
19065  /* "View.MemoryView":1203
19066  * for idx in range(ndim - 1, -1, -1):
19067  * strides[idx] = stride
19068  * stride *= shape[idx] # <<<<<<<<<<<<<<
19069  *
19070  * return stride
19071  */
19072  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19073  }
19074  }
19075  __pyx_L3:;
19076 
19077  /* "View.MemoryView":1205
19078  * stride *= shape[idx]
19079  *
19080  * return stride # <<<<<<<<<<<<<<
19081  *
19082  * @cname('__pyx_memoryview_copy_data_to_temp')
19083  */
19084  __pyx_r = __pyx_v_stride;
19085  goto __pyx_L0;
19086 
19087  /* "View.MemoryView":1187
19088  *
19089  * @cname('__pyx_fill_contig_strides_array')
19090  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19091  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19092  * int ndim, char order) nogil:
19093  */
19094 
19095  /* function exit code */
19096  __pyx_L1_error:;
19097  __Pyx_WriteUnraisable("View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19098  __pyx_r = 0;
19099  __pyx_L0:;
19100  __Pyx_TraceReturn(Py_None, 1);
19101  return __pyx_r;
19102 }
19103 
19104 /* "View.MemoryView":1208
19105  *
19106  * @cname('__pyx_memoryview_copy_data_to_temp')
19107  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19108  * __Pyx_memviewslice *tmpslice,
19109  * char order,
19110  */
19111 
19112 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) {
19113  int __pyx_v_i;
19114  void *__pyx_v_result;
19115  size_t __pyx_v_itemsize;
19116  size_t __pyx_v_size;
19117  void *__pyx_r;
19118  __Pyx_TraceDeclarations
19119  Py_ssize_t __pyx_t_1;
19120  int __pyx_t_2;
19121  int __pyx_t_3;
19122  struct __pyx_memoryview_obj *__pyx_t_4;
19123  int __pyx_t_5;
19124  int __pyx_t_6;
19125  int __pyx_lineno = 0;
19126  const char *__pyx_filename = NULL;
19127  int __pyx_clineno = 0;
19128  __Pyx_TraceCall("copy_data_to_temp", __pyx_f[1], 1208, 1, __PYX_ERR(1, 1208, __pyx_L1_error));
19129 
19130  /* "View.MemoryView":1219
19131  * cdef void *result
19132  *
19133  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19134  * cdef size_t size = slice_get_size(src, ndim)
19135  *
19136  */
19137  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19138  __pyx_v_itemsize = __pyx_t_1;
19139 
19140  /* "View.MemoryView":1220
19141  *
19142  * cdef size_t itemsize = src.memview.view.itemsize
19143  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
19144  *
19145  * result = malloc(size)
19146  */
19147  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19148 
19149  /* "View.MemoryView":1222
19150  * cdef size_t size = slice_get_size(src, ndim)
19151  *
19152  * result = malloc(size) # <<<<<<<<<<<<<<
19153  * if not result:
19154  * _err(MemoryError, NULL)
19155  */
19156  __pyx_v_result = malloc(__pyx_v_size);
19157 
19158  /* "View.MemoryView":1223
19159  *
19160  * result = malloc(size)
19161  * if not result: # <<<<<<<<<<<<<<
19162  * _err(MemoryError, NULL)
19163  *
19164  */
19165  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19166  if (__pyx_t_2) {
19167 
19168  /* "View.MemoryView":1224
19169  * result = malloc(size)
19170  * if not result:
19171  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
19172  *
19173  *
19174  */
19175  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
19176 
19177  /* "View.MemoryView":1223
19178  *
19179  * result = malloc(size)
19180  * if not result: # <<<<<<<<<<<<<<
19181  * _err(MemoryError, NULL)
19182  *
19183  */
19184  }
19185 
19186  /* "View.MemoryView":1227
19187  *
19188  *
19189  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
19190  * tmpslice.memview = src.memview
19191  * for i in range(ndim):
19192  */
19193  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
19194 
19195  /* "View.MemoryView":1228
19196  *
19197  * tmpslice.data = <char *> result
19198  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
19199  * for i in range(ndim):
19200  * tmpslice.shape[i] = src.shape[i]
19201  */
19202  __pyx_t_4 = __pyx_v_src->memview;
19203  __pyx_v_tmpslice->memview = __pyx_t_4;
19204 
19205  /* "View.MemoryView":1229
19206  * tmpslice.data = <char *> result
19207  * tmpslice.memview = src.memview
19208  * for i in range(ndim): # <<<<<<<<<<<<<<
19209  * tmpslice.shape[i] = src.shape[i]
19210  * tmpslice.suboffsets[i] = -1
19211  */
19212  __pyx_t_3 = __pyx_v_ndim;
19213  __pyx_t_5 = __pyx_t_3;
19214  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19215  __pyx_v_i = __pyx_t_6;
19216 
19217  /* "View.MemoryView":1230
19218  * tmpslice.memview = src.memview
19219  * for i in range(ndim):
19220  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
19221  * tmpslice.suboffsets[i] = -1
19222  *
19223  */
19224  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19225 
19226  /* "View.MemoryView":1231
19227  * for i in range(ndim):
19228  * tmpslice.shape[i] = src.shape[i]
19229  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19230  *
19231  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
19232  */
19233  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
19234  }
19235 
19236  /* "View.MemoryView":1233
19237  * tmpslice.suboffsets[i] = -1
19238  *
19239  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
19240  * ndim, order)
19241  *
19242  */
19243  (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));
19244 
19245  /* "View.MemoryView":1237
19246  *
19247  *
19248  * for i in range(ndim): # <<<<<<<<<<<<<<
19249  * if tmpslice.shape[i] == 1:
19250  * tmpslice.strides[i] = 0
19251  */
19252  __pyx_t_3 = __pyx_v_ndim;
19253  __pyx_t_5 = __pyx_t_3;
19254  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19255  __pyx_v_i = __pyx_t_6;
19256 
19257  /* "View.MemoryView":1238
19258  *
19259  * for i in range(ndim):
19260  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19261  * tmpslice.strides[i] = 0
19262  *
19263  */
19264  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19265  if (__pyx_t_2) {
19266 
19267  /* "View.MemoryView":1239
19268  * for i in range(ndim):
19269  * if tmpslice.shape[i] == 1:
19270  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
19271  *
19272  * if slice_is_contig(src[0], order, ndim):
19273  */
19274  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19275 
19276  /* "View.MemoryView":1238
19277  *
19278  * for i in range(ndim):
19279  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19280  * tmpslice.strides[i] = 0
19281  *
19282  */
19283  }
19284  }
19285 
19286  /* "View.MemoryView":1241
19287  * tmpslice.strides[i] = 0
19288  *
19289  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19290  * memcpy(result, src.data, size)
19291  * else:
19292  */
19293  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19294  if (__pyx_t_2) {
19295 
19296  /* "View.MemoryView":1242
19297  *
19298  * if slice_is_contig(src[0], order, ndim):
19299  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
19300  * else:
19301  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19302  */
19303  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19304 
19305  /* "View.MemoryView":1241
19306  * tmpslice.strides[i] = 0
19307  *
19308  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19309  * memcpy(result, src.data, size)
19310  * else:
19311  */
19312  goto __pyx_L9;
19313  }
19314 
19315  /* "View.MemoryView":1244
19316  * memcpy(result, src.data, size)
19317  * else:
19318  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
19319  *
19320  * return result
19321  */
19322  /*else*/ {
19323  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19324  }
19325  __pyx_L9:;
19326 
19327  /* "View.MemoryView":1246
19328  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19329  *
19330  * return result # <<<<<<<<<<<<<<
19331  *
19332  *
19333  */
19334  __pyx_r = __pyx_v_result;
19335  goto __pyx_L0;
19336 
19337  /* "View.MemoryView":1208
19338  *
19339  * @cname('__pyx_memoryview_copy_data_to_temp')
19340  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19341  * __Pyx_memviewslice *tmpslice,
19342  * char order,
19343  */
19344 
19345  /* function exit code */
19346  __pyx_L1_error:;
19347  {
19348  #ifdef WITH_THREAD
19349  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19350  #endif
19351  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19352  #ifdef WITH_THREAD
19353  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19354  #endif
19355  }
19356  __pyx_r = NULL;
19357  __pyx_L0:;
19358  __Pyx_TraceReturn(Py_None, 1);
19359  return __pyx_r;
19360 }
19361 
19362 /* "View.MemoryView":1251
19363  *
19364  * @cname('__pyx_memoryview_err_extents')
19365  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19366  * Py_ssize_t extent2) except -1 with gil:
19367  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19368  */
19369 
19370 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19371  int __pyx_r;
19372  __Pyx_TraceDeclarations
19373  __Pyx_RefNannyDeclarations
19374  PyObject *__pyx_t_1 = NULL;
19375  PyObject *__pyx_t_2 = NULL;
19376  PyObject *__pyx_t_3 = NULL;
19377  PyObject *__pyx_t_4 = NULL;
19378  int __pyx_lineno = 0;
19379  const char *__pyx_filename = NULL;
19380  int __pyx_clineno = 0;
19381  #ifdef WITH_THREAD
19382  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19383  #endif
19384  __Pyx_RefNannySetupContext("_err_extents", 0);
19385  __Pyx_TraceCall("_err_extents", __pyx_f[1], 1251, 0, __PYX_ERR(1, 1251, __pyx_L1_error));
19386 
19387  /* "View.MemoryView":1254
19388  * Py_ssize_t extent2) except -1 with gil:
19389  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19390  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
19391  *
19392  * @cname('__pyx_memoryview_err_dim')
19393  */
19394  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19395  __Pyx_GOTREF(__pyx_t_1);
19396  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
19397  __Pyx_GOTREF(__pyx_t_2);
19398  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
19399  __Pyx_GOTREF(__pyx_t_3);
19400  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
19401  __Pyx_GOTREF(__pyx_t_4);
19402  __Pyx_GIVEREF(__pyx_t_1);
19403  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19404  __Pyx_GIVEREF(__pyx_t_2);
19405  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19406  __Pyx_GIVEREF(__pyx_t_3);
19407  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19408  __pyx_t_1 = 0;
19409  __pyx_t_2 = 0;
19410  __pyx_t_3 = 0;
19411 
19412  /* "View.MemoryView":1253
19413  * cdef int _err_extents(int i, Py_ssize_t extent1,
19414  * Py_ssize_t extent2) except -1 with gil:
19415  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
19416  * (i, extent1, extent2))
19417  *
19418  */
19419  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
19420  __Pyx_GOTREF(__pyx_t_3);
19421  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19422  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
19423  __Pyx_GOTREF(__pyx_t_4);
19424  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19425  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19426  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19427  __PYX_ERR(1, 1253, __pyx_L1_error)
19428 
19429  /* "View.MemoryView":1251
19430  *
19431  * @cname('__pyx_memoryview_err_extents')
19432  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19433  * Py_ssize_t extent2) except -1 with gil:
19434  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19435  */
19436 
19437  /* function exit code */
19438  __pyx_L1_error:;
19439  __Pyx_XDECREF(__pyx_t_1);
19440  __Pyx_XDECREF(__pyx_t_2);
19441  __Pyx_XDECREF(__pyx_t_3);
19442  __Pyx_XDECREF(__pyx_t_4);
19443  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19444  __pyx_r = -1;
19445  __Pyx_TraceReturn(Py_None, 0);
19446  __Pyx_RefNannyFinishContext();
19447  #ifdef WITH_THREAD
19448  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19449  #endif
19450  return __pyx_r;
19451 }
19452 
19453 /* "View.MemoryView":1257
19454  *
19455  * @cname('__pyx_memoryview_err_dim')
19456  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19457  * raise error(msg.decode('ascii') % dim)
19458  *
19459  */
19460 
19461 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
19462  int __pyx_r;
19463  __Pyx_TraceDeclarations
19464  __Pyx_RefNannyDeclarations
19465  PyObject *__pyx_t_1 = NULL;
19466  PyObject *__pyx_t_2 = NULL;
19467  PyObject *__pyx_t_3 = NULL;
19468  PyObject *__pyx_t_4 = NULL;
19469  int __pyx_lineno = 0;
19470  const char *__pyx_filename = NULL;
19471  int __pyx_clineno = 0;
19472  #ifdef WITH_THREAD
19473  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19474  #endif
19475  __Pyx_RefNannySetupContext("_err_dim", 0);
19476  __Pyx_TraceCall("_err_dim", __pyx_f[1], 1257, 0, __PYX_ERR(1, 1257, __pyx_L1_error));
19477  __Pyx_INCREF(__pyx_v_error);
19478 
19479  /* "View.MemoryView":1258
19480  * @cname('__pyx_memoryview_err_dim')
19481  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
19482  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
19483  *
19484  * @cname('__pyx_memoryview_err')
19485  */
19486  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
19487  __Pyx_GOTREF(__pyx_t_2);
19488  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
19489  __Pyx_GOTREF(__pyx_t_3);
19490  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
19491  __Pyx_GOTREF(__pyx_t_4);
19492  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19493  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19494  __Pyx_INCREF(__pyx_v_error);
19495  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19496  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19497  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19498  if (likely(__pyx_t_2)) {
19499  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19500  __Pyx_INCREF(__pyx_t_2);
19501  __Pyx_INCREF(function);
19502  __Pyx_DECREF_SET(__pyx_t_3, function);
19503  }
19504  }
19505  __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);
19506  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19507  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19508  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
19509  __Pyx_GOTREF(__pyx_t_1);
19510  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19511  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19512  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19513  __PYX_ERR(1, 1258, __pyx_L1_error)
19514 
19515  /* "View.MemoryView":1257
19516  *
19517  * @cname('__pyx_memoryview_err_dim')
19518  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19519  * raise error(msg.decode('ascii') % dim)
19520  *
19521  */
19522 
19523  /* function exit code */
19524  __pyx_L1_error:;
19525  __Pyx_XDECREF(__pyx_t_1);
19526  __Pyx_XDECREF(__pyx_t_2);
19527  __Pyx_XDECREF(__pyx_t_3);
19528  __Pyx_XDECREF(__pyx_t_4);
19529  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19530  __pyx_r = -1;
19531  __Pyx_XDECREF(__pyx_v_error);
19532  __Pyx_TraceReturn(Py_None, 0);
19533  __Pyx_RefNannyFinishContext();
19534  #ifdef WITH_THREAD
19535  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19536  #endif
19537  return __pyx_r;
19538 }
19539 
19540 /* "View.MemoryView":1261
19541  *
19542  * @cname('__pyx_memoryview_err')
19543  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19544  * if msg != NULL:
19545  * raise error(msg.decode('ascii'))
19546  */
19547 
19548 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
19549  int __pyx_r;
19550  __Pyx_TraceDeclarations
19551  __Pyx_RefNannyDeclarations
19552  int __pyx_t_1;
19553  PyObject *__pyx_t_2 = NULL;
19554  PyObject *__pyx_t_3 = NULL;
19555  PyObject *__pyx_t_4 = NULL;
19556  PyObject *__pyx_t_5 = NULL;
19557  int __pyx_lineno = 0;
19558  const char *__pyx_filename = NULL;
19559  int __pyx_clineno = 0;
19560  #ifdef WITH_THREAD
19561  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19562  #endif
19563  __Pyx_RefNannySetupContext("_err", 0);
19564  __Pyx_TraceCall("_err", __pyx_f[1], 1261, 0, __PYX_ERR(1, 1261, __pyx_L1_error));
19565  __Pyx_INCREF(__pyx_v_error);
19566 
19567  /* "View.MemoryView":1262
19568  * @cname('__pyx_memoryview_err')
19569  * cdef int _err(object error, char *msg) except -1 with gil:
19570  * if msg != NULL: # <<<<<<<<<<<<<<
19571  * raise error(msg.decode('ascii'))
19572  * else:
19573  */
19574  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19575  if (unlikely(__pyx_t_1)) {
19576 
19577  /* "View.MemoryView":1263
19578  * cdef int _err(object error, char *msg) except -1 with gil:
19579  * if msg != NULL:
19580  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
19581  * else:
19582  * raise error
19583  */
19584  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
19585  __Pyx_GOTREF(__pyx_t_3);
19586  __Pyx_INCREF(__pyx_v_error);
19587  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19588  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19589  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19590  if (likely(__pyx_t_5)) {
19591  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19592  __Pyx_INCREF(__pyx_t_5);
19593  __Pyx_INCREF(function);
19594  __Pyx_DECREF_SET(__pyx_t_4, function);
19595  }
19596  }
19597  __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);
19598  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19599  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19600  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
19601  __Pyx_GOTREF(__pyx_t_2);
19602  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19603  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19604  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19605  __PYX_ERR(1, 1263, __pyx_L1_error)
19606 
19607  /* "View.MemoryView":1262
19608  * @cname('__pyx_memoryview_err')
19609  * cdef int _err(object error, char *msg) except -1 with gil:
19610  * if msg != NULL: # <<<<<<<<<<<<<<
19611  * raise error(msg.decode('ascii'))
19612  * else:
19613  */
19614  }
19615 
19616  /* "View.MemoryView":1265
19617  * raise error(msg.decode('ascii'))
19618  * else:
19619  * raise error # <<<<<<<<<<<<<<
19620  *
19621  * @cname('__pyx_memoryview_copy_contents')
19622  */
19623  /*else*/ {
19624  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19625  __PYX_ERR(1, 1265, __pyx_L1_error)
19626  }
19627 
19628  /* "View.MemoryView":1261
19629  *
19630  * @cname('__pyx_memoryview_err')
19631  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19632  * if msg != NULL:
19633  * raise error(msg.decode('ascii'))
19634  */
19635 
19636  /* function exit code */
19637  __pyx_L1_error:;
19638  __Pyx_XDECREF(__pyx_t_2);
19639  __Pyx_XDECREF(__pyx_t_3);
19640  __Pyx_XDECREF(__pyx_t_4);
19641  __Pyx_XDECREF(__pyx_t_5);
19642  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19643  __pyx_r = -1;
19644  __Pyx_XDECREF(__pyx_v_error);
19645  __Pyx_TraceReturn(Py_None, 0);
19646  __Pyx_RefNannyFinishContext();
19647  #ifdef WITH_THREAD
19648  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19649  #endif
19650  return __pyx_r;
19651 }
19652 
19653 /* "View.MemoryView":1268
19654  *
19655  * @cname('__pyx_memoryview_copy_contents')
19656  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19657  * __Pyx_memviewslice dst,
19658  * int src_ndim, int dst_ndim,
19659  */
19660 
19661 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) {
19662  void *__pyx_v_tmpdata;
19663  size_t __pyx_v_itemsize;
19664  int __pyx_v_i;
19665  char __pyx_v_order;
19666  int __pyx_v_broadcasting;
19667  int __pyx_v_direct_copy;
19668  __Pyx_memviewslice __pyx_v_tmp;
19669  int __pyx_v_ndim;
19670  int __pyx_r;
19671  __Pyx_TraceDeclarations
19672  Py_ssize_t __pyx_t_1;
19673  int __pyx_t_2;
19674  int __pyx_t_3;
19675  int __pyx_t_4;
19676  int __pyx_t_5;
19677  int __pyx_t_6;
19678  void *__pyx_t_7;
19679  int __pyx_t_8;
19680  int __pyx_lineno = 0;
19681  const char *__pyx_filename = NULL;
19682  int __pyx_clineno = 0;
19683  __Pyx_TraceCall("memoryview_copy_contents", __pyx_f[1], 1268, 1, __PYX_ERR(1, 1268, __pyx_L1_error));
19684 
19685  /* "View.MemoryView":1276
19686  * Check for overlapping memory and verify the shapes.
19687  * """
19688  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
19689  * cdef size_t itemsize = src.memview.view.itemsize
19690  * cdef int i
19691  */
19692  __pyx_v_tmpdata = NULL;
19693 
19694  /* "View.MemoryView":1277
19695  * """
19696  * cdef void *tmpdata = NULL
19697  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19698  * cdef int i
19699  * cdef char order = get_best_order(&src, src_ndim)
19700  */
19701  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19702  __pyx_v_itemsize = __pyx_t_1;
19703 
19704  /* "View.MemoryView":1279
19705  * cdef size_t itemsize = src.memview.view.itemsize
19706  * cdef int i
19707  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
19708  * cdef bint broadcasting = False
19709  * cdef bint direct_copy = False
19710  */
19711  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19712 
19713  /* "View.MemoryView":1280
19714  * cdef int i
19715  * cdef char order = get_best_order(&src, src_ndim)
19716  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
19717  * cdef bint direct_copy = False
19718  * cdef __Pyx_memviewslice tmp
19719  */
19720  __pyx_v_broadcasting = 0;
19721 
19722  /* "View.MemoryView":1281
19723  * cdef char order = get_best_order(&src, src_ndim)
19724  * cdef bint broadcasting = False
19725  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
19726  * cdef __Pyx_memviewslice tmp
19727  *
19728  */
19729  __pyx_v_direct_copy = 0;
19730 
19731  /* "View.MemoryView":1284
19732  * cdef __Pyx_memviewslice tmp
19733  *
19734  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19735  * broadcast_leading(&src, src_ndim, dst_ndim)
19736  * elif dst_ndim < src_ndim:
19737  */
19738  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19739  if (__pyx_t_2) {
19740 
19741  /* "View.MemoryView":1285
19742  *
19743  * if src_ndim < dst_ndim:
19744  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19745  * elif dst_ndim < src_ndim:
19746  * broadcast_leading(&dst, dst_ndim, src_ndim)
19747  */
19748  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19749 
19750  /* "View.MemoryView":1284
19751  * cdef __Pyx_memviewslice tmp
19752  *
19753  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19754  * broadcast_leading(&src, src_ndim, dst_ndim)
19755  * elif dst_ndim < src_ndim:
19756  */
19757  goto __pyx_L3;
19758  }
19759 
19760  /* "View.MemoryView":1286
19761  * if src_ndim < dst_ndim:
19762  * broadcast_leading(&src, src_ndim, dst_ndim)
19763  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19764  * broadcast_leading(&dst, dst_ndim, src_ndim)
19765  *
19766  */
19767  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19768  if (__pyx_t_2) {
19769 
19770  /* "View.MemoryView":1287
19771  * broadcast_leading(&src, src_ndim, dst_ndim)
19772  * elif dst_ndim < src_ndim:
19773  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
19774  *
19775  * cdef int ndim = max(src_ndim, dst_ndim)
19776  */
19777  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19778 
19779  /* "View.MemoryView":1286
19780  * if src_ndim < dst_ndim:
19781  * broadcast_leading(&src, src_ndim, dst_ndim)
19782  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19783  * broadcast_leading(&dst, dst_ndim, src_ndim)
19784  *
19785  */
19786  }
19787  __pyx_L3:;
19788 
19789  /* "View.MemoryView":1289
19790  * broadcast_leading(&dst, dst_ndim, src_ndim)
19791  *
19792  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19793  *
19794  * for i in range(ndim):
19795  */
19796  __pyx_t_3 = __pyx_v_dst_ndim;
19797  __pyx_t_4 = __pyx_v_src_ndim;
19798  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19799  __pyx_t_5 = __pyx_t_3;
19800  } else {
19801  __pyx_t_5 = __pyx_t_4;
19802  }
19803  __pyx_v_ndim = __pyx_t_5;
19804 
19805  /* "View.MemoryView":1291
19806  * cdef int ndim = max(src_ndim, dst_ndim)
19807  *
19808  * for i in range(ndim): # <<<<<<<<<<<<<<
19809  * if src.shape[i] != dst.shape[i]:
19810  * if src.shape[i] == 1:
19811  */
19812  __pyx_t_5 = __pyx_v_ndim;
19813  __pyx_t_3 = __pyx_t_5;
19814  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19815  __pyx_v_i = __pyx_t_4;
19816 
19817  /* "View.MemoryView":1292
19818  *
19819  * for i in range(ndim):
19820  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19821  * if src.shape[i] == 1:
19822  * broadcasting = True
19823  */
19824  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19825  if (__pyx_t_2) {
19826 
19827  /* "View.MemoryView":1293
19828  * for i in range(ndim):
19829  * if src.shape[i] != dst.shape[i]:
19830  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19831  * broadcasting = True
19832  * src.strides[i] = 0
19833  */
19834  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19835  if (__pyx_t_2) {
19836 
19837  /* "View.MemoryView":1294
19838  * if src.shape[i] != dst.shape[i]:
19839  * if src.shape[i] == 1:
19840  * broadcasting = True # <<<<<<<<<<<<<<
19841  * src.strides[i] = 0
19842  * else:
19843  */
19844  __pyx_v_broadcasting = 1;
19845 
19846  /* "View.MemoryView":1295
19847  * if src.shape[i] == 1:
19848  * broadcasting = True
19849  * src.strides[i] = 0 # <<<<<<<<<<<<<<
19850  * else:
19851  * _err_extents(i, dst.shape[i], src.shape[i])
19852  */
19853  (__pyx_v_src.strides[__pyx_v_i]) = 0;
19854 
19855  /* "View.MemoryView":1293
19856  * for i in range(ndim):
19857  * if src.shape[i] != dst.shape[i]:
19858  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19859  * broadcasting = True
19860  * src.strides[i] = 0
19861  */
19862  goto __pyx_L7;
19863  }
19864 
19865  /* "View.MemoryView":1297
19866  * src.strides[i] = 0
19867  * else:
19868  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
19869  *
19870  * if src.suboffsets[i] >= 0:
19871  */
19872  /*else*/ {
19873  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
19874  }
19875  __pyx_L7:;
19876 
19877  /* "View.MemoryView":1292
19878  *
19879  * for i in range(ndim):
19880  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19881  * if src.shape[i] == 1:
19882  * broadcasting = True
19883  */
19884  }
19885 
19886  /* "View.MemoryView":1299
19887  * _err_extents(i, dst.shape[i], src.shape[i])
19888  *
19889  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19890  * _err_dim(ValueError, "Dimension %d is not direct", i)
19891  *
19892  */
19893  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19894  if (__pyx_t_2) {
19895 
19896  /* "View.MemoryView":1300
19897  *
19898  * if src.suboffsets[i] >= 0:
19899  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
19900  *
19901  * if slices_overlap(&src, &dst, ndim, itemsize):
19902  */
19903  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
19904 
19905  /* "View.MemoryView":1299
19906  * _err_extents(i, dst.shape[i], src.shape[i])
19907  *
19908  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19909  * _err_dim(ValueError, "Dimension %d is not direct", i)
19910  *
19911  */
19912  }
19913  }
19914 
19915  /* "View.MemoryView":1302
19916  * _err_dim(ValueError, "Dimension %d is not direct", i)
19917  *
19918  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19919  *
19920  * if not slice_is_contig(src, order, ndim):
19921  */
19922  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19923  if (__pyx_t_2) {
19924 
19925  /* "View.MemoryView":1304
19926  * if slices_overlap(&src, &dst, ndim, itemsize):
19927  *
19928  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19929  * order = get_best_order(&dst, ndim)
19930  *
19931  */
19932  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19933  if (__pyx_t_2) {
19934 
19935  /* "View.MemoryView":1305
19936  *
19937  * if not slice_is_contig(src, order, ndim):
19938  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
19939  *
19940  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19941  */
19942  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19943 
19944  /* "View.MemoryView":1304
19945  * if slices_overlap(&src, &dst, ndim, itemsize):
19946  *
19947  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19948  * order = get_best_order(&dst, ndim)
19949  *
19950  */
19951  }
19952 
19953  /* "View.MemoryView":1307
19954  * order = get_best_order(&dst, ndim)
19955  *
19956  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
19957  * src = tmp
19958  *
19959  */
19960  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
19961  __pyx_v_tmpdata = __pyx_t_7;
19962 
19963  /* "View.MemoryView":1308
19964  *
19965  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19966  * src = tmp # <<<<<<<<<<<<<<
19967  *
19968  * if not broadcasting:
19969  */
19970  __pyx_v_src = __pyx_v_tmp;
19971 
19972  /* "View.MemoryView":1302
19973  * _err_dim(ValueError, "Dimension %d is not direct", i)
19974  *
19975  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19976  *
19977  * if not slice_is_contig(src, order, ndim):
19978  */
19979  }
19980 
19981  /* "View.MemoryView":1310
19982  * src = tmp
19983  *
19984  * if not broadcasting: # <<<<<<<<<<<<<<
19985  *
19986  *
19987  */
19988  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19989  if (__pyx_t_2) {
19990 
19991  /* "View.MemoryView":1313
19992  *
19993  *
19994  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19995  * direct_copy = slice_is_contig(dst, 'C', ndim)
19996  * elif slice_is_contig(src, 'F', ndim):
19997  */
19998  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
19999  if (__pyx_t_2) {
20000 
20001  /* "View.MemoryView":1314
20002  *
20003  * if slice_is_contig(src, 'C', ndim):
20004  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
20005  * elif slice_is_contig(src, 'F', ndim):
20006  * direct_copy = slice_is_contig(dst, 'F', ndim)
20007  */
20008  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
20009 
20010  /* "View.MemoryView":1313
20011  *
20012  *
20013  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
20014  * direct_copy = slice_is_contig(dst, 'C', ndim)
20015  * elif slice_is_contig(src, 'F', ndim):
20016  */
20017  goto __pyx_L12;
20018  }
20019 
20020  /* "View.MemoryView":1315
20021  * if slice_is_contig(src, 'C', ndim):
20022  * direct_copy = slice_is_contig(dst, 'C', ndim)
20023  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20024  * direct_copy = slice_is_contig(dst, 'F', ndim)
20025  *
20026  */
20027  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
20028  if (__pyx_t_2) {
20029 
20030  /* "View.MemoryView":1316
20031  * direct_copy = slice_is_contig(dst, 'C', ndim)
20032  * elif slice_is_contig(src, 'F', ndim):
20033  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
20034  *
20035  * if direct_copy:
20036  */
20037  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
20038 
20039  /* "View.MemoryView":1315
20040  * if slice_is_contig(src, 'C', ndim):
20041  * direct_copy = slice_is_contig(dst, 'C', ndim)
20042  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20043  * direct_copy = slice_is_contig(dst, 'F', ndim)
20044  *
20045  */
20046  }
20047  __pyx_L12:;
20048 
20049  /* "View.MemoryView":1318
20050  * direct_copy = slice_is_contig(dst, 'F', ndim)
20051  *
20052  * if direct_copy: # <<<<<<<<<<<<<<
20053  *
20054  * refcount_copying(&dst, dtype_is_object, ndim, False)
20055  */
20056  __pyx_t_2 = (__pyx_v_direct_copy != 0);
20057  if (__pyx_t_2) {
20058 
20059  /* "View.MemoryView":1320
20060  * if direct_copy:
20061  *
20062  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20063  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20064  * refcount_copying(&dst, dtype_is_object, ndim, True)
20065  */
20066  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20067 
20068  /* "View.MemoryView":1321
20069  *
20070  * refcount_copying(&dst, dtype_is_object, ndim, False)
20071  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
20072  * refcount_copying(&dst, dtype_is_object, ndim, True)
20073  * free(tmpdata)
20074  */
20075  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20076 
20077  /* "View.MemoryView":1322
20078  * refcount_copying(&dst, dtype_is_object, ndim, False)
20079  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20080  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20081  * free(tmpdata)
20082  * return 0
20083  */
20084  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20085 
20086  /* "View.MemoryView":1323
20087  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20088  * refcount_copying(&dst, dtype_is_object, ndim, True)
20089  * free(tmpdata) # <<<<<<<<<<<<<<
20090  * return 0
20091  *
20092  */
20093  free(__pyx_v_tmpdata);
20094 
20095  /* "View.MemoryView":1324
20096  * refcount_copying(&dst, dtype_is_object, ndim, True)
20097  * free(tmpdata)
20098  * return 0 # <<<<<<<<<<<<<<
20099  *
20100  * if order == 'F' == get_best_order(&dst, ndim):
20101  */
20102  __pyx_r = 0;
20103  goto __pyx_L0;
20104 
20105  /* "View.MemoryView":1318
20106  * direct_copy = slice_is_contig(dst, 'F', ndim)
20107  *
20108  * if direct_copy: # <<<<<<<<<<<<<<
20109  *
20110  * refcount_copying(&dst, dtype_is_object, ndim, False)
20111  */
20112  }
20113 
20114  /* "View.MemoryView":1310
20115  * src = tmp
20116  *
20117  * if not broadcasting: # <<<<<<<<<<<<<<
20118  *
20119  *
20120  */
20121  }
20122 
20123  /* "View.MemoryView":1326
20124  * return 0
20125  *
20126  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20127  *
20128  *
20129  */
20130  __pyx_t_2 = (__pyx_v_order == 'F');
20131  if (__pyx_t_2) {
20132  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20133  }
20134  __pyx_t_8 = (__pyx_t_2 != 0);
20135  if (__pyx_t_8) {
20136 
20137  /* "View.MemoryView":1329
20138  *
20139  *
20140  * transpose_memslice(&src) # <<<<<<<<<<<<<<
20141  * transpose_memslice(&dst)
20142  *
20143  */
20144  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
20145 
20146  /* "View.MemoryView":1330
20147  *
20148  * transpose_memslice(&src)
20149  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
20150  *
20151  * refcount_copying(&dst, dtype_is_object, ndim, False)
20152  */
20153  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
20154 
20155  /* "View.MemoryView":1326
20156  * return 0
20157  *
20158  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20159  *
20160  *
20161  */
20162  }
20163 
20164  /* "View.MemoryView":1332
20165  * transpose_memslice(&dst)
20166  *
20167  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20168  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20169  * refcount_copying(&dst, dtype_is_object, ndim, True)
20170  */
20171  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20172 
20173  /* "View.MemoryView":1333
20174  *
20175  * refcount_copying(&dst, dtype_is_object, ndim, False)
20176  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
20177  * refcount_copying(&dst, dtype_is_object, ndim, True)
20178  *
20179  */
20180  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20181 
20182  /* "View.MemoryView":1334
20183  * refcount_copying(&dst, dtype_is_object, ndim, False)
20184  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20185  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20186  *
20187  * free(tmpdata)
20188  */
20189  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20190 
20191  /* "View.MemoryView":1336
20192  * refcount_copying(&dst, dtype_is_object, ndim, True)
20193  *
20194  * free(tmpdata) # <<<<<<<<<<<<<<
20195  * return 0
20196  *
20197  */
20198  free(__pyx_v_tmpdata);
20199 
20200  /* "View.MemoryView":1337
20201  *
20202  * free(tmpdata)
20203  * return 0 # <<<<<<<<<<<<<<
20204  *
20205  * @cname('__pyx_memoryview_broadcast_leading')
20206  */
20207  __pyx_r = 0;
20208  goto __pyx_L0;
20209 
20210  /* "View.MemoryView":1268
20211  *
20212  * @cname('__pyx_memoryview_copy_contents')
20213  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20214  * __Pyx_memviewslice dst,
20215  * int src_ndim, int dst_ndim,
20216  */
20217 
20218  /* function exit code */
20219  __pyx_L1_error:;
20220  {
20221  #ifdef WITH_THREAD
20222  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20223  #endif
20224  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20225  #ifdef WITH_THREAD
20226  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20227  #endif
20228  }
20229  __pyx_r = -1;
20230  __pyx_L0:;
20231  __Pyx_TraceReturn(Py_None, 1);
20232  return __pyx_r;
20233 }
20234 
20235 /* "View.MemoryView":1340
20236  *
20237  * @cname('__pyx_memoryview_broadcast_leading')
20238  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20239  * int ndim,
20240  * int ndim_other) nogil:
20241  */
20242 
20243 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
20244  int __pyx_v_i;
20245  int __pyx_v_offset;
20246  __Pyx_TraceDeclarations
20247  int __pyx_t_1;
20248  int __pyx_t_2;
20249  int __pyx_t_3;
20250  int __pyx_lineno = 0;
20251  const char *__pyx_filename = NULL;
20252  int __pyx_clineno = 0;
20253  __Pyx_TraceCall("broadcast_leading", __pyx_f[1], 1340, 1, __PYX_ERR(1, 1340, __pyx_L1_error));
20254 
20255  /* "View.MemoryView":1344
20256  * int ndim_other) nogil:
20257  * cdef int i
20258  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
20259  *
20260  * for i in range(ndim - 1, -1, -1):
20261  */
20262  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20263 
20264  /* "View.MemoryView":1346
20265  * cdef int offset = ndim_other - ndim
20266  *
20267  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20268  * mslice.shape[i + offset] = mslice.shape[i]
20269  * mslice.strides[i + offset] = mslice.strides[i]
20270  */
20271  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20272  __pyx_v_i = __pyx_t_1;
20273 
20274  /* "View.MemoryView":1347
20275  *
20276  * for i in range(ndim - 1, -1, -1):
20277  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
20278  * mslice.strides[i + offset] = mslice.strides[i]
20279  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20280  */
20281  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20282 
20283  /* "View.MemoryView":1348
20284  * for i in range(ndim - 1, -1, -1):
20285  * mslice.shape[i + offset] = mslice.shape[i]
20286  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
20287  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20288  *
20289  */
20290  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20291 
20292  /* "View.MemoryView":1349
20293  * mslice.shape[i + offset] = mslice.shape[i]
20294  * mslice.strides[i + offset] = mslice.strides[i]
20295  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
20296  *
20297  * for i in range(offset):
20298  */
20299  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20300  }
20301 
20302  /* "View.MemoryView":1351
20303  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20304  *
20305  * for i in range(offset): # <<<<<<<<<<<<<<
20306  * mslice.shape[i] = 1
20307  * mslice.strides[i] = mslice.strides[0]
20308  */
20309  __pyx_t_1 = __pyx_v_offset;
20310  __pyx_t_2 = __pyx_t_1;
20311  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20312  __pyx_v_i = __pyx_t_3;
20313 
20314  /* "View.MemoryView":1352
20315  *
20316  * for i in range(offset):
20317  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
20318  * mslice.strides[i] = mslice.strides[0]
20319  * mslice.suboffsets[i] = -1
20320  */
20321  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20322 
20323  /* "View.MemoryView":1353
20324  * for i in range(offset):
20325  * mslice.shape[i] = 1
20326  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
20327  * mslice.suboffsets[i] = -1
20328  *
20329  */
20330  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20331 
20332  /* "View.MemoryView":1354
20333  * mslice.shape[i] = 1
20334  * mslice.strides[i] = mslice.strides[0]
20335  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20336  *
20337  *
20338  */
20339  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20340  }
20341 
20342  /* "View.MemoryView":1340
20343  *
20344  * @cname('__pyx_memoryview_broadcast_leading')
20345  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20346  * int ndim,
20347  * int ndim_other) nogil:
20348  */
20349 
20350  /* function exit code */
20351  goto __pyx_L0;
20352  __pyx_L1_error:;
20353  __Pyx_WriteUnraisable("View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20354  __pyx_L0:;
20355  __Pyx_TraceReturn(Py_None, 1);
20356 }
20357 
20358 /* "View.MemoryView":1362
20359  *
20360  * @cname('__pyx_memoryview_refcount_copying')
20361  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20362  * int ndim, bint inc) nogil:
20363  *
20364  */
20365 
20366 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) {
20367  __Pyx_TraceDeclarations
20368  int __pyx_t_1;
20369  int __pyx_lineno = 0;
20370  const char *__pyx_filename = NULL;
20371  int __pyx_clineno = 0;
20372  __Pyx_TraceCall("refcount_copying", __pyx_f[1], 1362, 1, __PYX_ERR(1, 1362, __pyx_L1_error));
20373 
20374  /* "View.MemoryView":1366
20375  *
20376  *
20377  * if dtype_is_object: # <<<<<<<<<<<<<<
20378  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20379  * dst.strides, ndim, inc)
20380  */
20381  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20382  if (__pyx_t_1) {
20383 
20384  /* "View.MemoryView":1367
20385  *
20386  * if dtype_is_object:
20387  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
20388  * dst.strides, ndim, inc)
20389  *
20390  */
20391  __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);
20392 
20393  /* "View.MemoryView":1366
20394  *
20395  *
20396  * if dtype_is_object: # <<<<<<<<<<<<<<
20397  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20398  * dst.strides, ndim, inc)
20399  */
20400  }
20401 
20402  /* "View.MemoryView":1362
20403  *
20404  * @cname('__pyx_memoryview_refcount_copying')
20405  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20406  * int ndim, bint inc) nogil:
20407  *
20408  */
20409 
20410  /* function exit code */
20411  goto __pyx_L0;
20412  __pyx_L1_error:;
20413  __Pyx_WriteUnraisable("View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20414  __pyx_L0:;
20415  __Pyx_TraceReturn(Py_None, 1);
20416 }
20417 
20418 /* "View.MemoryView":1371
20419  *
20420  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20421  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20422  * Py_ssize_t *strides, int ndim,
20423  * bint inc) with gil:
20424  */
20425 
20426 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) {
20427  __Pyx_TraceDeclarations
20428  __Pyx_RefNannyDeclarations
20429  int __pyx_lineno = 0;
20430  const char *__pyx_filename = NULL;
20431  int __pyx_clineno = 0;
20432  #ifdef WITH_THREAD
20433  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20434  #endif
20435  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
20436  __Pyx_TraceCall("refcount_objects_in_slice_with_gil", __pyx_f[1], 1371, 0, __PYX_ERR(1, 1371, __pyx_L1_error));
20437 
20438  /* "View.MemoryView":1374
20439  * Py_ssize_t *strides, int ndim,
20440  * bint inc) with gil:
20441  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
20442  *
20443  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20444  */
20445  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20446 
20447  /* "View.MemoryView":1371
20448  *
20449  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20450  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20451  * Py_ssize_t *strides, int ndim,
20452  * bint inc) with gil:
20453  */
20454 
20455  /* function exit code */
20456  goto __pyx_L0;
20457  __pyx_L1_error:;
20458  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20459  __pyx_L0:;
20460  __Pyx_TraceReturn(Py_None, 0);
20461  __Pyx_RefNannyFinishContext();
20462  #ifdef WITH_THREAD
20463  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20464  #endif
20465 }
20466 
20467 /* "View.MemoryView":1377
20468  *
20469  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20470  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20471  * Py_ssize_t *strides, int ndim, bint inc):
20472  * cdef Py_ssize_t i
20473  */
20474 
20475 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) {
20476  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20477  __Pyx_TraceDeclarations
20478  __Pyx_RefNannyDeclarations
20479  Py_ssize_t __pyx_t_1;
20480  Py_ssize_t __pyx_t_2;
20481  Py_ssize_t __pyx_t_3;
20482  int __pyx_t_4;
20483  int __pyx_lineno = 0;
20484  const char *__pyx_filename = NULL;
20485  int __pyx_clineno = 0;
20486  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
20487  __Pyx_TraceCall("refcount_objects_in_slice", __pyx_f[1], 1377, 0, __PYX_ERR(1, 1377, __pyx_L1_error));
20488 
20489  /* "View.MemoryView":1381
20490  * cdef Py_ssize_t i
20491  *
20492  * for i in range(shape[0]): # <<<<<<<<<<<<<<
20493  * if ndim == 1:
20494  * if inc:
20495  */
20496  __pyx_t_1 = (__pyx_v_shape[0]);
20497  __pyx_t_2 = __pyx_t_1;
20498  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20499  __pyx_v_i = __pyx_t_3;
20500 
20501  /* "View.MemoryView":1382
20502  *
20503  * for i in range(shape[0]):
20504  * if ndim == 1: # <<<<<<<<<<<<<<
20505  * if inc:
20506  * Py_INCREF((<PyObject **> data)[0])
20507  */
20508  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20509  if (__pyx_t_4) {
20510 
20511  /* "View.MemoryView":1383
20512  * for i in range(shape[0]):
20513  * if ndim == 1:
20514  * if inc: # <<<<<<<<<<<<<<
20515  * Py_INCREF((<PyObject **> data)[0])
20516  * else:
20517  */
20518  __pyx_t_4 = (__pyx_v_inc != 0);
20519  if (__pyx_t_4) {
20520 
20521  /* "View.MemoryView":1384
20522  * if ndim == 1:
20523  * if inc:
20524  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20525  * else:
20526  * Py_DECREF((<PyObject **> data)[0])
20527  */
20528  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20529 
20530  /* "View.MemoryView":1383
20531  * for i in range(shape[0]):
20532  * if ndim == 1:
20533  * if inc: # <<<<<<<<<<<<<<
20534  * Py_INCREF((<PyObject **> data)[0])
20535  * else:
20536  */
20537  goto __pyx_L6;
20538  }
20539 
20540  /* "View.MemoryView":1386
20541  * Py_INCREF((<PyObject **> data)[0])
20542  * else:
20543  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20544  * else:
20545  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20546  */
20547  /*else*/ {
20548  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20549  }
20550  __pyx_L6:;
20551 
20552  /* "View.MemoryView":1382
20553  *
20554  * for i in range(shape[0]):
20555  * if ndim == 1: # <<<<<<<<<<<<<<
20556  * if inc:
20557  * Py_INCREF((<PyObject **> data)[0])
20558  */
20559  goto __pyx_L5;
20560  }
20561 
20562  /* "View.MemoryView":1388
20563  * Py_DECREF((<PyObject **> data)[0])
20564  * else:
20565  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20566  * ndim - 1, inc)
20567  *
20568  */
20569  /*else*/ {
20570 
20571  /* "View.MemoryView":1389
20572  * else:
20573  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20574  * ndim - 1, inc) # <<<<<<<<<<<<<<
20575  *
20576  * data += strides[0]
20577  */
20578  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20579  }
20580  __pyx_L5:;
20581 
20582  /* "View.MemoryView":1391
20583  * ndim - 1, inc)
20584  *
20585  * data += strides[0] # <<<<<<<<<<<<<<
20586  *
20587  *
20588  */
20589  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20590  }
20591 
20592  /* "View.MemoryView":1377
20593  *
20594  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20595  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20596  * Py_ssize_t *strides, int ndim, bint inc):
20597  * cdef Py_ssize_t i
20598  */
20599 
20600  /* function exit code */
20601  goto __pyx_L0;
20602  __pyx_L1_error:;
20603  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20604  __pyx_L0:;
20605  __Pyx_TraceReturn(Py_None, 0);
20606  __Pyx_RefNannyFinishContext();
20607 }
20608 
20609 /* "View.MemoryView":1397
20610  *
20611  * @cname('__pyx_memoryview_slice_assign_scalar')
20612  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20613  * size_t itemsize, void *item,
20614  * bint dtype_is_object) nogil:
20615  */
20616 
20617 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) {
20618  __Pyx_TraceDeclarations
20619  int __pyx_lineno = 0;
20620  const char *__pyx_filename = NULL;
20621  int __pyx_clineno = 0;
20622  __Pyx_TraceCall("slice_assign_scalar", __pyx_f[1], 1397, 1, __PYX_ERR(1, 1397, __pyx_L1_error));
20623 
20624  /* "View.MemoryView":1400
20625  * size_t itemsize, void *item,
20626  * bint dtype_is_object) nogil:
20627  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20628  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20629  * itemsize, item)
20630  */
20631  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20632 
20633  /* "View.MemoryView":1401
20634  * bint dtype_is_object) nogil:
20635  * refcount_copying(dst, dtype_is_object, ndim, False)
20636  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
20637  * itemsize, item)
20638  * refcount_copying(dst, dtype_is_object, ndim, True)
20639  */
20640  __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);
20641 
20642  /* "View.MemoryView":1403
20643  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20644  * itemsize, item)
20645  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20646  *
20647  *
20648  */
20649  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20650 
20651  /* "View.MemoryView":1397
20652  *
20653  * @cname('__pyx_memoryview_slice_assign_scalar')
20654  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20655  * size_t itemsize, void *item,
20656  * bint dtype_is_object) nogil:
20657  */
20658 
20659  /* function exit code */
20660  goto __pyx_L0;
20661  __pyx_L1_error:;
20662  __Pyx_WriteUnraisable("View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20663  __pyx_L0:;
20664  __Pyx_TraceReturn(Py_None, 1);
20665 }
20666 
20667 /* "View.MemoryView":1407
20668  *
20669  * @cname('__pyx_memoryview__slice_assign_scalar')
20670  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20671  * Py_ssize_t *strides, int ndim,
20672  * size_t itemsize, void *item) nogil:
20673  */
20674 
20675 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) {
20676  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20677  Py_ssize_t __pyx_v_stride;
20678  Py_ssize_t __pyx_v_extent;
20679  __Pyx_TraceDeclarations
20680  int __pyx_t_1;
20681  Py_ssize_t __pyx_t_2;
20682  Py_ssize_t __pyx_t_3;
20683  Py_ssize_t __pyx_t_4;
20684  int __pyx_lineno = 0;
20685  const char *__pyx_filename = NULL;
20686  int __pyx_clineno = 0;
20687  __Pyx_TraceCall("_slice_assign_scalar", __pyx_f[1], 1407, 1, __PYX_ERR(1, 1407, __pyx_L1_error));
20688 
20689  /* "View.MemoryView":1411
20690  * size_t itemsize, void *item) nogil:
20691  * cdef Py_ssize_t i
20692  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
20693  * cdef Py_ssize_t extent = shape[0]
20694  *
20695  */
20696  __pyx_v_stride = (__pyx_v_strides[0]);
20697 
20698  /* "View.MemoryView":1412
20699  * cdef Py_ssize_t i
20700  * cdef Py_ssize_t stride = strides[0]
20701  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
20702  *
20703  * if ndim == 1:
20704  */
20705  __pyx_v_extent = (__pyx_v_shape[0]);
20706 
20707  /* "View.MemoryView":1414
20708  * cdef Py_ssize_t extent = shape[0]
20709  *
20710  * if ndim == 1: # <<<<<<<<<<<<<<
20711  * for i in range(extent):
20712  * memcpy(data, item, itemsize)
20713  */
20714  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20715  if (__pyx_t_1) {
20716 
20717  /* "View.MemoryView":1415
20718  *
20719  * if ndim == 1:
20720  * for i in range(extent): # <<<<<<<<<<<<<<
20721  * memcpy(data, item, itemsize)
20722  * data += stride
20723  */
20724  __pyx_t_2 = __pyx_v_extent;
20725  __pyx_t_3 = __pyx_t_2;
20726  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20727  __pyx_v_i = __pyx_t_4;
20728 
20729  /* "View.MemoryView":1416
20730  * if ndim == 1:
20731  * for i in range(extent):
20732  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
20733  * data += stride
20734  * else:
20735  */
20736  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20737 
20738  /* "View.MemoryView":1417
20739  * for i in range(extent):
20740  * memcpy(data, item, itemsize)
20741  * data += stride # <<<<<<<<<<<<<<
20742  * else:
20743  * for i in range(extent):
20744  */
20745  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20746  }
20747 
20748  /* "View.MemoryView":1414
20749  * cdef Py_ssize_t extent = shape[0]
20750  *
20751  * if ndim == 1: # <<<<<<<<<<<<<<
20752  * for i in range(extent):
20753  * memcpy(data, item, itemsize)
20754  */
20755  goto __pyx_L3;
20756  }
20757 
20758  /* "View.MemoryView":1419
20759  * data += stride
20760  * else:
20761  * for i in range(extent): # <<<<<<<<<<<<<<
20762  * _slice_assign_scalar(data, shape + 1, strides + 1,
20763  * ndim - 1, itemsize, item)
20764  */
20765  /*else*/ {
20766  __pyx_t_2 = __pyx_v_extent;
20767  __pyx_t_3 = __pyx_t_2;
20768  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20769  __pyx_v_i = __pyx_t_4;
20770 
20771  /* "View.MemoryView":1420
20772  * else:
20773  * for i in range(extent):
20774  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20775  * ndim - 1, itemsize, item)
20776  * data += stride
20777  */
20778  __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);
20779 
20780  /* "View.MemoryView":1422
20781  * _slice_assign_scalar(data, shape + 1, strides + 1,
20782  * ndim - 1, itemsize, item)
20783  * data += stride # <<<<<<<<<<<<<<
20784  *
20785  *
20786  */
20787  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20788  }
20789  }
20790  __pyx_L3:;
20791 
20792  /* "View.MemoryView":1407
20793  *
20794  * @cname('__pyx_memoryview__slice_assign_scalar')
20795  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20796  * Py_ssize_t *strides, int ndim,
20797  * size_t itemsize, void *item) nogil:
20798  */
20799 
20800  /* function exit code */
20801  goto __pyx_L0;
20802  __pyx_L1_error:;
20803  __Pyx_WriteUnraisable("View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20804  __pyx_L0:;
20805  __Pyx_TraceReturn(Py_None, 1);
20806 }
20807 
20808 /* "(tree fragment)":1
20809  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20810  * cdef object __pyx_PickleError
20811  * cdef object __pyx_result
20812  */
20813 
20814 /* Python wrapper */
20815 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20816 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};
20817 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20818  PyObject *__pyx_v___pyx_type = 0;
20819  long __pyx_v___pyx_checksum;
20820  PyObject *__pyx_v___pyx_state = 0;
20821  int __pyx_lineno = 0;
20822  const char *__pyx_filename = NULL;
20823  int __pyx_clineno = 0;
20824  PyObject *__pyx_r = 0;
20825  __Pyx_RefNannyDeclarations
20826  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
20827  {
20828  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20829  PyObject* values[3] = {0,0,0};
20830  if (unlikely(__pyx_kwds)) {
20831  Py_ssize_t kw_args;
20832  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20833  switch (pos_args) {
20834  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20835  CYTHON_FALLTHROUGH;
20836  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20837  CYTHON_FALLTHROUGH;
20838  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20839  CYTHON_FALLTHROUGH;
20840  case 0: break;
20841  default: goto __pyx_L5_argtuple_error;
20842  }
20843  kw_args = PyDict_Size(__pyx_kwds);
20844  switch (pos_args) {
20845  case 0:
20846  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20847  else goto __pyx_L5_argtuple_error;
20848  CYTHON_FALLTHROUGH;
20849  case 1:
20850  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20851  else {
20852  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20853  }
20854  CYTHON_FALLTHROUGH;
20855  case 2:
20856  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20857  else {
20858  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20859  }
20860  }
20861  if (unlikely(kw_args > 0)) {
20862  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20863  }
20864  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20865  goto __pyx_L5_argtuple_error;
20866  } else {
20867  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20868  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20869  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20870  }
20871  __pyx_v___pyx_type = values[0];
20872  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20873  __pyx_v___pyx_state = values[2];
20874  }
20875  goto __pyx_L4_argument_unpacking_done;
20876  __pyx_L5_argtuple_error:;
20877  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20878  __pyx_L3_error:;
20879  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20880  __Pyx_RefNannyFinishContext();
20881  return NULL;
20882  __pyx_L4_argument_unpacking_done:;
20883  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20884 
20885  /* function exit code */
20886  __Pyx_RefNannyFinishContext();
20887  return __pyx_r;
20888 }
20889 
20890 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) {
20891  PyObject *__pyx_v___pyx_PickleError = 0;
20892  PyObject *__pyx_v___pyx_result = 0;
20893  PyObject *__pyx_r = NULL;
20894  __Pyx_TraceDeclarations
20895  __Pyx_RefNannyDeclarations
20896  PyObject *__pyx_t_1 = NULL;
20897  int __pyx_t_2;
20898  int __pyx_t_3;
20899  PyObject *__pyx_t_4 = NULL;
20900  PyObject *__pyx_t_5 = NULL;
20901  PyObject *__pyx_t_6 = NULL;
20902  int __pyx_lineno = 0;
20903  const char *__pyx_filename = NULL;
20904  int __pyx_clineno = 0;
20905  __Pyx_TraceFrameInit(__pyx_codeobj__35)
20906  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
20907  __Pyx_TraceCall("__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
20908 
20909  /* "(tree fragment)":4
20910  * cdef object __pyx_PickleError
20911  * cdef object __pyx_result
20912  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
20913  * from pickle import PickleError as __pyx_PickleError
20914  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20915  */
20916  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
20917  __Pyx_GOTREF(__pyx_t_1);
20918  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__36, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
20919  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20920  __pyx_t_3 = (__pyx_t_2 != 0);
20921  if (__pyx_t_3) {
20922 
20923  /* "(tree fragment)":5
20924  * cdef object __pyx_result
20925  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
20926  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
20927  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20928  * __pyx_result = Enum.__new__(__pyx_type)
20929  */
20930  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20931  __Pyx_GOTREF(__pyx_t_1);
20932  __Pyx_INCREF(__pyx_n_s_PickleError);
20933  __Pyx_GIVEREF(__pyx_n_s_PickleError);
20934  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
20935  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
20936  __Pyx_GOTREF(__pyx_t_4);
20937  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20938  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20939  __Pyx_GOTREF(__pyx_t_1);
20940  __Pyx_INCREF(__pyx_t_1);
20941  __pyx_v___pyx_PickleError = __pyx_t_1;
20942  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20943  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20944 
20945  /* "(tree fragment)":6
20946  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
20947  * from pickle import PickleError as __pyx_PickleError
20948  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
20949  * __pyx_result = Enum.__new__(__pyx_type)
20950  * if __pyx_state is not None:
20951  */
20952  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
20953  __Pyx_GOTREF(__pyx_t_1);
20954  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
20955  __Pyx_GOTREF(__pyx_t_5);
20956  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20957  __Pyx_INCREF(__pyx_v___pyx_PickleError);
20958  __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
20959  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
20960  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
20961  if (likely(__pyx_t_6)) {
20962  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
20963  __Pyx_INCREF(__pyx_t_6);
20964  __Pyx_INCREF(function);
20965  __Pyx_DECREF_SET(__pyx_t_1, function);
20966  }
20967  }
20968  __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);
20969  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20970  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20971  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20972  __Pyx_GOTREF(__pyx_t_4);
20973  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20974  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20975  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20976  __PYX_ERR(1, 6, __pyx_L1_error)
20977 
20978  /* "(tree fragment)":4
20979  * cdef object __pyx_PickleError
20980  * cdef object __pyx_result
20981  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
20982  * from pickle import PickleError as __pyx_PickleError
20983  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20984  */
20985  }
20986 
20987  /* "(tree fragment)":7
20988  * from pickle import PickleError as __pyx_PickleError
20989  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20990  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
20991  * if __pyx_state is not None:
20992  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20993  */
20994  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
20995  __Pyx_GOTREF(__pyx_t_1);
20996  __pyx_t_5 = NULL;
20997  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
20998  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
20999  if (likely(__pyx_t_5)) {
21000  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
21001  __Pyx_INCREF(__pyx_t_5);
21002  __Pyx_INCREF(function);
21003  __Pyx_DECREF_SET(__pyx_t_1, function);
21004  }
21005  }
21006  __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);
21007  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21008  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
21009  __Pyx_GOTREF(__pyx_t_4);
21010  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21011  __pyx_v___pyx_result = __pyx_t_4;
21012  __pyx_t_4 = 0;
21013 
21014  /* "(tree fragment)":8
21015  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
21016  * __pyx_result = Enum.__new__(__pyx_type)
21017  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21018  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21019  * return __pyx_result
21020  */
21021  __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
21022  __pyx_t_2 = (__pyx_t_3 != 0);
21023  if (__pyx_t_2) {
21024 
21025  /* "(tree fragment)":9
21026  * __pyx_result = Enum.__new__(__pyx_type)
21027  * if __pyx_state is not None:
21028  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
21029  * return __pyx_result
21030  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21031  */
21032  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
21033  __pyx_t_4 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
21034  __Pyx_GOTREF(__pyx_t_4);
21035  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21036 
21037  /* "(tree fragment)":8
21038  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
21039  * __pyx_result = Enum.__new__(__pyx_type)
21040  * if __pyx_state is not None: # <<<<<<<<<<<<<<
21041  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21042  * return __pyx_result
21043  */
21044  }
21045 
21046  /* "(tree fragment)":10
21047  * if __pyx_state is not None:
21048  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21049  * return __pyx_result # <<<<<<<<<<<<<<
21050  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21051  * __pyx_result.name = __pyx_state[0]
21052  */
21053  __Pyx_XDECREF(__pyx_r);
21054  __Pyx_INCREF(__pyx_v___pyx_result);
21055  __pyx_r = __pyx_v___pyx_result;
21056  goto __pyx_L0;
21057 
21058  /* "(tree fragment)":1
21059  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21060  * cdef object __pyx_PickleError
21061  * cdef object __pyx_result
21062  */
21063 
21064  /* function exit code */
21065  __pyx_L1_error:;
21066  __Pyx_XDECREF(__pyx_t_1);
21067  __Pyx_XDECREF(__pyx_t_4);
21068  __Pyx_XDECREF(__pyx_t_5);
21069  __Pyx_XDECREF(__pyx_t_6);
21070  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
21071  __pyx_r = NULL;
21072  __pyx_L0:;
21073  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
21074  __Pyx_XDECREF(__pyx_v___pyx_result);
21075  __Pyx_XGIVEREF(__pyx_r);
21076  __Pyx_TraceReturn(__pyx_r, 0);
21077  __Pyx_RefNannyFinishContext();
21078  return __pyx_r;
21079 }
21080 
21081 /* "(tree fragment)":11
21082  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21083  * return __pyx_result
21084  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21085  * __pyx_result.name = __pyx_state[0]
21086  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21087  */
21088 
21089 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21090  PyObject *__pyx_r = NULL;
21091  __Pyx_TraceDeclarations
21092  __Pyx_RefNannyDeclarations
21093  PyObject *__pyx_t_1 = NULL;
21094  int __pyx_t_2;
21095  Py_ssize_t __pyx_t_3;
21096  int __pyx_t_4;
21097  int __pyx_t_5;
21098  PyObject *__pyx_t_6 = NULL;
21099  PyObject *__pyx_t_7 = NULL;
21100  PyObject *__pyx_t_8 = NULL;
21101  int __pyx_lineno = 0;
21102  const char *__pyx_filename = NULL;
21103  int __pyx_clineno = 0;
21104  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
21105  __Pyx_TraceCall("__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
21106 
21107  /* "(tree fragment)":12
21108  * return __pyx_result
21109  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21110  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
21111  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21112  * __pyx_result.__dict__.update(__pyx_state[1])
21113  */
21114  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21115  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21116  __PYX_ERR(1, 12, __pyx_L1_error)
21117  }
21118  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21119  __Pyx_GOTREF(__pyx_t_1);
21120  __Pyx_GIVEREF(__pyx_t_1);
21121  __Pyx_GOTREF(__pyx_v___pyx_result->name);
21122  __Pyx_DECREF(__pyx_v___pyx_result->name);
21123  __pyx_v___pyx_result->name = __pyx_t_1;
21124  __pyx_t_1 = 0;
21125 
21126  /* "(tree fragment)":13
21127  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21128  * __pyx_result.name = __pyx_state[0]
21129  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21130  * __pyx_result.__dict__.update(__pyx_state[1])
21131  */
21132  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21133  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21134  __PYX_ERR(1, 13, __pyx_L1_error)
21135  }
21136  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21137  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21138  if (__pyx_t_4) {
21139  } else {
21140  __pyx_t_2 = __pyx_t_4;
21141  goto __pyx_L4_bool_binop_done;
21142  }
21143  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21144  __pyx_t_5 = (__pyx_t_4 != 0);
21145  __pyx_t_2 = __pyx_t_5;
21146  __pyx_L4_bool_binop_done:;
21147  if (__pyx_t_2) {
21148 
21149  /* "(tree fragment)":14
21150  * __pyx_result.name = __pyx_state[0]
21151  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21152  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
21153  */
21154  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21155  __Pyx_GOTREF(__pyx_t_6);
21156  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
21157  __Pyx_GOTREF(__pyx_t_7);
21158  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21159  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21160  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21161  __PYX_ERR(1, 14, __pyx_L1_error)
21162  }
21163  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21164  __Pyx_GOTREF(__pyx_t_6);
21165  __pyx_t_8 = NULL;
21166  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21167  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21168  if (likely(__pyx_t_8)) {
21169  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21170  __Pyx_INCREF(__pyx_t_8);
21171  __Pyx_INCREF(function);
21172  __Pyx_DECREF_SET(__pyx_t_7, function);
21173  }
21174  }
21175  __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);
21176  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21177  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21178  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21179  __Pyx_GOTREF(__pyx_t_1);
21180  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21181  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21182 
21183  /* "(tree fragment)":13
21184  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21185  * __pyx_result.name = __pyx_state[0]
21186  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21187  * __pyx_result.__dict__.update(__pyx_state[1])
21188  */
21189  }
21190 
21191  /* "(tree fragment)":11
21192  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21193  * return __pyx_result
21194  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21195  * __pyx_result.name = __pyx_state[0]
21196  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21197  */
21198 
21199  /* function exit code */
21200  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21201  goto __pyx_L0;
21202  __pyx_L1_error:;
21203  __Pyx_XDECREF(__pyx_t_1);
21204  __Pyx_XDECREF(__pyx_t_6);
21205  __Pyx_XDECREF(__pyx_t_7);
21206  __Pyx_XDECREF(__pyx_t_8);
21207  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21208  __pyx_r = 0;
21209  __pyx_L0:;
21210  __Pyx_XGIVEREF(__pyx_r);
21211  __Pyx_TraceReturn(__pyx_r, 0);
21212  __Pyx_RefNannyFinishContext();
21213  return __pyx_r;
21214 }
21215 
21216 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21217  struct __pyx_obj_18BoundaryConditions_BC_Base *p;
21218  PyObject *o;
21219  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21220  o = (*t->tp_alloc)(t, 0);
21221  } else {
21222  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21223  }
21224  if (unlikely(!o)) return 0;
21225  p = ((struct __pyx_obj_18BoundaryConditions_BC_Base *)o);
21226  p->Shape = Py_None; Py_INCREF(Py_None);
21227  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
21228  p->BC_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
21229  p->ct = Py_None; Py_INCREF(Py_None);
21230  p->_b_or.data = NULL;
21231  p->_b_or.memview = NULL;
21232  return o;
21233 }
21234 
21235 static void __pyx_tp_dealloc_18BoundaryConditions_BC_Base(PyObject *o) {
21236  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21237  #if CYTHON_USE_TP_FINALIZE
21238  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21239  if (PyObject_CallFinalizerFromDealloc(o)) return;
21240  }
21241  #endif
21242  PyObject_GC_UnTrack(o);
21243  Py_CLEAR(p->Shape);
21244  Py_CLEAR(p->name);
21245  Py_CLEAR(p->BC_type);
21246  Py_CLEAR(p->ct);
21247  __PYX_XDEC_MEMVIEW(&p->_b_or, 1);
21248  (*Py_TYPE(o)->tp_free)(o);
21249 }
21250 
21251 static int __pyx_tp_traverse_18BoundaryConditions_BC_Base(PyObject *o, visitproc v, void *a) {
21252  int e;
21253  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21254  if (p->Shape) {
21255  e = (*v)(p->Shape, a); if (e) return e;
21256  }
21257  if (p->ct) {
21258  e = (*v)(p->ct, a); if (e) return e;
21259  }
21260  return 0;
21261 }
21262 
21263 static int __pyx_tp_clear_18BoundaryConditions_BC_Base(PyObject *o) {
21264  PyObject* tmp;
21265  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21266  tmp = ((PyObject*)p->Shape);
21267  p->Shape = Py_None; Py_INCREF(Py_None);
21268  Py_XDECREF(tmp);
21269  tmp = ((PyObject*)p->ct);
21270  p->ct = Py_None; Py_INCREF(Py_None);
21271  Py_XDECREF(tmp);
21272  return 0;
21273 }
21274 
21275 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, CYTHON_UNUSED void *x) {
21276  return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(o);
21277 }
21278 
21279 static int __pyx_setprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21280  if (v) {
21281  return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(o, v);
21282  }
21283  else {
21284  PyErr_SetString(PyExc_NotImplementedError, "__del__");
21285  return -1;
21286  }
21287 }
21288 
21289 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, CYTHON_UNUSED void *x) {
21290  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(o);
21291 }
21292 
21293 static int __pyx_setprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21294  if (v) {
21295  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(o, v);
21296  }
21297  else {
21298  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(o);
21299  }
21300 }
21301 
21302 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_name(PyObject *o, CYTHON_UNUSED void *x) {
21303  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(o);
21304 }
21305 
21306 static int __pyx_setprop_18BoundaryConditions_7BC_Base_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21307  if (v) {
21308  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(o, v);
21309  }
21310  else {
21311  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(o);
21312  }
21313 }
21314 
21315 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, CYTHON_UNUSED void *x) {
21316  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(o);
21317 }
21318 
21319 static int __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21320  if (v) {
21321  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(o, v);
21322  }
21323  else {
21324  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(o);
21325  }
21326 }
21327 
21328 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, CYTHON_UNUSED void *x) {
21329  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(o);
21330 }
21331 
21332 static int __pyx_setprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21333  if (v) {
21334  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(o, v);
21335  }
21336  else {
21337  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(o);
21338  }
21339 }
21340 
21341 static PyMethodDef __pyx_methods_18BoundaryConditions_BC_Base[] = {
21342  {"getContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext},
21343  {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_7BC_Base_4__reduce_cython__},
21344  {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_7BC_Base_6__setstate_cython__},
21345  {0, 0, 0, 0}
21346 };
21347 
21348 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BC_Base[] = {
21349  {(char *)"nd", __pyx_getprop_18BoundaryConditions_7BC_Base_nd, __pyx_setprop_18BoundaryConditions_7BC_Base_nd, (char *)"nd: 'int'", 0},
21350  {(char *)"Shape", __pyx_getprop_18BoundaryConditions_7BC_Base_Shape, __pyx_setprop_18BoundaryConditions_7BC_Base_Shape, (char *)"Shape: object", 0},
21351  {(char *)"name", __pyx_getprop_18BoundaryConditions_7BC_Base_name, __pyx_setprop_18BoundaryConditions_7BC_Base_name, (char *)"name: str", 0},
21352  {(char *)"BC_type", __pyx_getprop_18BoundaryConditions_7BC_Base_BC_type, __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type, (char *)"BC_type: str", 0},
21353  {(char *)"ct", __pyx_getprop_18BoundaryConditions_7BC_Base_ct, __pyx_setprop_18BoundaryConditions_7BC_Base_ct, (char *)"ct: object", 0},
21354  {0, 0, 0, 0, 0}
21355 };
21356 
21357 static PyTypeObject __pyx_type_18BoundaryConditions_BC_Base = {
21358  PyVarObject_HEAD_INIT(0, 0)
21359  "BoundaryConditions.BC_Base", /*tp_name*/
21360  sizeof(struct __pyx_obj_18BoundaryConditions_BC_Base), /*tp_basicsize*/
21361  0, /*tp_itemsize*/
21362  __pyx_tp_dealloc_18BoundaryConditions_BC_Base, /*tp_dealloc*/
21363  #if PY_VERSION_HEX < 0x030800b4
21364  0, /*tp_print*/
21365  #endif
21366  #if PY_VERSION_HEX >= 0x030800b4
21367  0, /*tp_vectorcall_offset*/
21368  #endif
21369  0, /*tp_getattr*/
21370  0, /*tp_setattr*/
21371  #if PY_MAJOR_VERSION < 3
21372  0, /*tp_compare*/
21373  #endif
21374  #if PY_MAJOR_VERSION >= 3
21375  0, /*tp_as_async*/
21376  #endif
21377  0, /*tp_repr*/
21378  0, /*tp_as_number*/
21379  0, /*tp_as_sequence*/
21380  0, /*tp_as_mapping*/
21381  0, /*tp_hash*/
21382  0, /*tp_call*/
21383  0, /*tp_str*/
21384  0, /*tp_getattro*/
21385  0, /*tp_setattro*/
21386  0, /*tp_as_buffer*/
21387  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21388  "BC_Base(shape=None, name=None, b_or=None, b_i=0, nd=None)\n\n Generic class regrouping boundary conditions\n ", /*tp_doc*/
21389  __pyx_tp_traverse_18BoundaryConditions_BC_Base, /*tp_traverse*/
21390  __pyx_tp_clear_18BoundaryConditions_BC_Base, /*tp_clear*/
21391  0, /*tp_richcompare*/
21392  0, /*tp_weaklistoffset*/
21393  0, /*tp_iter*/
21394  0, /*tp_iternext*/
21395  __pyx_methods_18BoundaryConditions_BC_Base, /*tp_methods*/
21396  0, /*tp_members*/
21397  __pyx_getsets_18BoundaryConditions_BC_Base, /*tp_getset*/
21398  0, /*tp_base*/
21399  0, /*tp_dict*/
21400  0, /*tp_descr_get*/
21401  0, /*tp_descr_set*/
21402  0, /*tp_dictoffset*/
21403  __pyx_pw_18BoundaryConditions_7BC_Base_1__init__, /*tp_init*/
21404  0, /*tp_alloc*/
21405  __pyx_tp_new_18BoundaryConditions_BC_Base, /*tp_new*/
21406  0, /*tp_free*/
21407  0, /*tp_is_gc*/
21408  0, /*tp_bases*/
21409  0, /*tp_mro*/
21410  0, /*tp_cache*/
21411  0, /*tp_subclasses*/
21412  0, /*tp_weaklist*/
21413  0, /*tp_del*/
21414  0, /*tp_version_tag*/
21415  #if PY_VERSION_HEX >= 0x030400a1
21416  0, /*tp_finalize*/
21417  #endif
21418  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21419  0, /*tp_vectorcall*/
21420  #endif
21421  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21422  0, /*tp_print*/
21423  #endif
21424  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21425  0, /*tp_pypy_flags*/
21426  #endif
21427 };
21428 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition __pyx_vtable_18BoundaryConditions_BoundaryCondition;
21429 
21430 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21431  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p;
21432  PyObject *o;
21433  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21434  o = (*t->tp_alloc)(t, 0);
21435  } else {
21436  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21437  }
21438  if (unlikely(!o)) return 0;
21439  p = ((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o);
21440  p->__pyx_vtab = __pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
21441  p->uOfXT = Py_None; Py_INCREF(Py_None);
21442  return o;
21443 }
21444 
21445 static void __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21446  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21447  #if CYTHON_USE_TP_FINALIZE
21448  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21449  if (PyObject_CallFinalizerFromDealloc(o)) return;
21450  }
21451  #endif
21452  PyObject_GC_UnTrack(o);
21453  Py_CLEAR(p->uOfXT);
21454  (*Py_TYPE(o)->tp_free)(o);
21455 }
21456 
21457 static int __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition(PyObject *o, visitproc v, void *a) {
21458  int e;
21459  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21460  if (p->uOfXT) {
21461  e = (*v)(p->uOfXT, a); if (e) return e;
21462  }
21463  return 0;
21464 }
21465 
21466 static int __pyx_tp_clear_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21467  PyObject* tmp;
21468  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21469  tmp = ((PyObject*)p->uOfXT);
21470  p->uOfXT = Py_None; Py_INCREF(Py_None);
21471  Py_XDECREF(tmp);
21472  return 0;
21473 }
21474 
21475 static PyObject *__pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, CYTHON_UNUSED void *x) {
21476  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(o);
21477 }
21478 
21479 static int __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21480  if (v) {
21481  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(o, v);
21482  }
21483  else {
21484  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(o);
21485  }
21486 }
21487 
21488 static PyMethodDef __pyx_methods_18BoundaryConditions_BoundaryCondition[] = {
21489  {"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_2init_cython},
21490  {"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC},
21491  {"setLinearBC", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC},
21492  {"setLinearRamp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp},
21493  {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__},
21494  {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__},
21495  {0, 0, 0, 0}
21496 };
21497 
21498 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BoundaryCondition[] = {
21499  {(char *)"uOfXT", __pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT, __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT, (char *)"uOfXT: object", 0},
21500  {0, 0, 0, 0, 0}
21501 };
21502 
21503 static PyTypeObject __pyx_type_18BoundaryConditions_BoundaryCondition = {
21504  PyVarObject_HEAD_INIT(0, 0)
21505  "BoundaryConditions.BoundaryCondition", /*tp_name*/
21506  sizeof(struct __pyx_obj_18BoundaryConditions_BoundaryCondition), /*tp_basicsize*/
21507  0, /*tp_itemsize*/
21508  __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition, /*tp_dealloc*/
21509  #if PY_VERSION_HEX < 0x030800b4
21510  0, /*tp_print*/
21511  #endif
21512  #if PY_VERSION_HEX >= 0x030800b4
21513  0, /*tp_vectorcall_offset*/
21514  #endif
21515  0, /*tp_getattr*/
21516  0, /*tp_setattr*/
21517  #if PY_MAJOR_VERSION < 3
21518  0, /*tp_compare*/
21519  #endif
21520  #if PY_MAJOR_VERSION >= 3
21521  0, /*tp_as_async*/
21522  #endif
21523  0, /*tp_repr*/
21524  0, /*tp_as_number*/
21525  0, /*tp_as_sequence*/
21526  0, /*tp_as_mapping*/
21527  0, /*tp_hash*/
21528  0, /*tp_call*/
21529  0, /*tp_str*/
21530  0, /*tp_getattro*/
21531  0, /*tp_setattro*/
21532  0, /*tp_as_buffer*/
21533  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21534  "BoundaryCondition()\n\n Boundary condition class\n\n Attributes\n ----------\n uOfXT: func or None\n boundary condition function of x (array_like) and t (float) or None for\n no boundary condition\n ", /*tp_doc*/
21535  __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition, /*tp_traverse*/
21536  __pyx_tp_clear_18BoundaryConditions_BoundaryCondition, /*tp_clear*/
21537  0, /*tp_richcompare*/
21538  0, /*tp_weaklistoffset*/
21539  0, /*tp_iter*/
21540  0, /*tp_iternext*/
21541  __pyx_methods_18BoundaryConditions_BoundaryCondition, /*tp_methods*/
21542  0, /*tp_members*/
21543  __pyx_getsets_18BoundaryConditions_BoundaryCondition, /*tp_getset*/
21544  0, /*tp_base*/
21545  0, /*tp_dict*/
21546  0, /*tp_descr_get*/
21547  0, /*tp_descr_set*/
21548  0, /*tp_dictoffset*/
21549  __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__, /*tp_init*/
21550  0, /*tp_alloc*/
21551  __pyx_tp_new_18BoundaryConditions_BoundaryCondition, /*tp_new*/
21552  0, /*tp_free*/
21553  0, /*tp_is_gc*/
21554  0, /*tp_bases*/
21555  0, /*tp_mro*/
21556  0, /*tp_cache*/
21557  0, /*tp_subclasses*/
21558  0, /*tp_weaklist*/
21559  0, /*tp_del*/
21560  0, /*tp_version_tag*/
21561  #if PY_VERSION_HEX >= 0x030400a1
21562  0, /*tp_finalize*/
21563  #endif
21564  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21565  0, /*tp_vectorcall*/
21566  #endif
21567  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21568  0, /*tp_print*/
21569  #endif
21570  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21571  0, /*tp_pypy_flags*/
21572  #endif
21573 };
21574 
21575 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[8];
21576 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
21577 
21578 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21579  PyObject *o;
21580  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21581  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC];
21582  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC));
21583  (void) PyObject_INIT(o, t);
21584  PyObject_GC_Track(o);
21585  } else {
21586  o = (*t->tp_alloc)(t, 0);
21587  if (unlikely(!o)) return 0;
21588  }
21589  return o;
21590 }
21591 
21592 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21593  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21594  PyObject_GC_UnTrack(o);
21595  Py_CLEAR(p->__pyx_v_value);
21596  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21597  __pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o);
21598  } else {
21599  (*Py_TYPE(o)->tp_free)(o);
21600  }
21601 }
21602 
21603 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o, visitproc v, void *a) {
21604  int e;
21605  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21606  if (p->__pyx_v_value) {
21607  e = (*v)(p->__pyx_v_value, a); if (e) return e;
21608  }
21609  return 0;
21610 }
21611 
21612 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21613  PyObject* tmp;
21614  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21615  tmp = ((PyObject*)p->__pyx_v_value);
21616  p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
21617  Py_XDECREF(tmp);
21618  return 0;
21619 }
21620 
21621 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC = {
21622  PyVarObject_HEAD_INIT(0, 0)
21623  "BoundaryConditions.__pyx_scope_struct__setConstantBC", /*tp_name*/
21624  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC), /*tp_basicsize*/
21625  0, /*tp_itemsize*/
21626  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_dealloc*/
21627  #if PY_VERSION_HEX < 0x030800b4
21628  0, /*tp_print*/
21629  #endif
21630  #if PY_VERSION_HEX >= 0x030800b4
21631  0, /*tp_vectorcall_offset*/
21632  #endif
21633  0, /*tp_getattr*/
21634  0, /*tp_setattr*/
21635  #if PY_MAJOR_VERSION < 3
21636  0, /*tp_compare*/
21637  #endif
21638  #if PY_MAJOR_VERSION >= 3
21639  0, /*tp_as_async*/
21640  #endif
21641  0, /*tp_repr*/
21642  0, /*tp_as_number*/
21643  0, /*tp_as_sequence*/
21644  0, /*tp_as_mapping*/
21645  0, /*tp_hash*/
21646  0, /*tp_call*/
21647  0, /*tp_str*/
21648  0, /*tp_getattro*/
21649  0, /*tp_setattro*/
21650  0, /*tp_as_buffer*/
21651  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21652  0, /*tp_doc*/
21653  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_traverse*/
21654  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_clear*/
21655  0, /*tp_richcompare*/
21656  0, /*tp_weaklistoffset*/
21657  0, /*tp_iter*/
21658  0, /*tp_iternext*/
21659  0, /*tp_methods*/
21660  0, /*tp_members*/
21661  0, /*tp_getset*/
21662  0, /*tp_base*/
21663  0, /*tp_dict*/
21664  0, /*tp_descr_get*/
21665  0, /*tp_descr_set*/
21666  0, /*tp_dictoffset*/
21667  0, /*tp_init*/
21668  0, /*tp_alloc*/
21669  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_new*/
21670  0, /*tp_free*/
21671  0, /*tp_is_gc*/
21672  0, /*tp_bases*/
21673  0, /*tp_mro*/
21674  0, /*tp_cache*/
21675  0, /*tp_subclasses*/
21676  0, /*tp_weaklist*/
21677  0, /*tp_del*/
21678  0, /*tp_version_tag*/
21679  #if PY_VERSION_HEX >= 0x030400a1
21680  0, /*tp_finalize*/
21681  #endif
21682  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21683  0, /*tp_vectorcall*/
21684  #endif
21685  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21686  0, /*tp_print*/
21687  #endif
21688  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21689  0, /*tp_pypy_flags*/
21690  #endif
21691 };
21692 
21693 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[8];
21694 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
21695 
21696 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21697  PyObject *o;
21698  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
21699  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC];
21700  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC));
21701  (void) PyObject_INIT(o, t);
21702  PyObject_GC_Track(o);
21703  } else {
21704  o = (*t->tp_alloc)(t, 0);
21705  if (unlikely(!o)) return 0;
21706  }
21707  return o;
21708 }
21709 
21710 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
21711  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21712  PyObject_GC_UnTrack(o);
21713  Py_CLEAR(p->__pyx_v_a);
21714  Py_CLEAR(p->__pyx_v_a0);
21715  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
21716  __pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o);
21717  } else {
21718  (*Py_TYPE(o)->tp_free)(o);
21719  }
21720 }
21721 
21722 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o, visitproc v, void *a) {
21723  int e;
21724  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21725  if (p->__pyx_v_a) {
21726  e = (*v)(p->__pyx_v_a, a); if (e) return e;
21727  }
21728  if (p->__pyx_v_a0) {
21729  e = (*v)(p->__pyx_v_a0, a); if (e) return e;
21730  }
21731  return 0;
21732 }
21733 
21734 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
21735  PyObject* tmp;
21736  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21737  tmp = ((PyObject*)p->__pyx_v_a);
21738  p->__pyx_v_a = Py_None; Py_INCREF(Py_None);
21739  Py_XDECREF(tmp);
21740  tmp = ((PyObject*)p->__pyx_v_a0);
21741  p->__pyx_v_a0 = Py_None; Py_INCREF(Py_None);
21742  Py_XDECREF(tmp);
21743  return 0;
21744 }
21745 
21746 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = {
21747  PyVarObject_HEAD_INIT(0, 0)
21748  "BoundaryConditions.__pyx_scope_struct_1_setLinearBC", /*tp_name*/
21749  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC), /*tp_basicsize*/
21750  0, /*tp_itemsize*/
21751  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_dealloc*/
21752  #if PY_VERSION_HEX < 0x030800b4
21753  0, /*tp_print*/
21754  #endif
21755  #if PY_VERSION_HEX >= 0x030800b4
21756  0, /*tp_vectorcall_offset*/
21757  #endif
21758  0, /*tp_getattr*/
21759  0, /*tp_setattr*/
21760  #if PY_MAJOR_VERSION < 3
21761  0, /*tp_compare*/
21762  #endif
21763  #if PY_MAJOR_VERSION >= 3
21764  0, /*tp_as_async*/
21765  #endif
21766  0, /*tp_repr*/
21767  0, /*tp_as_number*/
21768  0, /*tp_as_sequence*/
21769  0, /*tp_as_mapping*/
21770  0, /*tp_hash*/
21771  0, /*tp_call*/
21772  0, /*tp_str*/
21773  0, /*tp_getattro*/
21774  0, /*tp_setattro*/
21775  0, /*tp_as_buffer*/
21776  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21777  0, /*tp_doc*/
21778  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_traverse*/
21779  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_clear*/
21780  0, /*tp_richcompare*/
21781  0, /*tp_weaklistoffset*/
21782  0, /*tp_iter*/
21783  0, /*tp_iternext*/
21784  0, /*tp_methods*/
21785  0, /*tp_members*/
21786  0, /*tp_getset*/
21787  0, /*tp_base*/
21788  0, /*tp_dict*/
21789  0, /*tp_descr_get*/
21790  0, /*tp_descr_set*/
21791  0, /*tp_dictoffset*/
21792  0, /*tp_init*/
21793  0, /*tp_alloc*/
21794  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_new*/
21795  0, /*tp_free*/
21796  0, /*tp_is_gc*/
21797  0, /*tp_bases*/
21798  0, /*tp_mro*/
21799  0, /*tp_cache*/
21800  0, /*tp_subclasses*/
21801  0, /*tp_weaklist*/
21802  0, /*tp_del*/
21803  0, /*tp_version_tag*/
21804  #if PY_VERSION_HEX >= 0x030400a1
21805  0, /*tp_finalize*/
21806  #endif
21807  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21808  0, /*tp_vectorcall*/
21809  #endif
21810  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21811  0, /*tp_print*/
21812  #endif
21813  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21814  0, /*tp_pypy_flags*/
21815  #endif
21816 };
21817 
21818 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[8];
21819 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
21820 
21821 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21822  PyObject *o;
21823  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
21824  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp];
21825  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp));
21826  (void) PyObject_INIT(o, t);
21827  PyObject_GC_Track(o);
21828  } else {
21829  o = (*t->tp_alloc)(t, 0);
21830  if (unlikely(!o)) return 0;
21831  }
21832  return o;
21833 }
21834 
21835 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
21836  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21837  PyObject_GC_UnTrack(o);
21838  Py_CLEAR(p->__pyx_v_t1);
21839  Py_CLEAR(p->__pyx_v_value);
21840  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
21841  __pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o);
21842  } else {
21843  (*Py_TYPE(o)->tp_free)(o);
21844  }
21845 }
21846 
21847 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o, visitproc v, void *a) {
21848  int e;
21849  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21850  if (p->__pyx_v_t1) {
21851  e = (*v)(p->__pyx_v_t1, a); if (e) return e;
21852  }
21853  if (p->__pyx_v_value) {
21854  e = (*v)(p->__pyx_v_value, a); if (e) return e;
21855  }
21856  return 0;
21857 }
21858 
21859 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
21860  PyObject* tmp;
21861  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21862  tmp = ((PyObject*)p->__pyx_v_t1);
21863  p->__pyx_v_t1 = Py_None; Py_INCREF(Py_None);
21864  Py_XDECREF(tmp);
21865  tmp = ((PyObject*)p->__pyx_v_value);
21866  p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
21867  Py_XDECREF(tmp);
21868  return 0;
21869 }
21870 
21871 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = {
21872  PyVarObject_HEAD_INIT(0, 0)
21873  "BoundaryConditions.__pyx_scope_struct_2_setLinearRamp", /*tp_name*/
21874  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp), /*tp_basicsize*/
21875  0, /*tp_itemsize*/
21876  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_dealloc*/
21877  #if PY_VERSION_HEX < 0x030800b4
21878  0, /*tp_print*/
21879  #endif
21880  #if PY_VERSION_HEX >= 0x030800b4
21881  0, /*tp_vectorcall_offset*/
21882  #endif
21883  0, /*tp_getattr*/
21884  0, /*tp_setattr*/
21885  #if PY_MAJOR_VERSION < 3
21886  0, /*tp_compare*/
21887  #endif
21888  #if PY_MAJOR_VERSION >= 3
21889  0, /*tp_as_async*/
21890  #endif
21891  0, /*tp_repr*/
21892  0, /*tp_as_number*/
21893  0, /*tp_as_sequence*/
21894  0, /*tp_as_mapping*/
21895  0, /*tp_hash*/
21896  0, /*tp_call*/
21897  0, /*tp_str*/
21898  0, /*tp_getattro*/
21899  0, /*tp_setattro*/
21900  0, /*tp_as_buffer*/
21901  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21902  0, /*tp_doc*/
21903  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_traverse*/
21904  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_clear*/
21905  0, /*tp_richcompare*/
21906  0, /*tp_weaklistoffset*/
21907  0, /*tp_iter*/
21908  0, /*tp_iternext*/
21909  0, /*tp_methods*/
21910  0, /*tp_members*/
21911  0, /*tp_getset*/
21912  0, /*tp_base*/
21913  0, /*tp_dict*/
21914  0, /*tp_descr_get*/
21915  0, /*tp_descr_set*/
21916  0, /*tp_dictoffset*/
21917  0, /*tp_init*/
21918  0, /*tp_alloc*/
21919  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, /*tp_new*/
21920  0, /*tp_free*/
21921  0, /*tp_is_gc*/
21922  0, /*tp_bases*/
21923  0, /*tp_mro*/
21924  0, /*tp_cache*/
21925  0, /*tp_subclasses*/
21926  0, /*tp_weaklist*/
21927  0, /*tp_del*/
21928  0, /*tp_version_tag*/
21929  #if PY_VERSION_HEX >= 0x030400a1
21930  0, /*tp_finalize*/
21931  #endif
21932  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21933  0, /*tp_vectorcall*/
21934  #endif
21935  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21936  0, /*tp_print*/
21937  #endif
21938  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21939  0, /*tp_pypy_flags*/
21940  #endif
21941 };
21942 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21943 
21944 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21945  struct __pyx_array_obj *p;
21946  PyObject *o;
21947  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21948  o = (*t->tp_alloc)(t, 0);
21949  } else {
21950  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21951  }
21952  if (unlikely(!o)) return 0;
21953  p = ((struct __pyx_array_obj *)o);
21954  p->__pyx_vtab = __pyx_vtabptr_array;
21955  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21956  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21957  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
21958  return o;
21959  bad:
21960  Py_DECREF(o); o = 0;
21961  return NULL;
21962 }
21963 
21964 static void __pyx_tp_dealloc_array(PyObject *o) {
21965  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
21966  #if CYTHON_USE_TP_FINALIZE
21967  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))) {
21968  if (PyObject_CallFinalizerFromDealloc(o)) return;
21969  }
21970  #endif
21971  {
21972  PyObject *etype, *eval, *etb;
21973  PyErr_Fetch(&etype, &eval, &etb);
21974  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21975  __pyx_array___dealloc__(o);
21976  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21977  PyErr_Restore(etype, eval, etb);
21978  }
21979  Py_CLEAR(p->mode);
21980  Py_CLEAR(p->_format);
21981  (*Py_TYPE(o)->tp_free)(o);
21982 }
21983 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21984  PyObject *r;
21985  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21986  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21987  Py_DECREF(x);
21988  return r;
21989 }
21990 
21991 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21992  if (v) {
21993  return __pyx_array___setitem__(o, i, v);
21994  }
21995  else {
21996  PyErr_Format(PyExc_NotImplementedError,
21997  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21998  return -1;
21999  }
22000 }
22001 
22002 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
22003  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
22004  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
22005  PyErr_Clear();
22006  v = __pyx_array___getattr__(o, n);
22007  }
22008  return v;
22009 }
22010 
22011 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
22012  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
22013 }
22014 
22015 static PyMethodDef __pyx_methods_array[] = {
22016  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
22017  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
22018  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
22019  {0, 0, 0, 0}
22020 };
22021 
22022 static struct PyGetSetDef __pyx_getsets_array[] = {
22023  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
22024  {0, 0, 0, 0, 0}
22025 };
22026 
22027 static PySequenceMethods __pyx_tp_as_sequence_array = {
22028  __pyx_array___len__, /*sq_length*/
22029  0, /*sq_concat*/
22030  0, /*sq_repeat*/
22031  __pyx_sq_item_array, /*sq_item*/
22032  0, /*sq_slice*/
22033  0, /*sq_ass_item*/
22034  0, /*sq_ass_slice*/
22035  0, /*sq_contains*/
22036  0, /*sq_inplace_concat*/
22037  0, /*sq_inplace_repeat*/
22038 };
22039 
22040 static PyMappingMethods __pyx_tp_as_mapping_array = {
22041  __pyx_array___len__, /*mp_length*/
22042  __pyx_array___getitem__, /*mp_subscript*/
22043  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
22044 };
22045 
22046 static PyBufferProcs __pyx_tp_as_buffer_array = {
22047  #if PY_MAJOR_VERSION < 3
22048  0, /*bf_getreadbuffer*/
22049  #endif
22050  #if PY_MAJOR_VERSION < 3
22051  0, /*bf_getwritebuffer*/
22052  #endif
22053  #if PY_MAJOR_VERSION < 3
22054  0, /*bf_getsegcount*/
22055  #endif
22056  #if PY_MAJOR_VERSION < 3
22057  0, /*bf_getcharbuffer*/
22058  #endif
22059  __pyx_array_getbuffer, /*bf_getbuffer*/
22060  0, /*bf_releasebuffer*/
22061 };
22062 
22063 static PyTypeObject __pyx_type___pyx_array = {
22064  PyVarObject_HEAD_INIT(0, 0)
22065  "BoundaryConditions.array", /*tp_name*/
22066  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
22067  0, /*tp_itemsize*/
22068  __pyx_tp_dealloc_array, /*tp_dealloc*/
22069  #if PY_VERSION_HEX < 0x030800b4
22070  0, /*tp_print*/
22071  #endif
22072  #if PY_VERSION_HEX >= 0x030800b4
22073  0, /*tp_vectorcall_offset*/
22074  #endif
22075  0, /*tp_getattr*/
22076  0, /*tp_setattr*/
22077  #if PY_MAJOR_VERSION < 3
22078  0, /*tp_compare*/
22079  #endif
22080  #if PY_MAJOR_VERSION >= 3
22081  0, /*tp_as_async*/
22082  #endif
22083  0, /*tp_repr*/
22084  0, /*tp_as_number*/
22085  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
22086  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
22087  0, /*tp_hash*/
22088  0, /*tp_call*/
22089  0, /*tp_str*/
22090  __pyx_tp_getattro_array, /*tp_getattro*/
22091  0, /*tp_setattro*/
22092  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
22093  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
22094  0, /*tp_doc*/
22095  0, /*tp_traverse*/
22096  0, /*tp_clear*/
22097  0, /*tp_richcompare*/
22098  0, /*tp_weaklistoffset*/
22099  0, /*tp_iter*/
22100  0, /*tp_iternext*/
22101  __pyx_methods_array, /*tp_methods*/
22102  0, /*tp_members*/
22103  __pyx_getsets_array, /*tp_getset*/
22104  0, /*tp_base*/
22105  0, /*tp_dict*/
22106  0, /*tp_descr_get*/
22107  0, /*tp_descr_set*/
22108  0, /*tp_dictoffset*/
22109  0, /*tp_init*/
22110  0, /*tp_alloc*/
22111  __pyx_tp_new_array, /*tp_new*/
22112  0, /*tp_free*/
22113  0, /*tp_is_gc*/
22114  0, /*tp_bases*/
22115  0, /*tp_mro*/
22116  0, /*tp_cache*/
22117  0, /*tp_subclasses*/
22118  0, /*tp_weaklist*/
22119  0, /*tp_del*/
22120  0, /*tp_version_tag*/
22121  #if PY_VERSION_HEX >= 0x030400a1
22122  0, /*tp_finalize*/
22123  #endif
22124  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22125  0, /*tp_vectorcall*/
22126  #endif
22127  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22128  0, /*tp_print*/
22129  #endif
22130  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
22131  0, /*tp_pypy_flags*/
22132  #endif
22133 };
22134 
22135 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
22136  struct __pyx_MemviewEnum_obj *p;
22137  PyObject *o;
22138  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22139  o = (*t->tp_alloc)(t, 0);
22140  } else {
22141  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22142  }
22143  if (unlikely(!o)) return 0;
22144  p = ((struct __pyx_MemviewEnum_obj *)o);
22145  p->name = Py_None; Py_INCREF(Py_None);
22146  return o;
22147 }
22148 
22149 static void __pyx_tp_dealloc_Enum(PyObject *o) {
22150  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22151  #if CYTHON_USE_TP_FINALIZE
22152  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22153  if (PyObject_CallFinalizerFromDealloc(o)) return;
22154  }
22155  #endif
22156  PyObject_GC_UnTrack(o);
22157  Py_CLEAR(p->name);
22158  (*Py_TYPE(o)->tp_free)(o);
22159 }
22160 
22161 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
22162  int e;
22163  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22164  if (p->name) {
22165  e = (*v)(p->name, a); if (e) return e;
22166  }
22167  return 0;
22168 }
22169 
22170 static int __pyx_tp_clear_Enum(PyObject *o) {
22171  PyObject* tmp;
22172  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
22173  tmp = ((PyObject*)p->name);
22174  p->name = Py_None; Py_INCREF(Py_None);
22175  Py_XDECREF(tmp);
22176  return 0;
22177 }
22178 
22179 static PyMethodDef __pyx_methods_Enum[] = {
22180  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
22181  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
22182  {0, 0, 0, 0}
22183 };
22184 
22185 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
22186  PyVarObject_HEAD_INIT(0, 0)
22187  "BoundaryConditions.Enum", /*tp_name*/
22188  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
22189  0, /*tp_itemsize*/
22190  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
22191  #if PY_VERSION_HEX < 0x030800b4
22192  0, /*tp_print*/
22193  #endif
22194  #if PY_VERSION_HEX >= 0x030800b4
22195  0, /*tp_vectorcall_offset*/
22196  #endif
22197  0, /*tp_getattr*/
22198  0, /*tp_setattr*/
22199  #if PY_MAJOR_VERSION < 3
22200  0, /*tp_compare*/
22201  #endif
22202  #if PY_MAJOR_VERSION >= 3
22203  0, /*tp_as_async*/
22204  #endif
22205  __pyx_MemviewEnum___repr__, /*tp_repr*/
22206  0, /*tp_as_number*/
22207  0, /*tp_as_sequence*/
22208  0, /*tp_as_mapping*/
22209  0, /*tp_hash*/
22210  0, /*tp_call*/
22211  0, /*tp_str*/
22212  0, /*tp_getattro*/
22213  0, /*tp_setattro*/
22214  0, /*tp_as_buffer*/
22215  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22216  0, /*tp_doc*/
22217  __pyx_tp_traverse_Enum, /*tp_traverse*/
22218  __pyx_tp_clear_Enum, /*tp_clear*/
22219  0, /*tp_richcompare*/
22220  0, /*tp_weaklistoffset*/
22221  0, /*tp_iter*/
22222  0, /*tp_iternext*/
22223  __pyx_methods_Enum, /*tp_methods*/
22224  0, /*tp_members*/
22225  0, /*tp_getset*/
22226  0, /*tp_base*/
22227  0, /*tp_dict*/
22228  0, /*tp_descr_get*/
22229  0, /*tp_descr_set*/
22230  0, /*tp_dictoffset*/
22231  __pyx_MemviewEnum___init__, /*tp_init*/
22232  0, /*tp_alloc*/
22233  __pyx_tp_new_Enum, /*tp_new*/
22234  0, /*tp_free*/
22235  0, /*tp_is_gc*/
22236  0, /*tp_bases*/
22237  0, /*tp_mro*/
22238  0, /*tp_cache*/
22239  0, /*tp_subclasses*/
22240  0, /*tp_weaklist*/
22241  0, /*tp_del*/
22242  0, /*tp_version_tag*/
22243  #if PY_VERSION_HEX >= 0x030400a1
22244  0, /*tp_finalize*/
22245  #endif
22246  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22247  0, /*tp_vectorcall*/
22248  #endif
22249  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22250  0, /*tp_print*/
22251  #endif
22252  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
22253  0, /*tp_pypy_flags*/
22254  #endif
22255 };
22256 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22257 
22258 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22259  struct __pyx_memoryview_obj *p;
22260  PyObject *o;
22261  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22262  o = (*t->tp_alloc)(t, 0);
22263  } else {
22264  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22265  }
22266  if (unlikely(!o)) return 0;
22267  p = ((struct __pyx_memoryview_obj *)o);
22268  p->__pyx_vtab = __pyx_vtabptr_memoryview;
22269  p->obj = Py_None; Py_INCREF(Py_None);
22270  p->_size = Py_None; Py_INCREF(Py_None);
22271  p->_array_interface = Py_None; Py_INCREF(Py_None);
22272  p->view.obj = NULL;
22273  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
22274  return o;
22275  bad:
22276  Py_DECREF(o); o = 0;
22277  return NULL;
22278 }
22279 
22280 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22281  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22282  #if CYTHON_USE_TP_FINALIZE
22283  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22284  if (PyObject_CallFinalizerFromDealloc(o)) return;
22285  }
22286  #endif
22287  PyObject_GC_UnTrack(o);
22288  {
22289  PyObject *etype, *eval, *etb;
22290  PyErr_Fetch(&etype, &eval, &etb);
22291  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22292  __pyx_memoryview___dealloc__(o);
22293  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22294  PyErr_Restore(etype, eval, etb);
22295  }
22296  Py_CLEAR(p->obj);
22297  Py_CLEAR(p->_size);
22298  Py_CLEAR(p->_array_interface);
22299  (*Py_TYPE(o)->tp_free)(o);
22300 }
22301 
22302 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
22303  int e;
22304  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22305  if (p->obj) {
22306  e = (*v)(p->obj, a); if (e) return e;
22307  }
22308  if (p->_size) {
22309  e = (*v)(p->_size, a); if (e) return e;
22310  }
22311  if (p->_array_interface) {
22312  e = (*v)(p->_array_interface, a); if (e) return e;
22313  }
22314  if (p->view.obj) {
22315  e = (*v)(p->view.obj, a); if (e) return e;
22316  }
22317  return 0;
22318 }
22319 
22320 static int __pyx_tp_clear_memoryview(PyObject *o) {
22321  PyObject* tmp;
22322  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
22323  tmp = ((PyObject*)p->obj);
22324  p->obj = Py_None; Py_INCREF(Py_None);
22325  Py_XDECREF(tmp);
22326  tmp = ((PyObject*)p->_size);
22327  p->_size = Py_None; Py_INCREF(Py_None);
22328  Py_XDECREF(tmp);
22329  tmp = ((PyObject*)p->_array_interface);
22330  p->_array_interface = Py_None; Py_INCREF(Py_None);
22331  Py_XDECREF(tmp);
22332  Py_CLEAR(p->view.obj);
22333  return 0;
22334 }
22335 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22336  PyObject *r;
22337  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
22338  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22339  Py_DECREF(x);
22340  return r;
22341 }
22342 
22343 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
22344  if (v) {
22345  return __pyx_memoryview___setitem__(o, i, v);
22346  }
22347  else {
22348  PyErr_Format(PyExc_NotImplementedError,
22349  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22350  return -1;
22351  }
22352 }
22353 
22354 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
22355  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22356 }
22357 
22358 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
22359  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22360 }
22361 
22362 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
22363  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22364 }
22365 
22366 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
22367  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22368 }
22369 
22370 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
22371  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22372 }
22373 
22374 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
22375  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22376 }
22377 
22378 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
22379  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22380 }
22381 
22382 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
22383  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22384 }
22385 
22386 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
22387  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22388 }
22389 
22390 static PyMethodDef __pyx_methods_memoryview[] = {
22391  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22392  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22393  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22394  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22395  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22396  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22397  {0, 0, 0, 0}
22398 };
22399 
22400 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22401  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
22402  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
22403  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
22404  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
22405  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
22406  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
22407  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
22408  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
22409  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
22410  {0, 0, 0, 0, 0}
22411 };
22412 
22413 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22414  __pyx_memoryview___len__, /*sq_length*/
22415  0, /*sq_concat*/
22416  0, /*sq_repeat*/
22417  __pyx_sq_item_memoryview, /*sq_item*/
22418  0, /*sq_slice*/
22419  0, /*sq_ass_item*/
22420  0, /*sq_ass_slice*/
22421  0, /*sq_contains*/
22422  0, /*sq_inplace_concat*/
22423  0, /*sq_inplace_repeat*/
22424 };
22425 
22426 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22427  __pyx_memoryview___len__, /*mp_length*/
22428  __pyx_memoryview___getitem__, /*mp_subscript*/
22429  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
22430 };
22431 
22432 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22433  #if PY_MAJOR_VERSION < 3
22434  0, /*bf_getreadbuffer*/
22435  #endif
22436  #if PY_MAJOR_VERSION < 3
22437  0, /*bf_getwritebuffer*/
22438  #endif
22439  #if PY_MAJOR_VERSION < 3
22440  0, /*bf_getsegcount*/
22441  #endif
22442  #if PY_MAJOR_VERSION < 3
22443  0, /*bf_getcharbuffer*/
22444  #endif
22445  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
22446  0, /*bf_releasebuffer*/
22447 };
22448 
22449 static PyTypeObject __pyx_type___pyx_memoryview = {
22450  PyVarObject_HEAD_INIT(0, 0)
22451  "BoundaryConditions.memoryview", /*tp_name*/
22452  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
22453  0, /*tp_itemsize*/
22454  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
22455  #if PY_VERSION_HEX < 0x030800b4
22456  0, /*tp_print*/
22457  #endif
22458  #if PY_VERSION_HEX >= 0x030800b4
22459  0, /*tp_vectorcall_offset*/
22460  #endif
22461  0, /*tp_getattr*/
22462  0, /*tp_setattr*/
22463  #if PY_MAJOR_VERSION < 3
22464  0, /*tp_compare*/
22465  #endif
22466  #if PY_MAJOR_VERSION >= 3
22467  0, /*tp_as_async*/
22468  #endif
22469  __pyx_memoryview___repr__, /*tp_repr*/
22470  0, /*tp_as_number*/
22471  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
22472  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
22473  0, /*tp_hash*/
22474  0, /*tp_call*/
22475  __pyx_memoryview___str__, /*tp_str*/
22476  0, /*tp_getattro*/
22477  0, /*tp_setattro*/
22478  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
22479  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22480  0, /*tp_doc*/
22481  __pyx_tp_traverse_memoryview, /*tp_traverse*/
22482  __pyx_tp_clear_memoryview, /*tp_clear*/
22483  0, /*tp_richcompare*/
22484  0, /*tp_weaklistoffset*/
22485  0, /*tp_iter*/
22486  0, /*tp_iternext*/
22487  __pyx_methods_memoryview, /*tp_methods*/
22488  0, /*tp_members*/
22489  __pyx_getsets_memoryview, /*tp_getset*/
22490  0, /*tp_base*/
22491  0, /*tp_dict*/
22492  0, /*tp_descr_get*/
22493  0, /*tp_descr_set*/
22494  0, /*tp_dictoffset*/
22495  0, /*tp_init*/
22496  0, /*tp_alloc*/
22497  __pyx_tp_new_memoryview, /*tp_new*/
22498  0, /*tp_free*/
22499  0, /*tp_is_gc*/
22500  0, /*tp_bases*/
22501  0, /*tp_mro*/
22502  0, /*tp_cache*/
22503  0, /*tp_subclasses*/
22504  0, /*tp_weaklist*/
22505  0, /*tp_del*/
22506  0, /*tp_version_tag*/
22507  #if PY_VERSION_HEX >= 0x030400a1
22508  0, /*tp_finalize*/
22509  #endif
22510  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22511  0, /*tp_vectorcall*/
22512  #endif
22513  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22514  0, /*tp_print*/
22515  #endif
22516  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
22517  0, /*tp_pypy_flags*/
22518  #endif
22519 };
22520 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22521 
22522 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22523  struct __pyx_memoryviewslice_obj *p;
22524  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22525  if (unlikely(!o)) return 0;
22526  p = ((struct __pyx_memoryviewslice_obj *)o);
22527  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22528  p->from_object = Py_None; Py_INCREF(Py_None);
22529  p->from_slice.memview = NULL;
22530  return o;
22531 }
22532 
22533 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22534  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22535  #if CYTHON_USE_TP_FINALIZE
22536  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22537  if (PyObject_CallFinalizerFromDealloc(o)) return;
22538  }
22539  #endif
22540  PyObject_GC_UnTrack(o);
22541  {
22542  PyObject *etype, *eval, *etb;
22543  PyErr_Fetch(&etype, &eval, &etb);
22544  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
22545  __pyx_memoryviewslice___dealloc__(o);
22546  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
22547  PyErr_Restore(etype, eval, etb);
22548  }
22549  Py_CLEAR(p->from_object);
22550  PyObject_GC_Track(o);
22551  __pyx_tp_dealloc_memoryview(o);
22552 }
22553 
22554 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
22555  int e;
22556  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22557  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
22558  if (p->from_object) {
22559  e = (*v)(p->from_object, a); if (e) return e;
22560  }
22561  return 0;
22562 }
22563 
22564 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22565  PyObject* tmp;
22566  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
22567  __pyx_tp_clear_memoryview(o);
22568  tmp = ((PyObject*)p->from_object);
22569  p->from_object = Py_None; Py_INCREF(Py_None);
22570  Py_XDECREF(tmp);
22571  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22572  return 0;
22573 }
22574 
22575 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
22576  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22577 }
22578 
22579 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22580  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22581  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22582  {0, 0, 0, 0}
22583 };
22584 
22585 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22586  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
22587  {0, 0, 0, 0, 0}
22588 };
22589 
22590 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22591  PyVarObject_HEAD_INIT(0, 0)
22592  "BoundaryConditions._memoryviewslice", /*tp_name*/
22593  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
22594  0, /*tp_itemsize*/
22595  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
22596  #if PY_VERSION_HEX < 0x030800b4
22597  0, /*tp_print*/
22598  #endif
22599  #if PY_VERSION_HEX >= 0x030800b4
22600  0, /*tp_vectorcall_offset*/
22601  #endif
22602  0, /*tp_getattr*/
22603  0, /*tp_setattr*/
22604  #if PY_MAJOR_VERSION < 3
22605  0, /*tp_compare*/
22606  #endif
22607  #if PY_MAJOR_VERSION >= 3
22608  0, /*tp_as_async*/
22609  #endif
22610  #if CYTHON_COMPILING_IN_PYPY
22611  __pyx_memoryview___repr__, /*tp_repr*/
22612  #else
22613  0, /*tp_repr*/
22614  #endif
22615  0, /*tp_as_number*/
22616  0, /*tp_as_sequence*/
22617  0, /*tp_as_mapping*/
22618  0, /*tp_hash*/
22619  0, /*tp_call*/
22620  #if CYTHON_COMPILING_IN_PYPY
22621  __pyx_memoryview___str__, /*tp_str*/
22622  #else
22623  0, /*tp_str*/
22624  #endif
22625  0, /*tp_getattro*/
22626  0, /*tp_setattro*/
22627  0, /*tp_as_buffer*/
22628  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22629  "Internal class for passing memoryview slices to Python", /*tp_doc*/
22630  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
22631  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
22632  0, /*tp_richcompare*/
22633  0, /*tp_weaklistoffset*/
22634  0, /*tp_iter*/
22635  0, /*tp_iternext*/
22636  __pyx_methods__memoryviewslice, /*tp_methods*/
22637  0, /*tp_members*/
22638  __pyx_getsets__memoryviewslice, /*tp_getset*/
22639  0, /*tp_base*/
22640  0, /*tp_dict*/
22641  0, /*tp_descr_get*/
22642  0, /*tp_descr_set*/
22643  0, /*tp_dictoffset*/
22644  0, /*tp_init*/
22645  0, /*tp_alloc*/
22646  __pyx_tp_new__memoryviewslice, /*tp_new*/
22647  0, /*tp_free*/
22648  0, /*tp_is_gc*/
22649  0, /*tp_bases*/
22650  0, /*tp_mro*/
22651  0, /*tp_cache*/
22652  0, /*tp_subclasses*/
22653  0, /*tp_weaklist*/
22654  0, /*tp_del*/
22655  0, /*tp_version_tag*/
22656  #if PY_VERSION_HEX >= 0x030400a1
22657  0, /*tp_finalize*/
22658  #endif
22659  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22660  0, /*tp_vectorcall*/
22661  #endif
22662  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22663  0, /*tp_print*/
22664  #endif
22665  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
22666  0, /*tp_pypy_flags*/
22667  #endif
22668 };
22669 
22670 static PyMethodDef __pyx_methods[] = {
22671  {0, 0, 0, 0}
22672 };
22673 
22674 #if PY_MAJOR_VERSION >= 3
22675 #if CYTHON_PEP489_MULTI_PHASE_INIT
22676 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
22677 static int __pyx_pymod_exec_BoundaryConditions(PyObject* module); /*proto*/
22678 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22679  {Py_mod_create, (void*)__pyx_pymod_create},
22680  {Py_mod_exec, (void*)__pyx_pymod_exec_BoundaryConditions},
22681  {0, NULL}
22682 };
22683 #endif
22684 
22685 static struct PyModuleDef __pyx_moduledef = {
22686  PyModuleDef_HEAD_INIT,
22687  "BoundaryConditions",
22688  0, /* m_doc */
22689  #if CYTHON_PEP489_MULTI_PHASE_INIT
22690  0, /* m_size */
22691  #else
22692  -1, /* m_size */
22693  #endif
22694  __pyx_methods /* m_methods */,
22695  #if CYTHON_PEP489_MULTI_PHASE_INIT
22696  __pyx_moduledef_slots, /* m_slots */
22697  #else
22698  NULL, /* m_reload */
22699  #endif
22700  NULL, /* m_traverse */
22701  NULL, /* m_clear */
22702  NULL /* m_free */
22703 };
22704 #endif
22705 #ifndef CYTHON_SMALL_CODE
22706 #if defined(__clang__)
22707  #define CYTHON_SMALL_CODE
22708 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22709  #define CYTHON_SMALL_CODE __attribute__((cold))
22710 #else
22711  #define CYTHON_SMALL_CODE
22712 #endif
22713 #endif
22714 
22715 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22716  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22717  {&__pyx_n_s_BC_Base, __pyx_k_BC_Base, sizeof(__pyx_k_BC_Base), 0, 0, 1, 1},
22718  {&__pyx_n_s_BC_Base___reduce_cython, __pyx_k_BC_Base___reduce_cython, sizeof(__pyx_k_BC_Base___reduce_cython), 0, 0, 1, 1},
22719  {&__pyx_n_s_BC_Base___setstate_cython, __pyx_k_BC_Base___setstate_cython, sizeof(__pyx_k_BC_Base___setstate_cython), 0, 0, 1, 1},
22720  {&__pyx_n_s_BC_Base_getContext, __pyx_k_BC_Base_getContext, sizeof(__pyx_k_BC_Base_getContext), 0, 0, 1, 1},
22721  {&__pyx_n_s_BoundaryCondition, __pyx_k_BoundaryCondition, sizeof(__pyx_k_BoundaryCondition), 0, 0, 1, 1},
22722  {&__pyx_n_s_BoundaryCondition___reduce_cytho, __pyx_k_BoundaryCondition___reduce_cytho, sizeof(__pyx_k_BoundaryCondition___reduce_cytho), 0, 0, 1, 1},
22723  {&__pyx_n_s_BoundaryCondition___setstate_cyt, __pyx_k_BoundaryCondition___setstate_cyt, sizeof(__pyx_k_BoundaryCondition___setstate_cyt), 0, 0, 1, 1},
22724  {&__pyx_n_s_BoundaryCondition_init_cython, __pyx_k_BoundaryCondition_init_cython, sizeof(__pyx_k_BoundaryCondition_init_cython), 0, 0, 1, 1},
22725  {&__pyx_n_s_BoundaryCondition_resetBC, __pyx_k_BoundaryCondition_resetBC, sizeof(__pyx_k_BoundaryCondition_resetBC), 0, 0, 1, 1},
22726  {&__pyx_n_s_BoundaryCondition_setConstantBC, __pyx_k_BoundaryCondition_setConstantBC, sizeof(__pyx_k_BoundaryCondition_setConstantBC), 0, 0, 1, 1},
22727  {&__pyx_n_s_BoundaryCondition_setLinearBC, __pyx_k_BoundaryCondition_setLinearBC, sizeof(__pyx_k_BoundaryCondition_setLinearBC), 0, 0, 1, 1},
22728  {&__pyx_n_s_BoundaryCondition_setLinearRamp, __pyx_k_BoundaryCondition_setLinearRamp, sizeof(__pyx_k_BoundaryCondition_setLinearRamp), 0, 0, 1, 1},
22729  {&__pyx_n_s_BoundaryConditions, __pyx_k_BoundaryConditions, sizeof(__pyx_k_BoundaryConditions), 0, 0, 1, 1},
22730  {&__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},
22731  {&__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},
22732  {&__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},
22733  {&__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},
22734  {&__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},
22735  {&__pyx_n_s_Context, __pyx_k_Context, sizeof(__pyx_k_Context), 0, 0, 1, 1},
22736  {&__pyx_n_s_Domain, __pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 0, 1, 1},
22737  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22738  {&__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},
22739  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22740  {&__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},
22741  {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2, __pyx_k_Incompatible_checksums_0x_x_vs_0_2, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0_2), 0, 0, 1, 0},
22742  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22743  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22744  {&__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},
22745  {&__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},
22746  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22747  {&__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},
22748  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22749  {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1},
22750  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
22751  {&__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},
22752  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22753  {&__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC, __pyx_k_Shape_or_nd_must_be_passed_to_BC, sizeof(__pyx_k_Shape_or_nd_must_be_passed_to_BC), 0, 0, 1, 0},
22754  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22755  {&__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},
22756  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22757  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22758  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
22759  {&__pyx_n_s_a0, __pyx_k_a0, sizeof(__pyx_k_a0), 0, 0, 1, 1},
22760  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
22761  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22762  {&__pyx_n_s_b_i, __pyx_k_b_i, sizeof(__pyx_k_b_i), 0, 0, 1, 1},
22763  {&__pyx_n_s_b_or, __pyx_k_b_or, sizeof(__pyx_k_b_or), 0, 0, 1, 1},
22764  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
22765  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
22766  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
22767  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
22768  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22769  {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1},
22770  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22771  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22772  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
22773  {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
22774  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22775  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
22776  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22777  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
22778  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
22779  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
22780  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22781  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22782  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
22783  {&__pyx_n_s_getContext, __pyx_k_getContext, sizeof(__pyx_k_getContext), 0, 0, 1, 1},
22784  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22785  {&__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},
22786  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
22787  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
22788  {&__pyx_n_s_init_cython, __pyx_k_init_cython, sizeof(__pyx_k_init_cython), 0, 0, 1, 1},
22789  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22790  {&__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},
22791  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
22792  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
22793  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
22794  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
22795  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
22796  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22797  {&__pyx_n_s_nd, __pyx_k_nd, sizeof(__pyx_k_nd), 0, 0, 1, 1},
22798  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22799  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
22800  {&__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},
22801  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
22802  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22803  {&__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},
22804  {&__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},
22805  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
22806  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
22807  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22808  {&__pyx_n_s_proteus, __pyx_k_proteus, sizeof(__pyx_k_proteus), 0, 0, 1, 1},
22809  {&__pyx_kp_s_proteus_BoundaryConditions_py, __pyx_k_proteus_BoundaryConditions_py, sizeof(__pyx_k_proteus_BoundaryConditions_py), 0, 0, 1, 0},
22810  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22811  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22812  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22813  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22814  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22815  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22816  {&__pyx_n_s_pyx_unpickle_BC_Base, __pyx_k_pyx_unpickle_BC_Base, sizeof(__pyx_k_pyx_unpickle_BC_Base), 0, 0, 1, 1},
22817  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22818  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22819  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
22820  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22821  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22822  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22823  {&__pyx_n_s_resetBC, __pyx_k_resetBC, sizeof(__pyx_k_resetBC), 0, 0, 1, 1},
22824  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
22825  {&__pyx_kp_s_self_uuOfXT_cannot_be_converted, __pyx_k_self_uuOfXT_cannot_be_converted, sizeof(__pyx_k_self_uuOfXT_cannot_be_converted), 0, 0, 1, 0},
22826  {&__pyx_n_s_setConstantBC, __pyx_k_setConstantBC, sizeof(__pyx_k_setConstantBC), 0, 0, 1, 1},
22827  {&__pyx_n_s_setConstantBC_locals_lambda, __pyx_k_setConstantBC_locals_lambda, sizeof(__pyx_k_setConstantBC_locals_lambda), 0, 0, 1, 1},
22828  {&__pyx_n_s_setLinearBC, __pyx_k_setLinearBC, sizeof(__pyx_k_setLinearBC), 0, 0, 1, 1},
22829  {&__pyx_n_s_setLinearBC_locals_lambda, __pyx_k_setLinearBC_locals_lambda, sizeof(__pyx_k_setLinearBC_locals_lambda), 0, 0, 1, 1},
22830  {&__pyx_n_s_setLinearRamp, __pyx_k_setLinearRamp, sizeof(__pyx_k_setLinearRamp), 0, 0, 1, 1},
22831  {&__pyx_n_s_setLinearRamp_locals_lambda, __pyx_k_setLinearRamp_locals_lambda, sizeof(__pyx_k_setLinearRamp_locals_lambda), 0, 0, 1, 1},
22832  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22833  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22834  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
22835  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
22836  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
22837  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
22838  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
22839  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
22840  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22841  {&__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},
22842  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22843  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22844  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
22845  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
22846  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
22847  {&__pyx_n_s_t1, __pyx_k_t1, sizeof(__pyx_k_t1), 0, 0, 1, 1},
22848  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
22849  {&__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},
22850  {&__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},
22851  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22852  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
22853  {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
22854  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
22855  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
22856  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
22857  {0, 0, 0, 0, 0, 0, 0}
22858 };
22859 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
22860  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 113, __pyx_L1_error)
22861  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
22862  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 945, __pyx_L1_error)
22863  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error)
22864  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
22865  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
22866  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 180, __pyx_L1_error)
22867  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
22868  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
22869  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
22870  return 0;
22871  __pyx_L1_error:;
22872  return -1;
22873 }
22874 
22875 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
22876  __Pyx_RefNannyDeclarations
22877  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
22878 
22879  /* "BoundaryConditions.py":113
22880  * """
22881  *
22882  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:]) # <<<<<<<<<<<<<<
22883  *
22884  * def setLinearRamp(self,t1,value):
22885  */
22886  __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 113, __pyx_L1_error)
22887  __Pyx_GOTREF(__pyx_slice__7);
22888  __Pyx_GIVEREF(__pyx_slice__7);
22889 
22890  /* "(tree fragment)":2
22891  * def __reduce_cython__(self):
22892  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
22893  * def __setstate_cython__(self, __pyx_state):
22894  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
22895  */
22896  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error)
22897  __Pyx_GOTREF(__pyx_tuple__11);
22898  __Pyx_GIVEREF(__pyx_tuple__11);
22899 
22900  /* "(tree fragment)":4
22901  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
22902  * def __setstate_cython__(self, __pyx_state):
22903  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
22904  */
22905  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error)
22906  __Pyx_GOTREF(__pyx_tuple__13);
22907  __Pyx_GIVEREF(__pyx_tuple__13);
22908  __pyx_tuple__15 = PyTuple_Pack(3, __pyx_int_158231071, __pyx_int_81007987, __pyx_int_131364769); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 4, __pyx_L1_error)
22909  __Pyx_GOTREF(__pyx_tuple__15);
22910  __Pyx_GIVEREF(__pyx_tuple__15);
22911 
22912  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
22913  * __pyx_import_array()
22914  * except Exception:
22915  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
22916  *
22917  * cdef inline int import_umath() except -1:
22918  */
22919  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 945, __pyx_L1_error)
22920  __Pyx_GOTREF(__pyx_tuple__16);
22921  __Pyx_GIVEREF(__pyx_tuple__16);
22922 
22923  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
22924  * _import_umath()
22925  * except Exception:
22926  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
22927  *
22928  * cdef inline int import_ufunc() except -1:
22929  */
22930  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 951, __pyx_L1_error)
22931  __Pyx_GOTREF(__pyx_tuple__17);
22932  __Pyx_GIVEREF(__pyx_tuple__17);
22933 
22934  /* "View.MemoryView":133
22935  *
22936  * if not self.ndim:
22937  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
22938  *
22939  * if itemsize <= 0:
22940  */
22941  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 133, __pyx_L1_error)
22942  __Pyx_GOTREF(__pyx_tuple__18);
22943  __Pyx_GIVEREF(__pyx_tuple__18);
22944 
22945  /* "View.MemoryView":136
22946  *
22947  * if itemsize <= 0:
22948  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
22949  *
22950  * if not isinstance(format, bytes):
22951  */
22952  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 136, __pyx_L1_error)
22953  __Pyx_GOTREF(__pyx_tuple__19);
22954  __Pyx_GIVEREF(__pyx_tuple__19);
22955 
22956  /* "View.MemoryView":148
22957  *
22958  * if not self._shape:
22959  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
22960  *
22961  *
22962  */
22963  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 148, __pyx_L1_error)
22964  __Pyx_GOTREF(__pyx_tuple__20);
22965  __Pyx_GIVEREF(__pyx_tuple__20);
22966 
22967  /* "View.MemoryView":176
22968  * self.data = <char *>malloc(self.len)
22969  * if not self.data:
22970  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
22971  *
22972  * if self.dtype_is_object:
22973  */
22974  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 176, __pyx_L1_error)
22975  __Pyx_GOTREF(__pyx_tuple__21);
22976  __Pyx_GIVEREF(__pyx_tuple__21);
22977 
22978  /* "View.MemoryView":192
22979  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
22980  * if not (flags & bufmode):
22981  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
22982  * info.buf = self.data
22983  * info.len = self.len
22984  */
22985  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 192, __pyx_L1_error)
22986  __Pyx_GOTREF(__pyx_tuple__22);
22987  __Pyx_GIVEREF(__pyx_tuple__22);
22988 
22989  /* "(tree fragment)":2
22990  * def __reduce_cython__(self):
22991  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22992  * def __setstate_cython__(self, __pyx_state):
22993  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22994  */
22995  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
22996  __Pyx_GOTREF(__pyx_tuple__23);
22997  __Pyx_GIVEREF(__pyx_tuple__23);
22998 
22999  /* "(tree fragment)":4
23000  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23001  * def __setstate_cython__(self, __pyx_state):
23002  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23003  */
23004  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
23005  __Pyx_GOTREF(__pyx_tuple__24);
23006  __Pyx_GIVEREF(__pyx_tuple__24);
23007 
23008  /* "View.MemoryView":418
23009  * def __setitem__(memoryview self, object index, object value):
23010  * if self.view.readonly:
23011  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
23012  *
23013  * have_slices, index = _unellipsify(index, self.view.ndim)
23014  */
23015  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 418, __pyx_L1_error)
23016  __Pyx_GOTREF(__pyx_tuple__25);
23017  __Pyx_GIVEREF(__pyx_tuple__25);
23018 
23019  /* "View.MemoryView":495
23020  * result = struct.unpack(self.view.format, bytesitem)
23021  * except struct.error:
23022  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
23023  * else:
23024  * if len(self.view.format) == 1:
23025  */
23026  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 495, __pyx_L1_error)
23027  __Pyx_GOTREF(__pyx_tuple__26);
23028  __Pyx_GIVEREF(__pyx_tuple__26);
23029 
23030  /* "View.MemoryView":520
23031  * def __getbuffer__(self, Py_buffer *info, int flags):
23032  * if flags & PyBUF_WRITABLE and self.view.readonly:
23033  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
23034  *
23035  * if flags & PyBUF_ND:
23036  */
23037  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 520, __pyx_L1_error)
23038  __Pyx_GOTREF(__pyx_tuple__27);
23039  __Pyx_GIVEREF(__pyx_tuple__27);
23040 
23041  /* "View.MemoryView":570
23042  * if self.view.strides == NULL:
23043  *
23044  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
23045  *
23046  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
23047  */
23048  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 570, __pyx_L1_error)
23049  __Pyx_GOTREF(__pyx_tuple__28);
23050  __Pyx_GIVEREF(__pyx_tuple__28);
23051 
23052  /* "View.MemoryView":577
23053  * def suboffsets(self):
23054  * if self.view.suboffsets == NULL:
23055  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
23056  *
23057  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
23058  */
23059  __pyx_tuple__29 = PyTuple_New(1); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 577, __pyx_L1_error)
23060  __Pyx_GOTREF(__pyx_tuple__29);
23061  __Pyx_INCREF(__pyx_int_neg_1);
23062  __Pyx_GIVEREF(__pyx_int_neg_1);
23063  PyTuple_SET_ITEM(__pyx_tuple__29, 0, __pyx_int_neg_1);
23064  __Pyx_GIVEREF(__pyx_tuple__29);
23065 
23066  /* "(tree fragment)":2
23067  * def __reduce_cython__(self):
23068  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23069  * def __setstate_cython__(self, __pyx_state):
23070  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23071  */
23072  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error)
23073  __Pyx_GOTREF(__pyx_tuple__30);
23074  __Pyx_GIVEREF(__pyx_tuple__30);
23075 
23076  /* "(tree fragment)":4
23077  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23078  * def __setstate_cython__(self, __pyx_state):
23079  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23080  */
23081  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error)
23082  __Pyx_GOTREF(__pyx_tuple__31);
23083  __Pyx_GIVEREF(__pyx_tuple__31);
23084 
23085  /* "View.MemoryView":703
23086  * for suboffset in suboffsets[:ndim]:
23087  * if suboffset >= 0:
23088  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
23089  *
23090  *
23091  */
23092  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 703, __pyx_L1_error)
23093  __Pyx_GOTREF(__pyx_tuple__32);
23094  __Pyx_GIVEREF(__pyx_tuple__32);
23095 
23096  /* "(tree fragment)":2
23097  * def __reduce_cython__(self):
23098  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23099  * def __setstate_cython__(self, __pyx_state):
23100  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23101  */
23102  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 2, __pyx_L1_error)
23103  __Pyx_GOTREF(__pyx_tuple__33);
23104  __Pyx_GIVEREF(__pyx_tuple__33);
23105 
23106  /* "(tree fragment)":4
23107  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23108  * def __setstate_cython__(self, __pyx_state):
23109  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
23110  */
23111  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 4, __pyx_L1_error)
23112  __Pyx_GOTREF(__pyx_tuple__34);
23113  __Pyx_GIVEREF(__pyx_tuple__34);
23114  __pyx_tuple__36 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 4, __pyx_L1_error)
23115  __Pyx_GOTREF(__pyx_tuple__36);
23116  __Pyx_GIVEREF(__pyx_tuple__36);
23117 
23118  /* "BoundaryConditions.py":52
23119  * # setattr(BC_Base, name, default_value)
23120  *
23121  * def getContext(self, context=None): # <<<<<<<<<<<<<<
23122  * """
23123  * Gets context from proteus.Context or
23124  */
23125  __pyx_tuple__37 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_Context); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 52, __pyx_L1_error)
23126  __Pyx_GOTREF(__pyx_tuple__37);
23127  __Pyx_GIVEREF(__pyx_tuple__37);
23128  __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 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_BoundaryConditions_py, __pyx_n_s_getContext, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 52, __pyx_L1_error)
23129 
23130  /* "(tree fragment)":1
23131  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23132  * cdef tuple state
23133  * cdef object _dict
23134  */
23135  __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 1, __pyx_L1_error)
23136  __Pyx_GOTREF(__pyx_tuple__38);
23137  __Pyx_GIVEREF(__pyx_tuple__38);
23138  __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(1, 1, __pyx_L1_error)
23139 
23140  /* "(tree fragment)":16
23141  * else:
23142  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
23143  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23144  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
23145  */
23146  __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 16, __pyx_L1_error)
23147  __Pyx_GOTREF(__pyx_tuple__39);
23148  __Pyx_GIVEREF(__pyx_tuple__39);
23149  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 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_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(1, 16, __pyx_L1_error)
23150 
23151  /* "BoundaryConditions.py":81
23152  * self.uOfXT = None
23153  *
23154  * def init_cython(self): # <<<<<<<<<<<<<<
23155  * return self.uOfXT
23156  *
23157  */
23158  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 81, __pyx_L1_error)
23159  __Pyx_GOTREF(__pyx_tuple__40);
23160  __Pyx_GIVEREF(__pyx_tuple__40);
23161  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_init_cython, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 81, __pyx_L1_error)
23162 
23163  /* "BoundaryConditions.py":84
23164  * return self.uOfXT
23165  *
23166  * def resetBC(self): # <<<<<<<<<<<<<<
23167  * self.uOfXT = None
23168  *
23169  */
23170  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 84, __pyx_L1_error)
23171  __Pyx_GOTREF(__pyx_tuple__41);
23172  __Pyx_GIVEREF(__pyx_tuple__41);
23173  __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 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_BoundaryConditions_py, __pyx_n_s_resetBC, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 84, __pyx_L1_error)
23174 
23175  /* "BoundaryConditions.py":87
23176  * self.uOfXT = None
23177  *
23178  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
23179  * """
23180  * function returning constant BC
23181  */
23182  __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 87, __pyx_L1_error)
23183  __Pyx_GOTREF(__pyx_tuple__42);
23184  __Pyx_GIVEREF(__pyx_tuple__42);
23185  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setConstantBC, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 87, __pyx_L1_error)
23186 
23187  /* "BoundaryConditions.py":100
23188  *
23189  *
23190  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
23191  * """
23192  * function returning value=a0+ax*x+ay*y+az*z
23193  */
23194  __pyx_tuple__43 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_a0, __pyx_n_s_a); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 100, __pyx_L1_error)
23195  __Pyx_GOTREF(__pyx_tuple__43);
23196  __Pyx_GIVEREF(__pyx_tuple__43);
23197  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearBC, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 100, __pyx_L1_error)
23198 
23199  /* "BoundaryConditions.py":115
23200  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
23201  *
23202  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
23203  * """
23204  * function setting a linear ramp from t=0 to t=t1
23205  */
23206  __pyx_tuple__44 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_t1, __pyx_n_s_value); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 115, __pyx_L1_error)
23207  __Pyx_GOTREF(__pyx_tuple__44);
23208  __Pyx_GIVEREF(__pyx_tuple__44);
23209  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearRamp, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 115, __pyx_L1_error)
23210 
23211  /* "(tree fragment)":1
23212  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23213  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23214  * def __setstate_cython__(self, __pyx_state):
23215  */
23216  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 1, __pyx_L1_error)
23217  __Pyx_GOTREF(__pyx_tuple__45);
23218  __Pyx_GIVEREF(__pyx_tuple__45);
23219  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 1, __pyx_L1_error)
23220 
23221  /* "(tree fragment)":3
23222  * def __reduce_cython__(self):
23223  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23224  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23225  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23226  */
23227  __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 3, __pyx_L1_error)
23228  __Pyx_GOTREF(__pyx_tuple__46);
23229  __Pyx_GIVEREF(__pyx_tuple__46);
23230  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 3, __pyx_L1_error)
23231 
23232  /* "(tree fragment)":1
23233  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23234  * cdef object __pyx_PickleError
23235  * cdef object __pyx_result
23236  */
23237  __pyx_tuple__47 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 1, __pyx_L1_error)
23238  __Pyx_GOTREF(__pyx_tuple__47);
23239  __Pyx_GIVEREF(__pyx_tuple__47);
23240  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BC_Base, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
23241 
23242  /* "View.MemoryView":286
23243  * return self.name
23244  *
23245  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23246  * cdef strided = Enum("<strided and direct>") # default
23247  * cdef indirect = Enum("<strided and indirect>")
23248  */
23249  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 286, __pyx_L1_error)
23250  __Pyx_GOTREF(__pyx_tuple__48);
23251  __Pyx_GIVEREF(__pyx_tuple__48);
23252 
23253  /* "View.MemoryView":287
23254  *
23255  * cdef generic = Enum("<strided and direct or indirect>")
23256  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23257  * cdef indirect = Enum("<strided and indirect>")
23258  *
23259  */
23260  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 287, __pyx_L1_error)
23261  __Pyx_GOTREF(__pyx_tuple__49);
23262  __Pyx_GIVEREF(__pyx_tuple__49);
23263 
23264  /* "View.MemoryView":288
23265  * cdef generic = Enum("<strided and direct or indirect>")
23266  * cdef strided = Enum("<strided and direct>") # default
23267  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23268  *
23269  *
23270  */
23271  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 288, __pyx_L1_error)
23272  __Pyx_GOTREF(__pyx_tuple__50);
23273  __Pyx_GIVEREF(__pyx_tuple__50);
23274 
23275  /* "View.MemoryView":291
23276  *
23277  *
23278  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23279  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23280  *
23281  */
23282  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 291, __pyx_L1_error)
23283  __Pyx_GOTREF(__pyx_tuple__51);
23284  __Pyx_GIVEREF(__pyx_tuple__51);
23285 
23286  /* "View.MemoryView":292
23287  *
23288  * cdef contiguous = Enum("<contiguous and direct>")
23289  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23290  *
23291  *
23292  */
23293  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 292, __pyx_L1_error)
23294  __Pyx_GOTREF(__pyx_tuple__52);
23295  __Pyx_GIVEREF(__pyx_tuple__52);
23296 
23297  /* "(tree fragment)":1
23298  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23299  * cdef object __pyx_PickleError
23300  * cdef object __pyx_result
23301  */
23302  __pyx_tuple__53 = 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__53)) __PYX_ERR(1, 1, __pyx_L1_error)
23303  __Pyx_GOTREF(__pyx_tuple__53);
23304  __Pyx_GIVEREF(__pyx_tuple__53);
23305  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(1, 1, __pyx_L1_error)
23306  __Pyx_RefNannyFinishContext();
23307  return 0;
23308  __pyx_L1_error:;
23309  __Pyx_RefNannyFinishContext();
23310  return -1;
23311 }
23312 
23313 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
23314  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23315  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23316  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23317  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
23318  __pyx_int_81007987 = PyInt_FromLong(81007987L); if (unlikely(!__pyx_int_81007987)) __PYX_ERR(0, 1, __pyx_L1_error)
23319  __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
23320  __pyx_int_131364769 = PyInt_FromLong(131364769L); if (unlikely(!__pyx_int_131364769)) __PYX_ERR(0, 1, __pyx_L1_error)
23321  __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
23322  __pyx_int_158231071 = PyInt_FromLong(158231071L); if (unlikely(!__pyx_int_158231071)) __PYX_ERR(0, 1, __pyx_L1_error)
23323  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23324  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23325  return 0;
23326  __pyx_L1_error:;
23327  return -1;
23328 }
23329 
23330 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
23331 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
23332 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
23333 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
23334 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
23335 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
23336 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
23337 
23338 static int __Pyx_modinit_global_init_code(void) {
23339  __Pyx_RefNannyDeclarations
23340  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
23341  /*--- Global init code ---*/
23342  generic = Py_None; Py_INCREF(Py_None);
23343  strided = Py_None; Py_INCREF(Py_None);
23344  indirect = Py_None; Py_INCREF(Py_None);
23345  contiguous = Py_None; Py_INCREF(Py_None);
23346  indirect_contiguous = Py_None; Py_INCREF(Py_None);
23347  __Pyx_RefNannyFinishContext();
23348  return 0;
23349 }
23350 
23351 static int __Pyx_modinit_variable_export_code(void) {
23352  __Pyx_RefNannyDeclarations
23353  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
23354  /*--- Variable export code ---*/
23355  __Pyx_RefNannyFinishContext();
23356  return 0;
23357 }
23358 
23359 static int __Pyx_modinit_function_export_code(void) {
23360  __Pyx_RefNannyDeclarations
23361  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
23362  /*--- Function export code ---*/
23363  __Pyx_RefNannyFinishContext();
23364  return 0;
23365 }
23366 
23367 static int __Pyx_modinit_type_init_code(void) {
23368  __Pyx_RefNannyDeclarations
23369  int __pyx_lineno = 0;
23370  const char *__pyx_filename = NULL;
23371  int __pyx_clineno = 0;
23372  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
23373  /*--- Type init code ---*/
23374  if (PyType_Ready(&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23375  #if PY_VERSION_HEX < 0x030800B1
23376  __pyx_type_18BoundaryConditions_BC_Base.tp_print = 0;
23377  #endif
23378  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BC_Base.tp_dictoffset && __pyx_type_18BoundaryConditions_BC_Base.tp_getattro == PyObject_GenericGetAttr)) {
23379  __pyx_type_18BoundaryConditions_BC_Base.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23380  }
23381  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BC_Base, (PyObject *)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23382  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
23383  __pyx_ptype_18BoundaryConditions_BC_Base = &__pyx_type_18BoundaryConditions_BC_Base;
23384  __pyx_vtabptr_18BoundaryConditions_BoundaryCondition = &__pyx_vtable_18BoundaryConditions_BoundaryCondition;
23385  __pyx_vtable_18BoundaryConditions_BoundaryCondition.resetBC = (void (*)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, int __pyx_skip_dispatch))__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC;
23386  if (PyType_Ready(&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23387  #if PY_VERSION_HEX < 0x030800B1
23388  __pyx_type_18BoundaryConditions_BoundaryCondition.tp_print = 0;
23389  #endif
23390  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dictoffset && __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro == PyObject_GenericGetAttr)) {
23391  __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23392  }
23393  if (__Pyx_SetVtable(__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dict, __pyx_vtabptr_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23394  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BoundaryCondition, (PyObject *)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23395  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
23396  __pyx_ptype_18BoundaryConditions_BoundaryCondition = &__pyx_type_18BoundaryConditions_BoundaryCondition;
23397  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
23398  #if PY_VERSION_HEX < 0x030800B1
23399  __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_print = 0;
23400  #endif
23401  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro == PyObject_GenericGetAttr)) {
23402  __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23403  }
23404  __pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC;
23405  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
23406  #if PY_VERSION_HEX < 0x030800B1
23407  __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_print = 0;
23408  #endif
23409  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro == PyObject_GenericGetAttr)) {
23410  __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23411  }
23412  __pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
23413  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
23414  #if PY_VERSION_HEX < 0x030800B1
23415  __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_print = 0;
23416  #endif
23417  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro == PyObject_GenericGetAttr)) {
23418  __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23419  }
23420  __pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = &__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
23421  __pyx_vtabptr_array = &__pyx_vtable_array;
23422  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
23423  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23424  #if PY_VERSION_HEX < 0x030800B1
23425  __pyx_type___pyx_array.tp_print = 0;
23426  #endif
23427  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23428  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
23429  __pyx_array_type = &__pyx_type___pyx_array;
23430  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23431  #if PY_VERSION_HEX < 0x030800B1
23432  __pyx_type___pyx_MemviewEnum.tp_print = 0;
23433  #endif
23434  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23435  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23436  }
23437  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
23438  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23439  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23440  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23441  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23442  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23443  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23444  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23445  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
23446  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23447  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23448  #if PY_VERSION_HEX < 0x030800B1
23449  __pyx_type___pyx_memoryview.tp_print = 0;
23450  #endif
23451  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23452  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23453  }
23454  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23455  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
23456  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23457  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23458  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23459  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
23460  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23461  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23462  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23463  #if PY_VERSION_HEX < 0x030800B1
23464  __pyx_type___pyx_memoryviewslice.tp_print = 0;
23465  #endif
23466  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23467  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23468  }
23469  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23470  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
23471  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23472  __Pyx_RefNannyFinishContext();
23473  return 0;
23474  __pyx_L1_error:;
23475  __Pyx_RefNannyFinishContext();
23476  return -1;
23477 }
23478 
23479 static int __Pyx_modinit_type_import_code(void) {
23480  __Pyx_RefNannyDeclarations
23481  PyObject *__pyx_t_1 = NULL;
23482  int __pyx_lineno = 0;
23483  const char *__pyx_filename = NULL;
23484  int __pyx_clineno = 0;
23485  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
23486  /*--- Type import code ---*/
23487  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
23488  __Pyx_GOTREF(__pyx_t_1);
23489  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
23490  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23491  sizeof(PyTypeObject),
23492  #else
23493  sizeof(PyHeapTypeObject),
23494  #endif
23495  __Pyx_ImportType_CheckSize_Warn);
23496  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
23497  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23498  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 200, __pyx_L1_error)
23499  __Pyx_GOTREF(__pyx_t_1);
23500  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
23501  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(3, 200, __pyx_L1_error)
23502  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
23503  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(3, 223, __pyx_L1_error)
23504  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
23505  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(3, 227, __pyx_L1_error)
23506  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
23507  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(3, 239, __pyx_L1_error)
23508  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23509  if (!__pyx_ptype_5numpy_generic) __PYX_ERR(3, 771, __pyx_L1_error)
23510  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23511  if (!__pyx_ptype_5numpy_number) __PYX_ERR(3, 773, __pyx_L1_error)
23512  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23513  if (!__pyx_ptype_5numpy_integer) __PYX_ERR(3, 775, __pyx_L1_error)
23514  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23515  if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(3, 777, __pyx_L1_error)
23516  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23517  if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(3, 779, __pyx_L1_error)
23518  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23519  if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(3, 781, __pyx_L1_error)
23520  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23521  if (!__pyx_ptype_5numpy_floating) __PYX_ERR(3, 783, __pyx_L1_error)
23522  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23523  if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(3, 785, __pyx_L1_error)
23524  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23525  if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(3, 787, __pyx_L1_error)
23526  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
23527  if (!__pyx_ptype_5numpy_character) __PYX_ERR(3, 789, __pyx_L1_error)
23528  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
23529  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(3, 827, __pyx_L1_error)
23530  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23531  __Pyx_RefNannyFinishContext();
23532  return 0;
23533  __pyx_L1_error:;
23534  __Pyx_XDECREF(__pyx_t_1);
23535  __Pyx_RefNannyFinishContext();
23536  return -1;
23537 }
23538 
23539 static int __Pyx_modinit_variable_import_code(void) {
23540  __Pyx_RefNannyDeclarations
23541  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
23542  /*--- Variable import code ---*/
23543  __Pyx_RefNannyFinishContext();
23544  return 0;
23545 }
23546 
23547 static int __Pyx_modinit_function_import_code(void) {
23548  __Pyx_RefNannyDeclarations
23549  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
23550  /*--- Function import code ---*/
23551  __Pyx_RefNannyFinishContext();
23552  return 0;
23553 }
23554 
23555 
23556 #ifndef CYTHON_NO_PYINIT_EXPORT
23557 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23558 #elif PY_MAJOR_VERSION < 3
23559 #ifdef __cplusplus
23560 #define __Pyx_PyMODINIT_FUNC extern "C" void
23561 #else
23562 #define __Pyx_PyMODINIT_FUNC void
23563 #endif
23564 #else
23565 #ifdef __cplusplus
23566 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
23567 #else
23568 #define __Pyx_PyMODINIT_FUNC PyObject *
23569 #endif
23570 #endif
23571 
23572 
23573 #if PY_MAJOR_VERSION < 3
23574 __Pyx_PyMODINIT_FUNC initBoundaryConditions(void) CYTHON_SMALL_CODE; /*proto*/
23575 __Pyx_PyMODINIT_FUNC initBoundaryConditions(void)
23576 #else
23577 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void) CYTHON_SMALL_CODE; /*proto*/
23578 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)
23579 #if CYTHON_PEP489_MULTI_PHASE_INIT
23580 {
23581  return PyModuleDef_Init(&__pyx_moduledef);
23582 }
23583 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
23584  #if PY_VERSION_HEX >= 0x030700A1
23585  static PY_INT64_T main_interpreter_id = -1;
23586  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23587  if (main_interpreter_id == -1) {
23588  main_interpreter_id = current_id;
23589  return (unlikely(current_id == -1)) ? -1 : 0;
23590  } else if (unlikely(main_interpreter_id != current_id))
23591  #else
23592  static PyInterpreterState *main_interpreter = NULL;
23593  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23594  if (!main_interpreter) {
23595  main_interpreter = current_interpreter;
23596  } else if (unlikely(main_interpreter != current_interpreter))
23597  #endif
23598  {
23599  PyErr_SetString(
23600  PyExc_ImportError,
23601  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23602  return -1;
23603  }
23604  return 0;
23605 }
23606 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) {
23607  PyObject *value = PyObject_GetAttrString(spec, from_name);
23608  int result = 0;
23609  if (likely(value)) {
23610  if (allow_none || value != Py_None) {
23611  result = PyDict_SetItemString(moddict, to_name, value);
23612  }
23613  Py_DECREF(value);
23614  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23615  PyErr_Clear();
23616  } else {
23617  result = -1;
23618  }
23619  return result;
23620 }
23621 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23622  PyObject *module = NULL, *moddict, *modname;
23623  if (__Pyx_check_single_interpreter())
23624  return NULL;
23625  if (__pyx_m)
23626  return __Pyx_NewRef(__pyx_m);
23627  modname = PyObject_GetAttrString(spec, "name");
23628  if (unlikely(!modname)) goto bad;
23629  module = PyModule_NewObject(modname);
23630  Py_DECREF(modname);
23631  if (unlikely(!module)) goto bad;
23632  moddict = PyModule_GetDict(module);
23633  if (unlikely(!moddict)) goto bad;
23634  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
23635  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
23636  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
23637  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
23638  return module;
23639 bad:
23640  Py_XDECREF(module);
23641  return NULL;
23642 }
23643 
23644 
23645 static CYTHON_SMALL_CODE int __pyx_pymod_exec_BoundaryConditions(PyObject *__pyx_pyinit_module)
23646 #endif
23647 #endif
23648 {
23649  __Pyx_TraceDeclarations
23650  PyObject *__pyx_t_1 = NULL;
23651  static PyThread_type_lock __pyx_t_2[8];
23652  int __pyx_lineno = 0;
23653  const char *__pyx_filename = NULL;
23654  int __pyx_clineno = 0;
23655  __Pyx_RefNannyDeclarations
23656  #if CYTHON_PEP489_MULTI_PHASE_INIT
23657  if (__pyx_m) {
23658  if (__pyx_m == __pyx_pyinit_module) return 0;
23659  PyErr_SetString(PyExc_RuntimeError, "Module 'BoundaryConditions' has already been imported. Re-initialisation is not supported.");
23660  return -1;
23661  }
23662  #elif PY_MAJOR_VERSION >= 3
23663  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
23664  #endif
23665  #if CYTHON_REFNANNY
23666 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
23667 if (!__Pyx_RefNanny) {
23668  PyErr_Clear();
23669  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
23670  if (!__Pyx_RefNanny)
23671  Py_FatalError("failed to import 'refnanny' module");
23672 }
23673 #endif
23674  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", 0);
23675  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23676  #ifdef __Pxy_PyFrame_Initialize_Offsets
23677  __Pxy_PyFrame_Initialize_Offsets();
23678  #endif
23679  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23680  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23681  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23682  #ifdef __Pyx_CyFunction_USED
23683  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23684  #endif
23685  #ifdef __Pyx_FusedFunction_USED
23686  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23687  #endif
23688  #ifdef __Pyx_Coroutine_USED
23689  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23690  #endif
23691  #ifdef __Pyx_Generator_USED
23692  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23693  #endif
23694  #ifdef __Pyx_AsyncGen_USED
23695  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23696  #endif
23697  #ifdef __Pyx_StopAsyncIteration_USED
23698  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23699  #endif
23700  /*--- Library function declarations ---*/
23701  /*--- Threads initialization code ---*/
23702  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23703  PyEval_InitThreads();
23704  #endif
23705  /*--- Module creation code ---*/
23706  #if CYTHON_PEP489_MULTI_PHASE_INIT
23707  __pyx_m = __pyx_pyinit_module;
23708  Py_INCREF(__pyx_m);
23709  #else
23710  #if PY_MAJOR_VERSION < 3
23711  __pyx_m = Py_InitModule4("BoundaryConditions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23712  #else
23713  __pyx_m = PyModule_Create(&__pyx_moduledef);
23714  #endif
23715  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23716  #endif
23717  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23718  Py_INCREF(__pyx_d);
23719  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23720  Py_INCREF(__pyx_b);
23721  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23722  Py_INCREF(__pyx_cython_runtime);
23723  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23724  /*--- Initialize various global constants etc. ---*/
23725  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23726  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23727  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23728  #endif
23729  if (__pyx_module_is_main_BoundaryConditions) {
23730  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23731  }
23732  #if PY_MAJOR_VERSION >= 3
23733  {
23734  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23735  if (!PyDict_GetItemString(modules, "BoundaryConditions")) {
23736  if (unlikely(PyDict_SetItemString(modules, "BoundaryConditions", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23737  }
23738  }
23739  #endif
23740  /*--- Builtin init code ---*/
23741  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23742  /*--- Constants init code ---*/
23743  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23744  /*--- Global type/function init code ---*/
23745  (void)__Pyx_modinit_global_init_code();
23746  (void)__Pyx_modinit_variable_export_code();
23747  (void)__Pyx_modinit_function_export_code();
23748  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23749  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23750  (void)__Pyx_modinit_variable_import_code();
23751  (void)__Pyx_modinit_function_import_code();
23752  /*--- Execution code ---*/
23753  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23754  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23755  #endif
23756  __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
23757 
23758  /* "BoundaryConditions.py":9
23759  *
23760  * import cython
23761  * import numpy as np # <<<<<<<<<<<<<<
23762  * """
23763  * Module for creating boundary conditions. Imported in SpatialTools.py
23764  */
23765  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
23766  __Pyx_GOTREF(__pyx_t_1);
23767  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
23768  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23769 
23770  /* "BoundaryConditions.py":17
23771  * """
23772  *
23773  * __all__ = ['BC_Base', # <<<<<<<<<<<<<<
23774  * 'BoundaryCondition']
23775  *
23776  */
23777  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
23778  __Pyx_GOTREF(__pyx_t_1);
23779  __Pyx_INCREF(__pyx_n_s_BC_Base);
23780  __Pyx_GIVEREF(__pyx_n_s_BC_Base);
23781  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_BC_Base);
23782  __Pyx_INCREF(__pyx_n_s_BoundaryCondition);
23783  __Pyx_GIVEREF(__pyx_n_s_BoundaryCondition);
23784  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_BoundaryCondition);
23785  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
23786  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23787 
23788  /* "BoundaryConditions.py":52
23789  * # setattr(BC_Base, name, default_value)
23790  *
23791  * def getContext(self, context=None): # <<<<<<<<<<<<<<
23792  * """
23793  * Gets context from proteus.Context or
23794  */
23795  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_3getContext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base_getContext, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
23796  __Pyx_GOTREF(__pyx_t_1);
23797  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_getContext, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
23798  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23799  PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
23800 
23801  /* "(tree fragment)":1
23802  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23803  * cdef tuple state
23804  * cdef object _dict
23805  */
23806  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___reduce_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23807  __Pyx_GOTREF(__pyx_t_1);
23808  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23809  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23810  PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
23811 
23812  /* "(tree fragment)":16
23813  * else:
23814  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
23815  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23816  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
23817  */
23818  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___setstate_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
23819  __Pyx_GOTREF(__pyx_t_1);
23820  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
23821  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23822  PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
23823 
23824  /* "BoundaryConditions.py":81
23825  * self.uOfXT = None
23826  *
23827  * def init_cython(self): # <<<<<<<<<<<<<<
23828  * return self.uOfXT
23829  *
23830  */
23831  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_init_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
23832  __Pyx_GOTREF(__pyx_t_1);
23833  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_init_cython, __pyx_t_1) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
23834  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23835  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23836 
23837  /* "BoundaryConditions.py":84
23838  * return self.uOfXT
23839  *
23840  * def resetBC(self): # <<<<<<<<<<<<<<
23841  * self.uOfXT = None
23842  *
23843  */
23844  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_resetBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
23845  __Pyx_GOTREF(__pyx_t_1);
23846  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_resetBC, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
23847  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23848  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23849 
23850  /* "BoundaryConditions.py":87
23851  * self.uOfXT = None
23852  *
23853  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
23854  * """
23855  * function returning constant BC
23856  */
23857  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setConstantBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
23858  __Pyx_GOTREF(__pyx_t_1);
23859  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setConstantBC, __pyx_t_1) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
23860  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23861  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23862 
23863  /* "BoundaryConditions.py":100
23864  *
23865  *
23866  * def setLinearBC(self, a0, a): # <<<<<<<<<<<<<<
23867  * """
23868  * function returning value=a0+ax*x+ay*y+az*z
23869  */
23870  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
23871  __Pyx_GOTREF(__pyx_t_1);
23872  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearBC, __pyx_t_1) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
23873  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23874  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23875 
23876  /* "BoundaryConditions.py":115
23877  * self.uOfXT = lambda x, t, n=np.zeros(3,): a0+sum(a[:]*x[:])
23878  *
23879  * def setLinearRamp(self,t1,value): # <<<<<<<<<<<<<<
23880  * """
23881  * function setting a linear ramp from t=0 to t=t1
23882  */
23883  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearRamp, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
23884  __Pyx_GOTREF(__pyx_t_1);
23885  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearRamp, __pyx_t_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
23886  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23887  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23888 
23889  /* "(tree fragment)":1
23890  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23891  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23892  * def __setstate_cython__(self, __pyx_state):
23893  */
23894  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___reduce_cytho, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23895  __Pyx_GOTREF(__pyx_t_1);
23896  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23897  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23898 
23899  /* "(tree fragment)":3
23900  * def __reduce_cython__(self):
23901  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23902  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23903  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23904  */
23905  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___setstate_cyt, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
23906  __Pyx_GOTREF(__pyx_t_1);
23907  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
23908  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23909 
23910  /* "(tree fragment)":1
23911  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23912  * cdef object __pyx_PickleError
23913  * cdef object __pyx_result
23914  */
23915  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base, 0, __pyx_n_s_pyx_unpickle_BC_Base, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23916  __Pyx_GOTREF(__pyx_t_1);
23917  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BC_Base, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23918  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23919 
23920  /* "BoundaryConditions.py":1
23921  * #!python # <<<<<<<<<<<<<<
23922  * # distutils: language = c++
23923  * # cython: profile=True, binding=True, embedsignature=True
23924  */
23925  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23926  __Pyx_GOTREF(__pyx_t_1);
23927  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23928  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23929 
23930  /* "View.MemoryView":209
23931  * info.obj = self
23932  *
23933  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23934  *
23935  * def __dealloc__(array self):
23936  */
23937  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
23938  __Pyx_GOTREF(__pyx_t_1);
23939  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
23940  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23941  PyType_Modified(__pyx_array_type);
23942 
23943  /* "View.MemoryView":286
23944  * return self.name
23945  *
23946  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23947  * cdef strided = Enum("<strided and direct>") # default
23948  * cdef indirect = Enum("<strided and indirect>")
23949  */
23950  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
23951  __Pyx_GOTREF(__pyx_t_1);
23952  __Pyx_XGOTREF(generic);
23953  __Pyx_DECREF_SET(generic, __pyx_t_1);
23954  __Pyx_GIVEREF(__pyx_t_1);
23955  __pyx_t_1 = 0;
23956 
23957  /* "View.MemoryView":287
23958  *
23959  * cdef generic = Enum("<strided and direct or indirect>")
23960  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23961  * cdef indirect = Enum("<strided and indirect>")
23962  *
23963  */
23964  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
23965  __Pyx_GOTREF(__pyx_t_1);
23966  __Pyx_XGOTREF(strided);
23967  __Pyx_DECREF_SET(strided, __pyx_t_1);
23968  __Pyx_GIVEREF(__pyx_t_1);
23969  __pyx_t_1 = 0;
23970 
23971  /* "View.MemoryView":288
23972  * cdef generic = Enum("<strided and direct or indirect>")
23973  * cdef strided = Enum("<strided and direct>") # default
23974  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23975  *
23976  *
23977  */
23978  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
23979  __Pyx_GOTREF(__pyx_t_1);
23980  __Pyx_XGOTREF(indirect);
23981  __Pyx_DECREF_SET(indirect, __pyx_t_1);
23982  __Pyx_GIVEREF(__pyx_t_1);
23983  __pyx_t_1 = 0;
23984 
23985  /* "View.MemoryView":291
23986  *
23987  *
23988  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23989  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23990  *
23991  */
23992  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
23993  __Pyx_GOTREF(__pyx_t_1);
23994  __Pyx_XGOTREF(contiguous);
23995  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
23996  __Pyx_GIVEREF(__pyx_t_1);
23997  __pyx_t_1 = 0;
23998 
23999  /* "View.MemoryView":292
24000  *
24001  * cdef contiguous = Enum("<contiguous and direct>")
24002  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
24003  *
24004  *
24005  */
24006  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
24007  __Pyx_GOTREF(__pyx_t_1);
24008  __Pyx_XGOTREF(indirect_contiguous);
24009  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
24010  __Pyx_GIVEREF(__pyx_t_1);
24011  __pyx_t_1 = 0;
24012 
24013  /* "View.MemoryView":316
24014  *
24015  * DEF THREAD_LOCKS_PREALLOCATED = 8
24016  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
24017  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
24018  * PyThread_allocate_lock(),
24019  */
24020  __pyx_memoryview_thread_locks_used = 0;
24021 
24022  /* "View.MemoryView":317
24023  * DEF THREAD_LOCKS_PREALLOCATED = 8
24024  * cdef int __pyx_memoryview_thread_locks_used = 0
24025  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
24026  * PyThread_allocate_lock(),
24027  * PyThread_allocate_lock(),
24028  */
24029  __pyx_t_2[0] = PyThread_allocate_lock();
24030  __pyx_t_2[1] = PyThread_allocate_lock();
24031  __pyx_t_2[2] = PyThread_allocate_lock();
24032  __pyx_t_2[3] = PyThread_allocate_lock();
24033  __pyx_t_2[4] = PyThread_allocate_lock();
24034  __pyx_t_2[5] = PyThread_allocate_lock();
24035  __pyx_t_2[6] = PyThread_allocate_lock();
24036  __pyx_t_2[7] = PyThread_allocate_lock();
24037  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
24038 
24039  /* "View.MemoryView":549
24040  * info.obj = self
24041  *
24042  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24043  *
24044  *
24045  */
24046  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
24047  __Pyx_GOTREF(__pyx_t_1);
24048  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
24049  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24050  PyType_Modified(__pyx_memoryview_type);
24051 
24052  /* "View.MemoryView":995
24053  * return self.from_object
24054  *
24055  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
24056  *
24057  *
24058  */
24059  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
24060  __Pyx_GOTREF(__pyx_t_1);
24061  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
24062  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24063  PyType_Modified(__pyx_memoryviewslice_type);
24064 
24065  /* "(tree fragment)":1
24066  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
24067  * cdef object __pyx_PickleError
24068  * cdef object __pyx_result
24069  */
24070  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24071  __Pyx_GOTREF(__pyx_t_1);
24072  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24073  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24074 
24075  /* "(tree fragment)":11
24076  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
24077  * return __pyx_result
24078  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
24079  * __pyx_result.name = __pyx_state[0]
24080  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
24081  */
24082  __Pyx_TraceReturn(Py_None, 0);
24083 
24084  /*--- Wrapped vars code ---*/
24085 
24086  goto __pyx_L0;
24087  __pyx_L1_error:;
24088  __Pyx_XDECREF(__pyx_t_1);
24089  if (__pyx_m) {
24090  if (__pyx_d) {
24091  __Pyx_AddTraceback("init BoundaryConditions", __pyx_clineno, __pyx_lineno, __pyx_filename);
24092  }
24093  Py_CLEAR(__pyx_m);
24094  } else if (!PyErr_Occurred()) {
24095  PyErr_SetString(PyExc_ImportError, "init BoundaryConditions");
24096  }
24097  __pyx_L0:;
24098  __Pyx_RefNannyFinishContext();
24099  #if CYTHON_PEP489_MULTI_PHASE_INIT
24100  return (__pyx_m != NULL) ? 0 : -1;
24101  #elif PY_MAJOR_VERSION >= 3
24102  return __pyx_m;
24103  #else
24104  return;
24105  #endif
24106 }
24107 
24108 /* --- Runtime support code --- */
24109 /* Refnanny */
24110 #if CYTHON_REFNANNY
24111 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
24112  PyObject *m = NULL, *p = NULL;
24113  void *r = NULL;
24114  m = PyImport_ImportModule(modname);
24115  if (!m) goto end;
24116  p = PyObject_GetAttrString(m, "RefNannyAPI");
24117  if (!p) goto end;
24118  r = PyLong_AsVoidPtr(p);
24119 end:
24120  Py_XDECREF(p);
24121  Py_XDECREF(m);
24122  return (__Pyx_RefNannyAPIStruct *)r;
24123 }
24124 #endif
24125 
24126 /* PyObjectGetAttrStr */
24127 #if CYTHON_USE_TYPE_SLOTS
24128 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
24129  PyTypeObject* tp = Py_TYPE(obj);
24130  if (likely(tp->tp_getattro))
24131  return tp->tp_getattro(obj, attr_name);
24132 #if PY_MAJOR_VERSION < 3
24133  if (likely(tp->tp_getattr))
24134  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
24135 #endif
24136  return PyObject_GetAttr(obj, attr_name);
24137 }
24138 #endif
24139 
24140 /* GetBuiltinName */
24141 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24142  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24143  if (unlikely(!result)) {
24144  PyErr_Format(PyExc_NameError,
24145 #if PY_MAJOR_VERSION >= 3
24146  "name '%U' is not defined", name);
24147 #else
24148  "name '%.200s' is not defined", PyString_AS_STRING(name));
24149 #endif
24150  }
24151  return result;
24152 }
24153 
24154 /* RaiseDoubleKeywords */
24155 static void __Pyx_RaiseDoubleKeywordsError(
24156  const char* func_name,
24157  PyObject* kw_name)
24158 {
24159  PyErr_Format(PyExc_TypeError,
24160  #if PY_MAJOR_VERSION >= 3
24161  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24162  #else
24163  "%s() got multiple values for keyword argument '%s'", func_name,
24164  PyString_AsString(kw_name));
24165  #endif
24166 }
24167 
24168 /* ParseKeywords */
24169 static int __Pyx_ParseOptionalKeywords(
24170  PyObject *kwds,
24171  PyObject **argnames[],
24172  PyObject *kwds2,
24173  PyObject *values[],
24174  Py_ssize_t num_pos_args,
24175  const char* function_name)
24176 {
24177  PyObject *key = 0, *value = 0;
24178  Py_ssize_t pos = 0;
24179  PyObject*** name;
24180  PyObject*** first_kw_arg = argnames + num_pos_args;
24181  while (PyDict_Next(kwds, &pos, &key, &value)) {
24182  name = first_kw_arg;
24183  while (*name && (**name != key)) name++;
24184  if (*name) {
24185  values[name-argnames] = value;
24186  continue;
24187  }
24188  name = first_kw_arg;
24189  #if PY_MAJOR_VERSION < 3
24190  if (likely(PyString_Check(key))) {
24191  while (*name) {
24192  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24193  && _PyString_Eq(**name, key)) {
24194  values[name-argnames] = value;
24195  break;
24196  }
24197  name++;
24198  }
24199  if (*name) continue;
24200  else {
24201  PyObject*** argname = argnames;
24202  while (argname != first_kw_arg) {
24203  if ((**argname == key) || (
24204  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24205  && _PyString_Eq(**argname, key))) {
24206  goto arg_passed_twice;
24207  }
24208  argname++;
24209  }
24210  }
24211  } else
24212  #endif
24213  if (likely(PyUnicode_Check(key))) {
24214  while (*name) {
24215  int cmp = (**name == key) ? 0 :
24216  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24217  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24218  #endif
24219  PyUnicode_Compare(**name, key);
24220  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24221  if (cmp == 0) {
24222  values[name-argnames] = value;
24223  break;
24224  }
24225  name++;
24226  }
24227  if (*name) continue;
24228  else {
24229  PyObject*** argname = argnames;
24230  while (argname != first_kw_arg) {
24231  int cmp = (**argname == key) ? 0 :
24232  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24233  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
24234  #endif
24235  PyUnicode_Compare(**argname, key);
24236  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
24237  if (cmp == 0) goto arg_passed_twice;
24238  argname++;
24239  }
24240  }
24241  } else
24242  goto invalid_keyword_type;
24243  if (kwds2) {
24244  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
24245  } else {
24246  goto invalid_keyword;
24247  }
24248  }
24249  return 0;
24250 arg_passed_twice:
24251  __Pyx_RaiseDoubleKeywordsError(function_name, key);
24252  goto bad;
24253 invalid_keyword_type:
24254  PyErr_Format(PyExc_TypeError,
24255  "%.200s() keywords must be strings", function_name);
24256  goto bad;
24257 invalid_keyword:
24258  PyErr_Format(PyExc_TypeError,
24259  #if PY_MAJOR_VERSION < 3
24260  "%.200s() got an unexpected keyword argument '%.200s'",
24261  function_name, PyString_AsString(key));
24262  #else
24263  "%s() got an unexpected keyword argument '%U'",
24264  function_name, key);
24265  #endif
24266 bad:
24267  return -1;
24268 }
24269 
24270 /* RaiseArgTupleInvalid */
24271 static void __Pyx_RaiseArgtupleInvalid(
24272  const char* func_name,
24273  int exact,
24274  Py_ssize_t num_min,
24275  Py_ssize_t num_max,
24276  Py_ssize_t num_found)
24277 {
24278  Py_ssize_t num_expected;
24279  const char *more_or_less;
24280  if (num_found < num_min) {
24281  num_expected = num_min;
24282  more_or_less = "at least";
24283  } else {
24284  num_expected = num_max;
24285  more_or_less = "at most";
24286  }
24287  if (exact) {
24288  more_or_less = "exactly";
24289  }
24290  PyErr_Format(PyExc_TypeError,
24291  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
24292  func_name, more_or_less, num_expected,
24293  (num_expected == 1) ? "" : "s", num_found);
24294 }
24295 
24296 /* PyErrFetchRestore */
24297 #if CYTHON_FAST_THREAD_STATE
24298 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24299  PyObject *tmp_type, *tmp_value, *tmp_tb;
24300  tmp_type = tstate->curexc_type;
24301  tmp_value = tstate->curexc_value;
24302  tmp_tb = tstate->curexc_traceback;
24303  tstate->curexc_type = type;
24304  tstate->curexc_value = value;
24305  tstate->curexc_traceback = tb;
24306  Py_XDECREF(tmp_type);
24307  Py_XDECREF(tmp_value);
24308  Py_XDECREF(tmp_tb);
24309 }
24310 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24311  *type = tstate->curexc_type;
24312  *value = tstate->curexc_value;
24313  *tb = tstate->curexc_traceback;
24314  tstate->curexc_type = 0;
24315  tstate->curexc_value = 0;
24316  tstate->curexc_traceback = 0;
24317 }
24318 #endif
24319 
24320 /* Profile */
24321 #if CYTHON_PROFILE
24322 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
24323  PyFrameObject** frame,
24324  PyThreadState* tstate,
24325  const char *funcname,
24326  const char *srcfile,
24327  int firstlineno) {
24328  PyObject *type, *value, *traceback;
24329  int retval;
24330  if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
24331  if (*code == NULL) {
24332  *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
24333  if (*code == NULL) return 0;
24334  }
24335  *frame = PyFrame_New(
24336  tstate, /*PyThreadState *tstate*/
24337  *code, /*PyCodeObject *code*/
24338  __pyx_d, /*PyObject *globals*/
24339  0 /*PyObject *locals*/
24340  );
24341  if (*frame == NULL) return 0;
24342  if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
24343  Py_INCREF(Py_None);
24344  (*frame)->f_trace = Py_None;
24345  }
24346 #if PY_VERSION_HEX < 0x030400B1
24347  } else {
24348  (*frame)->f_tstate = tstate;
24349 #endif
24350  }
24351  __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
24352  retval = 1;
24353  __Pyx_EnterTracing(tstate);
24354  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
24355  #if CYTHON_TRACE
24356  if (tstate->c_tracefunc)
24357  retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
24358  if (retval && tstate->c_profilefunc)
24359  #endif
24360  retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
24361  __Pyx_LeaveTracing(tstate);
24362  if (retval) {
24363  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
24364  return __Pyx_IsTracing(tstate, 0, 0) && retval;
24365  } else {
24366  Py_XDECREF(type);
24367  Py_XDECREF(value);
24368  Py_XDECREF(traceback);
24369  return -1;
24370  }
24371 }
24372 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
24373  PyCodeObject *py_code = 0;
24374 #if PY_MAJOR_VERSION >= 3
24375  py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
24376  if (likely(py_code)) {
24377  py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
24378  }
24379 #else
24380  PyObject *py_srcfile = 0;
24381  PyObject *py_funcname = 0;
24382  py_funcname = PyString_FromString(funcname);
24383  if (unlikely(!py_funcname)) goto bad;
24384  py_srcfile = PyString_FromString(srcfile);
24385  if (unlikely(!py_srcfile)) goto bad;
24386  py_code = PyCode_New(
24387  0,
24388  0,
24389  0,
24390  CO_OPTIMIZED | CO_NEWLOCALS,
24391  __pyx_empty_bytes, /*PyObject *code,*/
24392  __pyx_empty_tuple, /*PyObject *consts,*/
24393  __pyx_empty_tuple, /*PyObject *names,*/
24394  __pyx_empty_tuple, /*PyObject *varnames,*/
24395  __pyx_empty_tuple, /*PyObject *freevars,*/
24396  __pyx_empty_tuple, /*PyObject *cellvars,*/
24397  py_srcfile, /*PyObject *filename,*/
24398  py_funcname, /*PyObject *name,*/
24399  firstlineno,
24400  __pyx_empty_bytes /*PyObject *lnotab*/
24401  );
24402 bad:
24403  Py_XDECREF(py_srcfile);
24404  Py_XDECREF(py_funcname);
24405 #endif
24406  return py_code;
24407 }
24408 #endif
24409 
24410 /* GetItemInt */
24411 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24412  PyObject *r;
24413  if (!j) return NULL;
24414  r = PyObject_GetItem(o, j);
24415  Py_DECREF(j);
24416  return r;
24417 }
24418 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24419  CYTHON_NCP_UNUSED int wraparound,
24420  CYTHON_NCP_UNUSED int boundscheck) {
24421 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24422  Py_ssize_t wrapped_i = i;
24423  if (wraparound & unlikely(i < 0)) {
24424  wrapped_i += PyList_GET_SIZE(o);
24425  }
24426  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24427  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24428  Py_INCREF(r);
24429  return r;
24430  }
24431  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24432 #else
24433  return PySequence_GetItem(o, i);
24434 #endif
24435 }
24436 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24437  CYTHON_NCP_UNUSED int wraparound,
24438  CYTHON_NCP_UNUSED int boundscheck) {
24439 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24440  Py_ssize_t wrapped_i = i;
24441  if (wraparound & unlikely(i < 0)) {
24442  wrapped_i += PyTuple_GET_SIZE(o);
24443  }
24444  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24445  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24446  Py_INCREF(r);
24447  return r;
24448  }
24449  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24450 #else
24451  return PySequence_GetItem(o, i);
24452 #endif
24453 }
24454 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
24455  CYTHON_NCP_UNUSED int wraparound,
24456  CYTHON_NCP_UNUSED int boundscheck) {
24457 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24458  if (is_list || PyList_CheckExact(o)) {
24459  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24460  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
24461  PyObject *r = PyList_GET_ITEM(o, n);
24462  Py_INCREF(r);
24463  return r;
24464  }
24465  }
24466  else if (PyTuple_CheckExact(o)) {
24467  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24468  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
24469  PyObject *r = PyTuple_GET_ITEM(o, n);
24470  Py_INCREF(r);
24471  return r;
24472  }
24473  } else {
24474  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24475  if (likely(m && m->sq_item)) {
24476  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24477  Py_ssize_t l = m->sq_length(o);
24478  if (likely(l >= 0)) {
24479  i += l;
24480  } else {
24481  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24482  return NULL;
24483  PyErr_Clear();
24484  }
24485  }
24486  return m->sq_item(o, i);
24487  }
24488  }
24489 #else
24490  if (is_list || PySequence_Check(o)) {
24491  return PySequence_GetItem(o, i);
24492  }
24493 #endif
24494  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24495 }
24496 
24497 /* ObjectGetItem */
24498 #if CYTHON_USE_TYPE_SLOTS
24499 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24500  PyObject *runerr;
24501  Py_ssize_t key_value;
24502  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24503  if (unlikely(!(m && m->sq_item))) {
24504  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24505  return NULL;
24506  }
24507  key_value = __Pyx_PyIndex_AsSsize_t(index);
24508  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24509  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24510  }
24511  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24512  PyErr_Clear();
24513  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24514  }
24515  return NULL;
24516 }
24517 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24518  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24519  if (likely(m && m->mp_subscript)) {
24520  return m->mp_subscript(obj, key);
24521  }
24522  return __Pyx_PyObject_GetIndex(obj, key);
24523 }
24524 #endif
24525 
24526 /* MemviewSliceInit */
24527 static int
24528 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
24529  int ndim,
24530  __Pyx_memviewslice *memviewslice,
24531  int memview_is_new_reference)
24532 {
24533  __Pyx_RefNannyDeclarations
24534  int i, retval=-1;
24535  Py_buffer *buf = &memview->view;
24536  __Pyx_RefNannySetupContext("init_memviewslice", 0);
24537  if (unlikely(memviewslice->memview || memviewslice->data)) {
24538  PyErr_SetString(PyExc_ValueError,
24539  "memviewslice is already initialized!");
24540  goto fail;
24541  }
24542  if (buf->strides) {
24543  for (i = 0; i < ndim; i++) {
24544  memviewslice->strides[i] = buf->strides[i];
24545  }
24546  } else {
24547  Py_ssize_t stride = buf->itemsize;
24548  for (i = ndim - 1; i >= 0; i--) {
24549  memviewslice->strides[i] = stride;
24550  stride *= buf->shape[i];
24551  }
24552  }
24553  for (i = 0; i < ndim; i++) {
24554  memviewslice->shape[i] = buf->shape[i];
24555  if (buf->suboffsets) {
24556  memviewslice->suboffsets[i] = buf->suboffsets[i];
24557  } else {
24558  memviewslice->suboffsets[i] = -1;
24559  }
24560  }
24561  memviewslice->memview = memview;
24562  memviewslice->data = (char *)buf->buf;
24563  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24564  Py_INCREF(memview);
24565  }
24566  retval = 0;
24567  goto no_fail;
24568 fail:
24569  memviewslice->memview = 0;
24570  memviewslice->data = 0;
24571  retval = -1;
24572 no_fail:
24573  __Pyx_RefNannyFinishContext();
24574  return retval;
24575 }
24576 #ifndef Py_NO_RETURN
24577 #define Py_NO_RETURN
24578 #endif
24579 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
24580  va_list vargs;
24581  char msg[200];
24582 #ifdef HAVE_STDARG_PROTOTYPES
24583  va_start(vargs, fmt);
24584 #else
24585  va_start(vargs);
24586 #endif
24587  vsnprintf(msg, 200, fmt, vargs);
24588  va_end(vargs);
24589  Py_FatalError(msg);
24590 }
24591 static CYTHON_INLINE int
24592 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24593  PyThread_type_lock lock)
24594 {
24595  int result;
24596  PyThread_acquire_lock(lock, 1);
24597  result = (*acquisition_count)++;
24598  PyThread_release_lock(lock);
24599  return result;
24600 }
24601 static CYTHON_INLINE int
24602 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24603  PyThread_type_lock lock)
24604 {
24605  int result;
24606  PyThread_acquire_lock(lock, 1);
24607  result = (*acquisition_count)--;
24608  PyThread_release_lock(lock);
24609  return result;
24610 }
24611 static CYTHON_INLINE void
24612 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
24613 {
24614  int first_time;
24615  struct __pyx_memoryview_obj *memview = memslice->memview;
24616  if (unlikely(!memview || (PyObject *) memview == Py_None))
24617  return;
24618  if (unlikely(__pyx_get_slice_count(memview) < 0))
24619  __pyx_fatalerror("Acquisition count is %d (line %d)",
24620  __pyx_get_slice_count(memview), lineno);
24621  first_time = __pyx_add_acquisition_count(memview) == 0;
24622  if (unlikely(first_time)) {
24623  if (have_gil) {
24624  Py_INCREF((PyObject *) memview);
24625  } else {
24626  PyGILState_STATE _gilstate = PyGILState_Ensure();
24627  Py_INCREF((PyObject *) memview);
24628  PyGILState_Release(_gilstate);
24629  }
24630  }
24631 }
24632 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24633  int have_gil, int lineno) {
24634  int last_time;
24635  struct __pyx_memoryview_obj *memview = memslice->memview;
24636  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24637  memslice->memview = NULL;
24638  return;
24639  }
24640  if (unlikely(__pyx_get_slice_count(memview) <= 0))
24641  __pyx_fatalerror("Acquisition count is %d (line %d)",
24642  __pyx_get_slice_count(memview), lineno);
24643  last_time = __pyx_sub_acquisition_count(memview) == 1;
24644  memslice->data = NULL;
24645  if (unlikely(last_time)) {
24646  if (have_gil) {
24647  Py_CLEAR(memslice->memview);
24648  } else {
24649  PyGILState_STATE _gilstate = PyGILState_Ensure();
24650  Py_CLEAR(memslice->memview);
24651  PyGILState_Release(_gilstate);
24652  }
24653  } else {
24654  memslice->memview = NULL;
24655  }
24656 }
24657 
24658 /* Import */
24659 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
24660  PyObject *empty_list = 0;
24661  PyObject *module = 0;
24662  PyObject *global_dict = 0;
24663  PyObject *empty_dict = 0;
24664  PyObject *list;
24665  #if PY_MAJOR_VERSION < 3
24666  PyObject *py_import;
24667  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
24668  if (!py_import)
24669  goto bad;
24670  #endif
24671  if (from_list)
24672  list = from_list;
24673  else {
24674  empty_list = PyList_New(0);
24675  if (!empty_list)
24676  goto bad;
24677  list = empty_list;
24678  }
24679  global_dict = PyModule_GetDict(__pyx_m);
24680  if (!global_dict)
24681  goto bad;
24682  empty_dict = PyDict_New();
24683  if (!empty_dict)
24684  goto bad;
24685  {
24686  #if PY_MAJOR_VERSION >= 3
24687  if (level == -1) {
24688  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
24689  module = PyImport_ImportModuleLevelObject(
24690  name, global_dict, empty_dict, list, 1);
24691  if (!module) {
24692  if (!PyErr_ExceptionMatches(PyExc_ImportError))
24693  goto bad;
24694  PyErr_Clear();
24695  }
24696  }
24697  level = 0;
24698  }
24699  #endif
24700  if (!module) {
24701  #if PY_MAJOR_VERSION < 3
24702  PyObject *py_level = PyInt_FromLong(level);
24703  if (!py_level)
24704  goto bad;
24705  module = PyObject_CallFunctionObjArgs(py_import,
24706  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
24707  Py_DECREF(py_level);
24708  #else
24709  module = PyImport_ImportModuleLevelObject(
24710  name, global_dict, empty_dict, list, level);
24711  #endif
24712  }
24713  }
24714 bad:
24715  #if PY_MAJOR_VERSION < 3
24716  Py_XDECREF(py_import);
24717  #endif
24718  Py_XDECREF(empty_list);
24719  Py_XDECREF(empty_dict);
24720  return module;
24721 }
24722 
24723 /* ImportFrom */
24724 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
24725  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
24726  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
24727  PyErr_Format(PyExc_ImportError,
24728  #if PY_MAJOR_VERSION < 3
24729  "cannot import name %.230s", PyString_AS_STRING(name));
24730  #else
24731  "cannot import name %S", name);
24732  #endif
24733  }
24734  return value;
24735 }
24736 
24737 /* PyFunctionFastCall */
24738 #if CYTHON_FAST_PYCALL
24739 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24740  PyObject *globals) {
24741  PyFrameObject *f;
24742  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24743  PyObject **fastlocals;
24744  Py_ssize_t i;
24745  PyObject *result;
24746  assert(globals != NULL);
24747  /* XXX Perhaps we should create a specialized
24748  PyFrame_New() that doesn't take locals, but does
24749  take builtins without sanity checking them.
24750  */
24751  assert(tstate != NULL);
24752  f = PyFrame_New(tstate, co, globals, NULL);
24753  if (f == NULL) {
24754  return NULL;
24755  }
24756  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
24757  for (i = 0; i < na; i++) {
24758  Py_INCREF(*args);
24759  fastlocals[i] = *args++;
24760  }
24761  result = PyEval_EvalFrameEx(f,0);
24762  ++tstate->recursion_depth;
24763  Py_DECREF(f);
24764  --tstate->recursion_depth;
24765  return result;
24766 }
24767 #if 1 || PY_VERSION_HEX < 0x030600B1
24768 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24769  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24770  PyObject *globals = PyFunction_GET_GLOBALS(func);
24771  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24772  PyObject *closure;
24773 #if PY_MAJOR_VERSION >= 3
24774  PyObject *kwdefs;
24775 #endif
24776  PyObject *kwtuple, **k;
24777  PyObject **d;
24778  Py_ssize_t nd;
24779  Py_ssize_t nk;
24780  PyObject *result;
24781  assert(kwargs == NULL || PyDict_Check(kwargs));
24782  nk = kwargs ? PyDict_Size(kwargs) : 0;
24783  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
24784  return NULL;
24785  }
24786  if (
24787 #if PY_MAJOR_VERSION >= 3
24788  co->co_kwonlyargcount == 0 &&
24789 #endif
24790  likely(kwargs == NULL || nk == 0) &&
24791  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24792  if (argdefs == NULL && co->co_argcount == nargs) {
24793  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24794  goto done;
24795  }
24796  else if (nargs == 0 && argdefs != NULL
24797  && co->co_argcount == Py_SIZE(argdefs)) {
24798  /* function called with no arguments, but all parameters have
24799  a default value: use default values as arguments .*/
24800  args = &PyTuple_GET_ITEM(argdefs, 0);
24801  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24802  goto done;
24803  }
24804  }
24805  if (kwargs != NULL) {
24806  Py_ssize_t pos, i;
24807  kwtuple = PyTuple_New(2 * nk);
24808  if (kwtuple == NULL) {
24809  result = NULL;
24810  goto done;
24811  }
24812  k = &PyTuple_GET_ITEM(kwtuple, 0);
24813  pos = i = 0;
24814  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24815  Py_INCREF(k[i]);
24816  Py_INCREF(k[i+1]);
24817  i += 2;
24818  }
24819  nk = i / 2;
24820  }
24821  else {
24822  kwtuple = NULL;
24823  k = NULL;
24824  }
24825  closure = PyFunction_GET_CLOSURE(func);
24826 #if PY_MAJOR_VERSION >= 3
24827  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24828 #endif
24829  if (argdefs != NULL) {
24830  d = &PyTuple_GET_ITEM(argdefs, 0);
24831  nd = Py_SIZE(argdefs);
24832  }
24833  else {
24834  d = NULL;
24835  nd = 0;
24836  }
24837 #if PY_MAJOR_VERSION >= 3
24838  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24839  args, (int)nargs,
24840  k, (int)nk,
24841  d, (int)nd, kwdefs, closure);
24842 #else
24843  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24844  args, (int)nargs,
24845  k, (int)nk,
24846  d, (int)nd, closure);
24847 #endif
24848  Py_XDECREF(kwtuple);
24849 done:
24850  Py_LeaveRecursiveCall();
24851  return result;
24852 }
24853 #endif
24854 #endif
24855 
24856 /* PyObjectCall */
24857 #if CYTHON_COMPILING_IN_CPYTHON
24858 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24859  PyObject *result;
24860  ternaryfunc call = Py_TYPE(func)->tp_call;
24861  if (unlikely(!call))
24862  return PyObject_Call(func, arg, kw);
24863  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24864  return NULL;
24865  result = (*call)(func, arg, kw);
24866  Py_LeaveRecursiveCall();
24867  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24868  PyErr_SetString(
24869  PyExc_SystemError,
24870  "NULL result without error in PyObject_Call");
24871  }
24872  return result;
24873 }
24874 #endif
24875 
24876 /* PyObjectCallMethO */
24877 #if CYTHON_COMPILING_IN_CPYTHON
24878 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24879  PyObject *self, *result;
24880  PyCFunction cfunc;
24881  cfunc = PyCFunction_GET_FUNCTION(func);
24882  self = PyCFunction_GET_SELF(func);
24883  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24884  return NULL;
24885  result = cfunc(self, arg);
24886  Py_LeaveRecursiveCall();
24887  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24888  PyErr_SetString(
24889  PyExc_SystemError,
24890  "NULL result without error in PyObject_Call");
24891  }
24892  return result;
24893 }
24894 #endif
24895 
24896 /* PyObjectCallNoArg */
24897 #if CYTHON_COMPILING_IN_CPYTHON
24898 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24899 #if CYTHON_FAST_PYCALL
24900  if (PyFunction_Check(func)) {
24901  return __Pyx_PyFunction_FastCall(func, NULL, 0);
24902  }
24903 #endif
24904 #ifdef __Pyx_CyFunction_USED
24905  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24906 #else
24907  if (likely(PyCFunction_Check(func)))
24908 #endif
24909  {
24910  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24911  return __Pyx_PyObject_CallMethO(func, NULL);
24912  }
24913  }
24914  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24915 }
24916 #endif
24917 
24918 /* PyCFunctionFastCall */
24919 #if CYTHON_FAST_PYCCALL
24920 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24921  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24922  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24923  PyObject *self = PyCFunction_GET_SELF(func);
24924  int flags = PyCFunction_GET_FLAGS(func);
24925  assert(PyCFunction_Check(func));
24926  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24927  assert(nargs >= 0);
24928  assert(nargs == 0 || args != NULL);
24929  /* _PyCFunction_FastCallDict() must not be called with an exception set,
24930  because it may clear it (directly or indirectly) and so the
24931  caller loses its exception */
24932  assert(!PyErr_Occurred());
24933  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24934  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
24935  } else {
24936  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
24937  }
24938 }
24939 #endif
24940 
24941 /* PyObjectCallOneArg */
24942 #if CYTHON_COMPILING_IN_CPYTHON
24943 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24944  PyObject *result;
24945  PyObject *args = PyTuple_New(1);
24946  if (unlikely(!args)) return NULL;
24947  Py_INCREF(arg);
24948  PyTuple_SET_ITEM(args, 0, arg);
24949  result = __Pyx_PyObject_Call(func, args, NULL);
24950  Py_DECREF(args);
24951  return result;
24952 }
24953 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24954 #if CYTHON_FAST_PYCALL
24955  if (PyFunction_Check(func)) {
24956  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24957  }
24958 #endif
24959  if (likely(PyCFunction_Check(func))) {
24960  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24961  return __Pyx_PyObject_CallMethO(func, arg);
24962 #if CYTHON_FAST_PYCCALL
24963  } else if (__Pyx_PyFastCFunction_Check(func)) {
24964  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24965 #endif
24966  }
24967  }
24968  return __Pyx__PyObject_CallOneArg(func, arg);
24969 }
24970 #else
24971 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24972  PyObject *result;
24973  PyObject *args = PyTuple_Pack(1, arg);
24974  if (unlikely(!args)) return NULL;
24975  result = __Pyx_PyObject_Call(func, args, NULL);
24976  Py_DECREF(args);
24977  return result;
24978 }
24979 #endif
24980 
24981 /* PyErrExceptionMatches */
24982 #if CYTHON_FAST_THREAD_STATE
24983 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24984  Py_ssize_t i, n;
24985  n = PyTuple_GET_SIZE(tuple);
24986 #if PY_MAJOR_VERSION >= 3
24987  for (i=0; i<n; i++) {
24988  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24989  }
24990 #endif
24991  for (i=0; i<n; i++) {
24992  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
24993  }
24994  return 0;
24995 }
24996 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24997  PyObject *exc_type = tstate->curexc_type;
24998  if (exc_type == err) return 1;
24999  if (unlikely(!exc_type)) return 0;
25000  if (unlikely(PyTuple_Check(err)))
25001  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
25002  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
25003 }
25004 #endif
25005 
25006 /* GetAttr */
25007 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
25008 #if CYTHON_USE_TYPE_SLOTS
25009 #if PY_MAJOR_VERSION >= 3
25010  if (likely(PyUnicode_Check(n)))
25011 #else
25012  if (likely(PyString_Check(n)))
25013 #endif
25014  return __Pyx_PyObject_GetAttrStr(o, n);
25015 #endif
25016  return PyObject_GetAttr(o, n);
25017 }
25018 
25019 /* GetAttr3 */
25020 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
25021  __Pyx_PyThreadState_declare
25022  __Pyx_PyThreadState_assign
25023  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25024  return NULL;
25025  __Pyx_PyErr_Clear();
25026  Py_INCREF(d);
25027  return d;
25028 }
25029 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
25030  PyObject *r = __Pyx_GetAttr(o, n);
25031  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
25032 }
25033 
25034 /* PyDictVersioning */
25035 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
25036 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
25037  PyObject *dict = Py_TYPE(obj)->tp_dict;
25038  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
25039 }
25040 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
25041  PyObject **dictptr = NULL;
25042  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
25043  if (offset) {
25044 #if CYTHON_COMPILING_IN_CPYTHON
25045  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
25046 #else
25047  dictptr = _PyObject_GetDictPtr(obj);
25048 #endif
25049  }
25050  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
25051 }
25052 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
25053  PyObject *dict = Py_TYPE(obj)->tp_dict;
25054  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
25055  return 0;
25056  return obj_dict_version == __Pyx_get_object_dict_version(obj);
25057 }
25058 #endif
25059 
25060 /* GetModuleGlobalName */
25061 #if CYTHON_USE_DICT_VERSIONS
25062 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
25063 #else
25064 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
25065 #endif
25066 {
25067  PyObject *result;
25068 #if !CYTHON_AVOID_BORROWED_REFS
25069 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
25070  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
25071  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25072  if (likely(result)) {
25073  return __Pyx_NewRef(result);
25074  } else if (unlikely(PyErr_Occurred())) {
25075  return NULL;
25076  }
25077 #else
25078  result = PyDict_GetItem(__pyx_d, name);
25079  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25080  if (likely(result)) {
25081  return __Pyx_NewRef(result);
25082  }
25083 #endif
25084 #else
25085  result = PyObject_GetItem(__pyx_d, name);
25086  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
25087  if (likely(result)) {
25088  return __Pyx_NewRef(result);
25089  }
25090  PyErr_Clear();
25091 #endif
25092  return __Pyx_GetBuiltinName(name);
25093 }
25094 
25095 /* KeywordStringCheck */
25096 static int __Pyx_CheckKeywordStrings(
25097  PyObject *kwdict,
25098  const char* function_name,
25099  int kw_allowed)
25100 {
25101  PyObject* key = 0;
25102  Py_ssize_t pos = 0;
25103 #if CYTHON_COMPILING_IN_PYPY
25104  if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
25105  goto invalid_keyword;
25106  return 1;
25107 #else
25108  while (PyDict_Next(kwdict, &pos, &key, 0)) {
25109  #if PY_MAJOR_VERSION < 3
25110  if (unlikely(!PyString_Check(key)))
25111  #endif
25112  if (unlikely(!PyUnicode_Check(key)))
25113  goto invalid_keyword_type;
25114  }
25115  if ((!kw_allowed) && unlikely(key))
25116  goto invalid_keyword;
25117  return 1;
25118 invalid_keyword_type:
25119  PyErr_Format(PyExc_TypeError,
25120  "%.200s() keywords must be strings", function_name);
25121  return 0;
25122 #endif
25123 invalid_keyword:
25124  PyErr_Format(PyExc_TypeError,
25125  #if PY_MAJOR_VERSION < 3
25126  "%.200s() got an unexpected keyword argument '%.200s'",
25127  function_name, PyString_AsString(key));
25128  #else
25129  "%s() got an unexpected keyword argument '%U'",
25130  function_name, key);
25131  #endif
25132  return 0;
25133 }
25134 
25135 /* WriteUnraisableException */
25136 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
25137  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
25138  int full_traceback, CYTHON_UNUSED int nogil) {
25139  PyObject *old_exc, *old_val, *old_tb;
25140  PyObject *ctx;
25141  __Pyx_PyThreadState_declare
25142 #ifdef WITH_THREAD
25143  PyGILState_STATE state;
25144  if (nogil)
25145  state = PyGILState_Ensure();
25146 #ifdef _MSC_VER
25147  else state = (PyGILState_STATE)-1;
25148 #endif
25149 #endif
25150  __Pyx_PyThreadState_assign
25151  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
25152  if (full_traceback) {
25153  Py_XINCREF(old_exc);
25154  Py_XINCREF(old_val);
25155  Py_XINCREF(old_tb);
25156  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25157  PyErr_PrintEx(1);
25158  }
25159  #if PY_MAJOR_VERSION < 3
25160  ctx = PyString_FromString(name);
25161  #else
25162  ctx = PyUnicode_FromString(name);
25163  #endif
25164  __Pyx_ErrRestore(old_exc, old_val, old_tb);
25165  if (!ctx) {
25166  PyErr_WriteUnraisable(Py_None);
25167  } else {
25168  PyErr_WriteUnraisable(ctx);
25169  Py_DECREF(ctx);
25170  }
25171 #ifdef WITH_THREAD
25172  if (nogil)
25173  PyGILState_Release(state);
25174 #endif
25175 }
25176 
25177 /* None */
25178 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
25179  PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
25180 }
25181 
25182 /* FetchCommonType */
25183 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25184  PyObject* fake_module;
25185  PyTypeObject* cached_type = NULL;
25186  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
25187  if (!fake_module) return NULL;
25188  Py_INCREF(fake_module);
25189  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25190  if (cached_type) {
25191  if (!PyType_Check((PyObject*)cached_type)) {
25192  PyErr_Format(PyExc_TypeError,
25193  "Shared Cython type %.200s is not a type object",
25194  type->tp_name);
25195  goto bad;
25196  }
25197  if (cached_type->tp_basicsize != type->tp_basicsize) {
25198  PyErr_Format(PyExc_TypeError,
25199  "Shared Cython type %.200s has the wrong size, try recompiling",
25200  type->tp_name);
25201  goto bad;
25202  }
25203  } else {
25204  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
25205  PyErr_Clear();
25206  if (PyType_Ready(type) < 0) goto bad;
25207  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25208  goto bad;
25209  Py_INCREF(type);
25210  cached_type = type;
25211  }
25212 done:
25213  Py_DECREF(fake_module);
25214  return cached_type;
25215 bad:
25216  Py_XDECREF(cached_type);
25217  cached_type = NULL;
25218  goto done;
25219 }
25220 
25221 /* CythonFunctionShared */
25222 #include <structmember.h>
25223 static PyObject *
25224 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
25225 {
25226  if (unlikely(op->func_doc == NULL)) {
25227  if (op->func.m_ml->ml_doc) {
25228 #if PY_MAJOR_VERSION >= 3
25229  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25230 #else
25231  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25232 #endif
25233  if (unlikely(op->func_doc == NULL))
25234  return NULL;
25235  } else {
25236  Py_INCREF(Py_None);
25237  return Py_None;
25238  }
25239  }
25240  Py_INCREF(op->func_doc);
25241  return op->func_doc;
25242 }
25243 static int
25244 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25245 {
25246  PyObject *tmp = op->func_doc;
25247  if (value == NULL) {
25248  value = Py_None;
25249  }
25250  Py_INCREF(value);
25251  op->func_doc = value;
25252  Py_XDECREF(tmp);
25253  return 0;
25254 }
25255 static PyObject *
25256 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25257 {
25258  if (unlikely(op->func_name == NULL)) {
25259 #if PY_MAJOR_VERSION >= 3
25260  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25261 #else
25262  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25263 #endif
25264  if (unlikely(op->func_name == NULL))
25265  return NULL;
25266  }
25267  Py_INCREF(op->func_name);
25268  return op->func_name;
25269 }
25270 static int
25271 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25272 {
25273  PyObject *tmp;
25274 #if PY_MAJOR_VERSION >= 3
25275  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25276 #else
25277  if (unlikely(value == NULL || !PyString_Check(value)))
25278 #endif
25279  {
25280  PyErr_SetString(PyExc_TypeError,
25281  "__name__ must be set to a string object");
25282  return -1;
25283  }
25284  tmp = op->func_name;
25285  Py_INCREF(value);
25286  op->func_name = value;
25287  Py_XDECREF(tmp);
25288  return 0;
25289 }
25290 static PyObject *
25291 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25292 {
25293  Py_INCREF(op->func_qualname);
25294  return op->func_qualname;
25295 }
25296 static int
25297 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25298 {
25299  PyObject *tmp;
25300 #if PY_MAJOR_VERSION >= 3
25301  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25302 #else
25303  if (unlikely(value == NULL || !PyString_Check(value)))
25304 #endif
25305  {
25306  PyErr_SetString(PyExc_TypeError,
25307  "__qualname__ must be set to a string object");
25308  return -1;
25309  }
25310  tmp = op->func_qualname;
25311  Py_INCREF(value);
25312  op->func_qualname = value;
25313  Py_XDECREF(tmp);
25314  return 0;
25315 }
25316 static PyObject *
25317 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
25318 {
25319  PyObject *self;
25320  self = m->func_closure;
25321  if (self == NULL)
25322  self = Py_None;
25323  Py_INCREF(self);
25324  return self;
25325 }
25326 static PyObject *
25327 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25328 {
25329  if (unlikely(op->func_dict == NULL)) {
25330  op->func_dict = PyDict_New();
25331  if (unlikely(op->func_dict == NULL))
25332  return NULL;
25333  }
25334  Py_INCREF(op->func_dict);
25335  return op->func_dict;
25336 }
25337 static int
25338 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25339 {
25340  PyObject *tmp;
25341  if (unlikely(value == NULL)) {
25342  PyErr_SetString(PyExc_TypeError,
25343  "function's dictionary may not be deleted");
25344  return -1;
25345  }
25346  if (unlikely(!PyDict_Check(value))) {
25347  PyErr_SetString(PyExc_TypeError,
25348  "setting function's dictionary to a non-dict");
25349  return -1;
25350  }
25351  tmp = op->func_dict;
25352  Py_INCREF(value);
25353  op->func_dict = value;
25354  Py_XDECREF(tmp);
25355  return 0;
25356 }
25357 static PyObject *
25358 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25359 {
25360  Py_INCREF(op->func_globals);
25361  return op->func_globals;
25362 }
25363 static PyObject *
25364 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25365 {
25366  Py_INCREF(Py_None);
25367  return Py_None;
25368 }
25369 static PyObject *
25370 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25371 {
25372  PyObject* result = (op->func_code) ? op->func_code : Py_None;
25373  Py_INCREF(result);
25374  return result;
25375 }
25376 static int
25377 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25378  int result = 0;
25379  PyObject *res = op->defaults_getter((PyObject *) op);
25380  if (unlikely(!res))
25381  return -1;
25382  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25383  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25384  Py_INCREF(op->defaults_tuple);
25385  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25386  Py_INCREF(op->defaults_kwdict);
25387  #else
25388  op->defaults_tuple = PySequence_ITEM(res, 0);
25389  if (unlikely(!op->defaults_tuple)) result = -1;
25390  else {
25391  op->defaults_kwdict = PySequence_ITEM(res, 1);
25392  if (unlikely(!op->defaults_kwdict)) result = -1;
25393  }
25394  #endif
25395  Py_DECREF(res);
25396  return result;
25397 }
25398 static int
25399 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25400  PyObject* tmp;
25401  if (!value) {
25402  value = Py_None;
25403  } else if (value != Py_None && !PyTuple_Check(value)) {
25404  PyErr_SetString(PyExc_TypeError,
25405  "__defaults__ must be set to a tuple object");
25406  return -1;
25407  }
25408  Py_INCREF(value);
25409  tmp = op->defaults_tuple;
25410  op->defaults_tuple = value;
25411  Py_XDECREF(tmp);
25412  return 0;
25413 }
25414 static PyObject *
25415 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25416  PyObject* result = op->defaults_tuple;
25417  if (unlikely(!result)) {
25418  if (op->defaults_getter) {
25419  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25420  result = op->defaults_tuple;
25421  } else {
25422  result = Py_None;
25423  }
25424  }
25425  Py_INCREF(result);
25426  return result;
25427 }
25428 static int
25429 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25430  PyObject* tmp;
25431  if (!value) {
25432  value = Py_None;
25433  } else if (value != Py_None && !PyDict_Check(value)) {
25434  PyErr_SetString(PyExc_TypeError,
25435  "__kwdefaults__ must be set to a dict object");
25436  return -1;
25437  }
25438  Py_INCREF(value);
25439  tmp = op->defaults_kwdict;
25440  op->defaults_kwdict = value;
25441  Py_XDECREF(tmp);
25442  return 0;
25443 }
25444 static PyObject *
25445 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25446  PyObject* result = op->defaults_kwdict;
25447  if (unlikely(!result)) {
25448  if (op->defaults_getter) {
25449  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25450  result = op->defaults_kwdict;
25451  } else {
25452  result = Py_None;
25453  }
25454  }
25455  Py_INCREF(result);
25456  return result;
25457 }
25458 static int
25459 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25460  PyObject* tmp;
25461  if (!value || value == Py_None) {
25462  value = NULL;
25463  } else if (!PyDict_Check(value)) {
25464  PyErr_SetString(PyExc_TypeError,
25465  "__annotations__ must be set to a dict object");
25466  return -1;
25467  }
25468  Py_XINCREF(value);
25469  tmp = op->func_annotations;
25470  op->func_annotations = value;
25471  Py_XDECREF(tmp);
25472  return 0;
25473 }
25474 static PyObject *
25475 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25476  PyObject* result = op->func_annotations;
25477  if (unlikely(!result)) {
25478  result = PyDict_New();
25479  if (unlikely(!result)) return NULL;
25480  op->func_annotations = result;
25481  }
25482  Py_INCREF(result);
25483  return result;
25484 }
25485 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25486  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25487  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25488  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25489  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25490  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25491  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25492  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25493  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25494  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25495  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25496  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25497  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25498  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25499  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25500  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25501  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25502  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25503  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25504  {0, 0, 0, 0, 0}
25505 };
25506 static PyMemberDef __pyx_CyFunction_members[] = {
25507  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25508  {0, 0, 0, 0, 0}
25509 };
25510 static PyObject *
25511 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25512 {
25513 #if PY_MAJOR_VERSION >= 3
25514  Py_INCREF(m->func_qualname);
25515  return m->func_qualname;
25516 #else
25517  return PyString_FromString(m->func.m_ml->ml_name);
25518 #endif
25519 }
25520 static PyMethodDef __pyx_CyFunction_methods[] = {
25521  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
25522  {0, 0, 0, 0}
25523 };
25524 #if PY_VERSION_HEX < 0x030500A0
25525 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
25526 #else
25527 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
25528 #endif
25529 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
25530  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25531  if (unlikely(op == NULL))
25532  return NULL;
25533  op->flags = flags;
25534  __Pyx_CyFunction_weakreflist(op) = NULL;
25535  op->func.m_ml = ml;
25536  op->func.m_self = (PyObject *) op;
25537  Py_XINCREF(closure);
25538  op->func_closure = closure;
25539  Py_XINCREF(module);
25540  op->func.m_module = module;
25541  op->func_dict = NULL;
25542  op->func_name = NULL;
25543  Py_INCREF(qualname);
25544  op->func_qualname = qualname;
25545  op->func_doc = NULL;
25546  op->func_classobj = NULL;
25547  op->func_globals = globals;
25548  Py_INCREF(op->func_globals);
25549  Py_XINCREF(code);
25550  op->func_code = code;
25551  op->defaults_pyobjects = 0;
25552  op->defaults_size = 0;
25553  op->defaults = NULL;
25554  op->defaults_tuple = NULL;
25555  op->defaults_kwdict = NULL;
25556  op->defaults_getter = NULL;
25557  op->func_annotations = NULL;
25558  return (PyObject *) op;
25559 }
25560 static int
25561 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25562 {
25563  Py_CLEAR(m->func_closure);
25564  Py_CLEAR(m->func.m_module);
25565  Py_CLEAR(m->func_dict);
25566  Py_CLEAR(m->func_name);
25567  Py_CLEAR(m->func_qualname);
25568  Py_CLEAR(m->func_doc);
25569  Py_CLEAR(m->func_globals);
25570  Py_CLEAR(m->func_code);
25571  Py_CLEAR(m->func_classobj);
25572  Py_CLEAR(m->defaults_tuple);
25573  Py_CLEAR(m->defaults_kwdict);
25574  Py_CLEAR(m->func_annotations);
25575  if (m->defaults) {
25576  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25577  int i;
25578  for (i = 0; i < m->defaults_pyobjects; i++)
25579  Py_XDECREF(pydefaults[i]);
25580  PyObject_Free(m->defaults);
25581  m->defaults = NULL;
25582  }
25583  return 0;
25584 }
25585 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
25586 {
25587  if (__Pyx_CyFunction_weakreflist(m) != NULL)
25588  PyObject_ClearWeakRefs((PyObject *) m);
25589  __Pyx_CyFunction_clear(m);
25590  PyObject_GC_Del(m);
25591 }
25592 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
25593 {
25594  PyObject_GC_UnTrack(m);
25595  __Pyx__CyFunction_dealloc(m);
25596 }
25597 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
25598 {
25599  Py_VISIT(m->func_closure);
25600  Py_VISIT(m->func.m_module);
25601  Py_VISIT(m->func_dict);
25602  Py_VISIT(m->func_name);
25603  Py_VISIT(m->func_qualname);
25604  Py_VISIT(m->func_doc);
25605  Py_VISIT(m->func_globals);
25606  Py_VISIT(m->func_code);
25607  Py_VISIT(m->func_classobj);
25608  Py_VISIT(m->defaults_tuple);
25609  Py_VISIT(m->defaults_kwdict);
25610  if (m->defaults) {
25611  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25612  int i;
25613  for (i = 0; i < m->defaults_pyobjects; i++)
25614  Py_VISIT(pydefaults[i]);
25615  }
25616  return 0;
25617 }
25618 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
25619 {
25620 #if PY_MAJOR_VERSION < 3
25621  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25622  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
25623  Py_INCREF(func);
25624  return func;
25625  }
25626  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
25627  if (type == NULL)
25628  type = (PyObject *)(Py_TYPE(obj));
25629  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
25630  }
25631  if (obj == Py_None)
25632  obj = NULL;
25633 #endif
25634  return __Pyx_PyMethod_New(func, obj, type);
25635 }
25636 static PyObject*
25637 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
25638 {
25639 #if PY_MAJOR_VERSION >= 3
25640  return PyUnicode_FromFormat("<cyfunction %U at %p>",
25641  op->func_qualname, (void *)op);
25642 #else
25643  return PyString_FromFormat("<cyfunction %s at %p>",
25644  PyString_AsString(op->func_qualname), (void *)op);
25645 #endif
25646 }
25647 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
25648  PyCFunctionObject* f = (PyCFunctionObject*)func;
25649  PyCFunction meth = f->m_ml->ml_meth;
25650  Py_ssize_t size;
25651  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
25652  case METH_VARARGS:
25653  if (likely(kw == NULL || PyDict_Size(kw) == 0))
25654  return (*meth)(self, arg);
25655  break;
25656  case METH_VARARGS | METH_KEYWORDS:
25657  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
25658  case METH_NOARGS:
25659  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25660  size = PyTuple_GET_SIZE(arg);
25661  if (likely(size == 0))
25662  return (*meth)(self, NULL);
25663  PyErr_Format(PyExc_TypeError,
25664  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
25665  f->m_ml->ml_name, size);
25666  return NULL;
25667  }
25668  break;
25669  case METH_O:
25670  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25671  size = PyTuple_GET_SIZE(arg);
25672  if (likely(size == 1)) {
25673  PyObject *result, *arg0;
25674  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25675  arg0 = PyTuple_GET_ITEM(arg, 0);
25676  #else
25677  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
25678  #endif
25679  result = (*meth)(self, arg0);
25680  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
25681  Py_DECREF(arg0);
25682  #endif
25683  return result;
25684  }
25685  PyErr_Format(PyExc_TypeError,
25686  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
25687  f->m_ml->ml_name, size);
25688  return NULL;
25689  }
25690  break;
25691  default:
25692  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
25693  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
25694  "longer supported!");
25695  return NULL;
25696  }
25697  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
25698  f->m_ml->ml_name);
25699  return NULL;
25700 }
25701 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25702  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
25703 }
25704 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
25705  PyObject *result;
25706  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
25707  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
25708  Py_ssize_t argc;
25709  PyObject *new_args;
25710  PyObject *self;
25711  argc = PyTuple_GET_SIZE(args);
25712  new_args = PyTuple_GetSlice(args, 1, argc);
25713  if (unlikely(!new_args))
25714  return NULL;
25715  self = PyTuple_GetItem(args, 0);
25716  if (unlikely(!self)) {
25717  Py_DECREF(new_args);
25718  PyErr_Format(PyExc_TypeError,
25719  "unbound method %.200S() needs an argument",
25720  cyfunc->func_qualname);
25721  return NULL;
25722  }
25723  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
25724  Py_DECREF(new_args);
25725  } else {
25726  result = __Pyx_CyFunction_Call(func, args, kw);
25727  }
25728  return result;
25729 }
25730 static PyTypeObject __pyx_CyFunctionType_type = {
25731  PyVarObject_HEAD_INIT(0, 0)
25732  "cython_function_or_method",
25733  sizeof(__pyx_CyFunctionObject),
25734  0,
25735  (destructor) __Pyx_CyFunction_dealloc,
25736  0,
25737  0,
25738  0,
25739 #if PY_MAJOR_VERSION < 3
25740  0,
25741 #else
25742  0,
25743 #endif
25744  (reprfunc) __Pyx_CyFunction_repr,
25745  0,
25746  0,
25747  0,
25748  0,
25749  __Pyx_CyFunction_CallAsMethod,
25750  0,
25751  0,
25752  0,
25753  0,
25754  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
25755  0,
25756  (traverseproc) __Pyx_CyFunction_traverse,
25757  (inquiry) __Pyx_CyFunction_clear,
25758  0,
25759 #if PY_VERSION_HEX < 0x030500A0
25760  offsetof(__pyx_CyFunctionObject, func_weakreflist),
25761 #else
25762  offsetof(PyCFunctionObject, m_weakreflist),
25763 #endif
25764  0,
25765  0,
25766  __pyx_CyFunction_methods,
25767  __pyx_CyFunction_members,
25768  __pyx_CyFunction_getsets,
25769  0,
25770  0,
25771  __Pyx_CyFunction_descr_get,
25772  0,
25773  offsetof(__pyx_CyFunctionObject, func_dict),
25774  0,
25775  0,
25776  0,
25777  0,
25778  0,
25779  0,
25780  0,
25781  0,
25782  0,
25783  0,
25784  0,
25785  0,
25786 #if PY_VERSION_HEX >= 0x030400a1
25787  0,
25788 #endif
25789 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
25790  0,
25791 #endif
25792 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
25793  0,
25794 #endif
25795 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
25796  0,
25797 #endif
25798 };
25799 static int __pyx_CyFunction_init(void) {
25800  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
25801  if (unlikely(__pyx_CyFunctionType == NULL)) {
25802  return -1;
25803  }
25804  return 0;
25805 }
25806 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
25807  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25808  m->defaults = PyObject_Malloc(size);
25809  if (unlikely(!m->defaults))
25810  return PyErr_NoMemory();
25811  memset(m->defaults, 0, size);
25812  m->defaults_pyobjects = pyobjects;
25813  m->defaults_size = size;
25814  return m->defaults;
25815 }
25816 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
25817  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25818  m->defaults_tuple = tuple;
25819  Py_INCREF(tuple);
25820 }
25821 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
25822  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25823  m->defaults_kwdict = dict;
25824  Py_INCREF(dict);
25825 }
25826 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
25827  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25828  m->func_annotations = dict;
25829  Py_INCREF(dict);
25830 }
25831 
25832 /* CythonFunction */
25833 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
25834  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25835  PyObject *op = __Pyx_CyFunction_Init(
25836  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
25837  ml, flags, qualname, closure, module, globals, code
25838  );
25839  if (likely(op)) {
25840  PyObject_GC_Track(op);
25841  }
25842  return op;
25843 }
25844 
25845 /* PyObjectCall2Args */
25846 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
25847  PyObject *args, *result = NULL;
25848  #if CYTHON_FAST_PYCALL
25849  if (PyFunction_Check(function)) {
25850  PyObject *args[2] = {arg1, arg2};
25851  return __Pyx_PyFunction_FastCall(function, args, 2);
25852  }
25853  #endif
25854  #if CYTHON_FAST_PYCCALL
25855  if (__Pyx_PyFastCFunction_Check(function)) {
25856  PyObject *args[2] = {arg1, arg2};
25857  return __Pyx_PyCFunction_FastCall(function, args, 2);
25858  }
25859  #endif
25860  args = PyTuple_New(2);
25861  if (unlikely(!args)) goto done;
25862  Py_INCREF(arg1);
25863  PyTuple_SET_ITEM(args, 0, arg1);
25864  Py_INCREF(arg2);
25865  PyTuple_SET_ITEM(args, 1, arg2);
25866  Py_INCREF(function);
25867  result = __Pyx_PyObject_Call(function, args, NULL);
25868  Py_DECREF(args);
25869  Py_DECREF(function);
25870 done:
25871  return result;
25872 }
25873 
25874 /* SliceObject */
25875 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
25876  Py_ssize_t cstart, Py_ssize_t cstop,
25877  PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
25878  int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
25879 #if CYTHON_USE_TYPE_SLOTS
25880  PyMappingMethods* mp;
25881 #if PY_MAJOR_VERSION < 3
25882  PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
25883  if (likely(ms && ms->sq_slice)) {
25884  if (!has_cstart) {
25885  if (_py_start && (*_py_start != Py_None)) {
25886  cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
25887  if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
25888  } else
25889  cstart = 0;
25890  }
25891  if (!has_cstop) {
25892  if (_py_stop && (*_py_stop != Py_None)) {
25893  cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
25894  if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
25895  } else
25896  cstop = PY_SSIZE_T_MAX;
25897  }
25898  if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
25899  Py_ssize_t l = ms->sq_length(obj);
25900  if (likely(l >= 0)) {
25901  if (cstop < 0) {
25902  cstop += l;
25903  if (cstop < 0) cstop = 0;
25904  }
25905  if (cstart < 0) {
25906  cstart += l;
25907  if (cstart < 0) cstart = 0;
25908  }
25909  } else {
25910  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25911  goto bad;
25912  PyErr_Clear();
25913  }
25914  }
25915  return ms->sq_slice(obj, cstart, cstop);
25916  }
25917 #endif
25918  mp = Py_TYPE(obj)->tp_as_mapping;
25919  if (likely(mp && mp->mp_subscript))
25920 #endif
25921  {
25922  PyObject* result;
25923  PyObject *py_slice, *py_start, *py_stop;
25924  if (_py_slice) {
25925  py_slice = *_py_slice;
25926  } else {
25927  PyObject* owned_start = NULL;
25928  PyObject* owned_stop = NULL;
25929  if (_py_start) {
25930  py_start = *_py_start;
25931  } else {
25932  if (has_cstart) {
25933  owned_start = py_start = PyInt_FromSsize_t(cstart);
25934  if (unlikely(!py_start)) goto bad;
25935  } else
25936  py_start = Py_None;
25937  }
25938  if (_py_stop) {
25939  py_stop = *_py_stop;
25940  } else {
25941  if (has_cstop) {
25942  owned_stop = py_stop = PyInt_FromSsize_t(cstop);
25943  if (unlikely(!py_stop)) {
25944  Py_XDECREF(owned_start);
25945  goto bad;
25946  }
25947  } else
25948  py_stop = Py_None;
25949  }
25950  py_slice = PySlice_New(py_start, py_stop, Py_None);
25951  Py_XDECREF(owned_start);
25952  Py_XDECREF(owned_stop);
25953  if (unlikely(!py_slice)) goto bad;
25954  }
25955 #if CYTHON_USE_TYPE_SLOTS
25956  result = mp->mp_subscript(obj, py_slice);
25957 #else
25958  result = PyObject_GetItem(obj, py_slice);
25959 #endif
25960  if (!_py_slice) {
25961  Py_DECREF(py_slice);
25962  }
25963  return result;
25964  }
25965  PyErr_Format(PyExc_TypeError,
25966  "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
25967 bad:
25968  return NULL;
25969 }
25970 
25971 /* RaiseException */
25972 #if PY_MAJOR_VERSION < 3
25973 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
25974  CYTHON_UNUSED PyObject *cause) {
25975  __Pyx_PyThreadState_declare
25976  Py_XINCREF(type);
25977  if (!value || value == Py_None)
25978  value = NULL;
25979  else
25980  Py_INCREF(value);
25981  if (!tb || tb == Py_None)
25982  tb = NULL;
25983  else {
25984  Py_INCREF(tb);
25985  if (!PyTraceBack_Check(tb)) {
25986  PyErr_SetString(PyExc_TypeError,
25987  "raise: arg 3 must be a traceback or None");
25988  goto raise_error;
25989  }
25990  }
25991  if (PyType_Check(type)) {
25992 #if CYTHON_COMPILING_IN_PYPY
25993  if (!value) {
25994  Py_INCREF(Py_None);
25995  value = Py_None;
25996  }
25997 #endif
25998  PyErr_NormalizeException(&type, &value, &tb);
25999  } else {
26000  if (value) {
26001  PyErr_SetString(PyExc_TypeError,
26002  "instance exception may not have a separate value");
26003  goto raise_error;
26004  }
26005  value = type;
26006  type = (PyObject*) Py_TYPE(type);
26007  Py_INCREF(type);
26008  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
26009  PyErr_SetString(PyExc_TypeError,
26010  "raise: exception class must be a subclass of BaseException");
26011  goto raise_error;
26012  }
26013  }
26014  __Pyx_PyThreadState_assign
26015  __Pyx_ErrRestore(type, value, tb);
26016  return;
26017 raise_error:
26018  Py_XDECREF(value);
26019  Py_XDECREF(type);
26020  Py_XDECREF(tb);
26021  return;
26022 }
26023 #else
26024 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
26025  PyObject* owned_instance = NULL;
26026  if (tb == Py_None) {
26027  tb = 0;
26028  } else if (tb && !PyTraceBack_Check(tb)) {
26029  PyErr_SetString(PyExc_TypeError,
26030  "raise: arg 3 must be a traceback or None");
26031  goto bad;
26032  }
26033  if (value == Py_None)
26034  value = 0;
26035  if (PyExceptionInstance_Check(type)) {
26036  if (value) {
26037  PyErr_SetString(PyExc_TypeError,
26038  "instance exception may not have a separate value");
26039  goto bad;
26040  }
26041  value = type;
26042  type = (PyObject*) Py_TYPE(value);
26043  } else if (PyExceptionClass_Check(type)) {
26044  PyObject *instance_class = NULL;
26045  if (value && PyExceptionInstance_Check(value)) {
26046  instance_class = (PyObject*) Py_TYPE(value);
26047  if (instance_class != type) {
26048  int is_subclass = PyObject_IsSubclass(instance_class, type);
26049  if (!is_subclass) {
26050  instance_class = NULL;
26051  } else if (unlikely(is_subclass == -1)) {
26052  goto bad;
26053  } else {
26054  type = instance_class;
26055  }
26056  }
26057  }
26058  if (!instance_class) {
26059  PyObject *args;
26060  if (!value)
26061  args = PyTuple_New(0);
26062  else if (PyTuple_Check(value)) {
26063  Py_INCREF(value);
26064  args = value;
26065  } else
26066  args = PyTuple_Pack(1, value);
26067  if (!args)
26068  goto bad;
26069  owned_instance = PyObject_Call(type, args, NULL);
26070  Py_DECREF(args);
26071  if (!owned_instance)
26072  goto bad;
26073  value = owned_instance;
26074  if (!PyExceptionInstance_Check(value)) {
26075  PyErr_Format(PyExc_TypeError,
26076  "calling %R should have returned an instance of "
26077  "BaseException, not %R",
26078  type, Py_TYPE(value));
26079  goto bad;
26080  }
26081  }
26082  } else {
26083  PyErr_SetString(PyExc_TypeError,
26084  "raise: exception class must be a subclass of BaseException");
26085  goto bad;
26086  }
26087  if (cause) {
26088  PyObject *fixed_cause;
26089  if (cause == Py_None) {
26090  fixed_cause = NULL;
26091  } else if (PyExceptionClass_Check(cause)) {
26092  fixed_cause = PyObject_CallObject(cause, NULL);
26093  if (fixed_cause == NULL)
26094  goto bad;
26095  } else if (PyExceptionInstance_Check(cause)) {
26096  fixed_cause = cause;
26097  Py_INCREF(fixed_cause);
26098  } else {
26099  PyErr_SetString(PyExc_TypeError,
26100  "exception causes must derive from "
26101  "BaseException");
26102  goto bad;
26103  }
26104  PyException_SetCause(value, fixed_cause);
26105  }
26106  PyErr_SetObject(type, value);
26107  if (tb) {
26108 #if CYTHON_COMPILING_IN_PYPY
26109  PyObject *tmp_type, *tmp_value, *tmp_tb;
26110  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
26111  Py_INCREF(tb);
26112  PyErr_Restore(tmp_type, tmp_value, tb);
26113  Py_XDECREF(tmp_tb);
26114 #else
26115  PyThreadState *tstate = __Pyx_PyThreadState_Current;
26116  PyObject* tmp_tb = tstate->curexc_traceback;
26117  if (tb != tmp_tb) {
26118  Py_INCREF(tb);
26119  tstate->curexc_traceback = tb;
26120  Py_XDECREF(tmp_tb);
26121  }
26122 #endif
26123  }
26124 bad:
26125  Py_XDECREF(owned_instance);
26126  return;
26127 }
26128 #endif
26129 
26130 /* HasAttr */
26131 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
26132  PyObject *r;
26133  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
26134  PyErr_SetString(PyExc_TypeError,
26135  "hasattr(): attribute name must be string");
26136  return -1;
26137  }
26138  r = __Pyx_GetAttr(o, n);
26139  if (unlikely(!r)) {
26140  PyErr_Clear();
26141  return 0;
26142  } else {
26143  Py_DECREF(r);
26144  return 1;
26145  }
26146 }
26147 
26148 /* GetTopmostException */
26149 #if CYTHON_USE_EXC_INFO_STACK
26150 static _PyErr_StackItem *
26151 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
26152 {
26153  _PyErr_StackItem *exc_info = tstate->exc_info;
26154  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
26155  exc_info->previous_item != NULL)
26156  {
26157  exc_info = exc_info->previous_item;
26158  }
26159  return exc_info;
26160 }
26161 #endif
26162 
26163 /* SaveResetException */
26164 #if CYTHON_FAST_THREAD_STATE
26165 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26166  #if CYTHON_USE_EXC_INFO_STACK
26167  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
26168  *type = exc_info->exc_type;
26169  *value = exc_info->exc_value;
26170  *tb = exc_info->exc_traceback;
26171  #else
26172  *type = tstate->exc_type;
26173  *value = tstate->exc_value;
26174  *tb = tstate->exc_traceback;
26175  #endif
26176  Py_XINCREF(*type);
26177  Py_XINCREF(*value);
26178  Py_XINCREF(*tb);
26179 }
26180 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
26181  PyObject *tmp_type, *tmp_value, *tmp_tb;
26182  #if CYTHON_USE_EXC_INFO_STACK
26183  _PyErr_StackItem *exc_info = tstate->exc_info;
26184  tmp_type = exc_info->exc_type;
26185  tmp_value = exc_info->exc_value;
26186  tmp_tb = exc_info->exc_traceback;
26187  exc_info->exc_type = type;
26188  exc_info->exc_value = value;
26189  exc_info->exc_traceback = tb;
26190  #else
26191  tmp_type = tstate->exc_type;
26192  tmp_value = tstate->exc_value;
26193  tmp_tb = tstate->exc_traceback;
26194  tstate->exc_type = type;
26195  tstate->exc_value = value;
26196  tstate->exc_traceback = tb;
26197  #endif
26198  Py_XDECREF(tmp_type);
26199  Py_XDECREF(tmp_value);
26200  Py_XDECREF(tmp_tb);
26201 }
26202 #endif
26203 
26204 /* GetException */
26205 #if CYTHON_FAST_THREAD_STATE
26206 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
26207 #else
26208 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
26209 #endif
26210 {
26211  PyObject *local_type, *local_value, *local_tb;
26212 #if CYTHON_FAST_THREAD_STATE
26213  PyObject *tmp_type, *tmp_value, *tmp_tb;
26214  local_type = tstate->curexc_type;
26215  local_value = tstate->curexc_value;
26216  local_tb = tstate->curexc_traceback;
26217  tstate->curexc_type = 0;
26218  tstate->curexc_value = 0;
26219  tstate->curexc_traceback = 0;
26220 #else
26221  PyErr_Fetch(&local_type, &local_value, &local_tb);
26222 #endif
26223  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
26224 #if CYTHON_FAST_THREAD_STATE
26225  if (unlikely(tstate->curexc_type))
26226 #else
26227  if (unlikely(PyErr_Occurred()))
26228 #endif
26229  goto bad;
26230  #if PY_MAJOR_VERSION >= 3
26231  if (local_tb) {
26232  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
26233  goto bad;
26234  }
26235  #endif
26236  Py_XINCREF(local_tb);
26237  Py_XINCREF(local_type);
26238  Py_XINCREF(local_value);
26239  *type = local_type;
26240  *value = local_value;
26241  *tb = local_tb;
26242 #if CYTHON_FAST_THREAD_STATE
26243  #if CYTHON_USE_EXC_INFO_STACK
26244  {
26245  _PyErr_StackItem *exc_info = tstate->exc_info;
26246  tmp_type = exc_info->exc_type;
26247  tmp_value = exc_info->exc_value;
26248  tmp_tb = exc_info->exc_traceback;
26249  exc_info->exc_type = local_type;
26250  exc_info->exc_value = local_value;
26251  exc_info->exc_traceback = local_tb;
26252  }
26253  #else
26254  tmp_type = tstate->exc_type;
26255  tmp_value = tstate->exc_value;
26256  tmp_tb = tstate->exc_traceback;
26257  tstate->exc_type = local_type;
26258  tstate->exc_value = local_value;
26259  tstate->exc_traceback = local_tb;
26260  #endif
26261  Py_XDECREF(tmp_type);
26262  Py_XDECREF(tmp_value);
26263  Py_XDECREF(tmp_tb);
26264 #else
26265  PyErr_SetExcInfo(local_type, local_value, local_tb);
26266 #endif
26267  return 0;
26268 bad:
26269  *type = 0;
26270  *value = 0;
26271  *tb = 0;
26272  Py_XDECREF(local_type);
26273  Py_XDECREF(local_value);
26274  Py_XDECREF(local_tb);
26275  return -1;
26276 }
26277 
26278 /* ArgTypeTest */
26279 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
26280 {
26281  if (unlikely(!type)) {
26282  PyErr_SetString(PyExc_SystemError, "Missing type object");
26283  return 0;
26284  }
26285  else if (exact) {
26286  #if PY_MAJOR_VERSION == 2
26287  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
26288  #endif
26289  }
26290  else {
26291  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
26292  }
26293  PyErr_Format(PyExc_TypeError,
26294  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
26295  name, type->tp_name, Py_TYPE(obj)->tp_name);
26296  return 0;
26297 }
26298 
26299 /* BytesEquals */
26300 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
26301 #if CYTHON_COMPILING_IN_PYPY
26302  return PyObject_RichCompareBool(s1, s2, equals);
26303 #else
26304  if (s1 == s2) {
26305  return (equals == Py_EQ);
26306  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
26307  const char *ps1, *ps2;
26308  Py_ssize_t length = PyBytes_GET_SIZE(s1);
26309  if (length != PyBytes_GET_SIZE(s2))
26310  return (equals == Py_NE);
26311  ps1 = PyBytes_AS_STRING(s1);
26312  ps2 = PyBytes_AS_STRING(s2);
26313  if (ps1[0] != ps2[0]) {
26314  return (equals == Py_NE);
26315  } else if (length == 1) {
26316  return (equals == Py_EQ);
26317  } else {
26318  int result;
26319 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
26320  Py_hash_t hash1, hash2;
26321  hash1 = ((PyBytesObject*)s1)->ob_shash;
26322  hash2 = ((PyBytesObject*)s2)->ob_shash;
26323  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
26324  return (equals == Py_NE);
26325  }
26326 #endif
26327  result = memcmp(ps1, ps2, (size_t)length);
26328  return (equals == Py_EQ) ? (result == 0) : (result != 0);
26329  }
26330  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
26331  return (equals == Py_NE);
26332  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
26333  return (equals == Py_NE);
26334  } else {
26335  int result;
26336  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
26337  if (!py_result)
26338  return -1;
26339  result = __Pyx_PyObject_IsTrue(py_result);
26340  Py_DECREF(py_result);
26341  return result;
26342  }
26343 #endif
26344 }
26345 
26346 /* UnicodeEquals */
26347 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
26348 #if CYTHON_COMPILING_IN_PYPY
26349  return PyObject_RichCompareBool(s1, s2, equals);
26350 #else
26351 #if PY_MAJOR_VERSION < 3
26352  PyObject* owned_ref = NULL;
26353 #endif
26354  int s1_is_unicode, s2_is_unicode;
26355  if (s1 == s2) {
26356  goto return_eq;
26357  }
26358  s1_is_unicode = PyUnicode_CheckExact(s1);
26359  s2_is_unicode = PyUnicode_CheckExact(s2);
26360 #if PY_MAJOR_VERSION < 3
26361  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
26362  owned_ref = PyUnicode_FromObject(s2);
26363  if (unlikely(!owned_ref))
26364  return -1;
26365  s2 = owned_ref;
26366  s2_is_unicode = 1;
26367  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
26368  owned_ref = PyUnicode_FromObject(s1);
26369  if (unlikely(!owned_ref))
26370  return -1;
26371  s1 = owned_ref;
26372  s1_is_unicode = 1;
26373  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
26374  return __Pyx_PyBytes_Equals(s1, s2, equals);
26375  }
26376 #endif
26377  if (s1_is_unicode & s2_is_unicode) {
26378  Py_ssize_t length;
26379  int kind;
26380  void *data1, *data2;
26381  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
26382  return -1;
26383  length = __Pyx_PyUnicode_GET_LENGTH(s1);
26384  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
26385  goto return_ne;
26386  }
26387 #if CYTHON_USE_UNICODE_INTERNALS
26388  {
26389  Py_hash_t hash1, hash2;
26390  #if CYTHON_PEP393_ENABLED
26391  hash1 = ((PyASCIIObject*)s1)->hash;
26392  hash2 = ((PyASCIIObject*)s2)->hash;
26393  #else
26394  hash1 = ((PyUnicodeObject*)s1)->hash;
26395  hash2 = ((PyUnicodeObject*)s2)->hash;
26396  #endif
26397  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
26398  goto return_ne;
26399  }
26400  }
26401 #endif
26402  kind = __Pyx_PyUnicode_KIND(s1);
26403  if (kind != __Pyx_PyUnicode_KIND(s2)) {
26404  goto return_ne;
26405  }
26406  data1 = __Pyx_PyUnicode_DATA(s1);
26407  data2 = __Pyx_PyUnicode_DATA(s2);
26408  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
26409  goto return_ne;
26410  } else if (length == 1) {
26411  goto return_eq;
26412  } else {
26413  int result = memcmp(data1, data2, (size_t)(length * kind));
26414  #if PY_MAJOR_VERSION < 3
26415  Py_XDECREF(owned_ref);
26416  #endif
26417  return (equals == Py_EQ) ? (result == 0) : (result != 0);
26418  }
26419  } else if ((s1 == Py_None) & s2_is_unicode) {
26420  goto return_ne;
26421  } else if ((s2 == Py_None) & s1_is_unicode) {
26422  goto return_ne;
26423  } else {
26424  int result;
26425  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
26426  #if PY_MAJOR_VERSION < 3
26427  Py_XDECREF(owned_ref);
26428  #endif
26429  if (!py_result)
26430  return -1;
26431  result = __Pyx_PyObject_IsTrue(py_result);
26432  Py_DECREF(py_result);
26433  return result;
26434  }
26435 return_eq:
26436  #if PY_MAJOR_VERSION < 3
26437  Py_XDECREF(owned_ref);
26438  #endif
26439  return (equals == Py_EQ);
26440 return_ne:
26441  #if PY_MAJOR_VERSION < 3
26442  Py_XDECREF(owned_ref);
26443  #endif
26444  return (equals == Py_NE);
26445 #endif
26446 }
26447 
26448 /* DivInt[Py_ssize_t] */
26449 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
26450  Py_ssize_t q = a / b;
26451  Py_ssize_t r = a - q*b;
26452  q -= ((r != 0) & ((r ^ b) < 0));
26453  return q;
26454 }
26455 
26456 /* decode_c_string */
26457 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
26458  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
26459  const char* encoding, const char* errors,
26460  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
26461  Py_ssize_t length;
26462  if (unlikely((start < 0) | (stop < 0))) {
26463  size_t slen = strlen(cstring);
26464  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
26465  PyErr_SetString(PyExc_OverflowError,
26466  "c-string too long to convert to Python");
26467  return NULL;
26468  }
26469  length = (Py_ssize_t) slen;
26470  if (start < 0) {
26471  start += length;
26472  if (start < 0)
26473  start = 0;
26474  }
26475  if (stop < 0)
26476  stop += length;
26477  }
26478  if (unlikely(stop <= start))
26479  return __Pyx_NewRef(__pyx_empty_unicode);
26480  length = stop - start;
26481  cstring += start;
26482  if (decode_func) {
26483  return decode_func(cstring, length, errors);
26484  } else {
26485  return PyUnicode_Decode(cstring, length, encoding, errors);
26486  }
26487 }
26488 
26489 /* RaiseTooManyValuesToUnpack */
26490 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
26491  PyErr_Format(PyExc_ValueError,
26492  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
26493 }
26494 
26495 /* RaiseNeedMoreValuesToUnpack */
26496 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
26497  PyErr_Format(PyExc_ValueError,
26498  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
26499  index, (index == 1) ? "" : "s");
26500 }
26501 
26502 /* RaiseNoneIterError */
26503 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
26504  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
26505 }
26506 
26507 /* ExtTypeTest */
26508 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
26509  if (unlikely(!type)) {
26510  PyErr_SetString(PyExc_SystemError, "Missing type object");
26511  return 0;
26512  }
26513  if (likely(__Pyx_TypeCheck(obj, type)))
26514  return 1;
26515  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
26516  Py_TYPE(obj)->tp_name, type->tp_name);
26517  return 0;
26518 }
26519 
26520 /* SwapException */
26521 #if CYTHON_FAST_THREAD_STATE
26522 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26523  PyObject *tmp_type, *tmp_value, *tmp_tb;
26524  #if CYTHON_USE_EXC_INFO_STACK
26525  _PyErr_StackItem *exc_info = tstate->exc_info;
26526  tmp_type = exc_info->exc_type;
26527  tmp_value = exc_info->exc_value;
26528  tmp_tb = exc_info->exc_traceback;
26529  exc_info->exc_type = *type;
26530  exc_info->exc_value = *value;
26531  exc_info->exc_traceback = *tb;
26532  #else
26533  tmp_type = tstate->exc_type;
26534  tmp_value = tstate->exc_value;
26535  tmp_tb = tstate->exc_traceback;
26536  tstate->exc_type = *type;
26537  tstate->exc_value = *value;
26538  tstate->exc_traceback = *tb;
26539  #endif
26540  *type = tmp_type;
26541  *value = tmp_value;
26542  *tb = tmp_tb;
26543 }
26544 #else
26545 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
26546  PyObject *tmp_type, *tmp_value, *tmp_tb;
26547  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
26548  PyErr_SetExcInfo(*type, *value, *tb);
26549  *type = tmp_type;
26550  *value = tmp_value;
26551  *tb = tmp_tb;
26552 }
26553 #endif
26554 
26555 /* FastTypeChecks */
26556 #if CYTHON_COMPILING_IN_CPYTHON
26557 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
26558  while (a) {
26559  a = a->tp_base;
26560  if (a == b)
26561  return 1;
26562  }
26563  return b == &PyBaseObject_Type;
26564 }
26565 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
26566  PyObject *mro;
26567  if (a == b) return 1;
26568  mro = a->tp_mro;
26569  if (likely(mro)) {
26570  Py_ssize_t i, n;
26571  n = PyTuple_GET_SIZE(mro);
26572  for (i = 0; i < n; i++) {
26573  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
26574  return 1;
26575  }
26576  return 0;
26577  }
26578  return __Pyx_InBases(a, b);
26579 }
26580 #if PY_MAJOR_VERSION == 2
26581 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
26582  PyObject *exception, *value, *tb;
26583  int res;
26584  __Pyx_PyThreadState_declare
26585  __Pyx_PyThreadState_assign
26586  __Pyx_ErrFetch(&exception, &value, &tb);
26587  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
26588  if (unlikely(res == -1)) {
26589  PyErr_WriteUnraisable(err);
26590  res = 0;
26591  }
26592  if (!res) {
26593  res = PyObject_IsSubclass(err, exc_type2);
26594  if (unlikely(res == -1)) {
26595  PyErr_WriteUnraisable(err);
26596  res = 0;
26597  }
26598  }
26599  __Pyx_ErrRestore(exception, value, tb);
26600  return res;
26601 }
26602 #else
26603 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
26604  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
26605  if (!res) {
26606  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
26607  }
26608  return res;
26609 }
26610 #endif
26611 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26612  Py_ssize_t i, n;
26613  assert(PyExceptionClass_Check(exc_type));
26614  n = PyTuple_GET_SIZE(tuple);
26615 #if PY_MAJOR_VERSION >= 3
26616  for (i=0; i<n; i++) {
26617  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
26618  }
26619 #endif
26620  for (i=0; i<n; i++) {
26621  PyObject *t = PyTuple_GET_ITEM(tuple, i);
26622  #if PY_MAJOR_VERSION < 3
26623  if (likely(exc_type == t)) return 1;
26624  #endif
26625  if (likely(PyExceptionClass_Check(t))) {
26626  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
26627  } else {
26628  }
26629  }
26630  return 0;
26631 }
26632 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
26633  if (likely(err == exc_type)) return 1;
26634  if (likely(PyExceptionClass_Check(err))) {
26635  if (likely(PyExceptionClass_Check(exc_type))) {
26636  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
26637  } else if (likely(PyTuple_Check(exc_type))) {
26638  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
26639  } else {
26640  }
26641  }
26642  return PyErr_GivenExceptionMatches(err, exc_type);
26643 }
26644 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
26645  assert(PyExceptionClass_Check(exc_type1));
26646  assert(PyExceptionClass_Check(exc_type2));
26647  if (likely(err == exc_type1 || err == exc_type2)) return 1;
26648  if (likely(PyExceptionClass_Check(err))) {
26649  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
26650  }
26651  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
26652 }
26653 #endif
26654 
26655 /* PyIntBinop */
26656 #if !CYTHON_COMPILING_IN_PYPY
26657 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
26658  (void)inplace;
26659  (void)zerodivision_check;
26660  #if PY_MAJOR_VERSION < 3
26661  if (likely(PyInt_CheckExact(op1))) {
26662  const long b = intval;
26663  long x;
26664  long a = PyInt_AS_LONG(op1);
26665  x = (long)((unsigned long)a + b);
26666  if (likely((x^a) >= 0 || (x^b) >= 0))
26667  return PyInt_FromLong(x);
26668  return PyLong_Type.tp_as_number->nb_add(op1, op2);
26669  }
26670  #endif
26671  #if CYTHON_USE_PYLONG_INTERNALS
26672  if (likely(PyLong_CheckExact(op1))) {
26673  const long b = intval;
26674  long a, x;
26675 #ifdef HAVE_LONG_LONG
26676  const PY_LONG_LONG llb = intval;
26677  PY_LONG_LONG lla, llx;
26678 #endif
26679  const digit* digits = ((PyLongObject*)op1)->ob_digit;
26680  const Py_ssize_t size = Py_SIZE(op1);
26681  if (likely(__Pyx_sst_abs(size) <= 1)) {
26682  a = likely(size) ? digits[0] : 0;
26683  if (size == -1) a = -a;
26684  } else {
26685  switch (size) {
26686  case -2:
26687  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26688  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26689  break;
26690 #ifdef HAVE_LONG_LONG
26691  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26692  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26693  goto long_long;
26694 #endif
26695  }
26696  CYTHON_FALLTHROUGH;
26697  case 2:
26698  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
26699  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26700  break;
26701 #ifdef HAVE_LONG_LONG
26702  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26703  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26704  goto long_long;
26705 #endif
26706  }
26707  CYTHON_FALLTHROUGH;
26708  case -3:
26709  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26710  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26711  break;
26712 #ifdef HAVE_LONG_LONG
26713  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26714  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]));
26715  goto long_long;
26716 #endif
26717  }
26718  CYTHON_FALLTHROUGH;
26719  case 3:
26720  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
26721  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26722  break;
26723 #ifdef HAVE_LONG_LONG
26724  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26725  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]));
26726  goto long_long;
26727 #endif
26728  }
26729  CYTHON_FALLTHROUGH;
26730  case -4:
26731  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
26732  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26733  break;
26734 #ifdef HAVE_LONG_LONG
26735  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26736  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]));
26737  goto long_long;
26738 #endif
26739  }
26740  CYTHON_FALLTHROUGH;
26741  case 4:
26742  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
26743  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26744  break;
26745 #ifdef HAVE_LONG_LONG
26746  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26747  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]));
26748  goto long_long;
26749 #endif
26750  }
26751  CYTHON_FALLTHROUGH;
26752  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
26753  }
26754  }
26755  x = a + b;
26756  return PyLong_FromLong(x);
26757 #ifdef HAVE_LONG_LONG
26758  long_long:
26759  llx = lla + llb;
26760  return PyLong_FromLongLong(llx);
26761 #endif
26762 
26763 
26764  }
26765  #endif
26766  if (PyFloat_CheckExact(op1)) {
26767  const long b = intval;
26768  double a = PyFloat_AS_DOUBLE(op1);
26769  double result;
26770  PyFPE_START_PROTECT("add", return NULL)
26771  result = ((double)a) + (double)b;
26772  PyFPE_END_PROTECT(result)
26773  return PyFloat_FromDouble(result);
26774  }
26775  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
26776 }
26777 #endif
26778 
26779 /* None */
26780 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
26781  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
26782 }
26783 
26784 /* DivInt[long] */
26785 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
26786  long q = a / b;
26787  long r = a - q*b;
26788  q -= ((r != 0) & ((r ^ b) < 0));
26789  return q;
26790 }
26791 
26792 /* PyObject_GenericGetAttrNoDict */
26793 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26794 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
26795  PyErr_Format(PyExc_AttributeError,
26796 #if PY_MAJOR_VERSION >= 3
26797  "'%.50s' object has no attribute '%U'",
26798  tp->tp_name, attr_name);
26799 #else
26800  "'%.50s' object has no attribute '%.400s'",
26801  tp->tp_name, PyString_AS_STRING(attr_name));
26802 #endif
26803  return NULL;
26804 }
26805 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
26806  PyObject *descr;
26807  PyTypeObject *tp = Py_TYPE(obj);
26808  if (unlikely(!PyString_Check(attr_name))) {
26809  return PyObject_GenericGetAttr(obj, attr_name);
26810  }
26811  assert(!tp->tp_dictoffset);
26812  descr = _PyType_Lookup(tp, attr_name);
26813  if (unlikely(!descr)) {
26814  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
26815  }
26816  Py_INCREF(descr);
26817  #if PY_MAJOR_VERSION < 3
26818  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
26819  #endif
26820  {
26821  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
26822  if (unlikely(f)) {
26823  PyObject *res = f(descr, obj, (PyObject *)tp);
26824  Py_DECREF(descr);
26825  return res;
26826  }
26827  }
26828  return descr;
26829 }
26830 #endif
26831 
26832 /* PyObject_GenericGetAttr */
26833 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26834 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
26835  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
26836  return PyObject_GenericGetAttr(obj, attr_name);
26837  }
26838  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
26839 }
26840 #endif
26841 
26842 /* PyObjectGetAttrStrNoError */
26843 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
26844  __Pyx_PyThreadState_declare
26845  __Pyx_PyThreadState_assign
26846  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
26847  __Pyx_PyErr_Clear();
26848 }
26849 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
26850  PyObject *result;
26851 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
26852  PyTypeObject* tp = Py_TYPE(obj);
26853  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
26854  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
26855  }
26856 #endif
26857  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
26858  if (unlikely(!result)) {
26859  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
26860  }
26861  return result;
26862 }
26863 
26864 /* SetupReduce */
26865 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
26866  int ret;
26867  PyObject *name_attr;
26868  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
26869  if (likely(name_attr)) {
26870  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
26871  } else {
26872  ret = -1;
26873  }
26874  if (unlikely(ret < 0)) {
26875  PyErr_Clear();
26876  ret = 0;
26877  }
26878  Py_XDECREF(name_attr);
26879  return ret;
26880 }
26881 static int __Pyx_setup_reduce(PyObject* type_obj) {
26882  int ret = 0;
26883  PyObject *object_reduce = NULL;
26884  PyObject *object_getstate = NULL;
26885  PyObject *object_reduce_ex = NULL;
26886  PyObject *reduce = NULL;
26887  PyObject *reduce_ex = NULL;
26888  PyObject *reduce_cython = NULL;
26889  PyObject *setstate = NULL;
26890  PyObject *setstate_cython = NULL;
26891  PyObject *getstate = NULL;
26892 #if CYTHON_USE_PYTYPE_LOOKUP
26893  getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
26894 #else
26895  getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
26896  if (!getstate && PyErr_Occurred()) {
26897  goto __PYX_BAD;
26898  }
26899 #endif
26900  if (getstate) {
26901 #if CYTHON_USE_PYTYPE_LOOKUP
26902  object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
26903 #else
26904  object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
26905  if (!object_getstate && PyErr_Occurred()) {
26906  goto __PYX_BAD;
26907  }
26908 #endif
26909  if (object_getstate != getstate) {
26910  goto __PYX_GOOD;
26911  }
26912  }
26913 #if CYTHON_USE_PYTYPE_LOOKUP
26914  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
26915 #else
26916  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
26917 #endif
26918  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
26919  if (reduce_ex == object_reduce_ex) {
26920 #if CYTHON_USE_PYTYPE_LOOKUP
26921  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
26922 #else
26923  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
26924 #endif
26925  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
26926  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
26927  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
26928  if (likely(reduce_cython)) {
26929  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26930  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26931  } else if (reduce == object_reduce || PyErr_Occurred()) {
26932  goto __PYX_BAD;
26933  }
26934  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
26935  if (!setstate) PyErr_Clear();
26936  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
26937  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
26938  if (likely(setstate_cython)) {
26939  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26940  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
26941  } else if (!setstate || PyErr_Occurred()) {
26942  goto __PYX_BAD;
26943  }
26944  }
26945  PyType_Modified((PyTypeObject*)type_obj);
26946  }
26947  }
26948  goto __PYX_GOOD;
26949 __PYX_BAD:
26950  if (!PyErr_Occurred())
26951  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
26952  ret = -1;
26953 __PYX_GOOD:
26954 #if !CYTHON_USE_PYTYPE_LOOKUP
26955  Py_XDECREF(object_reduce);
26956  Py_XDECREF(object_reduce_ex);
26957  Py_XDECREF(object_getstate);
26958  Py_XDECREF(getstate);
26959 #endif
26960  Py_XDECREF(reduce);
26961  Py_XDECREF(reduce_ex);
26962  Py_XDECREF(reduce_cython);
26963  Py_XDECREF(setstate);
26964  Py_XDECREF(setstate_cython);
26965  return ret;
26966 }
26967 
26968 /* SetVTable */
26969 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
26970 #if PY_VERSION_HEX >= 0x02070000
26971  PyObject *ob = PyCapsule_New(vtable, 0, 0);
26972 #else
26973  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
26974 #endif
26975  if (!ob)
26976  goto bad;
26977  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
26978  goto bad;
26979  Py_DECREF(ob);
26980  return 0;
26981 bad:
26982  Py_XDECREF(ob);
26983  return -1;
26984 }
26985 
26986 /* TypeImport */
26987 #ifndef __PYX_HAVE_RT_ImportType
26988 #define __PYX_HAVE_RT_ImportType
26989 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
26990  size_t size, enum __Pyx_ImportType_CheckSize check_size)
26991 {
26992  PyObject *result = 0;
26993  char warning[200];
26994  Py_ssize_t basicsize;
26995 #ifdef Py_LIMITED_API
26996  PyObject *py_basicsize;
26997 #endif
26998  result = PyObject_GetAttrString(module, class_name);
26999  if (!result)
27000  goto bad;
27001  if (!PyType_Check(result)) {
27002  PyErr_Format(PyExc_TypeError,
27003  "%.200s.%.200s is not a type object",
27004  module_name, class_name);
27005  goto bad;
27006  }
27007 #ifndef Py_LIMITED_API
27008  basicsize = ((PyTypeObject *)result)->tp_basicsize;
27009 #else
27010  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
27011  if (!py_basicsize)
27012  goto bad;
27013  basicsize = PyLong_AsSsize_t(py_basicsize);
27014  Py_DECREF(py_basicsize);
27015  py_basicsize = 0;
27016  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
27017  goto bad;
27018 #endif
27019  if ((size_t)basicsize < size) {
27020  PyErr_Format(PyExc_ValueError,
27021  "%.200s.%.200s size changed, may indicate binary incompatibility. "
27022  "Expected %zd from C header, got %zd from PyObject",
27023  module_name, class_name, size, basicsize);
27024  goto bad;
27025  }
27026  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
27027  PyErr_Format(PyExc_ValueError,
27028  "%.200s.%.200s size changed, may indicate binary incompatibility. "
27029  "Expected %zd from C header, got %zd from PyObject",
27030  module_name, class_name, size, basicsize);
27031  goto bad;
27032  }
27033  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
27034  PyOS_snprintf(warning, sizeof(warning),
27035  "%s.%s size changed, may indicate binary incompatibility. "
27036  "Expected %zd from C header, got %zd from PyObject",
27037  module_name, class_name, size, basicsize);
27038  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
27039  }
27040  return (PyTypeObject *)result;
27041 bad:
27042  Py_XDECREF(result);
27043  return NULL;
27044 }
27045 #endif
27046 
27047 /* CLineInTraceback */
27048 #ifndef CYTHON_CLINE_IN_TRACEBACK
27049 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
27050  PyObject *use_cline;
27051  PyObject *ptype, *pvalue, *ptraceback;
27052 #if CYTHON_COMPILING_IN_CPYTHON
27053  PyObject **cython_runtime_dict;
27054 #endif
27055  if (unlikely(!__pyx_cython_runtime)) {
27056  return c_line;
27057  }
27058  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
27059 #if CYTHON_COMPILING_IN_CPYTHON
27060  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
27061  if (likely(cython_runtime_dict)) {
27062  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
27063  use_cline, *cython_runtime_dict,
27064  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
27065  } else
27066 #endif
27067  {
27068  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
27069  if (use_cline_obj) {
27070  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
27071  Py_DECREF(use_cline_obj);
27072  } else {
27073  PyErr_Clear();
27074  use_cline = NULL;
27075  }
27076  }
27077  if (!use_cline) {
27078  c_line = 0;
27079  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
27080  }
27081  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
27082  c_line = 0;
27083  }
27084  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
27085  return c_line;
27086 }
27087 #endif
27088 
27089 /* CodeObjectCache */
27090 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
27091  int start = 0, mid = 0, end = count - 1;
27092  if (end >= 0 && code_line > entries[end].code_line) {
27093  return count;
27094  }
27095  while (start < end) {
27096  mid = start + (end - start) / 2;
27097  if (code_line < entries[mid].code_line) {
27098  end = mid;
27099  } else if (code_line > entries[mid].code_line) {
27100  start = mid + 1;
27101  } else {
27102  return mid;
27103  }
27104  }
27105  if (code_line <= entries[mid].code_line) {
27106  return mid;
27107  } else {
27108  return mid + 1;
27109  }
27110 }
27111 static PyCodeObject *__pyx_find_code_object(int code_line) {
27112  PyCodeObject* code_object;
27113  int pos;
27114  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
27115  return NULL;
27116  }
27117  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27118  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
27119  return NULL;
27120  }
27121  code_object = __pyx_code_cache.entries[pos].code_object;
27122  Py_INCREF(code_object);
27123  return code_object;
27124 }
27125 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
27126  int pos, i;
27127  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
27128  if (unlikely(!code_line)) {
27129  return;
27130  }
27131  if (unlikely(!entries)) {
27132  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
27133  if (likely(entries)) {
27134  __pyx_code_cache.entries = entries;
27135  __pyx_code_cache.max_count = 64;
27136  __pyx_code_cache.count = 1;
27137  entries[0].code_line = code_line;
27138  entries[0].code_object = code_object;
27139  Py_INCREF(code_object);
27140  }
27141  return;
27142  }
27143  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
27144  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
27145  PyCodeObject* tmp = entries[pos].code_object;
27146  entries[pos].code_object = code_object;
27147  Py_DECREF(tmp);
27148  return;
27149  }
27150  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
27151  int new_max = __pyx_code_cache.max_count + 64;
27152  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
27153  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
27154  if (unlikely(!entries)) {
27155  return;
27156  }
27157  __pyx_code_cache.entries = entries;
27158  __pyx_code_cache.max_count = new_max;
27159  }
27160  for (i=__pyx_code_cache.count; i>pos; i--) {
27161  entries[i] = entries[i-1];
27162  }
27163  entries[pos].code_line = code_line;
27164  entries[pos].code_object = code_object;
27165  __pyx_code_cache.count++;
27166  Py_INCREF(code_object);
27167 }
27168 
27169 /* AddTraceback */
27170 #include "compile.h"
27171 #include "frameobject.h"
27172 #include "traceback.h"
27173 #if PY_VERSION_HEX >= 0x030b00a6
27174  #ifndef Py_BUILD_CORE
27175  #define Py_BUILD_CORE 1
27176  #endif
27177  #include "internal/pycore_frame.h"
27178 #endif
27179 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
27180  const char *funcname, int c_line,
27181  int py_line, const char *filename) {
27182  PyCodeObject *py_code = NULL;
27183  PyObject *py_funcname = NULL;
27184  #if PY_MAJOR_VERSION < 3
27185  PyObject *py_srcfile = NULL;
27186  py_srcfile = PyString_FromString(filename);
27187  if (!py_srcfile) goto bad;
27188  #endif
27189  if (c_line) {
27190  #if PY_MAJOR_VERSION < 3
27191  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27192  if (!py_funcname) goto bad;
27193  #else
27194  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
27195  if (!py_funcname) goto bad;
27196  funcname = PyUnicode_AsUTF8(py_funcname);
27197  if (!funcname) goto bad;
27198  #endif
27199  }
27200  else {
27201  #if PY_MAJOR_VERSION < 3
27202  py_funcname = PyString_FromString(funcname);
27203  if (!py_funcname) goto bad;
27204  #endif
27205  }
27206  #if PY_MAJOR_VERSION < 3
27207  py_code = __Pyx_PyCode_New(
27208  0,
27209  0,
27210  0,
27211  0,
27212  0,
27213  __pyx_empty_bytes, /*PyObject *code,*/
27214  __pyx_empty_tuple, /*PyObject *consts,*/
27215  __pyx_empty_tuple, /*PyObject *names,*/
27216  __pyx_empty_tuple, /*PyObject *varnames,*/
27217  __pyx_empty_tuple, /*PyObject *freevars,*/
27218  __pyx_empty_tuple, /*PyObject *cellvars,*/
27219  py_srcfile, /*PyObject *filename,*/
27220  py_funcname, /*PyObject *name,*/
27221  py_line,
27222  __pyx_empty_bytes /*PyObject *lnotab*/
27223  );
27224  Py_DECREF(py_srcfile);
27225  #else
27226  py_code = PyCode_NewEmpty(filename, funcname, py_line);
27227  #endif
27228  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
27229  return py_code;
27230 bad:
27231  Py_XDECREF(py_funcname);
27232  #if PY_MAJOR_VERSION < 3
27233  Py_XDECREF(py_srcfile);
27234  #endif
27235  return NULL;
27236 }
27237 static void __Pyx_AddTraceback(const char *funcname, int c_line,
27238  int py_line, const char *filename) {
27239  PyCodeObject *py_code = 0;
27240  PyFrameObject *py_frame = 0;
27241  PyThreadState *tstate = __Pyx_PyThreadState_Current;
27242  PyObject *ptype, *pvalue, *ptraceback;
27243  if (c_line) {
27244  c_line = __Pyx_CLineForTraceback(tstate, c_line);
27245  }
27246  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
27247  if (!py_code) {
27248  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
27249  py_code = __Pyx_CreateCodeObjectForTraceback(
27250  funcname, c_line, py_line, filename);
27251  if (!py_code) {
27252  /* If the code object creation fails, then we should clear the
27253  fetched exception references and propagate the new exception */
27254  Py_XDECREF(ptype);
27255  Py_XDECREF(pvalue);
27256  Py_XDECREF(ptraceback);
27257  goto bad;
27258  }
27259  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
27260  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
27261  }
27262  py_frame = PyFrame_New(
27263  tstate, /*PyThreadState *tstate,*/
27264  py_code, /*PyCodeObject *code,*/
27265  __pyx_d, /*PyObject *globals,*/
27266  0 /*PyObject *locals*/
27267  );
27268  if (!py_frame) goto bad;
27269  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
27270  PyTraceBack_Here(py_frame);
27271 bad:
27272  Py_XDECREF(py_code);
27273  Py_XDECREF(py_frame);
27274 }
27275 
27276 #if PY_MAJOR_VERSION < 3
27277 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
27278  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
27279  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
27280  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
27281  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
27282  return -1;
27283 }
27284 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
27285  PyObject *obj = view->obj;
27286  if (!obj) return;
27287  if (PyObject_CheckBuffer(obj)) {
27288  PyBuffer_Release(view);
27289  return;
27290  }
27291  if ((0)) {}
27292  view->obj = NULL;
27293  Py_DECREF(obj);
27294 }
27295 #endif
27296 
27297 
27298 /* MemviewSliceIsContig */
27299 static int
27300 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
27301 {
27302  int i, index, step, start;
27303  Py_ssize_t itemsize = mvs.memview->view.itemsize;
27304  if (order == 'F') {
27305  step = 1;
27306  start = 0;
27307  } else {
27308  step = -1;
27309  start = ndim - 1;
27310  }
27311  for (i = 0; i < ndim; i++) {
27312  index = start + step * i;
27313  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
27314  return 0;
27315  itemsize *= mvs.shape[index];
27316  }
27317  return 1;
27318 }
27319 
27320 /* OverlappingSlices */
27321 static void
27322 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
27323  void **out_start, void **out_end,
27324  int ndim, size_t itemsize)
27325 {
27326  char *start, *end;
27327  int i;
27328  start = end = slice->data;
27329  for (i = 0; i < ndim; i++) {
27330  Py_ssize_t stride = slice->strides[i];
27331  Py_ssize_t extent = slice->shape[i];
27332  if (extent == 0) {
27333  *out_start = *out_end = start;
27334  return;
27335  } else {
27336  if (stride > 0)
27337  end += stride * (extent - 1);
27338  else
27339  start += stride * (extent - 1);
27340  }
27341  }
27342  *out_start = start;
27343  *out_end = end + itemsize;
27344 }
27345 static int
27346 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
27347  __Pyx_memviewslice *slice2,
27348  int ndim, size_t itemsize)
27349 {
27350  void *start1, *end1, *start2, *end2;
27351  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
27352  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
27353  return (start1 < end2) && (start2 < end1);
27354 }
27355 
27356 /* Capsule */
27357 static CYTHON_INLINE PyObject *
27358 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
27359 {
27360  PyObject *cobj;
27361 #if PY_VERSION_HEX >= 0x02070000
27362  cobj = PyCapsule_New(p, sig, NULL);
27363 #else
27364  cobj = PyCObject_FromVoidPtr(p, NULL);
27365 #endif
27366  return cobj;
27367 }
27368 
27369 /* MemviewDtypeToObject */
27370 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
27371  return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
27372 }
27373 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
27374  double value = __pyx_PyFloat_AsDouble(obj);
27375  if ((value == (double)-1) && PyErr_Occurred())
27376  return 0;
27377  *(double *) itemp = value;
27378  return 1;
27379 }
27380 
27381 /* IsLittleEndian */
27382 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
27383 {
27384  union {
27385  uint32_t u32;
27386  uint8_t u8[4];
27387  } S;
27388  S.u32 = 0x01020304;
27389  return S.u8[0] == 4;
27390 }
27391 
27392 /* BufferFormatCheck */
27393 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
27394  __Pyx_BufFmt_StackElem* stack,
27395  __Pyx_TypeInfo* type) {
27396  stack[0].field = &ctx->root;
27397  stack[0].parent_offset = 0;
27398  ctx->root.type = type;
27399  ctx->root.name = "buffer dtype";
27400  ctx->root.offset = 0;
27401  ctx->head = stack;
27402  ctx->head->field = &ctx->root;
27403  ctx->fmt_offset = 0;
27404  ctx->head->parent_offset = 0;
27405  ctx->new_packmode = '@';
27406  ctx->enc_packmode = '@';
27407  ctx->new_count = 1;
27408  ctx->enc_count = 0;
27409  ctx->enc_type = 0;
27410  ctx->is_complex = 0;
27411  ctx->is_valid_array = 0;
27412  ctx->struct_alignment = 0;
27413  while (type->typegroup == 'S') {
27414  ++ctx->head;
27415  ctx->head->field = type->fields;
27416  ctx->head->parent_offset = 0;
27417  type = type->fields->type;
27418  }
27419 }
27420 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
27421  int count;
27422  const char* t = *ts;
27423  if (*t < '0' || *t > '9') {
27424  return -1;
27425  } else {
27426  count = *t++ - '0';
27427  while (*t >= '0' && *t <= '9') {
27428  count *= 10;
27429  count += *t++ - '0';
27430  }
27431  }
27432  *ts = t;
27433  return count;
27434 }
27435 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
27436  int number = __Pyx_BufFmt_ParseNumber(ts);
27437  if (number == -1)
27438  PyErr_Format(PyExc_ValueError,\
27439  "Does not understand character buffer dtype format string ('%c')", **ts);
27440  return number;
27441 }
27442 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
27443  PyErr_Format(PyExc_ValueError,
27444  "Unexpected format string character: '%c'", ch);
27445 }
27446 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
27447  switch (ch) {
27448  case '?': return "'bool'";
27449  case 'c': return "'char'";
27450  case 'b': return "'signed char'";
27451  case 'B': return "'unsigned char'";
27452  case 'h': return "'short'";
27453  case 'H': return "'unsigned short'";
27454  case 'i': return "'int'";
27455  case 'I': return "'unsigned int'";
27456  case 'l': return "'long'";
27457  case 'L': return "'unsigned long'";
27458  case 'q': return "'long long'";
27459  case 'Q': return "'unsigned long long'";
27460  case 'f': return (is_complex ? "'complex float'" : "'float'");
27461  case 'd': return (is_complex ? "'complex double'" : "'double'");
27462  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
27463  case 'T': return "a struct";
27464  case 'O': return "Python object";
27465  case 'P': return "a pointer";
27466  case 's': case 'p': return "a string";
27467  case 0: return "end";
27468  default: return "unparseable format string";
27469  }
27470 }
27471 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
27472  switch (ch) {
27473  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27474  case 'h': case 'H': return 2;
27475  case 'i': case 'I': case 'l': case 'L': return 4;
27476  case 'q': case 'Q': return 8;
27477  case 'f': return (is_complex ? 8 : 4);
27478  case 'd': return (is_complex ? 16 : 8);
27479  case 'g': {
27480  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
27481  return 0;
27482  }
27483  case 'O': case 'P': return sizeof(void*);
27484  default:
27485  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27486  return 0;
27487  }
27488 }
27489 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
27490  switch (ch) {
27491  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27492  case 'h': case 'H': return sizeof(short);
27493  case 'i': case 'I': return sizeof(int);
27494  case 'l': case 'L': return sizeof(long);
27495  #ifdef HAVE_LONG_LONG
27496  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
27497  #endif
27498  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
27499  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
27500  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
27501  case 'O': case 'P': return sizeof(void*);
27502  default: {
27503  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27504  return 0;
27505  }
27506  }
27507 }
27508 typedef struct { char c; short x; } __Pyx_st_short;
27509 typedef struct { char c; int x; } __Pyx_st_int;
27510 typedef struct { char c; long x; } __Pyx_st_long;
27511 typedef struct { char c; float x; } __Pyx_st_float;
27512 typedef struct { char c; double x; } __Pyx_st_double;
27513 typedef struct { char c; long double x; } __Pyx_st_longdouble;
27514 typedef struct { char c; void *x; } __Pyx_st_void_p;
27515 #ifdef HAVE_LONG_LONG
27516 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
27517 #endif
27518 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
27519  switch (ch) {
27520  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27521  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
27522  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
27523  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
27524 #ifdef HAVE_LONG_LONG
27525  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
27526 #endif
27527  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
27528  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
27529  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
27530  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
27531  default:
27532  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27533  return 0;
27534  }
27535 }
27536 /* These are for computing the padding at the end of the struct to align
27537  on the first member of the struct. This will probably the same as above,
27538  but we don't have any guarantees.
27539  */
27540 typedef struct { short x; char c; } __Pyx_pad_short;
27541 typedef struct { int x; char c; } __Pyx_pad_int;
27542 typedef struct { long x; char c; } __Pyx_pad_long;
27543 typedef struct { float x; char c; } __Pyx_pad_float;
27544 typedef struct { double x; char c; } __Pyx_pad_double;
27545 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
27546 typedef struct { void *x; char c; } __Pyx_pad_void_p;
27547 #ifdef HAVE_LONG_LONG
27548 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
27549 #endif
27550 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
27551  switch (ch) {
27552  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
27553  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
27554  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
27555  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
27556 #ifdef HAVE_LONG_LONG
27557  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
27558 #endif
27559  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
27560  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
27561  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
27562  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
27563  default:
27564  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27565  return 0;
27566  }
27567 }
27568 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
27569  switch (ch) {
27570  case 'c':
27571  return 'H';
27572  case 'b': case 'h': case 'i':
27573  case 'l': case 'q': case 's': case 'p':
27574  return 'I';
27575  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
27576  return 'U';
27577  case 'f': case 'd': case 'g':
27578  return (is_complex ? 'C' : 'R');
27579  case 'O':
27580  return 'O';
27581  case 'P':
27582  return 'P';
27583  default: {
27584  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
27585  return 0;
27586  }
27587  }
27588 }
27589 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
27590  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
27591  const char* expected;
27592  const char* quote;
27593  if (ctx->head == NULL) {
27594  expected = "end";
27595  quote = "";
27596  } else {
27597  expected = ctx->head->field->type->name;
27598  quote = "'";
27599  }
27600  PyErr_Format(PyExc_ValueError,
27601  "Buffer dtype mismatch, expected %s%s%s but got %s",
27602  quote, expected, quote,
27603  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
27604  } else {
27605  __Pyx_StructField* field = ctx->head->field;
27606  __Pyx_StructField* parent = (ctx->head - 1)->field;
27607  PyErr_Format(PyExc_ValueError,
27608  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
27609  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
27610  parent->type->name, field->name);
27611  }
27612 }
27613 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
27614  char group;
27615  size_t size, offset, arraysize = 1;
27616  if (ctx->enc_type == 0) return 0;
27617  if (ctx->head->field->type->arraysize[0]) {
27618  int i, ndim = 0;
27619  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
27620  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
27621  ndim = 1;
27622  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
27623  PyErr_Format(PyExc_ValueError,
27624  "Expected a dimension of size %zu, got %zu",
27625  ctx->head->field->type->arraysize[0], ctx->enc_count);
27626  return -1;
27627  }
27628  }
27629  if (!ctx->is_valid_array) {
27630  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
27631  ctx->head->field->type->ndim, ndim);
27632  return -1;
27633  }
27634  for (i = 0; i < ctx->head->field->type->ndim; i++) {
27635  arraysize *= ctx->head->field->type->arraysize[i];
27636  }
27637  ctx->is_valid_array = 0;
27638  ctx->enc_count = 1;
27639  }
27640  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
27641  do {
27642  __Pyx_StructField* field = ctx->head->field;
27643  __Pyx_TypeInfo* type = field->type;
27644  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
27645  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
27646  } else {
27647  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
27648  }
27649  if (ctx->enc_packmode == '@') {
27650  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
27651  size_t align_mod_offset;
27652  if (align_at == 0) return -1;
27653  align_mod_offset = ctx->fmt_offset % align_at;
27654  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
27655  if (ctx->struct_alignment == 0)
27656  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
27657  ctx->is_complex);
27658  }
27659  if (type->size != size || type->typegroup != group) {
27660  if (type->typegroup == 'C' && type->fields != NULL) {
27661  size_t parent_offset = ctx->head->parent_offset + field->offset;
27662  ++ctx->head;
27663  ctx->head->field = type->fields;
27664  ctx->head->parent_offset = parent_offset;
27665  continue;
27666  }
27667  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
27668  } else {
27669  __Pyx_BufFmt_RaiseExpected(ctx);
27670  return -1;
27671  }
27672  }
27673  offset = ctx->head->parent_offset + field->offset;
27674  if (ctx->fmt_offset != offset) {
27675  PyErr_Format(PyExc_ValueError,
27676  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
27677  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
27678  return -1;
27679  }
27680  ctx->fmt_offset += size;
27681  if (arraysize)
27682  ctx->fmt_offset += (arraysize - 1) * size;
27683  --ctx->enc_count;
27684  while (1) {
27685  if (field == &ctx->root) {
27686  ctx->head = NULL;
27687  if (ctx->enc_count != 0) {
27688  __Pyx_BufFmt_RaiseExpected(ctx);
27689  return -1;
27690  }
27691  break;
27692  }
27693  ctx->head->field = ++field;
27694  if (field->type == NULL) {
27695  --ctx->head;
27696  field = ctx->head->field;
27697  continue;
27698  } else if (field->type->typegroup == 'S') {
27699  size_t parent_offset = ctx->head->parent_offset + field->offset;
27700  if (field->type->fields->type == NULL) continue;
27701  field = field->type->fields;
27702  ++ctx->head;
27703  ctx->head->field = field;
27704  ctx->head->parent_offset = parent_offset;
27705  break;
27706  } else {
27707  break;
27708  }
27709  }
27710  } while (ctx->enc_count);
27711  ctx->enc_type = 0;
27712  ctx->is_complex = 0;
27713  return 0;
27714 }
27715 static PyObject *
27716 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
27717 {
27718  const char *ts = *tsp;
27719  int i = 0, number, ndim;
27720  ++ts;
27721  if (ctx->new_count != 1) {
27722  PyErr_SetString(PyExc_ValueError,
27723  "Cannot handle repeated arrays in format string");
27724  return NULL;
27725  }
27726  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27727  ndim = ctx->head->field->type->ndim;
27728  while (*ts && *ts != ')') {
27729  switch (*ts) {
27730  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
27731  default: break;
27732  }
27733  number = __Pyx_BufFmt_ExpectNumber(&ts);
27734  if (number == -1) return NULL;
27735  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
27736  return PyErr_Format(PyExc_ValueError,
27737  "Expected a dimension of size %zu, got %d",
27738  ctx->head->field->type->arraysize[i], number);
27739  if (*ts != ',' && *ts != ')')
27740  return PyErr_Format(PyExc_ValueError,
27741  "Expected a comma in format string, got '%c'", *ts);
27742  if (*ts == ',') ts++;
27743  i++;
27744  }
27745  if (i != ndim)
27746  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
27747  ctx->head->field->type->ndim, i);
27748  if (!*ts) {
27749  PyErr_SetString(PyExc_ValueError,
27750  "Unexpected end of format string, expected ')'");
27751  return NULL;
27752  }
27753  ctx->is_valid_array = 1;
27754  ctx->new_count = 1;
27755  *tsp = ++ts;
27756  return Py_None;
27757 }
27758 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
27759  int got_Z = 0;
27760  while (1) {
27761  switch(*ts) {
27762  case 0:
27763  if (ctx->enc_type != 0 && ctx->head == NULL) {
27764  __Pyx_BufFmt_RaiseExpected(ctx);
27765  return NULL;
27766  }
27767  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27768  if (ctx->head != NULL) {
27769  __Pyx_BufFmt_RaiseExpected(ctx);
27770  return NULL;
27771  }
27772  return ts;
27773  case ' ':
27774  case '\r':
27775  case '\n':
27776  ++ts;
27777  break;
27778  case '<':
27779  if (!__Pyx_Is_Little_Endian()) {
27780  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
27781  return NULL;
27782  }
27783  ctx->new_packmode = '=';
27784  ++ts;
27785  break;
27786  case '>':
27787  case '!':
27788  if (__Pyx_Is_Little_Endian()) {
27789  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
27790  return NULL;
27791  }
27792  ctx->new_packmode = '=';
27793  ++ts;
27794  break;
27795  case '=':
27796  case '@':
27797  case '^':
27798  ctx->new_packmode = *ts++;
27799  break;
27800  case 'T':
27801  {
27802  const char* ts_after_sub;
27803  size_t i, struct_count = ctx->new_count;
27804  size_t struct_alignment = ctx->struct_alignment;
27805  ctx->new_count = 1;
27806  ++ts;
27807  if (*ts != '{') {
27808  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
27809  return NULL;
27810  }
27811  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27812  ctx->enc_type = 0;
27813  ctx->enc_count = 0;
27814  ctx->struct_alignment = 0;
27815  ++ts;
27816  ts_after_sub = ts;
27817  for (i = 0; i != struct_count; ++i) {
27818  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27819  if (!ts_after_sub) return NULL;
27820  }
27821  ts = ts_after_sub;
27822  if (struct_alignment) ctx->struct_alignment = struct_alignment;
27823  }
27824  break;
27825  case '}':
27826  {
27827  size_t alignment = ctx->struct_alignment;
27828  ++ts;
27829  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27830  ctx->enc_type = 0;
27831  if (alignment && ctx->fmt_offset % alignment) {
27832  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27833  }
27834  }
27835  return ts;
27836  case 'x':
27837  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27838  ctx->fmt_offset += ctx->new_count;
27839  ctx->new_count = 1;
27840  ctx->enc_count = 0;
27841  ctx->enc_type = 0;
27842  ctx->enc_packmode = ctx->new_packmode;
27843  ++ts;
27844  break;
27845  case 'Z':
27846  got_Z = 1;
27847  ++ts;
27848  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
27849  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
27850  return NULL;
27851  }
27852  CYTHON_FALLTHROUGH;
27853  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
27854  case 'l': case 'L': case 'q': case 'Q':
27855  case 'f': case 'd': case 'g':
27856  case 'O': case 'p':
27857  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
27858  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
27859  ctx->enc_count += ctx->new_count;
27860  ctx->new_count = 1;
27861  got_Z = 0;
27862  ++ts;
27863  break;
27864  }
27865  CYTHON_FALLTHROUGH;
27866  case 's':
27867  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27868  ctx->enc_count = ctx->new_count;
27869  ctx->enc_packmode = ctx->new_packmode;
27870  ctx->enc_type = *ts;
27871  ctx->is_complex = got_Z;
27872  ++ts;
27873  ctx->new_count = 1;
27874  got_Z = 0;
27875  break;
27876  case ':':
27877  ++ts;
27878  while(*ts != ':') ++ts;
27879  ++ts;
27880  break;
27881  case '(':
27882  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
27883  break;
27884  default:
27885  {
27886  int number = __Pyx_BufFmt_ExpectNumber(&ts);
27887  if (number == -1) return NULL;
27888  ctx->new_count = (size_t)number;
27889  }
27890  }
27891  }
27892 }
27893 
27894 /* TypeInfoCompare */
27895  static int
27896 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27897 {
27898  int i;
27899  if (!a || !b)
27900  return 0;
27901  if (a == b)
27902  return 1;
27903  if (a->size != b->size || a->typegroup != b->typegroup ||
27904  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27905  if (a->typegroup == 'H' || b->typegroup == 'H') {
27906  return a->size == b->size;
27907  } else {
27908  return 0;
27909  }
27910  }
27911  if (a->ndim) {
27912  for (i = 0; i < a->ndim; i++)
27913  if (a->arraysize[i] != b->arraysize[i])
27914  return 0;
27915  }
27916  if (a->typegroup == 'S') {
27917  if (a->flags != b->flags)
27918  return 0;
27919  if (a->fields || b->fields) {
27920  if (!(a->fields && b->fields))
27921  return 0;
27922  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27923  __Pyx_StructField *field_a = a->fields + i;
27924  __Pyx_StructField *field_b = b->fields + i;
27925  if (field_a->offset != field_b->offset ||
27926  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27927  return 0;
27928  }
27929  return !a->fields[i].type && !b->fields[i].type;
27930  }
27931  }
27932  return 1;
27933 }
27934 
27935 /* MemviewSliceValidateAndInit */
27936  static int
27937 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
27938 {
27939  if (buf->shape[dim] <= 1)
27940  return 1;
27941  if (buf->strides) {
27942  if (spec & __Pyx_MEMVIEW_CONTIG) {
27943  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27944  if (unlikely(buf->strides[dim] != sizeof(void *))) {
27945  PyErr_Format(PyExc_ValueError,
27946  "Buffer is not indirectly contiguous "
27947  "in dimension %d.", dim);
27948  goto fail;
27949  }
27950  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
27951  PyErr_SetString(PyExc_ValueError,
27952  "Buffer and memoryview are not contiguous "
27953  "in the same dimension.");
27954  goto fail;
27955  }
27956  }
27957  if (spec & __Pyx_MEMVIEW_FOLLOW) {
27958  Py_ssize_t stride = buf->strides[dim];
27959  if (stride < 0)
27960  stride = -stride;
27961  if (unlikely(stride < buf->itemsize)) {
27962  PyErr_SetString(PyExc_ValueError,
27963  "Buffer and memoryview are not contiguous "
27964  "in the same dimension.");
27965  goto fail;
27966  }
27967  }
27968  } else {
27969  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
27970  PyErr_Format(PyExc_ValueError,
27971  "C-contiguous buffer is not contiguous in "
27972  "dimension %d", dim);
27973  goto fail;
27974  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
27975  PyErr_Format(PyExc_ValueError,
27976  "C-contiguous buffer is not indirect in "
27977  "dimension %d", dim);
27978  goto fail;
27979  } else if (unlikely(buf->suboffsets)) {
27980  PyErr_SetString(PyExc_ValueError,
27981  "Buffer exposes suboffsets but no strides");
27982  goto fail;
27983  }
27984  }
27985  return 1;
27986 fail:
27987  return 0;
27988 }
27989 static int
27990 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
27991 {
27992  if (spec & __Pyx_MEMVIEW_DIRECT) {
27993  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
27994  PyErr_Format(PyExc_ValueError,
27995  "Buffer not compatible with direct access "
27996  "in dimension %d.", dim);
27997  goto fail;
27998  }
27999  }
28000  if (spec & __Pyx_MEMVIEW_PTR) {
28001  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
28002  PyErr_Format(PyExc_ValueError,
28003  "Buffer is not indirectly accessible "
28004  "in dimension %d.", dim);
28005  goto fail;
28006  }
28007  }
28008  return 1;
28009 fail:
28010  return 0;
28011 }
28012 static int
28013 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
28014 {
28015  int i;
28016  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
28017  Py_ssize_t stride = 1;
28018  for (i = 0; i < ndim; i++) {
28019  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
28020  PyErr_SetString(PyExc_ValueError,
28021  "Buffer not fortran contiguous.");
28022  goto fail;
28023  }
28024  stride = stride * buf->shape[i];
28025  }
28026  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
28027  Py_ssize_t stride = 1;
28028  for (i = ndim - 1; i >- 1; i--) {
28029  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
28030  PyErr_SetString(PyExc_ValueError,
28031  "Buffer not C contiguous.");
28032  goto fail;
28033  }
28034  stride = stride * buf->shape[i];
28035  }
28036  }
28037  return 1;
28038 fail:
28039  return 0;
28040 }
28041 static int __Pyx_ValidateAndInit_memviewslice(
28042  int *axes_specs,
28043  int c_or_f_flag,
28044  int buf_flags,
28045  int ndim,
28046  __Pyx_TypeInfo *dtype,
28047  __Pyx_BufFmt_StackElem stack[],
28048  __Pyx_memviewslice *memviewslice,
28049  PyObject *original_obj)
28050 {
28051  struct __pyx_memoryview_obj *memview, *new_memview;
28052  __Pyx_RefNannyDeclarations
28053  Py_buffer *buf;
28054  int i, spec = 0, retval = -1;
28055  __Pyx_BufFmt_Context ctx;
28056  int from_memoryview = __pyx_memoryview_check(original_obj);
28057  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
28058  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
28059  original_obj)->typeinfo)) {
28060  memview = (struct __pyx_memoryview_obj *) original_obj;
28061  new_memview = NULL;
28062  } else {
28063  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28064  original_obj, buf_flags, 0, dtype);
28065  new_memview = memview;
28066  if (unlikely(!memview))
28067  goto fail;
28068  }
28069  buf = &memview->view;
28070  if (unlikely(buf->ndim != ndim)) {
28071  PyErr_Format(PyExc_ValueError,
28072  "Buffer has wrong number of dimensions (expected %d, got %d)",
28073  ndim, buf->ndim);
28074  goto fail;
28075  }
28076  if (new_memview) {
28077  __Pyx_BufFmt_Init(&ctx, stack, dtype);
28078  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
28079  }
28080  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
28081  PyErr_Format(PyExc_ValueError,
28082  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
28083  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
28084  buf->itemsize,
28085  (buf->itemsize > 1) ? "s" : "",
28086  dtype->name,
28087  dtype->size,
28088  (dtype->size > 1) ? "s" : "");
28089  goto fail;
28090  }
28091  if (buf->len > 0) {
28092  for (i = 0; i < ndim; i++) {
28093  spec = axes_specs[i];
28094  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
28095  goto fail;
28096  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
28097  goto fail;
28098  }
28099  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
28100  goto fail;
28101  }
28102  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
28103  new_memview != NULL) == -1)) {
28104  goto fail;
28105  }
28106  retval = 0;
28107  goto no_fail;
28108 fail:
28109  Py_XDECREF(new_memview);
28110  retval = -1;
28111 no_fail:
28112  __Pyx_RefNannyFinishContext();
28113  return retval;
28114 }
28115 
28116 /* ObjectToMemviewSlice */
28117  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
28118  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
28119  __Pyx_BufFmt_StackElem stack[1];
28120  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
28121  int retcode;
28122  if (obj == Py_None) {
28123  result.memview = (struct __pyx_memoryview_obj *) Py_None;
28124  return result;
28125  }
28126  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
28127  PyBUF_RECORDS_RO | writable_flag, 1,
28128  &__Pyx_TypeInfo_double, stack,
28129  &result, obj);
28130  if (unlikely(retcode == -1))
28131  goto __pyx_fail;
28132  return result;
28133 __pyx_fail:
28134  result.memview = NULL;
28135  result.data = NULL;
28136  return result;
28137 }
28138 
28139 /* CIntFromPyVerify */
28140  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
28141  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
28142 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
28143  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
28144 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
28145  {\
28146  func_type value = func_value;\
28147  if (sizeof(target_type) < sizeof(func_type)) {\
28148  if (unlikely(value != (func_type) (target_type) value)) {\
28149  func_type zero = 0;\
28150  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
28151  return (target_type) -1;\
28152  if (is_unsigned && unlikely(value < zero))\
28153  goto raise_neg_overflow;\
28154  else\
28155  goto raise_overflow;\
28156  }\
28157  }\
28158  return (target_type) value;\
28159  }
28160 
28161 /* Declarations */
28162  #if CYTHON_CCOMPLEX
28163  #ifdef __cplusplus
28164  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
28165  return ::std::complex< float >(x, y);
28166  }
28167  #else
28168  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
28169  return x + y*(__pyx_t_float_complex)_Complex_I;
28170  }
28171  #endif
28172 #else
28173  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
28174  __pyx_t_float_complex z;
28175  z.real = x;
28176  z.imag = y;
28177  return z;
28178  }
28179 #endif
28180 
28181 /* Arithmetic */
28182  #if CYTHON_CCOMPLEX
28183 #else
28184  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28185  return (a.real == b.real) && (a.imag == b.imag);
28186  }
28187  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28188  __pyx_t_float_complex z;
28189  z.real = a.real + b.real;
28190  z.imag = a.imag + b.imag;
28191  return z;
28192  }
28193  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28194  __pyx_t_float_complex z;
28195  z.real = a.real - b.real;
28196  z.imag = a.imag - b.imag;
28197  return z;
28198  }
28199  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28200  __pyx_t_float_complex z;
28201  z.real = a.real * b.real - a.imag * b.imag;
28202  z.imag = a.real * b.imag + a.imag * b.real;
28203  return z;
28204  }
28205  #if 1
28206  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28207  if (b.imag == 0) {
28208  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28209  } else if (fabsf(b.real) >= fabsf(b.imag)) {
28210  if (b.real == 0 && b.imag == 0) {
28211  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
28212  } else {
28213  float r = b.imag / b.real;
28214  float s = (float)(1.0) / (b.real + b.imag * r);
28215  return __pyx_t_float_complex_from_parts(
28216  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
28217  }
28218  } else {
28219  float r = b.real / b.imag;
28220  float s = (float)(1.0) / (b.imag + b.real * r);
28221  return __pyx_t_float_complex_from_parts(
28222  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
28223  }
28224  }
28225  #else
28226  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28227  if (b.imag == 0) {
28228  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28229  } else {
28230  float denom = b.real * b.real + b.imag * b.imag;
28231  return __pyx_t_float_complex_from_parts(
28232  (a.real * b.real + a.imag * b.imag) / denom,
28233  (a.imag * b.real - a.real * b.imag) / denom);
28234  }
28235  }
28236  #endif
28237  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
28238  __pyx_t_float_complex z;
28239  z.real = -a.real;
28240  z.imag = -a.imag;
28241  return z;
28242  }
28243  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
28244  return (a.real == 0) && (a.imag == 0);
28245  }
28246  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
28247  __pyx_t_float_complex z;
28248  z.real = a.real;
28249  z.imag = -a.imag;
28250  return z;
28251  }
28252  #if 1
28253  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
28254  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
28255  return sqrtf(z.real*z.real + z.imag*z.imag);
28256  #else
28257  return hypotf(z.real, z.imag);
28258  #endif
28259  }
28260  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28261  __pyx_t_float_complex z;
28262  float r, lnr, theta, z_r, z_theta;
28263  if (b.imag == 0 && b.real == (int)b.real) {
28264  if (b.real < 0) {
28265  float denom = a.real * a.real + a.imag * a.imag;
28266  a.real = a.real / denom;
28267  a.imag = -a.imag / denom;
28268  b.real = -b.real;
28269  }
28270  switch ((int)b.real) {
28271  case 0:
28272  z.real = 1;
28273  z.imag = 0;
28274  return z;
28275  case 1:
28276  return a;
28277  case 2:
28278  return __Pyx_c_prod_float(a, a);
28279  case 3:
28280  z = __Pyx_c_prod_float(a, a);
28281  return __Pyx_c_prod_float(z, a);
28282  case 4:
28283  z = __Pyx_c_prod_float(a, a);
28284  return __Pyx_c_prod_float(z, z);
28285  }
28286  }
28287  if (a.imag == 0) {
28288  if (a.real == 0) {
28289  return a;
28290  } else if (b.imag == 0) {
28291  z.real = powf(a.real, b.real);
28292  z.imag = 0;
28293  return z;
28294  } else if (a.real > 0) {
28295  r = a.real;
28296  theta = 0;
28297  } else {
28298  r = -a.real;
28299  theta = atan2f(0.0, -1.0);
28300  }
28301  } else {
28302  r = __Pyx_c_abs_float(a);
28303  theta = atan2f(a.imag, a.real);
28304  }
28305  lnr = logf(r);
28306  z_r = expf(lnr * b.real - theta * b.imag);
28307  z_theta = theta * b.real + lnr * b.imag;
28308  z.real = z_r * cosf(z_theta);
28309  z.imag = z_r * sinf(z_theta);
28310  return z;
28311  }
28312  #endif
28313 #endif
28314 
28315 /* Declarations */
28316  #if CYTHON_CCOMPLEX
28317  #ifdef __cplusplus
28318  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
28319  return ::std::complex< double >(x, y);
28320  }
28321  #else
28322  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
28323  return x + y*(__pyx_t_double_complex)_Complex_I;
28324  }
28325  #endif
28326 #else
28327  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
28328  __pyx_t_double_complex z;
28329  z.real = x;
28330  z.imag = y;
28331  return z;
28332  }
28333 #endif
28334 
28335 /* Arithmetic */
28336  #if CYTHON_CCOMPLEX
28337 #else
28338  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28339  return (a.real == b.real) && (a.imag == b.imag);
28340  }
28341  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28342  __pyx_t_double_complex z;
28343  z.real = a.real + b.real;
28344  z.imag = a.imag + b.imag;
28345  return z;
28346  }
28347  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28348  __pyx_t_double_complex z;
28349  z.real = a.real - b.real;
28350  z.imag = a.imag - b.imag;
28351  return z;
28352  }
28353  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28354  __pyx_t_double_complex z;
28355  z.real = a.real * b.real - a.imag * b.imag;
28356  z.imag = a.real * b.imag + a.imag * b.real;
28357  return z;
28358  }
28359  #if 1
28360  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28361  if (b.imag == 0) {
28362  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28363  } else if (fabs(b.real) >= fabs(b.imag)) {
28364  if (b.real == 0 && b.imag == 0) {
28365  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
28366  } else {
28367  double r = b.imag / b.real;
28368  double s = (double)(1.0) / (b.real + b.imag * r);
28369  return __pyx_t_double_complex_from_parts(
28370  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
28371  }
28372  } else {
28373  double r = b.real / b.imag;
28374  double s = (double)(1.0) / (b.imag + b.real * r);
28375  return __pyx_t_double_complex_from_parts(
28376  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
28377  }
28378  }
28379  #else
28380  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28381  if (b.imag == 0) {
28382  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28383  } else {
28384  double denom = b.real * b.real + b.imag * b.imag;
28385  return __pyx_t_double_complex_from_parts(
28386  (a.real * b.real + a.imag * b.imag) / denom,
28387  (a.imag * b.real - a.real * b.imag) / denom);
28388  }
28389  }
28390  #endif
28391  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
28392  __pyx_t_double_complex z;
28393  z.real = -a.real;
28394  z.imag = -a.imag;
28395  return z;
28396  }
28397  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
28398  return (a.real == 0) && (a.imag == 0);
28399  }
28400  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
28401  __pyx_t_double_complex z;
28402  z.real = a.real;
28403  z.imag = -a.imag;
28404  return z;
28405  }
28406  #if 1
28407  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
28408  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
28409  return sqrt(z.real*z.real + z.imag*z.imag);
28410  #else
28411  return hypot(z.real, z.imag);
28412  #endif
28413  }
28414  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28415  __pyx_t_double_complex z;
28416  double r, lnr, theta, z_r, z_theta;
28417  if (b.imag == 0 && b.real == (int)b.real) {
28418  if (b.real < 0) {
28419  double denom = a.real * a.real + a.imag * a.imag;
28420  a.real = a.real / denom;
28421  a.imag = -a.imag / denom;
28422  b.real = -b.real;
28423  }
28424  switch ((int)b.real) {
28425  case 0:
28426  z.real = 1;
28427  z.imag = 0;
28428  return z;
28429  case 1:
28430  return a;
28431  case 2:
28432  return __Pyx_c_prod_double(a, a);
28433  case 3:
28434  z = __Pyx_c_prod_double(a, a);
28435  return __Pyx_c_prod_double(z, a);
28436  case 4:
28437  z = __Pyx_c_prod_double(a, a);
28438  return __Pyx_c_prod_double(z, z);
28439  }
28440  }
28441  if (a.imag == 0) {
28442  if (a.real == 0) {
28443  return a;
28444  } else if (b.imag == 0) {
28445  z.real = pow(a.real, b.real);
28446  z.imag = 0;
28447  return z;
28448  } else if (a.real > 0) {
28449  r = a.real;
28450  theta = 0;
28451  } else {
28452  r = -a.real;
28453  theta = atan2(0.0, -1.0);
28454  }
28455  } else {
28456  r = __Pyx_c_abs_double(a);
28457  theta = atan2(a.imag, a.real);
28458  }
28459  lnr = log(r);
28460  z_r = exp(lnr * b.real - theta * b.imag);
28461  z_theta = theta * b.real + lnr * b.imag;
28462  z.real = z_r * cos(z_theta);
28463  z.imag = z_r * sin(z_theta);
28464  return z;
28465  }
28466  #endif
28467 #endif
28468 
28469 /* MemviewSliceCopyTemplate */
28470  static __Pyx_memviewslice
28471 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
28472  const char *mode, int ndim,
28473  size_t sizeof_dtype, int contig_flag,
28474  int dtype_is_object)
28475 {
28476  __Pyx_RefNannyDeclarations
28477  int i;
28478  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
28479  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
28480  Py_buffer *buf = &from_memview->view;
28481  PyObject *shape_tuple = NULL;
28482  PyObject *temp_int = NULL;
28483  struct __pyx_array_obj *array_obj = NULL;
28484  struct __pyx_memoryview_obj *memview_obj = NULL;
28485  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
28486  for (i = 0; i < ndim; i++) {
28487  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
28488  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
28489  "indirect dimensions (axis %d)", i);
28490  goto fail;
28491  }
28492  }
28493  shape_tuple = PyTuple_New(ndim);
28494  if (unlikely(!shape_tuple)) {
28495  goto fail;
28496  }
28497  __Pyx_GOTREF(shape_tuple);
28498  for(i = 0; i < ndim; i++) {
28499  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
28500  if(unlikely(!temp_int)) {
28501  goto fail;
28502  } else {
28503  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
28504  temp_int = NULL;
28505  }
28506  }
28507  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
28508  if (unlikely(!array_obj)) {
28509  goto fail;
28510  }
28511  __Pyx_GOTREF(array_obj);
28512  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28513  (PyObject *) array_obj, contig_flag,
28514  dtype_is_object,
28515  from_mvs->memview->typeinfo);
28516  if (unlikely(!memview_obj))
28517  goto fail;
28518  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
28519  goto fail;
28520  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
28521  dtype_is_object) < 0))
28522  goto fail;
28523  goto no_fail;
28524 fail:
28525  __Pyx_XDECREF(new_mvs.memview);
28526  new_mvs.memview = NULL;
28527  new_mvs.data = NULL;
28528 no_fail:
28529  __Pyx_XDECREF(shape_tuple);
28530  __Pyx_XDECREF(temp_int);
28531  __Pyx_XDECREF(array_obj);
28532  __Pyx_RefNannyFinishContext();
28533  return new_mvs;
28534 }
28535 
28536 /* CIntToPy */
28537  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
28538 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28539 #pragma GCC diagnostic push
28540 #pragma GCC diagnostic ignored "-Wconversion"
28541 #endif
28542  const int neg_one = (int) -1, const_zero = (int) 0;
28543 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28544 #pragma GCC diagnostic pop
28545 #endif
28546  const int is_unsigned = neg_one > const_zero;
28547  if (is_unsigned) {
28548  if (sizeof(int) < sizeof(long)) {
28549  return PyInt_FromLong((long) value);
28550  } else if (sizeof(int) <= sizeof(unsigned long)) {
28551  return PyLong_FromUnsignedLong((unsigned long) value);
28552 #ifdef HAVE_LONG_LONG
28553  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
28554  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28555 #endif
28556  }
28557  } else {
28558  if (sizeof(int) <= sizeof(long)) {
28559  return PyInt_FromLong((long) value);
28560 #ifdef HAVE_LONG_LONG
28561  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28562  return PyLong_FromLongLong((PY_LONG_LONG) value);
28563 #endif
28564  }
28565  }
28566  {
28567  int one = 1; int little = (int)*(unsigned char *)&one;
28568  unsigned char *bytes = (unsigned char *)&value;
28569  return _PyLong_FromByteArray(bytes, sizeof(int),
28570  little, !is_unsigned);
28571  }
28572 }
28573 
28574 /* CIntFromPy */
28575  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
28576 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28577 #pragma GCC diagnostic push
28578 #pragma GCC diagnostic ignored "-Wconversion"
28579 #endif
28580  const int neg_one = (int) -1, const_zero = (int) 0;
28581 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28582 #pragma GCC diagnostic pop
28583 #endif
28584  const int is_unsigned = neg_one > const_zero;
28585 #if PY_MAJOR_VERSION < 3
28586  if (likely(PyInt_Check(x))) {
28587  if (sizeof(int) < sizeof(long)) {
28588  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
28589  } else {
28590  long val = PyInt_AS_LONG(x);
28591  if (is_unsigned && unlikely(val < 0)) {
28592  goto raise_neg_overflow;
28593  }
28594  return (int) val;
28595  }
28596  } else
28597 #endif
28598  if (likely(PyLong_Check(x))) {
28599  if (is_unsigned) {
28600 #if CYTHON_USE_PYLONG_INTERNALS
28601  const digit* digits = ((PyLongObject*)x)->ob_digit;
28602  switch (Py_SIZE(x)) {
28603  case 0: return (int) 0;
28604  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
28605  case 2:
28606  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
28607  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28608  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28609  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
28610  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28611  }
28612  }
28613  break;
28614  case 3:
28615  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28616  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28617  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28618  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
28619  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28620  }
28621  }
28622  break;
28623  case 4:
28624  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28625  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28626  __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])))
28627  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
28628  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28629  }
28630  }
28631  break;
28632  }
28633 #endif
28634 #if CYTHON_COMPILING_IN_CPYTHON
28635  if (unlikely(Py_SIZE(x) < 0)) {
28636  goto raise_neg_overflow;
28637  }
28638 #else
28639  {
28640  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28641  if (unlikely(result < 0))
28642  return (int) -1;
28643  if (unlikely(result == 1))
28644  goto raise_neg_overflow;
28645  }
28646 #endif
28647  if (sizeof(int) <= sizeof(unsigned long)) {
28648  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
28649 #ifdef HAVE_LONG_LONG
28650  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
28651  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28652 #endif
28653  }
28654  } else {
28655 #if CYTHON_USE_PYLONG_INTERNALS
28656  const digit* digits = ((PyLongObject*)x)->ob_digit;
28657  switch (Py_SIZE(x)) {
28658  case 0: return (int) 0;
28659  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
28660  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
28661  case -2:
28662  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
28663  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28664  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28665  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28666  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28667  }
28668  }
28669  break;
28670  case 2:
28671  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
28672  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28673  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28674  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28675  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28676  }
28677  }
28678  break;
28679  case -3:
28680  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28681  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28682  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28683  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28684  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28685  }
28686  }
28687  break;
28688  case 3:
28689  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28690  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28691  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28692  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28693  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28694  }
28695  }
28696  break;
28697  case -4:
28698  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28699  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28700  __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])))
28701  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28702  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28703  }
28704  }
28705  break;
28706  case 4:
28707  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28708  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28709  __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])))
28710  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28711  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28712  }
28713  }
28714  break;
28715  }
28716 #endif
28717  if (sizeof(int) <= sizeof(long)) {
28718  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
28719 #ifdef HAVE_LONG_LONG
28720  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28721  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
28722 #endif
28723  }
28724  }
28725  {
28726 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28727  PyErr_SetString(PyExc_RuntimeError,
28728  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28729 #else
28730  int val;
28731  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28732  #if PY_MAJOR_VERSION < 3
28733  if (likely(v) && !PyLong_Check(v)) {
28734  PyObject *tmp = v;
28735  v = PyNumber_Long(tmp);
28736  Py_DECREF(tmp);
28737  }
28738  #endif
28739  if (likely(v)) {
28740  int one = 1; int is_little = (int)*(unsigned char *)&one;
28741  unsigned char *bytes = (unsigned char *)&val;
28742  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28743  bytes, sizeof(val),
28744  is_little, !is_unsigned);
28745  Py_DECREF(v);
28746  if (likely(!ret))
28747  return val;
28748  }
28749 #endif
28750  return (int) -1;
28751  }
28752  } else {
28753  int val;
28754  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28755  if (!tmp) return (int) -1;
28756  val = __Pyx_PyInt_As_int(tmp);
28757  Py_DECREF(tmp);
28758  return val;
28759  }
28760 raise_overflow:
28761  PyErr_SetString(PyExc_OverflowError,
28762  "value too large to convert to int");
28763  return (int) -1;
28764 raise_neg_overflow:
28765  PyErr_SetString(PyExc_OverflowError,
28766  "can't convert negative value to int");
28767  return (int) -1;
28768 }
28769 
28770 /* CIntFromPy */
28771  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
28772 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28773 #pragma GCC diagnostic push
28774 #pragma GCC diagnostic ignored "-Wconversion"
28775 #endif
28776  const long neg_one = (long) -1, const_zero = (long) 0;
28777 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28778 #pragma GCC diagnostic pop
28779 #endif
28780  const int is_unsigned = neg_one > const_zero;
28781 #if PY_MAJOR_VERSION < 3
28782  if (likely(PyInt_Check(x))) {
28783  if (sizeof(long) < sizeof(long)) {
28784  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
28785  } else {
28786  long val = PyInt_AS_LONG(x);
28787  if (is_unsigned && unlikely(val < 0)) {
28788  goto raise_neg_overflow;
28789  }
28790  return (long) val;
28791  }
28792  } else
28793 #endif
28794  if (likely(PyLong_Check(x))) {
28795  if (is_unsigned) {
28796 #if CYTHON_USE_PYLONG_INTERNALS
28797  const digit* digits = ((PyLongObject*)x)->ob_digit;
28798  switch (Py_SIZE(x)) {
28799  case 0: return (long) 0;
28800  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
28801  case 2:
28802  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28803  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28804  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28805  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
28806  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28807  }
28808  }
28809  break;
28810  case 3:
28811  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28812  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28813  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28814  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
28815  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28816  }
28817  }
28818  break;
28819  case 4:
28820  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28821  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28822  __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])))
28823  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
28824  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28825  }
28826  }
28827  break;
28828  }
28829 #endif
28830 #if CYTHON_COMPILING_IN_CPYTHON
28831  if (unlikely(Py_SIZE(x) < 0)) {
28832  goto raise_neg_overflow;
28833  }
28834 #else
28835  {
28836  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28837  if (unlikely(result < 0))
28838  return (long) -1;
28839  if (unlikely(result == 1))
28840  goto raise_neg_overflow;
28841  }
28842 #endif
28843  if (sizeof(long) <= sizeof(unsigned long)) {
28844  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
28845 #ifdef HAVE_LONG_LONG
28846  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28847  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28848 #endif
28849  }
28850  } else {
28851 #if CYTHON_USE_PYLONG_INTERNALS
28852  const digit* digits = ((PyLongObject*)x)->ob_digit;
28853  switch (Py_SIZE(x)) {
28854  case 0: return (long) 0;
28855  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
28856  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
28857  case -2:
28858  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
28859  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28860  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28861  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28862  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28863  }
28864  }
28865  break;
28866  case 2:
28867  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28868  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28869  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28870  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28871  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28872  }
28873  }
28874  break;
28875  case -3:
28876  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28877  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28878  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28879  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28880  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28881  }
28882  }
28883  break;
28884  case 3:
28885  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28886  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28887  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28888  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28889  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28890  }
28891  }
28892  break;
28893  case -4:
28894  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28895  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28896  __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])))
28897  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28898  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28899  }
28900  }
28901  break;
28902  case 4:
28903  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28904  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28905  __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])))
28906  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28907  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28908  }
28909  }
28910  break;
28911  }
28912 #endif
28913  if (sizeof(long) <= sizeof(long)) {
28914  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
28915 #ifdef HAVE_LONG_LONG
28916  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28917  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
28918 #endif
28919  }
28920  }
28921  {
28922 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28923  PyErr_SetString(PyExc_RuntimeError,
28924  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28925 #else
28926  long val;
28927  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28928  #if PY_MAJOR_VERSION < 3
28929  if (likely(v) && !PyLong_Check(v)) {
28930  PyObject *tmp = v;
28931  v = PyNumber_Long(tmp);
28932  Py_DECREF(tmp);
28933  }
28934  #endif
28935  if (likely(v)) {
28936  int one = 1; int is_little = (int)*(unsigned char *)&one;
28937  unsigned char *bytes = (unsigned char *)&val;
28938  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28939  bytes, sizeof(val),
28940  is_little, !is_unsigned);
28941  Py_DECREF(v);
28942  if (likely(!ret))
28943  return val;
28944  }
28945 #endif
28946  return (long) -1;
28947  }
28948  } else {
28949  long val;
28950  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28951  if (!tmp) return (long) -1;
28952  val = __Pyx_PyInt_As_long(tmp);
28953  Py_DECREF(tmp);
28954  return val;
28955  }
28956 raise_overflow:
28957  PyErr_SetString(PyExc_OverflowError,
28958  "value too large to convert to long");
28959  return (long) -1;
28960 raise_neg_overflow:
28961  PyErr_SetString(PyExc_OverflowError,
28962  "can't convert negative value to long");
28963  return (long) -1;
28964 }
28965 
28966 /* CIntToPy */
28967  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
28968 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28969 #pragma GCC diagnostic push
28970 #pragma GCC diagnostic ignored "-Wconversion"
28971 #endif
28972  const long neg_one = (long) -1, const_zero = (long) 0;
28973 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28974 #pragma GCC diagnostic pop
28975 #endif
28976  const int is_unsigned = neg_one > const_zero;
28977  if (is_unsigned) {
28978  if (sizeof(long) < sizeof(long)) {
28979  return PyInt_FromLong((long) value);
28980  } else if (sizeof(long) <= sizeof(unsigned long)) {
28981  return PyLong_FromUnsignedLong((unsigned long) value);
28982 #ifdef HAVE_LONG_LONG
28983  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28984  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28985 #endif
28986  }
28987  } else {
28988  if (sizeof(long) <= sizeof(long)) {
28989  return PyInt_FromLong((long) value);
28990 #ifdef HAVE_LONG_LONG
28991  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28992  return PyLong_FromLongLong((PY_LONG_LONG) value);
28993 #endif
28994  }
28995  }
28996  {
28997  int one = 1; int little = (int)*(unsigned char *)&one;
28998  unsigned char *bytes = (unsigned char *)&value;
28999  return _PyLong_FromByteArray(bytes, sizeof(long),
29000  little, !is_unsigned);
29001  }
29002 }
29003 
29004 /* CIntFromPy */
29005  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
29006 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29007 #pragma GCC diagnostic push
29008 #pragma GCC diagnostic ignored "-Wconversion"
29009 #endif
29010  const char neg_one = (char) -1, const_zero = (char) 0;
29011 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29012 #pragma GCC diagnostic pop
29013 #endif
29014  const int is_unsigned = neg_one > const_zero;
29015 #if PY_MAJOR_VERSION < 3
29016  if (likely(PyInt_Check(x))) {
29017  if (sizeof(char) < sizeof(long)) {
29018  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
29019  } else {
29020  long val = PyInt_AS_LONG(x);
29021  if (is_unsigned && unlikely(val < 0)) {
29022  goto raise_neg_overflow;
29023  }
29024  return (char) val;
29025  }
29026  } else
29027 #endif
29028  if (likely(PyLong_Check(x))) {
29029  if (is_unsigned) {
29030 #if CYTHON_USE_PYLONG_INTERNALS
29031  const digit* digits = ((PyLongObject*)x)->ob_digit;
29032  switch (Py_SIZE(x)) {
29033  case 0: return (char) 0;
29034  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
29035  case 2:
29036  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
29037  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29038  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29039  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
29040  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
29041  }
29042  }
29043  break;
29044  case 3:
29045  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
29046  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29047  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29048  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
29049  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
29050  }
29051  }
29052  break;
29053  case 4:
29054  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
29055  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29056  __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])))
29057  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
29058  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
29059  }
29060  }
29061  break;
29062  }
29063 #endif
29064 #if CYTHON_COMPILING_IN_CPYTHON
29065  if (unlikely(Py_SIZE(x) < 0)) {
29066  goto raise_neg_overflow;
29067  }
29068 #else
29069  {
29070  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
29071  if (unlikely(result < 0))
29072  return (char) -1;
29073  if (unlikely(result == 1))
29074  goto raise_neg_overflow;
29075  }
29076 #endif
29077  if (sizeof(char) <= sizeof(unsigned long)) {
29078  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
29079 #ifdef HAVE_LONG_LONG
29080  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
29081  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
29082 #endif
29083  }
29084  } else {
29085 #if CYTHON_USE_PYLONG_INTERNALS
29086  const digit* digits = ((PyLongObject*)x)->ob_digit;
29087  switch (Py_SIZE(x)) {
29088  case 0: return (char) 0;
29089  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
29090  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
29091  case -2:
29092  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
29093  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29094  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29095  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
29096  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29097  }
29098  }
29099  break;
29100  case 2:
29101  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
29102  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
29103  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29104  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
29105  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29106  }
29107  }
29108  break;
29109  case -3:
29110  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
29111  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29112  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29113  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
29114  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29115  }
29116  }
29117  break;
29118  case 3:
29119  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
29120  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
29121  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29122  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
29123  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29124  }
29125  }
29126  break;
29127  case -4:
29128  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
29129  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29130  __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])))
29131  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
29132  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29133  }
29134  }
29135  break;
29136  case 4:
29137  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
29138  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
29139  __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])))
29140  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
29141  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
29142  }
29143  }
29144  break;
29145  }
29146 #endif
29147  if (sizeof(char) <= sizeof(long)) {
29148  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
29149 #ifdef HAVE_LONG_LONG
29150  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
29151  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
29152 #endif
29153  }
29154  }
29155  {
29156 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
29157  PyErr_SetString(PyExc_RuntimeError,
29158  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
29159 #else
29160  char val;
29161  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
29162  #if PY_MAJOR_VERSION < 3
29163  if (likely(v) && !PyLong_Check(v)) {
29164  PyObject *tmp = v;
29165  v = PyNumber_Long(tmp);
29166  Py_DECREF(tmp);
29167  }
29168  #endif
29169  if (likely(v)) {
29170  int one = 1; int is_little = (int)*(unsigned char *)&one;
29171  unsigned char *bytes = (unsigned char *)&val;
29172  int ret = _PyLong_AsByteArray((PyLongObject *)v,
29173  bytes, sizeof(val),
29174  is_little, !is_unsigned);
29175  Py_DECREF(v);
29176  if (likely(!ret))
29177  return val;
29178  }
29179 #endif
29180  return (char) -1;
29181  }
29182  } else {
29183  char val;
29184  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
29185  if (!tmp) return (char) -1;
29186  val = __Pyx_PyInt_As_char(tmp);
29187  Py_DECREF(tmp);
29188  return val;
29189  }
29190 raise_overflow:
29191  PyErr_SetString(PyExc_OverflowError,
29192  "value too large to convert to char");
29193  return (char) -1;
29194 raise_neg_overflow:
29195  PyErr_SetString(PyExc_OverflowError,
29196  "can't convert negative value to char");
29197  return (char) -1;
29198 }
29199 
29200 /* CheckBinaryVersion */
29201  static int __Pyx_check_binary_version(void) {
29202  char ctversion[5];
29203  int same=1, i, found_dot;
29204  const char* rt_from_call = Py_GetVersion();
29205  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
29206  found_dot = 0;
29207  for (i = 0; i < 4; i++) {
29208  if (!ctversion[i]) {
29209  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
29210  break;
29211  }
29212  if (rt_from_call[i] != ctversion[i]) {
29213  same = 0;
29214  break;
29215  }
29216  }
29217  if (!same) {
29218  char rtversion[5] = {'\0'};
29219  char message[200];
29220  for (i=0; i<4; ++i) {
29221  if (rt_from_call[i] == '.') {
29222  if (found_dot) break;
29223  found_dot = 1;
29224  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
29225  break;
29226  }
29227  rtversion[i] = rt_from_call[i];
29228  }
29229  PyOS_snprintf(message, sizeof(message),
29230  "compiletime version %s of module '%.100s' "
29231  "does not match runtime version %s",
29232  ctversion, __Pyx_MODULE_NAME, rtversion);
29233  return PyErr_WarnEx(NULL, message, 1);
29234  }
29235  return 0;
29236 }
29237 
29238 /* InitStrings */
29239  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
29240  while (t->p) {
29241  #if PY_MAJOR_VERSION < 3
29242  if (t->is_unicode) {
29243  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
29244  } else if (t->intern) {
29245  *t->p = PyString_InternFromString(t->s);
29246  } else {
29247  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
29248  }
29249  #else
29250  if (t->is_unicode | t->is_str) {
29251  if (t->intern) {
29252  *t->p = PyUnicode_InternFromString(t->s);
29253  } else if (t->encoding) {
29254  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
29255  } else {
29256  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
29257  }
29258  } else {
29259  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
29260  }
29261  #endif
29262  if (!*t->p)
29263  return -1;
29264  if (PyObject_Hash(*t->p) == -1)
29265  return -1;
29266  ++t;
29267  }
29268  return 0;
29269 }
29270 
29271 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
29272  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29273 }
29274 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
29275  Py_ssize_t ignore;
29276  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29277 }
29278 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29279 #if !CYTHON_PEP393_ENABLED
29280 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29281  char* defenc_c;
29282  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
29283  if (!defenc) return NULL;
29284  defenc_c = PyBytes_AS_STRING(defenc);
29285 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29286  {
29287  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
29288  char* c;
29289  for (c = defenc_c; c < end; c++) {
29290  if ((unsigned char) (*c) >= 128) {
29291  PyUnicode_AsASCIIString(o);
29292  return NULL;
29293  }
29294  }
29295  }
29296 #endif
29297  *length = PyBytes_GET_SIZE(defenc);
29298  return defenc_c;
29299 }
29300 #else
29301 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29302  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
29303 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29304  if (likely(PyUnicode_IS_ASCII(o))) {
29305  *length = PyUnicode_GET_LENGTH(o);
29306  return PyUnicode_AsUTF8(o);
29307  } else {
29308  PyUnicode_AsASCIIString(o);
29309  return NULL;
29310  }
29311 #else
29312  return PyUnicode_AsUTF8AndSize(o, length);
29313 #endif
29314 }
29315 #endif
29316 #endif
29317 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
29318 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29319  if (
29320 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29321  __Pyx_sys_getdefaultencoding_not_ascii &&
29322 #endif
29323  PyUnicode_Check(o)) {
29324  return __Pyx_PyUnicode_AsStringAndSize(o, length);
29325  } else
29326 #endif
29327 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
29328  if (PyByteArray_Check(o)) {
29329  *length = PyByteArray_GET_SIZE(o);
29330  return PyByteArray_AS_STRING(o);
29331  } else
29332 #endif
29333  {
29334  char* result;
29335  int r = PyBytes_AsStringAndSize(o, &result, length);
29336  if (unlikely(r < 0)) {
29337  return NULL;
29338  } else {
29339  return result;
29340  }
29341  }
29342 }
29343 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
29344  int is_true = x == Py_True;
29345  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
29346  else return PyObject_IsTrue(x);
29347 }
29348 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
29349  int retval;
29350  if (unlikely(!x)) return -1;
29351  retval = __Pyx_PyObject_IsTrue(x);
29352  Py_DECREF(x);
29353  return retval;
29354 }
29355 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
29356 #if PY_MAJOR_VERSION >= 3
29357  if (PyLong_Check(result)) {
29358  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
29359  "__int__ returned non-int (type %.200s). "
29360  "The ability to return an instance of a strict subclass of int "
29361  "is deprecated, and may be removed in a future version of Python.",
29362  Py_TYPE(result)->tp_name)) {
29363  Py_DECREF(result);
29364  return NULL;
29365  }
29366  return result;
29367  }
29368 #endif
29369  PyErr_Format(PyExc_TypeError,
29370  "__%.4s__ returned non-%.4s (type %.200s)",
29371  type_name, type_name, Py_TYPE(result)->tp_name);
29372  Py_DECREF(result);
29373  return NULL;
29374 }
29375 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
29376 #if CYTHON_USE_TYPE_SLOTS
29377  PyNumberMethods *m;
29378 #endif
29379  const char *name = NULL;
29380  PyObject *res = NULL;
29381 #if PY_MAJOR_VERSION < 3
29382  if (likely(PyInt_Check(x) || PyLong_Check(x)))
29383 #else
29384  if (likely(PyLong_Check(x)))
29385 #endif
29386  return __Pyx_NewRef(x);
29387 #if CYTHON_USE_TYPE_SLOTS
29388  m = Py_TYPE(x)->tp_as_number;
29389  #if PY_MAJOR_VERSION < 3
29390  if (m && m->nb_int) {
29391  name = "int";
29392  res = m->nb_int(x);
29393  }
29394  else if (m && m->nb_long) {
29395  name = "long";
29396  res = m->nb_long(x);
29397  }
29398  #else
29399  if (likely(m && m->nb_int)) {
29400  name = "int";
29401  res = m->nb_int(x);
29402  }
29403  #endif
29404 #else
29405  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
29406  res = PyNumber_Int(x);
29407  }
29408 #endif
29409  if (likely(res)) {
29410 #if PY_MAJOR_VERSION < 3
29411  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
29412 #else
29413  if (unlikely(!PyLong_CheckExact(res))) {
29414 #endif
29415  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
29416  }
29417  }
29418  else if (!PyErr_Occurred()) {
29419  PyErr_SetString(PyExc_TypeError,
29420  "an integer is required");
29421  }
29422  return res;
29423 }
29424 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
29425  Py_ssize_t ival;
29426  PyObject *x;
29427 #if PY_MAJOR_VERSION < 3
29428  if (likely(PyInt_CheckExact(b))) {
29429  if (sizeof(Py_ssize_t) >= sizeof(long))
29430  return PyInt_AS_LONG(b);
29431  else
29432  return PyInt_AsSsize_t(b);
29433  }
29434 #endif
29435  if (likely(PyLong_CheckExact(b))) {
29436  #if CYTHON_USE_PYLONG_INTERNALS
29437  const digit* digits = ((PyLongObject*)b)->ob_digit;
29438  const Py_ssize_t size = Py_SIZE(b);
29439  if (likely(__Pyx_sst_abs(size) <= 1)) {
29440  ival = likely(size) ? digits[0] : 0;
29441  if (size == -1) ival = -ival;
29442  return ival;
29443  } else {
29444  switch (size) {
29445  case 2:
29446  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29447  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29448  }
29449  break;
29450  case -2:
29451  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
29452  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29453  }
29454  break;
29455  case 3:
29456  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29457  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29458  }
29459  break;
29460  case -3:
29461  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
29462  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
29463  }
29464  break;
29465  case 4:
29466  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29467  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]));
29468  }
29469  break;
29470  case -4:
29471  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
29472  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]));
29473  }
29474  break;
29475  }
29476  }
29477  #endif
29478  return PyLong_AsSsize_t(b);
29479  }
29480  x = PyNumber_Index(b);
29481  if (!x) return -1;
29482  ival = PyInt_AsSsize_t(x);
29483  Py_DECREF(x);
29484  return ival;
29485 }
29486 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
29487  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
29488  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
29489 #if PY_MAJOR_VERSION < 3
29490  } else if (likely(PyInt_CheckExact(o))) {
29491  return PyInt_AS_LONG(o);
29492 #endif
29493  } else {
29494  Py_ssize_t ival;
29495  PyObject *x;
29496  x = PyNumber_Index(o);
29497  if (!x) return -1;
29498  ival = PyInt_AsLong(x);
29499  Py_DECREF(x);
29500  return ival;
29501  }
29502 }
29503 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
29504  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
29505 }
29506 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
29507  return PyInt_FromSize_t(ival);
29508 }
29509 
29510 
29511 #endif /* Py_PYTHON_H */
f
Double f
Definition: Headers.h:64
number
Int number
Definition: Headers.h:33
s
Double s
Definition: Headers.h:84
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
q
Double q
Definition: Headers.h:81
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
T
Double T
Definition: Headers.h:87
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
c
Double c
Definition: Headers.h:54
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8