proteus  1.8.1
C/C++/Fortran libraries
equivalent_polynomials.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__equivalent_polynomials
708 #define __PYX_HAVE_API__equivalent_polynomials
709 /* Early includes */
710 #include "equivalent_polynomials.h"
711 #include <string.h>
712 #include <stdio.h>
713 #include "numpy/arrayobject.h"
714 #include "numpy/ndarrayobject.h"
715 #include "numpy/ndarraytypes.h"
716 #include "numpy/arrayscalars.h"
717 #include "numpy/ufuncobject.h"
718 
719  /* NumPy API declarations from "numpy/__init__.pxd" */
720 
721 #include "pythread.h"
722 #include <stdlib.h>
723 #include "pystate.h"
724 #ifdef _OPENMP
725 #include <omp.h>
726 #endif /* _OPENMP */
727 
728 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
729 #define CYTHON_WITHOUT_ASSERTIONS
730 #endif
731 
732 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
733  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
734 
735 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
736 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
737 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
738 #define __PYX_DEFAULT_STRING_ENCODING ""
739 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
740 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
741 #define __Pyx_uchar_cast(c) ((unsigned char)c)
742 #define __Pyx_long_cast(x) ((long)x)
743 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
744  (sizeof(type) < sizeof(Py_ssize_t)) ||\
745  (sizeof(type) > sizeof(Py_ssize_t) &&\
746  likely(v < (type)PY_SSIZE_T_MAX ||\
747  v == (type)PY_SSIZE_T_MAX) &&\
748  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
749  v == (type)PY_SSIZE_T_MIN))) ||\
750  (sizeof(type) == sizeof(Py_ssize_t) &&\
751  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
752  v == (type)PY_SSIZE_T_MAX))) )
753 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
754  return (size_t) i < (size_t) limit;
755 }
756 #if defined (__cplusplus) && __cplusplus >= 201103L
757  #include <cstdlib>
758  #define __Pyx_sst_abs(value) std::abs(value)
759 #elif SIZEOF_INT >= SIZEOF_SIZE_T
760  #define __Pyx_sst_abs(value) abs(value)
761 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
762  #define __Pyx_sst_abs(value) labs(value)
763 #elif defined (_MSC_VER)
764  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
765 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
766  #define __Pyx_sst_abs(value) llabs(value)
767 #elif defined (__GNUC__)
768  #define __Pyx_sst_abs(value) __builtin_llabs(value)
769 #else
770  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
771 #endif
772 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
773 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
774 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
775 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
776 #define __Pyx_PyBytes_FromString PyBytes_FromString
777 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
778 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
779 #if PY_MAJOR_VERSION < 3
780  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
781  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
782 #else
783  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
784  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
785 #endif
786 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
787 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
788 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
789 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
790 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
791 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
792 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
793 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
794 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
795 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
796 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
797 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
798 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
799 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
800 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
801 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
802 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
803  const Py_UNICODE *u_end = u;
804  while (*u_end++) ;
805  return (size_t)(u_end - u - 1);
806 }
807 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
808 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
809 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
810 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
811 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
812 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
813 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
814 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
815 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
816 #define __Pyx_PySequence_Tuple(obj)\
817  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
818 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
819 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
820 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
821 #if CYTHON_ASSUME_SAFE_MACROS
822 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
823 #else
824 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
825 #endif
826 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
827 #if PY_MAJOR_VERSION >= 3
828 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
829 #else
830 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
831 #endif
832 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
833 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
834 static int __Pyx_sys_getdefaultencoding_not_ascii;
835 static int __Pyx_init_sys_getdefaultencoding_params(void) {
836  PyObject* sys;
837  PyObject* default_encoding = NULL;
838  PyObject* ascii_chars_u = NULL;
839  PyObject* ascii_chars_b = NULL;
840  const char* default_encoding_c;
841  sys = PyImport_ImportModule("sys");
842  if (!sys) goto bad;
843  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
844  Py_DECREF(sys);
845  if (!default_encoding) goto bad;
846  default_encoding_c = PyBytes_AsString(default_encoding);
847  if (!default_encoding_c) goto bad;
848  if (strcmp(default_encoding_c, "ascii") == 0) {
849  __Pyx_sys_getdefaultencoding_not_ascii = 0;
850  } else {
851  char ascii_chars[128];
852  int c;
853  for (c = 0; c < 128; c++) {
854  ascii_chars[c] = c;
855  }
856  __Pyx_sys_getdefaultencoding_not_ascii = 1;
857  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
858  if (!ascii_chars_u) goto bad;
859  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
860  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
861  PyErr_Format(
862  PyExc_ValueError,
863  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
864  default_encoding_c);
865  goto bad;
866  }
867  Py_DECREF(ascii_chars_u);
868  Py_DECREF(ascii_chars_b);
869  }
870  Py_DECREF(default_encoding);
871  return 0;
872 bad:
873  Py_XDECREF(default_encoding);
874  Py_XDECREF(ascii_chars_u);
875  Py_XDECREF(ascii_chars_b);
876  return -1;
877 }
878 #endif
879 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
880 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
881 #else
882 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
883 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
884 static char* __PYX_DEFAULT_STRING_ENCODING;
885 static int __Pyx_init_sys_getdefaultencoding_params(void) {
886  PyObject* sys;
887  PyObject* default_encoding = NULL;
888  char* default_encoding_c;
889  sys = PyImport_ImportModule("sys");
890  if (!sys) goto bad;
891  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
892  Py_DECREF(sys);
893  if (!default_encoding) goto bad;
894  default_encoding_c = PyBytes_AsString(default_encoding);
895  if (!default_encoding_c) goto bad;
896  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
897  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
898  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
899  Py_DECREF(default_encoding);
900  return 0;
901 bad:
902  Py_XDECREF(default_encoding);
903  return -1;
904 }
905 #endif
906 #endif
907 
908 
909 /* Test for GCC > 2.95 */
910 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
911  #define likely(x) __builtin_expect(!!(x), 1)
912  #define unlikely(x) __builtin_expect(!!(x), 0)
913 #else /* !__GNUC__ or GCC < 2.95 */
914  #define likely(x) (x)
915  #define unlikely(x) (x)
916 #endif /* __GNUC__ */
917 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
918 
919 static PyObject *__pyx_m = NULL;
920 static PyObject *__pyx_d;
921 static PyObject *__pyx_b;
922 static PyObject *__pyx_cython_runtime = NULL;
923 static PyObject *__pyx_empty_tuple;
924 static PyObject *__pyx_empty_bytes;
925 static PyObject *__pyx_empty_unicode;
926 static int __pyx_lineno;
927 static int __pyx_clineno = 0;
928 static const char * __pyx_cfilenm= __FILE__;
929 static const char *__pyx_filename;
930 
931 /* Header.proto */
932 #if !defined(CYTHON_CCOMPLEX)
933  #if defined(__cplusplus)
934  #define CYTHON_CCOMPLEX 1
935  #elif defined(_Complex_I)
936  #define CYTHON_CCOMPLEX 1
937  #else
938  #define CYTHON_CCOMPLEX 0
939  #endif
940 #endif
941 #if CYTHON_CCOMPLEX
942  #ifdef __cplusplus
943  #include <complex>
944  #else
945  #include <complex.h>
946  #endif
947 #endif
948 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
949  #undef _Complex_I
950  #define _Complex_I 1.0fj
951 #endif
952 
953 
954 static const char *__pyx_f[] = {
955  "stringsource",
956  "proteus/equivalent_polynomials.pyx",
957  "__init__.pxd",
958  "type.pxd",
959 };
960 /* ForceInitThreads.proto */
961 #ifndef __PYX_FORCE_INIT_THREADS
962  #define __PYX_FORCE_INIT_THREADS 0
963 #endif
964 
965 /* NoFastGil.proto */
966 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
967 #define __Pyx_PyGILState_Release PyGILState_Release
968 #define __Pyx_FastGIL_Remember()
969 #define __Pyx_FastGIL_Forget()
970 #define __Pyx_FastGilFuncInit()
971 
972 /* BufferFormatStructs.proto */
973 #define IS_UNSIGNED(type) (((type) -1) > 0)
974 struct __Pyx_StructField_;
975 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
976 typedef struct {
977  const char* name;
978  struct __Pyx_StructField_* fields;
979  size_t size;
980  size_t arraysize[8];
981  int ndim;
982  char typegroup;
983  char is_unsigned;
984  int flags;
985 } __Pyx_TypeInfo;
986 typedef struct __Pyx_StructField_ {
987  __Pyx_TypeInfo* type;
988  const char* name;
989  size_t offset;
990 } __Pyx_StructField;
991 typedef struct {
992  __Pyx_StructField* field;
993  size_t parent_offset;
994 } __Pyx_BufFmt_StackElem;
995 typedef struct {
996  __Pyx_StructField root;
997  __Pyx_BufFmt_StackElem* head;
998  size_t fmt_offset;
999  size_t new_count, enc_count;
1000  size_t struct_alignment;
1001  int is_complex;
1002  char enc_type;
1003  char new_packmode;
1004  char enc_packmode;
1005  char is_valid_array;
1006 } __Pyx_BufFmt_Context;
1007 
1008 /* Atomics.proto */
1009 #include <pythread.h>
1010 #ifndef CYTHON_ATOMICS
1011  #define CYTHON_ATOMICS 1
1012 #endif
1013 #define __pyx_atomic_int_type int
1014 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
1015  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
1016  !defined(__i386__)
1017  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
1018  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
1019  #ifdef __PYX_DEBUG_ATOMICS
1020  #warning "Using GNU atomics"
1021  #endif
1022 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
1023  #include <Windows.h>
1024  #undef __pyx_atomic_int_type
1025  #define __pyx_atomic_int_type LONG
1026  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
1027  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
1028  #ifdef __PYX_DEBUG_ATOMICS
1029  #pragma message ("Using MSVC atomics")
1030  #endif
1031 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
1032  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
1033  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
1034  #ifdef __PYX_DEBUG_ATOMICS
1035  #warning "Using Intel atomics"
1036  #endif
1037 #else
1038  #undef CYTHON_ATOMICS
1039  #define CYTHON_ATOMICS 0
1040  #ifdef __PYX_DEBUG_ATOMICS
1041  #warning "Not using atomics"
1042  #endif
1043 #endif
1044 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1045 #if CYTHON_ATOMICS
1046  #define __pyx_add_acquisition_count(memview)\
1047  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1048  #define __pyx_sub_acquisition_count(memview)\
1049  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1050 #else
1051  #define __pyx_add_acquisition_count(memview)\
1052  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1053  #define __pyx_sub_acquisition_count(memview)\
1054  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1055 #endif
1056 
1057 /* MemviewSliceStruct.proto */
1058 struct __pyx_memoryview_obj;
1059 typedef struct {
1060  struct __pyx_memoryview_obj *memview;
1061  char *data;
1062  Py_ssize_t shape[8];
1063  Py_ssize_t strides[8];
1064  Py_ssize_t suboffsets[8];
1065 } __Pyx_memviewslice;
1066 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1067 
1068 
1069 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":690
1070  * # in Cython to enable them only on the right systems.
1071  *
1072  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1073  * ctypedef npy_int16 int16_t
1074  * ctypedef npy_int32 int32_t
1075  */
1076 typedef npy_int8 __pyx_t_5numpy_int8_t;
1077 
1078 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":691
1079  *
1080  * ctypedef npy_int8 int8_t
1081  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1082  * ctypedef npy_int32 int32_t
1083  * ctypedef npy_int64 int64_t
1084  */
1085 typedef npy_int16 __pyx_t_5numpy_int16_t;
1086 
1087 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":692
1088  * ctypedef npy_int8 int8_t
1089  * ctypedef npy_int16 int16_t
1090  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1091  * ctypedef npy_int64 int64_t
1092  * #ctypedef npy_int96 int96_t
1093  */
1094 typedef npy_int32 __pyx_t_5numpy_int32_t;
1095 
1096 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":693
1097  * ctypedef npy_int16 int16_t
1098  * ctypedef npy_int32 int32_t
1099  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1100  * #ctypedef npy_int96 int96_t
1101  * #ctypedef npy_int128 int128_t
1102  */
1103 typedef npy_int64 __pyx_t_5numpy_int64_t;
1104 
1105 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":697
1106  * #ctypedef npy_int128 int128_t
1107  *
1108  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1109  * ctypedef npy_uint16 uint16_t
1110  * ctypedef npy_uint32 uint32_t
1111  */
1112 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1113 
1114 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":698
1115  *
1116  * ctypedef npy_uint8 uint8_t
1117  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1118  * ctypedef npy_uint32 uint32_t
1119  * ctypedef npy_uint64 uint64_t
1120  */
1121 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1122 
1123 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":699
1124  * ctypedef npy_uint8 uint8_t
1125  * ctypedef npy_uint16 uint16_t
1126  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1127  * ctypedef npy_uint64 uint64_t
1128  * #ctypedef npy_uint96 uint96_t
1129  */
1130 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1131 
1132 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":700
1133  * ctypedef npy_uint16 uint16_t
1134  * ctypedef npy_uint32 uint32_t
1135  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1136  * #ctypedef npy_uint96 uint96_t
1137  * #ctypedef npy_uint128 uint128_t
1138  */
1139 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1140 
1141 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":704
1142  * #ctypedef npy_uint128 uint128_t
1143  *
1144  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1145  * ctypedef npy_float64 float64_t
1146  * #ctypedef npy_float80 float80_t
1147  */
1148 typedef npy_float32 __pyx_t_5numpy_float32_t;
1149 
1150 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":705
1151  *
1152  * ctypedef npy_float32 float32_t
1153  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1154  * #ctypedef npy_float80 float80_t
1155  * #ctypedef npy_float128 float128_t
1156  */
1157 typedef npy_float64 __pyx_t_5numpy_float64_t;
1158 
1159 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":714
1160  * # The int types are mapped a bit surprising --
1161  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1162  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1163  * ctypedef npy_longlong long_t
1164  * ctypedef npy_longlong longlong_t
1165  */
1166 typedef npy_long __pyx_t_5numpy_int_t;
1167 
1168 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":715
1169  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1170  * ctypedef npy_long int_t
1171  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1172  * ctypedef npy_longlong longlong_t
1173  *
1174  */
1175 typedef npy_longlong __pyx_t_5numpy_long_t;
1176 
1177 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":716
1178  * ctypedef npy_long int_t
1179  * ctypedef npy_longlong long_t
1180  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1181  *
1182  * ctypedef npy_ulong uint_t
1183  */
1184 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1185 
1186 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":718
1187  * ctypedef npy_longlong longlong_t
1188  *
1189  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1190  * ctypedef npy_ulonglong ulong_t
1191  * ctypedef npy_ulonglong ulonglong_t
1192  */
1193 typedef npy_ulong __pyx_t_5numpy_uint_t;
1194 
1195 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":719
1196  *
1197  * ctypedef npy_ulong uint_t
1198  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1199  * ctypedef npy_ulonglong ulonglong_t
1200  *
1201  */
1202 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1203 
1204 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":720
1205  * ctypedef npy_ulong uint_t
1206  * ctypedef npy_ulonglong ulong_t
1207  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1208  *
1209  * ctypedef npy_intp intp_t
1210  */
1211 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1212 
1213 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":722
1214  * ctypedef npy_ulonglong ulonglong_t
1215  *
1216  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1217  * ctypedef npy_uintp uintp_t
1218  *
1219  */
1220 typedef npy_intp __pyx_t_5numpy_intp_t;
1221 
1222 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":723
1223  *
1224  * ctypedef npy_intp intp_t
1225  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1226  *
1227  * ctypedef npy_double float_t
1228  */
1229 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1230 
1231 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":725
1232  * ctypedef npy_uintp uintp_t
1233  *
1234  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1235  * ctypedef npy_double double_t
1236  * ctypedef npy_longdouble longdouble_t
1237  */
1238 typedef npy_double __pyx_t_5numpy_float_t;
1239 
1240 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":726
1241  *
1242  * ctypedef npy_double float_t
1243  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1244  * ctypedef npy_longdouble longdouble_t
1245  *
1246  */
1247 typedef npy_double __pyx_t_5numpy_double_t;
1248 
1249 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":727
1250  * ctypedef npy_double float_t
1251  * ctypedef npy_double double_t
1252  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1253  *
1254  * ctypedef npy_cfloat cfloat_t
1255  */
1256 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1257 /* Declarations.proto */
1258 #if CYTHON_CCOMPLEX
1259  #ifdef __cplusplus
1260  typedef ::std::complex< float > __pyx_t_float_complex;
1261  #else
1262  typedef float _Complex __pyx_t_float_complex;
1263  #endif
1264 #else
1265  typedef struct { float real, imag; } __pyx_t_float_complex;
1266 #endif
1267 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1268 
1269 /* Declarations.proto */
1270 #if CYTHON_CCOMPLEX
1271  #ifdef __cplusplus
1272  typedef ::std::complex< double > __pyx_t_double_complex;
1273  #else
1274  typedef double _Complex __pyx_t_double_complex;
1275  #endif
1276 #else
1277  typedef struct { double real, imag; } __pyx_t_double_complex;
1278 #endif
1279 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1280 
1281 
1282 /*--- Type declarations ---*/
1283 struct __pyx_obj_22equivalent_polynomials_Simplex;
1284 struct __pyx_array_obj;
1285 struct __pyx_MemviewEnum_obj;
1286 struct __pyx_memoryview_obj;
1287 struct __pyx_memoryviewslice_obj;
1288 
1289 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":729
1290  * ctypedef npy_longdouble longdouble_t
1291  *
1292  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1293  * ctypedef npy_cdouble cdouble_t
1294  * ctypedef npy_clongdouble clongdouble_t
1295  */
1296 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1297 
1298 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":730
1299  *
1300  * ctypedef npy_cfloat cfloat_t
1301  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1302  * ctypedef npy_clongdouble clongdouble_t
1303  *
1304  */
1305 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1306 
1307 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":731
1308  * ctypedef npy_cfloat cfloat_t
1309  * ctypedef npy_cdouble cdouble_t
1310  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1311  *
1312  * ctypedef npy_cdouble complex_t
1313  */
1314 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1315 
1316 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":733
1317  * ctypedef npy_clongdouble clongdouble_t
1318  *
1319  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1320  *
1321  * cdef inline object PyArray_MultiIterNew1(a):
1322  */
1323 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1324 
1325 /* "equivalent_polynomials.pyx":22
1326  *
1327  *
1328  * cdef class Simplex: # <<<<<<<<<<<<<<
1329  * cdef np.ndarray xiBuffer
1330  * cdef int nSpace
1331  */
1332 struct __pyx_obj_22equivalent_polynomials_Simplex {
1333  PyObject_HEAD
1334  PyArrayObject *xiBuffer;
1335  int nSpace;
1336  int nP;
1337  int nQ;
1338  int nEBQ;
1339  int q;
1340  bool inside_out;
1341  PyArrayObject *_H;
1342  PyArrayObject *_ImH;
1343  PyArrayObject *_D;
1353 };
1354 
1355 
1356 /* "View.MemoryView":105
1357  *
1358  * @cname("__pyx_array")
1359  * cdef class array: # <<<<<<<<<<<<<<
1360  *
1361  * cdef:
1362  */
1363 struct __pyx_array_obj {
1364  PyObject_HEAD
1365  struct __pyx_vtabstruct_array *__pyx_vtab;
1366  char *data;
1367  Py_ssize_t len;
1368  char *format;
1369  int ndim;
1370  Py_ssize_t *_shape;
1371  Py_ssize_t *_strides;
1372  Py_ssize_t itemsize;
1373  PyObject *mode;
1374  PyObject *_format;
1375  void (*callback_free_data)(void *);
1376  int free_data;
1377  int dtype_is_object;
1378 };
1379 
1380 
1381 /* "View.MemoryView":279
1382  *
1383  * @cname('__pyx_MemviewEnum')
1384  * cdef class Enum(object): # <<<<<<<<<<<<<<
1385  * cdef object name
1386  * def __init__(self, name):
1387  */
1388 struct __pyx_MemviewEnum_obj {
1389  PyObject_HEAD
1390  PyObject *name;
1391 };
1392 
1393 
1394 /* "View.MemoryView":330
1395  *
1396  * @cname('__pyx_memoryview')
1397  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1398  *
1399  * cdef object obj
1400  */
1401 struct __pyx_memoryview_obj {
1402  PyObject_HEAD
1403  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1404  PyObject *obj;
1405  PyObject *_size;
1406  PyObject *_array_interface;
1407  PyThread_type_lock lock;
1408  __pyx_atomic_int acquisition_count[2];
1409  __pyx_atomic_int *acquisition_count_aligned_p;
1410  Py_buffer view;
1411  int flags;
1412  int dtype_is_object;
1413  __Pyx_TypeInfo *typeinfo;
1414 };
1415 
1416 
1417 /* "View.MemoryView":965
1418  *
1419  * @cname('__pyx_memoryviewslice')
1420  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1421  * "Internal class for passing memoryview slices to Python"
1422  *
1423  */
1424 struct __pyx_memoryviewslice_obj {
1425  struct __pyx_memoryview_obj __pyx_base;
1426  __Pyx_memviewslice from_slice;
1427  PyObject *from_object;
1428  PyObject *(*to_object_func)(char *);
1429  int (*to_dtype_func)(char *, PyObject *);
1430 };
1431 
1432 
1433 
1434 /* "View.MemoryView":105
1435  *
1436  * @cname("__pyx_array")
1437  * cdef class array: # <<<<<<<<<<<<<<
1438  *
1439  * cdef:
1440  */
1441 
1442 struct __pyx_vtabstruct_array {
1443  PyObject *(*get_memview)(struct __pyx_array_obj *);
1444 };
1445 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1446 
1447 
1448 /* "View.MemoryView":330
1449  *
1450  * @cname('__pyx_memoryview')
1451  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1452  *
1453  * cdef object obj
1454  */
1455 
1456 struct __pyx_vtabstruct_memoryview {
1457  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1458  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1459  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1460  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1461  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1462  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1463  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1464 };
1465 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1466 
1467 
1468 /* "View.MemoryView":965
1469  *
1470  * @cname('__pyx_memoryviewslice')
1471  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1472  * "Internal class for passing memoryview slices to Python"
1473  *
1474  */
1475 
1476 struct __pyx_vtabstruct__memoryviewslice {
1477  struct __pyx_vtabstruct_memoryview __pyx_base;
1478 };
1479 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1480 
1481 /* --- Runtime support code (head) --- */
1482 /* Refnanny.proto */
1483 #ifndef CYTHON_REFNANNY
1484  #define CYTHON_REFNANNY 0
1485 #endif
1486 #if CYTHON_REFNANNY
1487  typedef struct {
1488  void (*INCREF)(void*, PyObject*, int);
1489  void (*DECREF)(void*, PyObject*, int);
1490  void (*GOTREF)(void*, PyObject*, int);
1491  void (*GIVEREF)(void*, PyObject*, int);
1492  void* (*SetupContext)(const char*, int, const char*);
1493  void (*FinishContext)(void**);
1494  } __Pyx_RefNannyAPIStruct;
1495  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1496  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1497  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1498 #ifdef WITH_THREAD
1499  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1500  if (acquire_gil) {\
1501  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1502  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1503  PyGILState_Release(__pyx_gilstate_save);\
1504  } else {\
1505  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1506  }
1507 #else
1508  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1509  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1510 #endif
1511  #define __Pyx_RefNannyFinishContext()\
1512  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1513  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1514  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1515  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1516  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1517  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1518  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1519  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1520  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1521 #else
1522  #define __Pyx_RefNannyDeclarations
1523  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1524  #define __Pyx_RefNannyFinishContext()
1525  #define __Pyx_INCREF(r) Py_INCREF(r)
1526  #define __Pyx_DECREF(r) Py_DECREF(r)
1527  #define __Pyx_GOTREF(r)
1528  #define __Pyx_GIVEREF(r)
1529  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1530  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1531  #define __Pyx_XGOTREF(r)
1532  #define __Pyx_XGIVEREF(r)
1533 #endif
1534 #define __Pyx_XDECREF_SET(r, v) do {\
1535  PyObject *tmp = (PyObject *) r;\
1536  r = v; __Pyx_XDECREF(tmp);\
1537  } while (0)
1538 #define __Pyx_DECREF_SET(r, v) do {\
1539  PyObject *tmp = (PyObject *) r;\
1540  r = v; __Pyx_DECREF(tmp);\
1541  } while (0)
1542 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1543 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1544 
1545 /* PyObjectGetAttrStr.proto */
1546 #if CYTHON_USE_TYPE_SLOTS
1547 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1548 #else
1549 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1550 #endif
1551 
1552 /* GetBuiltinName.proto */
1553 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1554 
1555 /* RaiseArgTupleInvalid.proto */
1556 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1557  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1558 
1559 /* RaiseDoubleKeywords.proto */
1560 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1561 
1562 /* ParseKeywords.proto */
1563 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1564  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1565  const char* function_name);
1566 
1567 /* PyDictVersioning.proto */
1568 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1569 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1570 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1571 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1572  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1573  (cache_var) = (value);
1574 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1575  static PY_UINT64_T __pyx_dict_version = 0;\
1576  static PyObject *__pyx_dict_cached_value = NULL;\
1577  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1578  (VAR) = __pyx_dict_cached_value;\
1579  } else {\
1580  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1581  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1582  }\
1583 }
1584 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1585 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1586 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1587 #else
1588 #define __PYX_GET_DICT_VERSION(dict) (0)
1589 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1590 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1591 #endif
1592 
1593 /* GetModuleGlobalName.proto */
1594 #if CYTHON_USE_DICT_VERSIONS
1595 #define __Pyx_GetModuleGlobalName(var, name) {\
1596  static PY_UINT64_T __pyx_dict_version = 0;\
1597  static PyObject *__pyx_dict_cached_value = NULL;\
1598  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1599  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1600  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1601 }
1602 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1603  PY_UINT64_T __pyx_dict_version;\
1604  PyObject *__pyx_dict_cached_value;\
1605  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1606 }
1607 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1608 #else
1609 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1610 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1611 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1612 #endif
1613 
1614 /* PyObjectCall.proto */
1615 #if CYTHON_COMPILING_IN_CPYTHON
1616 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1617 #else
1618 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1619 #endif
1620 
1621 /* ExtTypeTest.proto */
1622 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1623 
1624 /* ArgTypeTest.proto */
1625 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1626  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1627  __Pyx__ArgTypeTest(obj, type, name, exact))
1628 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1629 
1630 /* SliceObject.proto */
1631 #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
1632  __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
1633 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
1634  PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
1635  PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1636  int has_cstart, int has_cstop, int wraparound);
1637 
1638 /* PyCFunctionFastCall.proto */
1639 #if CYTHON_FAST_PYCCALL
1640 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1641 #else
1642 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1643 #endif
1644 
1645 /* PyFunctionFastCall.proto */
1646 #if CYTHON_FAST_PYCALL
1647 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1648  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1649 #if 1 || PY_VERSION_HEX < 0x030600B1
1650 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1651 #else
1652 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1653 #endif
1654 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1655  (sizeof(char [1 - 2*!(cond)]) - 1)
1656 #ifndef Py_MEMBER_SIZE
1657 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1658 #endif
1659 #if CYTHON_FAST_PYCALL
1660  static size_t __pyx_pyframe_localsplus_offset = 0;
1661  #include "frameobject.h"
1662 #if PY_VERSION_HEX >= 0x030b00a6
1663  #ifndef Py_BUILD_CORE
1664  #define Py_BUILD_CORE 1
1665  #endif
1666  #include "internal/pycore_frame.h"
1667 #endif
1668  #define __Pxy_PyFrame_Initialize_Offsets()\
1669  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1670  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1671  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1672  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1673 #endif // CYTHON_FAST_PYCALL
1674 #endif
1675 
1676 /* PyObjectCall2Args.proto */
1677 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1678 
1679 /* PyObjectCallMethO.proto */
1680 #if CYTHON_COMPILING_IN_CPYTHON
1681 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1682 #endif
1683 
1684 /* PyObjectCallOneArg.proto */
1685 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1686 
1687 /* GetItemInt.proto */
1688 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1689  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1690  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1691  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1692  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1693 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1694  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1695  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1696  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1697 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1698  int wraparound, int boundscheck);
1699 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1700  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1701  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1702  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1703 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1704  int wraparound, int boundscheck);
1705 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1706 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1707  int is_list, int wraparound, int boundscheck);
1708 
1709 /* PyThreadStateGet.proto */
1710 #if CYTHON_FAST_THREAD_STATE
1711 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1712 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1713 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1714 #else
1715 #define __Pyx_PyThreadState_declare
1716 #define __Pyx_PyThreadState_assign
1717 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1718 #endif
1719 
1720 /* PyErrFetchRestore.proto */
1721 #if CYTHON_FAST_THREAD_STATE
1722 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1723 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1724 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1725 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1726 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1727 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1728 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1729 #if CYTHON_COMPILING_IN_CPYTHON
1730 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1731 #else
1732 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1733 #endif
1734 #else
1735 #define __Pyx_PyErr_Clear() PyErr_Clear()
1736 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1737 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1738 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1739 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1740 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1741 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1742 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1743 #endif
1744 
1745 /* RaiseException.proto */
1746 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1747 
1748 /* GetTopmostException.proto */
1749 #if CYTHON_USE_EXC_INFO_STACK
1750 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1751 #endif
1752 
1753 /* SaveResetException.proto */
1754 #if CYTHON_FAST_THREAD_STATE
1755 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1756 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1757 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1758 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1759 #else
1760 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1761 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1762 #endif
1763 
1764 /* PyErrExceptionMatches.proto */
1765 #if CYTHON_FAST_THREAD_STATE
1766 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1767 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1768 #else
1769 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1770 #endif
1771 
1772 /* GetException.proto */
1773 #if CYTHON_FAST_THREAD_STATE
1774 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1775 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1776 #else
1777 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1778 #endif
1779 
1780 /* IncludeStringH.proto */
1781 #include <string.h>
1782 
1783 /* BytesEquals.proto */
1784 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1785 
1786 /* UnicodeEquals.proto */
1787 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1788 
1789 /* StrEquals.proto */
1790 #if PY_MAJOR_VERSION >= 3
1791 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1792 #else
1793 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1794 #endif
1795 
1796 /* DivInt[Py_ssize_t].proto */
1797 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1798 
1799 /* UnaryNegOverflows.proto */
1800 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1801  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1802 
1803 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1804 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1805 /* GetAttr.proto */
1806 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1807 
1808 /* ObjectGetItem.proto */
1809 #if CYTHON_USE_TYPE_SLOTS
1810 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1811 #else
1812 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1813 #endif
1814 
1815 /* decode_c_string_utf16.proto */
1816 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1817  int byteorder = 0;
1818  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1819 }
1820 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1821  int byteorder = -1;
1822  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1823 }
1824 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1825  int byteorder = 1;
1826  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1827 }
1828 
1829 /* decode_c_string.proto */
1830 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1831  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1832  const char* encoding, const char* errors,
1833  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1834 
1835 /* GetAttr3.proto */
1836 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1837 
1838 /* RaiseTooManyValuesToUnpack.proto */
1839 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1840 
1841 /* RaiseNeedMoreValuesToUnpack.proto */
1842 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1843 
1844 /* RaiseNoneIterError.proto */
1845 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1846 
1847 /* SwapException.proto */
1848 #if CYTHON_FAST_THREAD_STATE
1849 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1850 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1851 #else
1852 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1853 #endif
1854 
1855 /* Import.proto */
1856 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1857 
1858 /* FastTypeChecks.proto */
1859 #if CYTHON_COMPILING_IN_CPYTHON
1860 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1861 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1862 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1863 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1864 #else
1865 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1866 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1867 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1868 #endif
1869 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1870 
1871 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1872 /* ListCompAppend.proto */
1873 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1874 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1875  PyListObject* L = (PyListObject*) list;
1876  Py_ssize_t len = Py_SIZE(list);
1877  if (likely(L->allocated > len)) {
1878  Py_INCREF(x);
1879  PyList_SET_ITEM(list, len, x);
1880  __Pyx_SET_SIZE(list, len + 1);
1881  return 0;
1882  }
1883  return PyList_Append(list, x);
1884 }
1885 #else
1886 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1887 #endif
1888 
1889 /* PyIntBinop.proto */
1890 #if !CYTHON_COMPILING_IN_PYPY
1891 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1892 #else
1893 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1894  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1895 #endif
1896 
1897 /* ListExtend.proto */
1898 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1899 #if CYTHON_COMPILING_IN_CPYTHON
1900  PyObject* none = _PyList_Extend((PyListObject*)L, v);
1901  if (unlikely(!none))
1902  return -1;
1903  Py_DECREF(none);
1904  return 0;
1905 #else
1906  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1907 #endif
1908 }
1909 
1910 /* ListAppend.proto */
1911 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1912 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1913  PyListObject* L = (PyListObject*) list;
1914  Py_ssize_t len = Py_SIZE(list);
1915  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1916  Py_INCREF(x);
1917  PyList_SET_ITEM(list, len, x);
1918  __Pyx_SET_SIZE(list, len + 1);
1919  return 0;
1920  }
1921  return PyList_Append(list, x);
1922 }
1923 #else
1924 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1925 #endif
1926 
1927 /* None.proto */
1928 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
1929 
1930 /* DivInt[long].proto */
1931 static CYTHON_INLINE long __Pyx_div_long(long, long);
1932 
1933 /* PySequenceContains.proto */
1934 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
1935  int result = PySequence_Contains(seq, item);
1936  return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1937 }
1938 
1939 /* ImportFrom.proto */
1940 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1941 
1942 /* HasAttr.proto */
1943 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1944 
1945 /* StringJoin.proto */
1946 #if PY_MAJOR_VERSION < 3
1947 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
1948 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
1949 #else
1950 #define __Pyx_PyString_Join PyUnicode_Join
1951 #define __Pyx_PyBaseString_Join PyUnicode_Join
1952 #endif
1953 #if CYTHON_COMPILING_IN_CPYTHON
1954  #if PY_MAJOR_VERSION < 3
1955  #define __Pyx_PyBytes_Join _PyString_Join
1956  #else
1957  #define __Pyx_PyBytes_Join _PyBytes_Join
1958  #endif
1959 #else
1960 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
1961 #endif
1962 
1963 /* PyObject_Unicode.proto */
1964 #if PY_MAJOR_VERSION >= 3
1965 #define __Pyx_PyObject_Unicode(obj)\
1966  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
1967 #else
1968 #define __Pyx_PyObject_Unicode(obj)\
1969  (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
1970 #endif
1971 
1972 /* PyObject_GenericGetAttrNoDict.proto */
1973 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1974 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1975 #else
1976 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1977 #endif
1978 
1979 /* PyObject_GenericGetAttr.proto */
1980 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1981 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1982 #else
1983 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1984 #endif
1985 
1986 /* PyObjectGetAttrStrNoError.proto */
1987 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1988 
1989 /* SetupReduce.proto */
1990 static int __Pyx_setup_reduce(PyObject* type_obj);
1991 
1992 /* SetVTable.proto */
1993 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1994 
1995 /* TypeImport.proto */
1996 #ifndef __PYX_HAVE_RT_ImportType_proto
1997 #define __PYX_HAVE_RT_ImportType_proto
1998 enum __Pyx_ImportType_CheckSize {
1999  __Pyx_ImportType_CheckSize_Error = 0,
2000  __Pyx_ImportType_CheckSize_Warn = 1,
2001  __Pyx_ImportType_CheckSize_Ignore = 2
2002 };
2003 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2004 #endif
2005 
2006 /* CLineInTraceback.proto */
2007 #ifdef CYTHON_CLINE_IN_TRACEBACK
2008 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2009 #else
2010 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2011 #endif
2012 
2013 /* CodeObjectCache.proto */
2014 typedef struct {
2015  PyCodeObject* code_object;
2016  int code_line;
2017 } __Pyx_CodeObjectCacheEntry;
2018 struct __Pyx_CodeObjectCache {
2019  int count;
2020  int max_count;
2021  __Pyx_CodeObjectCacheEntry* entries;
2022 };
2023 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2024 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2025 static PyCodeObject *__pyx_find_code_object(int code_line);
2026 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2027 
2028 /* AddTraceback.proto */
2029 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2030  int py_line, const char *filename);
2031 
2032 /* None.proto */
2033 #include <new>
2034 
2035 /* GCCDiagnostics.proto */
2036 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2037 #define __Pyx_HAS_GCC_DIAGNOSTIC
2038 #endif
2039 
2040 /* MemviewDtypeToObject.proto */
2041 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
2042 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
2043 
2044 /* RealImag.proto */
2045 #if CYTHON_CCOMPLEX
2046  #ifdef __cplusplus
2047  #define __Pyx_CREAL(z) ((z).real())
2048  #define __Pyx_CIMAG(z) ((z).imag())
2049  #else
2050  #define __Pyx_CREAL(z) (__real__(z))
2051  #define __Pyx_CIMAG(z) (__imag__(z))
2052  #endif
2053 #else
2054  #define __Pyx_CREAL(z) ((z).real)
2055  #define __Pyx_CIMAG(z) ((z).imag)
2056 #endif
2057 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2058  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2059  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2060  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2061 #else
2062  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2063  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2064 #endif
2065 
2066 /* Arithmetic.proto */
2067 #if CYTHON_CCOMPLEX
2068  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2069  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2070  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2071  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2072  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2073  #define __Pyx_c_neg_float(a) (-(a))
2074  #ifdef __cplusplus
2075  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2076  #define __Pyx_c_conj_float(z) (::std::conj(z))
2077  #if 1
2078  #define __Pyx_c_abs_float(z) (::std::abs(z))
2079  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2080  #endif
2081  #else
2082  #define __Pyx_c_is_zero_float(z) ((z)==0)
2083  #define __Pyx_c_conj_float(z) (conjf(z))
2084  #if 1
2085  #define __Pyx_c_abs_float(z) (cabsf(z))
2086  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2087  #endif
2088  #endif
2089 #else
2090  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2091  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2092  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2093  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2094  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2095  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2096  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2097  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2098  #if 1
2099  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2100  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2101  #endif
2102 #endif
2103 
2104 /* Arithmetic.proto */
2105 #if CYTHON_CCOMPLEX
2106  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2107  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2108  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2109  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2110  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2111  #define __Pyx_c_neg_double(a) (-(a))
2112  #ifdef __cplusplus
2113  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2114  #define __Pyx_c_conj_double(z) (::std::conj(z))
2115  #if 1
2116  #define __Pyx_c_abs_double(z) (::std::abs(z))
2117  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2118  #endif
2119  #else
2120  #define __Pyx_c_is_zero_double(z) ((z)==0)
2121  #define __Pyx_c_conj_double(z) (conj(z))
2122  #if 1
2123  #define __Pyx_c_abs_double(z) (cabs(z))
2124  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2125  #endif
2126  #endif
2127 #else
2128  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2129  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2130  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2131  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2132  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2133  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2134  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2135  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2136  #if 1
2137  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2138  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2139  #endif
2140 #endif
2141 
2142 #if PY_MAJOR_VERSION < 3
2143  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2144  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2145 #else
2146  #define __Pyx_GetBuffer PyObject_GetBuffer
2147  #define __Pyx_ReleaseBuffer PyBuffer_Release
2148 #endif
2149 
2150 
2151 /* BufferStructDeclare.proto */
2152 typedef struct {
2153  Py_ssize_t shape, strides, suboffsets;
2154 } __Pyx_Buf_DimInfo;
2155 typedef struct {
2156  size_t refcount;
2157  Py_buffer pybuffer;
2158 } __Pyx_Buffer;
2159 typedef struct {
2160  __Pyx_Buffer *rcbuffer;
2161  char *data;
2162  __Pyx_Buf_DimInfo diminfo[8];
2163 } __Pyx_LocalBuf_ND;
2164 
2165 /* MemviewSliceIsContig.proto */
2166 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2167 
2168 /* OverlappingSlices.proto */
2169 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2170  __Pyx_memviewslice *slice2,
2171  int ndim, size_t itemsize);
2172 
2173 /* Capsule.proto */
2174 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2175 
2176 /* CIntFromPy.proto */
2177 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2178 
2179 /* CIntToPy.proto */
2180 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2181 
2182 /* TypeInfoToFormat.proto */
2183 struct __pyx_typeinfo_string {
2184  char string[3];
2185 };
2186 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
2187 
2188 /* MemviewSliceCopyTemplate.proto */
2189 static __Pyx_memviewslice
2190 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2191  const char *mode, int ndim,
2192  size_t sizeof_dtype, int contig_flag,
2193  int dtype_is_object);
2194 
2195 /* MemviewSliceInit.proto */
2196 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2197 #define __Pyx_MEMVIEW_DIRECT 1
2198 #define __Pyx_MEMVIEW_PTR 2
2199 #define __Pyx_MEMVIEW_FULL 4
2200 #define __Pyx_MEMVIEW_CONTIG 8
2201 #define __Pyx_MEMVIEW_STRIDED 16
2202 #define __Pyx_MEMVIEW_FOLLOW 32
2203 #define __Pyx_IS_C_CONTIG 1
2204 #define __Pyx_IS_F_CONTIG 2
2205 static int __Pyx_init_memviewslice(
2206  struct __pyx_memoryview_obj *memview,
2207  int ndim,
2208  __Pyx_memviewslice *memviewslice,
2209  int memview_is_new_reference);
2210 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
2211  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2212 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
2213  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2214 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2215 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2216 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2217 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2218 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
2219 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
2220 
2221 /* CIntFromPy.proto */
2222 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2223 
2224 /* CIntToPy.proto */
2225 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2226 
2227 /* CIntFromPy.proto */
2228 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2229 
2230 /* CheckBinaryVersion.proto */
2231 static int __Pyx_check_binary_version(void);
2232 
2233 /* InitStrings.proto */
2234 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2235 
2236 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2237 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2238 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2239 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2240 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*/
2241 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2242 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2243 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2244 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2245 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2246 
2247 /* Module declarations from 'libcpp' */
2248 
2249 /* Module declarations from 'cpython.buffer' */
2250 
2251 /* Module declarations from 'libc.string' */
2252 
2253 /* Module declarations from 'libc.stdio' */
2254 
2255 /* Module declarations from '__builtin__' */
2256 
2257 /* Module declarations from 'cpython.type' */
2258 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2259 
2260 /* Module declarations from 'cpython' */
2261 
2262 /* Module declarations from 'cpython.object' */
2263 
2264 /* Module declarations from 'cpython.ref' */
2265 
2266 /* Module declarations from 'cpython.mem' */
2267 
2268 /* Module declarations from 'numpy' */
2269 
2270 /* Module declarations from 'numpy' */
2271 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2272 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2273 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2274 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2275 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2276 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2277 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2278 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2279 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2280 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2281 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2282 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2283 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2284 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2285 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2286 
2287 /* Module declarations from 'equivalent_polynomials' */
2288 static PyTypeObject *__pyx_ptype_22equivalent_polynomials_Simplex = 0;
2289 static PyTypeObject *__pyx_array_type = 0;
2290 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2291 static PyTypeObject *__pyx_memoryview_type = 0;
2292 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2293 static PyObject *generic = 0;
2294 static PyObject *strided = 0;
2295 static PyObject *indirect = 0;
2296 static PyObject *contiguous = 0;
2297 static PyObject *indirect_contiguous = 0;
2298 static int __pyx_memoryview_thread_locks_used;
2299 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2300 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2301 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2302 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2303 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2304 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2305 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2306 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2307 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*/
2308 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2309 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2310 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2311 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2312 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2313 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2314 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2315 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2316 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2317 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2318 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2319 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2320 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2321 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2322 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2323 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2324 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2325 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2326 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2327 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2328 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2329 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2330 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2331 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2332 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2333 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/
2334 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2335 #define __Pyx_MODULE_NAME "equivalent_polynomials"
2336 extern int __pyx_module_is_main_equivalent_polynomials;
2337 int __pyx_module_is_main_equivalent_polynomials = 0;
2338 
2339 /* Implementation of 'equivalent_polynomials' */
2340 static PyObject *__pyx_builtin_TypeError;
2341 static PyObject *__pyx_builtin_ImportError;
2342 static PyObject *__pyx_builtin_ValueError;
2343 static PyObject *__pyx_builtin_MemoryError;
2344 static PyObject *__pyx_builtin_enumerate;
2345 static PyObject *__pyx_builtin_range;
2346 static PyObject *__pyx_builtin_Ellipsis;
2347 static PyObject *__pyx_builtin_id;
2348 static PyObject *__pyx_builtin_IndexError;
2349 static const char __pyx_k_O[] = "O";
2350 static const char __pyx_k_T[] = "T{";
2351  static const char __pyx_k_c[] = "c";
2352  static const char __pyx_k_d[] = "d";
2353  static const char __pyx_k_s[] = "(%s)";
2354  static const char __pyx_k_id[] = "id";
2355  static const char __pyx_k_nP[] = "nP";
2356  static const char __pyx_k_nQ[] = "nQ";
2357  static const char __pyx_k_np[] = "np";
2358  static const char __pyx_k_xi[] = "xi";
2359  static const char __pyx_k__35[] = "^";
2360  static const char __pyx_k__36[] = "";
2361  static const char __pyx_k__37[] = ":";
2362 static const char __pyx_k__38[] = "}";
2363 static const char __pyx_k__39[] = ",";
2364 static const char __pyx_k_new[] = "__new__";
2365 static const char __pyx_k_obj[] = "obj";
2366 static const char __pyx_k_base[] = "base";
2367 static const char __pyx_k_dict[] = "__dict__";
2368 static const char __pyx_k_join[] = "join";
2369 static const char __pyx_k_main[] = "__main__";
2370 static const char __pyx_k_mode[] = "mode";
2371 static const char __pyx_k_name[] = "name";
2372 static const char __pyx_k_ndim[] = "ndim";
2373 static const char __pyx_k_pack[] = "pack";
2374 static const char __pyx_k_size[] = "size";
2375 static const char __pyx_k_step[] = "step";
2376 static const char __pyx_k_stop[] = "stop";
2377 static const char __pyx_k_test[] = "__test__";
2378 static const char __pyx_k_ASCII[] = "ASCII";
2379 static const char __pyx_k_class[] = "__class__";
2380 static const char __pyx_k_error[] = "error";
2381 static const char __pyx_k_flags[] = "flags";
2382 static const char __pyx_k_numpy[] = "numpy";
2383 static const char __pyx_k_range[] = "range";
2384 static const char __pyx_k_shape[] = "shape";
2385 static const char __pyx_k_start[] = "start";
2386 static const char __pyx_k_zeros[] = "zeros";
2387 static const char __pyx_k_encode[] = "encode";
2388 static const char __pyx_k_format[] = "format";
2389 static const char __pyx_k_import[] = "__import__";
2390 static const char __pyx_k_nSpace[] = "nSpace";
2391 static const char __pyx_k_name_2[] = "__name__";
2392 static const char __pyx_k_pickle[] = "pickle";
2393 static const char __pyx_k_reduce[] = "__reduce__";
2394 static const char __pyx_k_struct[] = "struct";
2395 static const char __pyx_k_unpack[] = "unpack";
2396 static const char __pyx_k_update[] = "update";
2397 static const char __pyx_k_Simplex[] = "Simplex";
2398 static const char __pyx_k_asarray[] = "asarray";
2399 static const char __pyx_k_fortran[] = "fortran";
2400 static const char __pyx_k_memview[] = "memview";
2401 static const char __pyx_k_phi_dof[] = "phi_dof";
2402 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2403 static const char __pyx_k_getstate[] = "__getstate__";
2404 static const char __pyx_k_itemsize[] = "itemsize";
2405 static const char __pyx_k_pyx_type[] = "__pyx_type";
2406 static const char __pyx_k_setstate[] = "__setstate__";
2407 static const char __pyx_k_TypeError[] = "TypeError";
2408 static const char __pyx_k_enumerate[] = "enumerate";
2409 static const char __pyx_k_phi_nodes[] = "phi_nodes";
2410 static const char __pyx_k_pyx_state[] = "__pyx_state";
2411 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2412 static const char __pyx_k_IndexError[] = "IndexError";
2413 static const char __pyx_k_ValueError[] = "ValueError";
2414 static const char __pyx_k_pyx_result[] = "__pyx_result";
2415 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2416 static const char __pyx_k_ImportError[] = "ImportError";
2417 static const char __pyx_k_MemoryError[] = "MemoryError";
2418 static const char __pyx_k_PickleError[] = "PickleError";
2419 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2420 static const char __pyx_k_stringsource[] = "stringsource";
2421 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2422 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2423 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2424 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2425 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2426 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2427 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2428 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2429 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2430 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2431 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2432 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2433 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2434 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2435 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2436 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2437 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2438 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2439 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2440 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2441 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2442 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2443 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2444 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2445 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2446 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2447 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2448 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2449 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2450 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2451 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2452 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2453 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2454 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2455 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2456 static PyObject *__pyx_n_s_ASCII;
2457 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2458 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2459 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2460 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2461 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2462 static PyObject *__pyx_n_s_Ellipsis;
2463 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2464 static PyObject *__pyx_n_s_ImportError;
2465 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2466 static PyObject *__pyx_n_s_IndexError;
2467 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2468 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2469 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2470 static PyObject *__pyx_n_s_MemoryError;
2471 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2472 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2473 static PyObject *__pyx_n_b_O;
2474 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2475 static PyObject *__pyx_n_s_PickleError;
2476 static PyObject *__pyx_n_s_Simplex;
2477 static PyObject *__pyx_kp_b_T;
2478 static PyObject *__pyx_n_s_TypeError;
2479 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2480 static PyObject *__pyx_n_s_ValueError;
2481 static PyObject *__pyx_n_s_View_MemoryView;
2482 static PyObject *__pyx_kp_b__35;
2483 static PyObject *__pyx_kp_b__36;
2484 static PyObject *__pyx_kp_b__37;
2485 static PyObject *__pyx_kp_b__38;
2486 static PyObject *__pyx_kp_u__39;
2487 static PyObject *__pyx_n_s_allocate_buffer;
2488 static PyObject *__pyx_n_s_asarray;
2489 static PyObject *__pyx_n_s_base;
2490 static PyObject *__pyx_n_s_c;
2491 static PyObject *__pyx_n_u_c;
2492 static PyObject *__pyx_n_s_class;
2493 static PyObject *__pyx_n_s_cline_in_traceback;
2494 static PyObject *__pyx_kp_s_contiguous_and_direct;
2495 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2496 static PyObject *__pyx_n_s_d;
2497 static PyObject *__pyx_n_s_dict;
2498 static PyObject *__pyx_n_s_dtype_is_object;
2499 static PyObject *__pyx_n_s_encode;
2500 static PyObject *__pyx_n_s_enumerate;
2501 static PyObject *__pyx_n_s_error;
2502 static PyObject *__pyx_n_s_flags;
2503 static PyObject *__pyx_n_s_format;
2504 static PyObject *__pyx_n_s_fortran;
2505 static PyObject *__pyx_n_u_fortran;
2506 static PyObject *__pyx_n_s_getstate;
2507 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2508 static PyObject *__pyx_n_s_id;
2509 static PyObject *__pyx_n_s_import;
2510 static PyObject *__pyx_n_s_itemsize;
2511 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2512 static PyObject *__pyx_n_s_join;
2513 static PyObject *__pyx_n_s_main;
2514 static PyObject *__pyx_n_s_memview;
2515 static PyObject *__pyx_n_s_mode;
2516 static PyObject *__pyx_n_s_nP;
2517 static PyObject *__pyx_n_s_nQ;
2518 static PyObject *__pyx_n_s_nSpace;
2519 static PyObject *__pyx_n_s_name;
2520 static PyObject *__pyx_n_s_name_2;
2521 static PyObject *__pyx_n_s_ndim;
2522 static PyObject *__pyx_n_s_new;
2523 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2524 static PyObject *__pyx_n_s_np;
2525 static PyObject *__pyx_n_s_numpy;
2526 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2527 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2528 static PyObject *__pyx_n_s_obj;
2529 static PyObject *__pyx_n_s_pack;
2530 static PyObject *__pyx_n_s_phi_dof;
2531 static PyObject *__pyx_n_s_phi_nodes;
2532 static PyObject *__pyx_n_s_pickle;
2533 static PyObject *__pyx_n_s_pyx_PickleError;
2534 static PyObject *__pyx_n_s_pyx_checksum;
2535 static PyObject *__pyx_n_s_pyx_getbuffer;
2536 static PyObject *__pyx_n_s_pyx_result;
2537 static PyObject *__pyx_n_s_pyx_state;
2538 static PyObject *__pyx_n_s_pyx_type;
2539 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2540 static PyObject *__pyx_n_s_pyx_vtable;
2541 static PyObject *__pyx_n_s_range;
2542 static PyObject *__pyx_n_s_reduce;
2543 static PyObject *__pyx_n_s_reduce_cython;
2544 static PyObject *__pyx_n_s_reduce_ex;
2545 static PyObject *__pyx_kp_u_s;
2546 static PyObject *__pyx_n_s_setstate;
2547 static PyObject *__pyx_n_s_setstate_cython;
2548 static PyObject *__pyx_n_s_shape;
2549 static PyObject *__pyx_n_s_size;
2550 static PyObject *__pyx_n_s_start;
2551 static PyObject *__pyx_n_s_step;
2552 static PyObject *__pyx_n_s_stop;
2553 static PyObject *__pyx_kp_s_strided_and_direct;
2554 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2555 static PyObject *__pyx_kp_s_strided_and_indirect;
2556 static PyObject *__pyx_kp_s_stringsource;
2557 static PyObject *__pyx_n_s_struct;
2558 static PyObject *__pyx_n_s_test;
2559 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2560 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2561 static PyObject *__pyx_n_s_unpack;
2562 static PyObject *__pyx_n_s_update;
2563 static PyObject *__pyx_n_s_xi;
2564 static PyObject *__pyx_n_s_zeros;
2565 static int __pyx_pf_22equivalent_polynomials_7Simplex___cinit__(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, PyObject *__pyx_v_nSpace, PyObject *__pyx_v_nP, PyObject *__pyx_v_nQ); /* proto */
2566 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_2calculate(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, PyArrayObject *__pyx_v_phi_dof, PyArrayObject *__pyx_v_phi_nodes, PyArrayObject *__pyx_v_xi); /* proto */
2567 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_4set_quad(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, int __pyx_v_q); /* proto */
2568 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_1H___get__(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self); /* proto */
2569 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_3ImH___get__(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self); /* proto */
2570 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_1D___get__(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self); /* proto */
2571 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self); /* proto */
2572 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2573 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 */
2574 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 */
2575 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2576 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2577 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2578 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2579 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2580 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 */
2581 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2582 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 */
2583 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2584 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2585 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2586 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2587 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 */
2588 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2589 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2590 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 */
2591 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 */
2592 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2593 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2594 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2595 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2596 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2597 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2598 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2599 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2600 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2601 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2602 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2603 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2604 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2605 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2606 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2607 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2608 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2609 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 */
2610 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2611 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2612 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2613 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 */
2614 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 */
2615 static PyObject *__pyx_tp_new_22equivalent_polynomials_Simplex(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2616 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2617 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2618 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2619 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2620 static PyObject *__pyx_int_0;
2621 static PyObject *__pyx_int_1;
2622 static PyObject *__pyx_int_2;
2623 static PyObject *__pyx_int_3;
2624 static PyObject *__pyx_int_50;
2625 static PyObject *__pyx_int_112105877;
2626 static PyObject *__pyx_int_136983863;
2627 static PyObject *__pyx_int_184977713;
2628 static PyObject *__pyx_int_neg_1;
2629 static PyObject *__pyx_tuple_;
2630 static PyObject *__pyx_tuple__2;
2631 static PyObject *__pyx_tuple__3;
2632 static PyObject *__pyx_tuple__4;
2633 static PyObject *__pyx_tuple__5;
2634 static PyObject *__pyx_tuple__6;
2635 static PyObject *__pyx_tuple__7;
2636 static PyObject *__pyx_tuple__8;
2637 static PyObject *__pyx_tuple__9;
2638 static PyObject *__pyx_slice__30;
2639 static PyObject *__pyx_tuple__10;
2640 static PyObject *__pyx_tuple__11;
2641 static PyObject *__pyx_tuple__12;
2642 static PyObject *__pyx_tuple__13;
2643 static PyObject *__pyx_tuple__14;
2644 static PyObject *__pyx_tuple__15;
2645 static PyObject *__pyx_tuple__16;
2646 static PyObject *__pyx_tuple__17;
2647 static PyObject *__pyx_tuple__18;
2648 static PyObject *__pyx_tuple__19;
2649 static PyObject *__pyx_tuple__20;
2650 static PyObject *__pyx_tuple__21;
2651 static PyObject *__pyx_tuple__22;
2652 static PyObject *__pyx_tuple__23;
2653 static PyObject *__pyx_tuple__24;
2654 static PyObject *__pyx_tuple__25;
2655 static PyObject *__pyx_tuple__26;
2656 static PyObject *__pyx_tuple__27;
2657 static PyObject *__pyx_tuple__28;
2658 static PyObject *__pyx_tuple__29;
2659 static PyObject *__pyx_tuple__31;
2660 static PyObject *__pyx_tuple__32;
2661 static PyObject *__pyx_tuple__33;
2662 static PyObject *__pyx_tuple__34;
2663 static PyObject *__pyx_tuple__40;
2664 static PyObject *__pyx_tuple__41;
2665 static PyObject *__pyx_tuple__42;
2666 static PyObject *__pyx_tuple__43;
2667 static PyObject *__pyx_tuple__44;
2668 static PyObject *__pyx_tuple__45;
2669 static PyObject *__pyx_codeobj__46;
2670 /* Late includes */
2671 
2672 /* "equivalent_polynomials.pyx":43
2673  * cdef eqp.cSimplex[nSpace3T,nP2T,nQT,nEBQT] s32
2674  * cdef eqp.cSimplex[nSpace3T,nP3T,nQT,nEBQT] s33
2675  * def __cinit__(self, nSpace, nP, nQ): # <<<<<<<<<<<<<<
2676  * self.xiBuffer=np.zeros((50,3),'d')
2677  * self.nSpace = nSpace
2678  */
2679 
2680 /* Python wrapper */
2681 static int __pyx_pw_22equivalent_polynomials_7Simplex_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2682 static int __pyx_pw_22equivalent_polynomials_7Simplex_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2683  PyObject *__pyx_v_nSpace = 0;
2684  PyObject *__pyx_v_nP = 0;
2685  PyObject *__pyx_v_nQ = 0;
2686  int __pyx_lineno = 0;
2687  const char *__pyx_filename = NULL;
2688  int __pyx_clineno = 0;
2689  int __pyx_r;
2690  __Pyx_RefNannyDeclarations
2691  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
2692  {
2693  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nSpace,&__pyx_n_s_nP,&__pyx_n_s_nQ,0};
2694  PyObject* values[3] = {0,0,0};
2695  if (unlikely(__pyx_kwds)) {
2696  Py_ssize_t kw_args;
2697  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2698  switch (pos_args) {
2699  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2700  CYTHON_FALLTHROUGH;
2701  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2702  CYTHON_FALLTHROUGH;
2703  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2704  CYTHON_FALLTHROUGH;
2705  case 0: break;
2706  default: goto __pyx_L5_argtuple_error;
2707  }
2708  kw_args = PyDict_Size(__pyx_kwds);
2709  switch (pos_args) {
2710  case 0:
2711  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
2712  else goto __pyx_L5_argtuple_error;
2713  CYTHON_FALLTHROUGH;
2714  case 1:
2715  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nP)) != 0)) kw_args--;
2716  else {
2717  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(1, 43, __pyx_L3_error)
2718  }
2719  CYTHON_FALLTHROUGH;
2720  case 2:
2721  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nQ)) != 0)) kw_args--;
2722  else {
2723  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(1, 43, __pyx_L3_error)
2724  }
2725  }
2726  if (unlikely(kw_args > 0)) {
2727  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 43, __pyx_L3_error)
2728  }
2729  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2730  goto __pyx_L5_argtuple_error;
2731  } else {
2732  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2733  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2734  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2735  }
2736  __pyx_v_nSpace = values[0];
2737  __pyx_v_nP = values[1];
2738  __pyx_v_nQ = values[2];
2739  }
2740  goto __pyx_L4_argument_unpacking_done;
2741  __pyx_L5_argtuple_error:;
2742  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 43, __pyx_L3_error)
2743  __pyx_L3_error:;
2744  __Pyx_AddTraceback("equivalent_polynomials.Simplex.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2745  __Pyx_RefNannyFinishContext();
2746  return -1;
2747  __pyx_L4_argument_unpacking_done:;
2748  __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex___cinit__(((struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self), __pyx_v_nSpace, __pyx_v_nP, __pyx_v_nQ);
2749 
2750  /* function exit code */
2751  __Pyx_RefNannyFinishContext();
2752  return __pyx_r;
2753 }
2754 
2755 static int __pyx_pf_22equivalent_polynomials_7Simplex___cinit__(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, PyObject *__pyx_v_nSpace, PyObject *__pyx_v_nP, PyObject *__pyx_v_nQ) {
2756  int __pyx_r;
2757  __Pyx_RefNannyDeclarations
2758  PyObject *__pyx_t_1 = NULL;
2759  PyObject *__pyx_t_2 = NULL;
2760  int __pyx_t_3;
2761  int __pyx_lineno = 0;
2762  const char *__pyx_filename = NULL;
2763  int __pyx_clineno = 0;
2764  __Pyx_RefNannySetupContext("__cinit__", 0);
2765 
2766  /* "equivalent_polynomials.pyx":44
2767  * cdef eqp.cSimplex[nSpace3T,nP3T,nQT,nEBQT] s33
2768  * def __cinit__(self, nSpace, nP, nQ):
2769  * self.xiBuffer=np.zeros((50,3),'d') # <<<<<<<<<<<<<<
2770  * self.nSpace = nSpace
2771  * self.nP = nP
2772  */
2773  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error)
2774  __Pyx_GOTREF(__pyx_t_1);
2775  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 44, __pyx_L1_error)
2776  __Pyx_GOTREF(__pyx_t_2);
2777  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2778  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error)
2779  __Pyx_GOTREF(__pyx_t_1);
2780  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2781  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 44, __pyx_L1_error)
2782  __Pyx_GIVEREF(__pyx_t_1);
2783  __Pyx_GOTREF(__pyx_v_self->xiBuffer);
2784  __Pyx_DECREF(((PyObject *)__pyx_v_self->xiBuffer));
2785  __pyx_v_self->xiBuffer = ((PyArrayObject *)__pyx_t_1);
2786  __pyx_t_1 = 0;
2787 
2788  /* "equivalent_polynomials.pyx":45
2789  * def __cinit__(self, nSpace, nP, nQ):
2790  * self.xiBuffer=np.zeros((50,3),'d')
2791  * self.nSpace = nSpace # <<<<<<<<<<<<<<
2792  * self.nP = nP
2793  * self.nQ=nQ
2794  */
2795  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_nSpace); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 45, __pyx_L1_error)
2796  __pyx_v_self->nSpace = __pyx_t_3;
2797 
2798  /* "equivalent_polynomials.pyx":46
2799  * self.xiBuffer=np.zeros((50,3),'d')
2800  * self.nSpace = nSpace
2801  * self.nP = nP # <<<<<<<<<<<<<<
2802  * self.nQ=nQ
2803  * self.nEBQ=nQ#cek hack
2804  */
2805  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_nP); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 46, __pyx_L1_error)
2806  __pyx_v_self->nP = __pyx_t_3;
2807 
2808  /* "equivalent_polynomials.pyx":47
2809  * self.nSpace = nSpace
2810  * self.nP = nP
2811  * self.nQ=nQ # <<<<<<<<<<<<<<
2812  * self.nEBQ=nQ#cek hack
2813  * self.q=0
2814  */
2815  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_nQ); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 47, __pyx_L1_error)
2816  __pyx_v_self->nQ = __pyx_t_3;
2817 
2818  /* "equivalent_polynomials.pyx":48
2819  * self.nP = nP
2820  * self.nQ=nQ
2821  * self.nEBQ=nQ#cek hack # <<<<<<<<<<<<<<
2822  * self.q=0
2823  * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi):
2824  */
2825  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_nQ); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
2826  __pyx_v_self->nEBQ = __pyx_t_3;
2827 
2828  /* "equivalent_polynomials.pyx":49
2829  * self.nQ=nQ
2830  * self.nEBQ=nQ#cek hack
2831  * self.q=0 # <<<<<<<<<<<<<<
2832  * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi):
2833  * self.xiBuffer[:xi.shape[0]]=xi
2834  */
2835  __pyx_v_self->q = 0;
2836 
2837  /* "equivalent_polynomials.pyx":43
2838  * cdef eqp.cSimplex[nSpace3T,nP2T,nQT,nEBQT] s32
2839  * cdef eqp.cSimplex[nSpace3T,nP3T,nQT,nEBQT] s33
2840  * def __cinit__(self, nSpace, nP, nQ): # <<<<<<<<<<<<<<
2841  * self.xiBuffer=np.zeros((50,3),'d')
2842  * self.nSpace = nSpace
2843  */
2844 
2845  /* function exit code */
2846  __pyx_r = 0;
2847  goto __pyx_L0;
2848  __pyx_L1_error:;
2849  __Pyx_XDECREF(__pyx_t_1);
2850  __Pyx_XDECREF(__pyx_t_2);
2851  __Pyx_AddTraceback("equivalent_polynomials.Simplex.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2852  __pyx_r = -1;
2853  __pyx_L0:;
2854  __Pyx_RefNannyFinishContext();
2855  return __pyx_r;
2856 }
2857 
2858 /* "equivalent_polynomials.pyx":50
2859  * self.nEBQ=nQ#cek hack
2860  * self.q=0
2861  * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi): # <<<<<<<<<<<<<<
2862  * self.xiBuffer[:xi.shape[0]]=xi
2863  * if (self.nSpace,self.nP) == (1,1):
2864  */
2865 
2866 /* Python wrapper */
2867 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_3calculate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2868 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_3calculate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2869  PyArrayObject *__pyx_v_phi_dof = 0;
2870  PyArrayObject *__pyx_v_phi_nodes = 0;
2871  PyArrayObject *__pyx_v_xi = 0;
2872  int __pyx_lineno = 0;
2873  const char *__pyx_filename = NULL;
2874  int __pyx_clineno = 0;
2875  PyObject *__pyx_r = 0;
2876  __Pyx_RefNannyDeclarations
2877  __Pyx_RefNannySetupContext("calculate (wrapper)", 0);
2878  {
2879  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_phi_dof,&__pyx_n_s_phi_nodes,&__pyx_n_s_xi,0};
2880  PyObject* values[3] = {0,0,0};
2881  if (unlikely(__pyx_kwds)) {
2882  Py_ssize_t kw_args;
2883  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2884  switch (pos_args) {
2885  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2886  CYTHON_FALLTHROUGH;
2887  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2888  CYTHON_FALLTHROUGH;
2889  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2890  CYTHON_FALLTHROUGH;
2891  case 0: break;
2892  default: goto __pyx_L5_argtuple_error;
2893  }
2894  kw_args = PyDict_Size(__pyx_kwds);
2895  switch (pos_args) {
2896  case 0:
2897  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi_dof)) != 0)) kw_args--;
2898  else goto __pyx_L5_argtuple_error;
2899  CYTHON_FALLTHROUGH;
2900  case 1:
2901  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi_nodes)) != 0)) kw_args--;
2902  else {
2903  __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(1, 50, __pyx_L3_error)
2904  }
2905  CYTHON_FALLTHROUGH;
2906  case 2:
2907  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xi)) != 0)) kw_args--;
2908  else {
2909  __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(1, 50, __pyx_L3_error)
2910  }
2911  }
2912  if (unlikely(kw_args > 0)) {
2913  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "calculate") < 0)) __PYX_ERR(1, 50, __pyx_L3_error)
2914  }
2915  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2916  goto __pyx_L5_argtuple_error;
2917  } else {
2918  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2919  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2920  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2921  }
2922  __pyx_v_phi_dof = ((PyArrayObject *)values[0]);
2923  __pyx_v_phi_nodes = ((PyArrayObject *)values[1]);
2924  __pyx_v_xi = ((PyArrayObject *)values[2]);
2925  }
2926  goto __pyx_L4_argument_unpacking_done;
2927  __pyx_L5_argtuple_error:;
2928  __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 50, __pyx_L3_error)
2929  __pyx_L3_error:;
2930  __Pyx_AddTraceback("equivalent_polynomials.Simplex.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename);
2931  __Pyx_RefNannyFinishContext();
2932  return NULL;
2933  __pyx_L4_argument_unpacking_done:;
2934  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi_dof), __pyx_ptype_5numpy_ndarray, 1, "phi_dof", 0))) __PYX_ERR(1, 50, __pyx_L1_error)
2935  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phi_nodes), __pyx_ptype_5numpy_ndarray, 1, "phi_nodes", 0))) __PYX_ERR(1, 50, __pyx_L1_error)
2936  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xi), __pyx_ptype_5numpy_ndarray, 1, "xi", 0))) __PYX_ERR(1, 50, __pyx_L1_error)
2937  __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_2calculate(((struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self), __pyx_v_phi_dof, __pyx_v_phi_nodes, __pyx_v_xi);
2938 
2939  /* function exit code */
2940  goto __pyx_L0;
2941  __pyx_L1_error:;
2942  __pyx_r = NULL;
2943  __pyx_L0:;
2944  __Pyx_RefNannyFinishContext();
2945  return __pyx_r;
2946 }
2947 
2948 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_2calculate(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, PyArrayObject *__pyx_v_phi_dof, PyArrayObject *__pyx_v_phi_nodes, PyArrayObject *__pyx_v_xi) {
2949  CYTHON_UNUSED int __pyx_v_icase;
2950  PyObject *__pyx_r = NULL;
2951  __Pyx_RefNannyDeclarations
2952  PyObject *__pyx_t_1 = NULL;
2953  PyObject *__pyx_t_2 = NULL;
2954  PyObject *__pyx_t_3 = NULL;
2955  int __pyx_t_4;
2956  double *__pyx_t_5;
2957  struct __pyx_array_obj *__pyx_t_6 = NULL;
2958  PyObject *__pyx_t_7 = NULL;
2959  bool __pyx_t_8;
2960  int __pyx_lineno = 0;
2961  const char *__pyx_filename = NULL;
2962  int __pyx_clineno = 0;
2963  __Pyx_RefNannySetupContext("calculate", 0);
2964 
2965  /* "equivalent_polynomials.pyx":51
2966  * self.q=0
2967  * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi):
2968  * self.xiBuffer[:xi.shape[0]]=xi # <<<<<<<<<<<<<<
2969  * if (self.nSpace,self.nP) == (1,1):
2970  * icase = self.s11.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
2971  */
2972  if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_self->xiBuffer), ((PyObject *)__pyx_v_xi), 0, (__pyx_v_xi->dimensions[0]), NULL, NULL, NULL, 0, 1, 1) < 0) __PYX_ERR(1, 51, __pyx_L1_error)
2973 
2974  /* "equivalent_polynomials.pyx":52
2975  * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi):
2976  * self.xiBuffer[:xi.shape[0]]=xi
2977  * if (self.nSpace,self.nP) == (1,1): # <<<<<<<<<<<<<<
2978  * icase = self.s11.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
2979  * self._H = np.asarray(<double[:self.nQ]>self.s11.get_H())
2980  */
2981  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 52, __pyx_L1_error)
2982  __Pyx_GOTREF(__pyx_t_1);
2983  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error)
2984  __Pyx_GOTREF(__pyx_t_2);
2985  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 52, __pyx_L1_error)
2986  __Pyx_GOTREF(__pyx_t_3);
2987  __Pyx_GIVEREF(__pyx_t_1);
2988  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
2989  __Pyx_GIVEREF(__pyx_t_2);
2990  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
2991  __pyx_t_1 = 0;
2992  __pyx_t_2 = 0;
2993  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_tuple__3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error)
2994  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2995  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 52, __pyx_L1_error)
2996  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2997  if (__pyx_t_4) {
2998 
2999  /* "equivalent_polynomials.pyx":53
3000  * self.xiBuffer[:xi.shape[0]]=xi
3001  * if (self.nSpace,self.nP) == (1,1):
3002  * icase = self.s11.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
3003  * self._H = np.asarray(<double[:self.nQ]>self.s11.get_H())
3004  * self._ImH = np.asarray(<double[:self.nQ]>self.s11.get_ImH())
3005  */
3006  __pyx_v_icase = __pyx_v_self->s11.calculate(((double *)__pyx_v_phi_dof->data), ((double *)__pyx_v_phi_nodes->data), ((double *)__pyx_v_self->xiBuffer->data), 0);
3007 
3008  /* "equivalent_polynomials.pyx":54
3009  * if (self.nSpace,self.nP) == (1,1):
3010  * icase = self.s11.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3011  * self._H = np.asarray(<double[:self.nQ]>self.s11.get_H()) # <<<<<<<<<<<<<<
3012  * self._ImH = np.asarray(<double[:self.nQ]>self.s11.get_ImH())
3013  * self._D = np.asarray(<double[:self.nQ]>self.s11.get_D())
3014  */
3015  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 54, __pyx_L1_error)
3016  __Pyx_GOTREF(__pyx_t_3);
3017  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 54, __pyx_L1_error)
3018  __Pyx_GOTREF(__pyx_t_1);
3019  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3020  __pyx_t_5 = __pyx_v_self->s11.get_H();
3021  if (!__pyx_t_5) {
3022  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3023  __PYX_ERR(1, 54, __pyx_L1_error)
3024  }
3025  __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 54, __pyx_L1_error)
3026  __Pyx_GOTREF(__pyx_t_7);
3027  __pyx_t_3 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 54, __pyx_L1_error)
3028  __Pyx_GOTREF(__pyx_t_3);
3029  __pyx_t_6 = __pyx_array_new(__pyx_t_3, sizeof(double), PyBytes_AS_STRING(__pyx_t_7), (char *) "c", (char *) __pyx_t_5);
3030  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 54, __pyx_L1_error)
3031  __Pyx_GOTREF(__pyx_t_6);
3032  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3033  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3034  __pyx_t_7 = NULL;
3035  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
3036  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
3037  if (likely(__pyx_t_7)) {
3038  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
3039  __Pyx_INCREF(__pyx_t_7);
3040  __Pyx_INCREF(function);
3041  __Pyx_DECREF_SET(__pyx_t_1, function);
3042  }
3043  }
3044  __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_t_6));
3045  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3046  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3047  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 54, __pyx_L1_error)
3048  __Pyx_GOTREF(__pyx_t_2);
3049  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3050  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 54, __pyx_L1_error)
3051  __Pyx_GIVEREF(__pyx_t_2);
3052  __Pyx_GOTREF(__pyx_v_self->_H);
3053  __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
3054  __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_2);
3055  __pyx_t_2 = 0;
3056 
3057  /* "equivalent_polynomials.pyx":55
3058  * icase = self.s11.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3059  * self._H = np.asarray(<double[:self.nQ]>self.s11.get_H())
3060  * self._ImH = np.asarray(<double[:self.nQ]>self.s11.get_ImH()) # <<<<<<<<<<<<<<
3061  * self._D = np.asarray(<double[:self.nQ]>self.s11.get_D())
3062  * self.inside_out = self.s11.inside_out
3063  */
3064  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 55, __pyx_L1_error)
3065  __Pyx_GOTREF(__pyx_t_1);
3066  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 55, __pyx_L1_error)
3067  __Pyx_GOTREF(__pyx_t_7);
3068  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3069  __pyx_t_5 = __pyx_v_self->s11.get_ImH();
3070  if (!__pyx_t_5) {
3071  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3072  __PYX_ERR(1, 55, __pyx_L1_error)
3073  }
3074  __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 55, __pyx_L1_error)
3075  __Pyx_GOTREF(__pyx_t_3);
3076  __pyx_t_1 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 55, __pyx_L1_error)
3077  __Pyx_GOTREF(__pyx_t_1);
3078  __pyx_t_6 = __pyx_array_new(__pyx_t_1, sizeof(double), PyBytes_AS_STRING(__pyx_t_3), (char *) "c", (char *) __pyx_t_5);
3079  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 55, __pyx_L1_error)
3080  __Pyx_GOTREF(__pyx_t_6);
3081  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3082  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3083  __pyx_t_3 = NULL;
3084  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
3085  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
3086  if (likely(__pyx_t_3)) {
3087  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
3088  __Pyx_INCREF(__pyx_t_3);
3089  __Pyx_INCREF(function);
3090  __Pyx_DECREF_SET(__pyx_t_7, function);
3091  }
3092  }
3093  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
3094  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3095  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3096  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 55, __pyx_L1_error)
3097  __Pyx_GOTREF(__pyx_t_2);
3098  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3099  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 55, __pyx_L1_error)
3100  __Pyx_GIVEREF(__pyx_t_2);
3101  __Pyx_GOTREF(__pyx_v_self->_ImH);
3102  __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
3103  __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_2);
3104  __pyx_t_2 = 0;
3105 
3106  /* "equivalent_polynomials.pyx":56
3107  * self._H = np.asarray(<double[:self.nQ]>self.s11.get_H())
3108  * self._ImH = np.asarray(<double[:self.nQ]>self.s11.get_ImH())
3109  * self._D = np.asarray(<double[:self.nQ]>self.s11.get_D()) # <<<<<<<<<<<<<<
3110  * self.inside_out = self.s11.inside_out
3111  * elif (self.nSpace,self.nP) == (1,2):
3112  */
3113  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 56, __pyx_L1_error)
3114  __Pyx_GOTREF(__pyx_t_7);
3115  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 56, __pyx_L1_error)
3116  __Pyx_GOTREF(__pyx_t_3);
3117  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3118  __pyx_t_5 = __pyx_v_self->s11.get_D();
3119  if (!__pyx_t_5) {
3120  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3121  __PYX_ERR(1, 56, __pyx_L1_error)
3122  }
3123  __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error)
3124  __Pyx_GOTREF(__pyx_t_1);
3125  __pyx_t_7 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 56, __pyx_L1_error)
3126  __Pyx_GOTREF(__pyx_t_7);
3127  __pyx_t_6 = __pyx_array_new(__pyx_t_7, sizeof(double), PyBytes_AS_STRING(__pyx_t_1), (char *) "c", (char *) __pyx_t_5);
3128  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 56, __pyx_L1_error)
3129  __Pyx_GOTREF(__pyx_t_6);
3130  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3131  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3132  __pyx_t_1 = NULL;
3133  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3134  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
3135  if (likely(__pyx_t_1)) {
3136  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3137  __Pyx_INCREF(__pyx_t_1);
3138  __Pyx_INCREF(function);
3139  __Pyx_DECREF_SET(__pyx_t_3, function);
3140  }
3141  }
3142  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_6));
3143  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3144  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3145  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 56, __pyx_L1_error)
3146  __Pyx_GOTREF(__pyx_t_2);
3147  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3148  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 56, __pyx_L1_error)
3149  __Pyx_GIVEREF(__pyx_t_2);
3150  __Pyx_GOTREF(__pyx_v_self->_D);
3151  __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
3152  __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_2);
3153  __pyx_t_2 = 0;
3154 
3155  /* "equivalent_polynomials.pyx":57
3156  * self._ImH = np.asarray(<double[:self.nQ]>self.s11.get_ImH())
3157  * self._D = np.asarray(<double[:self.nQ]>self.s11.get_D())
3158  * self.inside_out = self.s11.inside_out # <<<<<<<<<<<<<<
3159  * elif (self.nSpace,self.nP) == (1,2):
3160  * icase = self.s12.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3161  */
3162  __pyx_t_8 = __pyx_v_self->s11.inside_out;
3163  __pyx_v_self->inside_out = __pyx_t_8;
3164 
3165  /* "equivalent_polynomials.pyx":52
3166  * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi):
3167  * self.xiBuffer[:xi.shape[0]]=xi
3168  * if (self.nSpace,self.nP) == (1,1): # <<<<<<<<<<<<<<
3169  * icase = self.s11.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3170  * self._H = np.asarray(<double[:self.nQ]>self.s11.get_H())
3171  */
3172  goto __pyx_L3;
3173  }
3174 
3175  /* "equivalent_polynomials.pyx":58
3176  * self._D = np.asarray(<double[:self.nQ]>self.s11.get_D())
3177  * self.inside_out = self.s11.inside_out
3178  * elif (self.nSpace,self.nP) == (1,2): # <<<<<<<<<<<<<<
3179  * icase = self.s12.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3180  * self._H = np.asarray(<double[:self.nQ]>self.s12.get_H())
3181  */
3182  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 58, __pyx_L1_error)
3183  __Pyx_GOTREF(__pyx_t_2);
3184  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 58, __pyx_L1_error)
3185  __Pyx_GOTREF(__pyx_t_3);
3186  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 58, __pyx_L1_error)
3187  __Pyx_GOTREF(__pyx_t_1);
3188  __Pyx_GIVEREF(__pyx_t_2);
3189  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
3190  __Pyx_GIVEREF(__pyx_t_3);
3191  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
3192  __pyx_t_2 = 0;
3193  __pyx_t_3 = 0;
3194  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_tuple__4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 58, __pyx_L1_error)
3195  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3196  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 58, __pyx_L1_error)
3197  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3198  if (__pyx_t_4) {
3199 
3200  /* "equivalent_polynomials.pyx":59
3201  * self.inside_out = self.s11.inside_out
3202  * elif (self.nSpace,self.nP) == (1,2):
3203  * icase = self.s12.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
3204  * self._H = np.asarray(<double[:self.nQ]>self.s12.get_H())
3205  * self._ImH = np.asarray(<double[:self.nQ]>self.s12.get_ImH())
3206  */
3207  __pyx_v_icase = __pyx_v_self->s12.calculate(((double *)__pyx_v_phi_dof->data), ((double *)__pyx_v_phi_nodes->data), ((double *)__pyx_v_self->xiBuffer->data), 0);
3208 
3209  /* "equivalent_polynomials.pyx":60
3210  * elif (self.nSpace,self.nP) == (1,2):
3211  * icase = self.s12.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3212  * self._H = np.asarray(<double[:self.nQ]>self.s12.get_H()) # <<<<<<<<<<<<<<
3213  * self._ImH = np.asarray(<double[:self.nQ]>self.s12.get_ImH())
3214  * self._D = np.asarray(<double[:self.nQ]>self.s12.get_D())
3215  */
3216  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L1_error)
3217  __Pyx_GOTREF(__pyx_t_1);
3218  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 60, __pyx_L1_error)
3219  __Pyx_GOTREF(__pyx_t_2);
3220  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3221  __pyx_t_5 = __pyx_v_self->s12.get_H();
3222  if (!__pyx_t_5) {
3223  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3224  __PYX_ERR(1, 60, __pyx_L1_error)
3225  }
3226  __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 60, __pyx_L1_error)
3227  __Pyx_GOTREF(__pyx_t_7);
3228  __pyx_t_1 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L1_error)
3229  __Pyx_GOTREF(__pyx_t_1);
3230  __pyx_t_6 = __pyx_array_new(__pyx_t_1, sizeof(double), PyBytes_AS_STRING(__pyx_t_7), (char *) "c", (char *) __pyx_t_5);
3231  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 60, __pyx_L1_error)
3232  __Pyx_GOTREF(__pyx_t_6);
3233  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3234  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3235  __pyx_t_7 = NULL;
3236  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3237  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
3238  if (likely(__pyx_t_7)) {
3239  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3240  __Pyx_INCREF(__pyx_t_7);
3241  __Pyx_INCREF(function);
3242  __Pyx_DECREF_SET(__pyx_t_2, function);
3243  }
3244  }
3245  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_6));
3246  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3247  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3248  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 60, __pyx_L1_error)
3249  __Pyx_GOTREF(__pyx_t_3);
3250  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3251  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 60, __pyx_L1_error)
3252  __Pyx_GIVEREF(__pyx_t_3);
3253  __Pyx_GOTREF(__pyx_v_self->_H);
3254  __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
3255  __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_3);
3256  __pyx_t_3 = 0;
3257 
3258  /* "equivalent_polynomials.pyx":61
3259  * icase = self.s12.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3260  * self._H = np.asarray(<double[:self.nQ]>self.s12.get_H())
3261  * self._ImH = np.asarray(<double[:self.nQ]>self.s12.get_ImH()) # <<<<<<<<<<<<<<
3262  * self._D = np.asarray(<double[:self.nQ]>self.s12.get_D())
3263  * self.inside_out = self.s12.inside_out
3264  */
3265  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 61, __pyx_L1_error)
3266  __Pyx_GOTREF(__pyx_t_2);
3267  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 61, __pyx_L1_error)
3268  __Pyx_GOTREF(__pyx_t_7);
3269  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3270  __pyx_t_5 = __pyx_v_self->s12.get_ImH();
3271  if (!__pyx_t_5) {
3272  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3273  __PYX_ERR(1, 61, __pyx_L1_error)
3274  }
3275  __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
3276  __Pyx_GOTREF(__pyx_t_1);
3277  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 61, __pyx_L1_error)
3278  __Pyx_GOTREF(__pyx_t_2);
3279  __pyx_t_6 = __pyx_array_new(__pyx_t_2, sizeof(double), PyBytes_AS_STRING(__pyx_t_1), (char *) "c", (char *) __pyx_t_5);
3280  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 61, __pyx_L1_error)
3281  __Pyx_GOTREF(__pyx_t_6);
3282  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3283  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3284  __pyx_t_1 = NULL;
3285  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
3286  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
3287  if (likely(__pyx_t_1)) {
3288  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
3289  __Pyx_INCREF(__pyx_t_1);
3290  __Pyx_INCREF(function);
3291  __Pyx_DECREF_SET(__pyx_t_7, function);
3292  }
3293  }
3294  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_1, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
3295  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3296  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3297  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 61, __pyx_L1_error)
3298  __Pyx_GOTREF(__pyx_t_3);
3299  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3300  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 61, __pyx_L1_error)
3301  __Pyx_GIVEREF(__pyx_t_3);
3302  __Pyx_GOTREF(__pyx_v_self->_ImH);
3303  __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
3304  __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_3);
3305  __pyx_t_3 = 0;
3306 
3307  /* "equivalent_polynomials.pyx":62
3308  * self._H = np.asarray(<double[:self.nQ]>self.s12.get_H())
3309  * self._ImH = np.asarray(<double[:self.nQ]>self.s12.get_ImH())
3310  * self._D = np.asarray(<double[:self.nQ]>self.s12.get_D()) # <<<<<<<<<<<<<<
3311  * self.inside_out = self.s12.inside_out
3312  * elif (self.nSpace,self.nP) == (1,3):
3313  */
3314  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 62, __pyx_L1_error)
3315  __Pyx_GOTREF(__pyx_t_7);
3316  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 62, __pyx_L1_error)
3317  __Pyx_GOTREF(__pyx_t_1);
3318  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3319  __pyx_t_5 = __pyx_v_self->s12.get_D();
3320  if (!__pyx_t_5) {
3321  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3322  __PYX_ERR(1, 62, __pyx_L1_error)
3323  }
3324  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 62, __pyx_L1_error)
3325  __Pyx_GOTREF(__pyx_t_2);
3326  __pyx_t_7 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 62, __pyx_L1_error)
3327  __Pyx_GOTREF(__pyx_t_7);
3328  __pyx_t_6 = __pyx_array_new(__pyx_t_7, sizeof(double), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_5);
3329  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 62, __pyx_L1_error)
3330  __Pyx_GOTREF(__pyx_t_6);
3331  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3332  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3333  __pyx_t_2 = NULL;
3334  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
3335  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
3336  if (likely(__pyx_t_2)) {
3337  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
3338  __Pyx_INCREF(__pyx_t_2);
3339  __Pyx_INCREF(function);
3340  __Pyx_DECREF_SET(__pyx_t_1, function);
3341  }
3342  }
3343  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_t_6));
3344  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3345  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3346  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 62, __pyx_L1_error)
3347  __Pyx_GOTREF(__pyx_t_3);
3348  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3349  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 62, __pyx_L1_error)
3350  __Pyx_GIVEREF(__pyx_t_3);
3351  __Pyx_GOTREF(__pyx_v_self->_D);
3352  __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
3353  __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_3);
3354  __pyx_t_3 = 0;
3355 
3356  /* "equivalent_polynomials.pyx":63
3357  * self._ImH = np.asarray(<double[:self.nQ]>self.s12.get_ImH())
3358  * self._D = np.asarray(<double[:self.nQ]>self.s12.get_D())
3359  * self.inside_out = self.s12.inside_out # <<<<<<<<<<<<<<
3360  * elif (self.nSpace,self.nP) == (1,3):
3361  * icase = self.s13.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3362  */
3363  __pyx_t_8 = __pyx_v_self->s12.inside_out;
3364  __pyx_v_self->inside_out = __pyx_t_8;
3365 
3366  /* "equivalent_polynomials.pyx":58
3367  * self._D = np.asarray(<double[:self.nQ]>self.s11.get_D())
3368  * self.inside_out = self.s11.inside_out
3369  * elif (self.nSpace,self.nP) == (1,2): # <<<<<<<<<<<<<<
3370  * icase = self.s12.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3371  * self._H = np.asarray(<double[:self.nQ]>self.s12.get_H())
3372  */
3373  goto __pyx_L3;
3374  }
3375 
3376  /* "equivalent_polynomials.pyx":64
3377  * self._D = np.asarray(<double[:self.nQ]>self.s12.get_D())
3378  * self.inside_out = self.s12.inside_out
3379  * elif (self.nSpace,self.nP) == (1,3): # <<<<<<<<<<<<<<
3380  * icase = self.s13.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3381  * self._H = np.asarray(<double[:self.nQ]>self.s13.get_H())
3382  */
3383  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 64, __pyx_L1_error)
3384  __Pyx_GOTREF(__pyx_t_3);
3385  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 64, __pyx_L1_error)
3386  __Pyx_GOTREF(__pyx_t_1);
3387  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 64, __pyx_L1_error)
3388  __Pyx_GOTREF(__pyx_t_2);
3389  __Pyx_GIVEREF(__pyx_t_3);
3390  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
3391  __Pyx_GIVEREF(__pyx_t_1);
3392  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
3393  __pyx_t_3 = 0;
3394  __pyx_t_1 = 0;
3395  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 64, __pyx_L1_error)
3396  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3397  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 64, __pyx_L1_error)
3398  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3399  if (__pyx_t_4) {
3400 
3401  /* "equivalent_polynomials.pyx":65
3402  * self.inside_out = self.s12.inside_out
3403  * elif (self.nSpace,self.nP) == (1,3):
3404  * icase = self.s13.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
3405  * self._H = np.asarray(<double[:self.nQ]>self.s13.get_H())
3406  * self._ImH = np.asarray(<double[:self.nQ]>self.s13.get_ImH())
3407  */
3408  __pyx_v_icase = __pyx_v_self->s13.calculate(((double *)__pyx_v_phi_dof->data), ((double *)__pyx_v_phi_nodes->data), ((double *)__pyx_v_self->xiBuffer->data), 0);
3409 
3410  /* "equivalent_polynomials.pyx":66
3411  * elif (self.nSpace,self.nP) == (1,3):
3412  * icase = self.s13.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3413  * self._H = np.asarray(<double[:self.nQ]>self.s13.get_H()) # <<<<<<<<<<<<<<
3414  * self._ImH = np.asarray(<double[:self.nQ]>self.s13.get_ImH())
3415  * self._D = np.asarray(<double[:self.nQ]>self.s13.get_D())
3416  */
3417  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 66, __pyx_L1_error)
3418  __Pyx_GOTREF(__pyx_t_2);
3419  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 66, __pyx_L1_error)
3420  __Pyx_GOTREF(__pyx_t_3);
3421  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3422  __pyx_t_5 = __pyx_v_self->s13.get_H();
3423  if (!__pyx_t_5) {
3424  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3425  __PYX_ERR(1, 66, __pyx_L1_error)
3426  }
3427  __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 66, __pyx_L1_error)
3428  __Pyx_GOTREF(__pyx_t_7);
3429  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 66, __pyx_L1_error)
3430  __Pyx_GOTREF(__pyx_t_2);
3431  __pyx_t_6 = __pyx_array_new(__pyx_t_2, sizeof(double), PyBytes_AS_STRING(__pyx_t_7), (char *) "c", (char *) __pyx_t_5);
3432  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 66, __pyx_L1_error)
3433  __Pyx_GOTREF(__pyx_t_6);
3434  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3435  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3436  __pyx_t_7 = NULL;
3437  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3438  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
3439  if (likely(__pyx_t_7)) {
3440  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3441  __Pyx_INCREF(__pyx_t_7);
3442  __Pyx_INCREF(function);
3443  __Pyx_DECREF_SET(__pyx_t_3, function);
3444  }
3445  }
3446  __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_6));
3447  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3448  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3449  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 66, __pyx_L1_error)
3450  __Pyx_GOTREF(__pyx_t_1);
3451  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3452  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 66, __pyx_L1_error)
3453  __Pyx_GIVEREF(__pyx_t_1);
3454  __Pyx_GOTREF(__pyx_v_self->_H);
3455  __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
3456  __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_1);
3457  __pyx_t_1 = 0;
3458 
3459  /* "equivalent_polynomials.pyx":67
3460  * icase = self.s13.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3461  * self._H = np.asarray(<double[:self.nQ]>self.s13.get_H())
3462  * self._ImH = np.asarray(<double[:self.nQ]>self.s13.get_ImH()) # <<<<<<<<<<<<<<
3463  * self._D = np.asarray(<double[:self.nQ]>self.s13.get_D())
3464  * self.inside_out = self.s13.inside_out
3465  */
3466  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 67, __pyx_L1_error)
3467  __Pyx_GOTREF(__pyx_t_3);
3468  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 67, __pyx_L1_error)
3469  __Pyx_GOTREF(__pyx_t_7);
3470  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3471  __pyx_t_5 = __pyx_v_self->s13.get_ImH();
3472  if (!__pyx_t_5) {
3473  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3474  __PYX_ERR(1, 67, __pyx_L1_error)
3475  }
3476  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 67, __pyx_L1_error)
3477  __Pyx_GOTREF(__pyx_t_2);
3478  __pyx_t_3 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 67, __pyx_L1_error)
3479  __Pyx_GOTREF(__pyx_t_3);
3480  __pyx_t_6 = __pyx_array_new(__pyx_t_3, sizeof(double), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_5);
3481  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 67, __pyx_L1_error)
3482  __Pyx_GOTREF(__pyx_t_6);
3483  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3484  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3485  __pyx_t_2 = NULL;
3486  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
3487  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
3488  if (likely(__pyx_t_2)) {
3489  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
3490  __Pyx_INCREF(__pyx_t_2);
3491  __Pyx_INCREF(function);
3492  __Pyx_DECREF_SET(__pyx_t_7, function);
3493  }
3494  }
3495  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
3496  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3497  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3498  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 67, __pyx_L1_error)
3499  __Pyx_GOTREF(__pyx_t_1);
3500  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3501  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 67, __pyx_L1_error)
3502  __Pyx_GIVEREF(__pyx_t_1);
3503  __Pyx_GOTREF(__pyx_v_self->_ImH);
3504  __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
3505  __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_1);
3506  __pyx_t_1 = 0;
3507 
3508  /* "equivalent_polynomials.pyx":68
3509  * self._H = np.asarray(<double[:self.nQ]>self.s13.get_H())
3510  * self._ImH = np.asarray(<double[:self.nQ]>self.s13.get_ImH())
3511  * self._D = np.asarray(<double[:self.nQ]>self.s13.get_D()) # <<<<<<<<<<<<<<
3512  * self.inside_out = self.s13.inside_out
3513  * elif (self.nSpace,self.nP) == (2,1):
3514  */
3515  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 68, __pyx_L1_error)
3516  __Pyx_GOTREF(__pyx_t_7);
3517  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 68, __pyx_L1_error)
3518  __Pyx_GOTREF(__pyx_t_2);
3519  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3520  __pyx_t_5 = __pyx_v_self->s13.get_D();
3521  if (!__pyx_t_5) {
3522  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3523  __PYX_ERR(1, 68, __pyx_L1_error)
3524  }
3525  __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 68, __pyx_L1_error)
3526  __Pyx_GOTREF(__pyx_t_3);
3527  __pyx_t_7 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 68, __pyx_L1_error)
3528  __Pyx_GOTREF(__pyx_t_7);
3529  __pyx_t_6 = __pyx_array_new(__pyx_t_7, sizeof(double), PyBytes_AS_STRING(__pyx_t_3), (char *) "c", (char *) __pyx_t_5);
3530  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 68, __pyx_L1_error)
3531  __Pyx_GOTREF(__pyx_t_6);
3532  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3533  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3534  __pyx_t_3 = NULL;
3535  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3536  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3537  if (likely(__pyx_t_3)) {
3538  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3539  __Pyx_INCREF(__pyx_t_3);
3540  __Pyx_INCREF(function);
3541  __Pyx_DECREF_SET(__pyx_t_2, function);
3542  }
3543  }
3544  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_6));
3545  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3546  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3547  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error)
3548  __Pyx_GOTREF(__pyx_t_1);
3549  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3550  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 68, __pyx_L1_error)
3551  __Pyx_GIVEREF(__pyx_t_1);
3552  __Pyx_GOTREF(__pyx_v_self->_D);
3553  __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
3554  __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_1);
3555  __pyx_t_1 = 0;
3556 
3557  /* "equivalent_polynomials.pyx":69
3558  * self._ImH = np.asarray(<double[:self.nQ]>self.s13.get_ImH())
3559  * self._D = np.asarray(<double[:self.nQ]>self.s13.get_D())
3560  * self.inside_out = self.s13.inside_out # <<<<<<<<<<<<<<
3561  * elif (self.nSpace,self.nP) == (2,1):
3562  * icase = self.s21.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3563  */
3564  __pyx_t_8 = __pyx_v_self->s13.inside_out;
3565  __pyx_v_self->inside_out = __pyx_t_8;
3566 
3567  /* "equivalent_polynomials.pyx":64
3568  * self._D = np.asarray(<double[:self.nQ]>self.s12.get_D())
3569  * self.inside_out = self.s12.inside_out
3570  * elif (self.nSpace,self.nP) == (1,3): # <<<<<<<<<<<<<<
3571  * icase = self.s13.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3572  * self._H = np.asarray(<double[:self.nQ]>self.s13.get_H())
3573  */
3574  goto __pyx_L3;
3575  }
3576 
3577  /* "equivalent_polynomials.pyx":70
3578  * self._D = np.asarray(<double[:self.nQ]>self.s13.get_D())
3579  * self.inside_out = self.s13.inside_out
3580  * elif (self.nSpace,self.nP) == (2,1): # <<<<<<<<<<<<<<
3581  * icase = self.s21.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3582  * self._H = np.asarray(<double[:self.nQ]>self.s21.get_H())
3583  */
3584  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error)
3585  __Pyx_GOTREF(__pyx_t_1);
3586  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 70, __pyx_L1_error)
3587  __Pyx_GOTREF(__pyx_t_2);
3588  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 70, __pyx_L1_error)
3589  __Pyx_GOTREF(__pyx_t_3);
3590  __Pyx_GIVEREF(__pyx_t_1);
3591  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
3592  __Pyx_GIVEREF(__pyx_t_2);
3593  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
3594  __pyx_t_1 = 0;
3595  __pyx_t_2 = 0;
3596  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_tuple__6, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 70, __pyx_L1_error)
3597  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3598  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 70, __pyx_L1_error)
3599  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3600  if (__pyx_t_4) {
3601 
3602  /* "equivalent_polynomials.pyx":71
3603  * self.inside_out = self.s13.inside_out
3604  * elif (self.nSpace,self.nP) == (2,1):
3605  * icase = self.s21.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
3606  * self._H = np.asarray(<double[:self.nQ]>self.s21.get_H())
3607  * self._ImH = np.asarray(<double[:self.nQ]>self.s21.get_ImH())
3608  */
3609  __pyx_v_icase = __pyx_v_self->s21.calculate(((double *)__pyx_v_phi_dof->data), ((double *)__pyx_v_phi_nodes->data), ((double *)__pyx_v_self->xiBuffer->data), 0);
3610 
3611  /* "equivalent_polynomials.pyx":72
3612  * elif (self.nSpace,self.nP) == (2,1):
3613  * icase = self.s21.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3614  * self._H = np.asarray(<double[:self.nQ]>self.s21.get_H()) # <<<<<<<<<<<<<<
3615  * self._ImH = np.asarray(<double[:self.nQ]>self.s21.get_ImH())
3616  * self._D = np.asarray(<double[:self.nQ]>self.s21.get_D())
3617  */
3618  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 72, __pyx_L1_error)
3619  __Pyx_GOTREF(__pyx_t_3);
3620  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L1_error)
3621  __Pyx_GOTREF(__pyx_t_1);
3622  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3623  __pyx_t_5 = __pyx_v_self->s21.get_H();
3624  if (!__pyx_t_5) {
3625  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3626  __PYX_ERR(1, 72, __pyx_L1_error)
3627  }
3628  __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 72, __pyx_L1_error)
3629  __Pyx_GOTREF(__pyx_t_7);
3630  __pyx_t_3 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 72, __pyx_L1_error)
3631  __Pyx_GOTREF(__pyx_t_3);
3632  __pyx_t_6 = __pyx_array_new(__pyx_t_3, sizeof(double), PyBytes_AS_STRING(__pyx_t_7), (char *) "c", (char *) __pyx_t_5);
3633  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 72, __pyx_L1_error)
3634  __Pyx_GOTREF(__pyx_t_6);
3635  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3636  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3637  __pyx_t_7 = NULL;
3638  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
3639  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
3640  if (likely(__pyx_t_7)) {
3641  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
3642  __Pyx_INCREF(__pyx_t_7);
3643  __Pyx_INCREF(function);
3644  __Pyx_DECREF_SET(__pyx_t_1, function);
3645  }
3646  }
3647  __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_t_6));
3648  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3649  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3650  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 72, __pyx_L1_error)
3651  __Pyx_GOTREF(__pyx_t_2);
3652  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3653  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 72, __pyx_L1_error)
3654  __Pyx_GIVEREF(__pyx_t_2);
3655  __Pyx_GOTREF(__pyx_v_self->_H);
3656  __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
3657  __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_2);
3658  __pyx_t_2 = 0;
3659 
3660  /* "equivalent_polynomials.pyx":73
3661  * icase = self.s21.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3662  * self._H = np.asarray(<double[:self.nQ]>self.s21.get_H())
3663  * self._ImH = np.asarray(<double[:self.nQ]>self.s21.get_ImH()) # <<<<<<<<<<<<<<
3664  * self._D = np.asarray(<double[:self.nQ]>self.s21.get_D())
3665  * self.inside_out = self.s21.inside_out
3666  */
3667  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error)
3668  __Pyx_GOTREF(__pyx_t_1);
3669  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 73, __pyx_L1_error)
3670  __Pyx_GOTREF(__pyx_t_7);
3671  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3672  __pyx_t_5 = __pyx_v_self->s21.get_ImH();
3673  if (!__pyx_t_5) {
3674  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3675  __PYX_ERR(1, 73, __pyx_L1_error)
3676  }
3677  __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 73, __pyx_L1_error)
3678  __Pyx_GOTREF(__pyx_t_3);
3679  __pyx_t_1 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error)
3680  __Pyx_GOTREF(__pyx_t_1);
3681  __pyx_t_6 = __pyx_array_new(__pyx_t_1, sizeof(double), PyBytes_AS_STRING(__pyx_t_3), (char *) "c", (char *) __pyx_t_5);
3682  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 73, __pyx_L1_error)
3683  __Pyx_GOTREF(__pyx_t_6);
3684  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3685  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3686  __pyx_t_3 = NULL;
3687  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
3688  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
3689  if (likely(__pyx_t_3)) {
3690  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
3691  __Pyx_INCREF(__pyx_t_3);
3692  __Pyx_INCREF(function);
3693  __Pyx_DECREF_SET(__pyx_t_7, function);
3694  }
3695  }
3696  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
3697  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3698  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3699  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error)
3700  __Pyx_GOTREF(__pyx_t_2);
3701  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3702  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 73, __pyx_L1_error)
3703  __Pyx_GIVEREF(__pyx_t_2);
3704  __Pyx_GOTREF(__pyx_v_self->_ImH);
3705  __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
3706  __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_2);
3707  __pyx_t_2 = 0;
3708 
3709  /* "equivalent_polynomials.pyx":74
3710  * self._H = np.asarray(<double[:self.nQ]>self.s21.get_H())
3711  * self._ImH = np.asarray(<double[:self.nQ]>self.s21.get_ImH())
3712  * self._D = np.asarray(<double[:self.nQ]>self.s21.get_D()) # <<<<<<<<<<<<<<
3713  * self.inside_out = self.s21.inside_out
3714  * elif (self.nSpace,self.nP) == (2,2):
3715  */
3716  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 74, __pyx_L1_error)
3717  __Pyx_GOTREF(__pyx_t_7);
3718  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 74, __pyx_L1_error)
3719  __Pyx_GOTREF(__pyx_t_3);
3720  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3721  __pyx_t_5 = __pyx_v_self->s21.get_D();
3722  if (!__pyx_t_5) {
3723  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3724  __PYX_ERR(1, 74, __pyx_L1_error)
3725  }
3726  __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 74, __pyx_L1_error)
3727  __Pyx_GOTREF(__pyx_t_1);
3728  __pyx_t_7 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 74, __pyx_L1_error)
3729  __Pyx_GOTREF(__pyx_t_7);
3730  __pyx_t_6 = __pyx_array_new(__pyx_t_7, sizeof(double), PyBytes_AS_STRING(__pyx_t_1), (char *) "c", (char *) __pyx_t_5);
3731  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 74, __pyx_L1_error)
3732  __Pyx_GOTREF(__pyx_t_6);
3733  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3734  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3735  __pyx_t_1 = NULL;
3736  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3737  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
3738  if (likely(__pyx_t_1)) {
3739  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3740  __Pyx_INCREF(__pyx_t_1);
3741  __Pyx_INCREF(function);
3742  __Pyx_DECREF_SET(__pyx_t_3, function);
3743  }
3744  }
3745  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_6));
3746  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3747  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3748  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L1_error)
3749  __Pyx_GOTREF(__pyx_t_2);
3750  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3751  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 74, __pyx_L1_error)
3752  __Pyx_GIVEREF(__pyx_t_2);
3753  __Pyx_GOTREF(__pyx_v_self->_D);
3754  __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
3755  __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_2);
3756  __pyx_t_2 = 0;
3757 
3758  /* "equivalent_polynomials.pyx":75
3759  * self._ImH = np.asarray(<double[:self.nQ]>self.s21.get_ImH())
3760  * self._D = np.asarray(<double[:self.nQ]>self.s21.get_D())
3761  * self.inside_out = self.s21.inside_out # <<<<<<<<<<<<<<
3762  * elif (self.nSpace,self.nP) == (2,2):
3763  * icase = self.s22.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3764  */
3765  __pyx_t_8 = __pyx_v_self->s21.inside_out;
3766  __pyx_v_self->inside_out = __pyx_t_8;
3767 
3768  /* "equivalent_polynomials.pyx":70
3769  * self._D = np.asarray(<double[:self.nQ]>self.s13.get_D())
3770  * self.inside_out = self.s13.inside_out
3771  * elif (self.nSpace,self.nP) == (2,1): # <<<<<<<<<<<<<<
3772  * icase = self.s21.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3773  * self._H = np.asarray(<double[:self.nQ]>self.s21.get_H())
3774  */
3775  goto __pyx_L3;
3776  }
3777 
3778  /* "equivalent_polynomials.pyx":76
3779  * self._D = np.asarray(<double[:self.nQ]>self.s21.get_D())
3780  * self.inside_out = self.s21.inside_out
3781  * elif (self.nSpace,self.nP) == (2,2): # <<<<<<<<<<<<<<
3782  * icase = self.s22.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3783  * self._H = np.asarray(<double[:self.nQ]>self.s22.get_H())
3784  */
3785  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 76, __pyx_L1_error)
3786  __Pyx_GOTREF(__pyx_t_2);
3787  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 76, __pyx_L1_error)
3788  __Pyx_GOTREF(__pyx_t_3);
3789  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 76, __pyx_L1_error)
3790  __Pyx_GOTREF(__pyx_t_1);
3791  __Pyx_GIVEREF(__pyx_t_2);
3792  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
3793  __Pyx_GIVEREF(__pyx_t_3);
3794  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
3795  __pyx_t_2 = 0;
3796  __pyx_t_3 = 0;
3797  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_tuple__7, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 76, __pyx_L1_error)
3798  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3799  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 76, __pyx_L1_error)
3800  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3801  if (__pyx_t_4) {
3802 
3803  /* "equivalent_polynomials.pyx":77
3804  * self.inside_out = self.s21.inside_out
3805  * elif (self.nSpace,self.nP) == (2,2):
3806  * icase = self.s22.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
3807  * self._H = np.asarray(<double[:self.nQ]>self.s22.get_H())
3808  * self._ImH = np.asarray(<double[:self.nQ]>self.s22.get_ImH())
3809  */
3810  __pyx_v_icase = __pyx_v_self->s22.calculate(((double *)__pyx_v_phi_dof->data), ((double *)__pyx_v_phi_nodes->data), ((double *)__pyx_v_self->xiBuffer->data), 0);
3811 
3812  /* "equivalent_polynomials.pyx":78
3813  * elif (self.nSpace,self.nP) == (2,2):
3814  * icase = self.s22.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3815  * self._H = np.asarray(<double[:self.nQ]>self.s22.get_H()) # <<<<<<<<<<<<<<
3816  * self._ImH = np.asarray(<double[:self.nQ]>self.s22.get_ImH())
3817  * self._D = np.asarray(<double[:self.nQ]>self.s22.get_D())
3818  */
3819  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 78, __pyx_L1_error)
3820  __Pyx_GOTREF(__pyx_t_1);
3821  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 78, __pyx_L1_error)
3822  __Pyx_GOTREF(__pyx_t_2);
3823  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3824  __pyx_t_5 = __pyx_v_self->s22.get_H();
3825  if (!__pyx_t_5) {
3826  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3827  __PYX_ERR(1, 78, __pyx_L1_error)
3828  }
3829  __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 78, __pyx_L1_error)
3830  __Pyx_GOTREF(__pyx_t_7);
3831  __pyx_t_1 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 78, __pyx_L1_error)
3832  __Pyx_GOTREF(__pyx_t_1);
3833  __pyx_t_6 = __pyx_array_new(__pyx_t_1, sizeof(double), PyBytes_AS_STRING(__pyx_t_7), (char *) "c", (char *) __pyx_t_5);
3834  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 78, __pyx_L1_error)
3835  __Pyx_GOTREF(__pyx_t_6);
3836  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3837  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3838  __pyx_t_7 = NULL;
3839  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3840  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
3841  if (likely(__pyx_t_7)) {
3842  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3843  __Pyx_INCREF(__pyx_t_7);
3844  __Pyx_INCREF(function);
3845  __Pyx_DECREF_SET(__pyx_t_2, function);
3846  }
3847  }
3848  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_6));
3849  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3850  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3851  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 78, __pyx_L1_error)
3852  __Pyx_GOTREF(__pyx_t_3);
3853  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3854  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 78, __pyx_L1_error)
3855  __Pyx_GIVEREF(__pyx_t_3);
3856  __Pyx_GOTREF(__pyx_v_self->_H);
3857  __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
3858  __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_3);
3859  __pyx_t_3 = 0;
3860 
3861  /* "equivalent_polynomials.pyx":79
3862  * icase = self.s22.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3863  * self._H = np.asarray(<double[:self.nQ]>self.s22.get_H())
3864  * self._ImH = np.asarray(<double[:self.nQ]>self.s22.get_ImH()) # <<<<<<<<<<<<<<
3865  * self._D = np.asarray(<double[:self.nQ]>self.s22.get_D())
3866  * self.inside_out = self.s22.inside_out
3867  */
3868  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 79, __pyx_L1_error)
3869  __Pyx_GOTREF(__pyx_t_2);
3870  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 79, __pyx_L1_error)
3871  __Pyx_GOTREF(__pyx_t_7);
3872  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3873  __pyx_t_5 = __pyx_v_self->s22.get_ImH();
3874  if (!__pyx_t_5) {
3875  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3876  __PYX_ERR(1, 79, __pyx_L1_error)
3877  }
3878  __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 79, __pyx_L1_error)
3879  __Pyx_GOTREF(__pyx_t_1);
3880  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 79, __pyx_L1_error)
3881  __Pyx_GOTREF(__pyx_t_2);
3882  __pyx_t_6 = __pyx_array_new(__pyx_t_2, sizeof(double), PyBytes_AS_STRING(__pyx_t_1), (char *) "c", (char *) __pyx_t_5);
3883  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 79, __pyx_L1_error)
3884  __Pyx_GOTREF(__pyx_t_6);
3885  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3886  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3887  __pyx_t_1 = NULL;
3888  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
3889  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
3890  if (likely(__pyx_t_1)) {
3891  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
3892  __Pyx_INCREF(__pyx_t_1);
3893  __Pyx_INCREF(function);
3894  __Pyx_DECREF_SET(__pyx_t_7, function);
3895  }
3896  }
3897  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_1, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
3898  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3899  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3900  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 79, __pyx_L1_error)
3901  __Pyx_GOTREF(__pyx_t_3);
3902  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3903  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 79, __pyx_L1_error)
3904  __Pyx_GIVEREF(__pyx_t_3);
3905  __Pyx_GOTREF(__pyx_v_self->_ImH);
3906  __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
3907  __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_3);
3908  __pyx_t_3 = 0;
3909 
3910  /* "equivalent_polynomials.pyx":80
3911  * self._H = np.asarray(<double[:self.nQ]>self.s22.get_H())
3912  * self._ImH = np.asarray(<double[:self.nQ]>self.s22.get_ImH())
3913  * self._D = np.asarray(<double[:self.nQ]>self.s22.get_D()) # <<<<<<<<<<<<<<
3914  * self.inside_out = self.s22.inside_out
3915  * elif (self.nSpace,self.nP) == (2,3):
3916  */
3917  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 80, __pyx_L1_error)
3918  __Pyx_GOTREF(__pyx_t_7);
3919  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 80, __pyx_L1_error)
3920  __Pyx_GOTREF(__pyx_t_1);
3921  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3922  __pyx_t_5 = __pyx_v_self->s22.get_D();
3923  if (!__pyx_t_5) {
3924  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
3925  __PYX_ERR(1, 80, __pyx_L1_error)
3926  }
3927  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 80, __pyx_L1_error)
3928  __Pyx_GOTREF(__pyx_t_2);
3929  __pyx_t_7 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 80, __pyx_L1_error)
3930  __Pyx_GOTREF(__pyx_t_7);
3931  __pyx_t_6 = __pyx_array_new(__pyx_t_7, sizeof(double), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_5);
3932  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 80, __pyx_L1_error)
3933  __Pyx_GOTREF(__pyx_t_6);
3934  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3935  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3936  __pyx_t_2 = NULL;
3937  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
3938  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
3939  if (likely(__pyx_t_2)) {
3940  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
3941  __Pyx_INCREF(__pyx_t_2);
3942  __Pyx_INCREF(function);
3943  __Pyx_DECREF_SET(__pyx_t_1, function);
3944  }
3945  }
3946  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_t_6));
3947  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3948  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
3949  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 80, __pyx_L1_error)
3950  __Pyx_GOTREF(__pyx_t_3);
3951  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3952  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 80, __pyx_L1_error)
3953  __Pyx_GIVEREF(__pyx_t_3);
3954  __Pyx_GOTREF(__pyx_v_self->_D);
3955  __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
3956  __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_3);
3957  __pyx_t_3 = 0;
3958 
3959  /* "equivalent_polynomials.pyx":81
3960  * self._ImH = np.asarray(<double[:self.nQ]>self.s22.get_ImH())
3961  * self._D = np.asarray(<double[:self.nQ]>self.s22.get_D())
3962  * self.inside_out = self.s22.inside_out # <<<<<<<<<<<<<<
3963  * elif (self.nSpace,self.nP) == (2,3):
3964  * icase = self.s23.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3965  */
3966  __pyx_t_8 = __pyx_v_self->s22.inside_out;
3967  __pyx_v_self->inside_out = __pyx_t_8;
3968 
3969  /* "equivalent_polynomials.pyx":76
3970  * self._D = np.asarray(<double[:self.nQ]>self.s21.get_D())
3971  * self.inside_out = self.s21.inside_out
3972  * elif (self.nSpace,self.nP) == (2,2): # <<<<<<<<<<<<<<
3973  * icase = self.s22.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3974  * self._H = np.asarray(<double[:self.nQ]>self.s22.get_H())
3975  */
3976  goto __pyx_L3;
3977  }
3978 
3979  /* "equivalent_polynomials.pyx":82
3980  * self._D = np.asarray(<double[:self.nQ]>self.s22.get_D())
3981  * self.inside_out = self.s22.inside_out
3982  * elif (self.nSpace,self.nP) == (2,3): # <<<<<<<<<<<<<<
3983  * icase = self.s23.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
3984  * self._H = np.asarray(<double[:self.nQ]>self.s23.get_H())
3985  */
3986  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 82, __pyx_L1_error)
3987  __Pyx_GOTREF(__pyx_t_3);
3988  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 82, __pyx_L1_error)
3989  __Pyx_GOTREF(__pyx_t_1);
3990  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 82, __pyx_L1_error)
3991  __Pyx_GOTREF(__pyx_t_2);
3992  __Pyx_GIVEREF(__pyx_t_3);
3993  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
3994  __Pyx_GIVEREF(__pyx_t_1);
3995  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
3996  __pyx_t_3 = 0;
3997  __pyx_t_1 = 0;
3998  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__8, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 82, __pyx_L1_error)
3999  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4000  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 82, __pyx_L1_error)
4001  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4002  if (__pyx_t_4) {
4003 
4004  /* "equivalent_polynomials.pyx":83
4005  * self.inside_out = self.s22.inside_out
4006  * elif (self.nSpace,self.nP) == (2,3):
4007  * icase = self.s23.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
4008  * self._H = np.asarray(<double[:self.nQ]>self.s23.get_H())
4009  * self._ImH = np.asarray(<double[:self.nQ]>self.s23.get_ImH())
4010  */
4011  __pyx_v_icase = __pyx_v_self->s23.calculate(((double *)__pyx_v_phi_dof->data), ((double *)__pyx_v_phi_nodes->data), ((double *)__pyx_v_self->xiBuffer->data), 0);
4012 
4013  /* "equivalent_polynomials.pyx":84
4014  * elif (self.nSpace,self.nP) == (2,3):
4015  * icase = self.s23.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4016  * self._H = np.asarray(<double[:self.nQ]>self.s23.get_H()) # <<<<<<<<<<<<<<
4017  * self._ImH = np.asarray(<double[:self.nQ]>self.s23.get_ImH())
4018  * self._D = np.asarray(<double[:self.nQ]>self.s23.get_D())
4019  */
4020  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 84, __pyx_L1_error)
4021  __Pyx_GOTREF(__pyx_t_2);
4022  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 84, __pyx_L1_error)
4023  __Pyx_GOTREF(__pyx_t_3);
4024  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4025  __pyx_t_5 = __pyx_v_self->s23.get_H();
4026  if (!__pyx_t_5) {
4027  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4028  __PYX_ERR(1, 84, __pyx_L1_error)
4029  }
4030  __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 84, __pyx_L1_error)
4031  __Pyx_GOTREF(__pyx_t_7);
4032  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 84, __pyx_L1_error)
4033  __Pyx_GOTREF(__pyx_t_2);
4034  __pyx_t_6 = __pyx_array_new(__pyx_t_2, sizeof(double), PyBytes_AS_STRING(__pyx_t_7), (char *) "c", (char *) __pyx_t_5);
4035  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 84, __pyx_L1_error)
4036  __Pyx_GOTREF(__pyx_t_6);
4037  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4038  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4039  __pyx_t_7 = NULL;
4040  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4041  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
4042  if (likely(__pyx_t_7)) {
4043  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4044  __Pyx_INCREF(__pyx_t_7);
4045  __Pyx_INCREF(function);
4046  __Pyx_DECREF_SET(__pyx_t_3, function);
4047  }
4048  }
4049  __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_6));
4050  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4051  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4052  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 84, __pyx_L1_error)
4053  __Pyx_GOTREF(__pyx_t_1);
4054  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4055  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 84, __pyx_L1_error)
4056  __Pyx_GIVEREF(__pyx_t_1);
4057  __Pyx_GOTREF(__pyx_v_self->_H);
4058  __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
4059  __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_1);
4060  __pyx_t_1 = 0;
4061 
4062  /* "equivalent_polynomials.pyx":85
4063  * icase = self.s23.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4064  * self._H = np.asarray(<double[:self.nQ]>self.s23.get_H())
4065  * self._ImH = np.asarray(<double[:self.nQ]>self.s23.get_ImH()) # <<<<<<<<<<<<<<
4066  * self._D = np.asarray(<double[:self.nQ]>self.s23.get_D())
4067  * self.inside_out = self.s23.inside_out
4068  */
4069  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 85, __pyx_L1_error)
4070  __Pyx_GOTREF(__pyx_t_3);
4071  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 85, __pyx_L1_error)
4072  __Pyx_GOTREF(__pyx_t_7);
4073  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4074  __pyx_t_5 = __pyx_v_self->s23.get_ImH();
4075  if (!__pyx_t_5) {
4076  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4077  __PYX_ERR(1, 85, __pyx_L1_error)
4078  }
4079  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 85, __pyx_L1_error)
4080  __Pyx_GOTREF(__pyx_t_2);
4081  __pyx_t_3 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 85, __pyx_L1_error)
4082  __Pyx_GOTREF(__pyx_t_3);
4083  __pyx_t_6 = __pyx_array_new(__pyx_t_3, sizeof(double), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_5);
4084  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 85, __pyx_L1_error)
4085  __Pyx_GOTREF(__pyx_t_6);
4086  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4087  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4088  __pyx_t_2 = NULL;
4089  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
4090  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
4091  if (likely(__pyx_t_2)) {
4092  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
4093  __Pyx_INCREF(__pyx_t_2);
4094  __Pyx_INCREF(function);
4095  __Pyx_DECREF_SET(__pyx_t_7, function);
4096  }
4097  }
4098  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
4099  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4100  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4101  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 85, __pyx_L1_error)
4102  __Pyx_GOTREF(__pyx_t_1);
4103  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4104  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 85, __pyx_L1_error)
4105  __Pyx_GIVEREF(__pyx_t_1);
4106  __Pyx_GOTREF(__pyx_v_self->_ImH);
4107  __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
4108  __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_1);
4109  __pyx_t_1 = 0;
4110 
4111  /* "equivalent_polynomials.pyx":86
4112  * self._H = np.asarray(<double[:self.nQ]>self.s23.get_H())
4113  * self._ImH = np.asarray(<double[:self.nQ]>self.s23.get_ImH())
4114  * self._D = np.asarray(<double[:self.nQ]>self.s23.get_D()) # <<<<<<<<<<<<<<
4115  * self.inside_out = self.s23.inside_out
4116  * if (self.nSpace,self.nP) == (3,1):
4117  */
4118  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 86, __pyx_L1_error)
4119  __Pyx_GOTREF(__pyx_t_7);
4120  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 86, __pyx_L1_error)
4121  __Pyx_GOTREF(__pyx_t_2);
4122  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4123  __pyx_t_5 = __pyx_v_self->s23.get_D();
4124  if (!__pyx_t_5) {
4125  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4126  __PYX_ERR(1, 86, __pyx_L1_error)
4127  }
4128  __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 86, __pyx_L1_error)
4129  __Pyx_GOTREF(__pyx_t_3);
4130  __pyx_t_7 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 86, __pyx_L1_error)
4131  __Pyx_GOTREF(__pyx_t_7);
4132  __pyx_t_6 = __pyx_array_new(__pyx_t_7, sizeof(double), PyBytes_AS_STRING(__pyx_t_3), (char *) "c", (char *) __pyx_t_5);
4133  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 86, __pyx_L1_error)
4134  __Pyx_GOTREF(__pyx_t_6);
4135  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4136  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4137  __pyx_t_3 = NULL;
4138  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4139  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4140  if (likely(__pyx_t_3)) {
4141  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4142  __Pyx_INCREF(__pyx_t_3);
4143  __Pyx_INCREF(function);
4144  __Pyx_DECREF_SET(__pyx_t_2, function);
4145  }
4146  }
4147  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_6));
4148  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4149  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4150  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 86, __pyx_L1_error)
4151  __Pyx_GOTREF(__pyx_t_1);
4152  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4153  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 86, __pyx_L1_error)
4154  __Pyx_GIVEREF(__pyx_t_1);
4155  __Pyx_GOTREF(__pyx_v_self->_D);
4156  __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
4157  __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_1);
4158  __pyx_t_1 = 0;
4159 
4160  /* "equivalent_polynomials.pyx":87
4161  * self._ImH = np.asarray(<double[:self.nQ]>self.s23.get_ImH())
4162  * self._D = np.asarray(<double[:self.nQ]>self.s23.get_D())
4163  * self.inside_out = self.s23.inside_out # <<<<<<<<<<<<<<
4164  * if (self.nSpace,self.nP) == (3,1):
4165  * icase = self.s31.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4166  */
4167  __pyx_t_8 = __pyx_v_self->s23.inside_out;
4168  __pyx_v_self->inside_out = __pyx_t_8;
4169 
4170  /* "equivalent_polynomials.pyx":82
4171  * self._D = np.asarray(<double[:self.nQ]>self.s22.get_D())
4172  * self.inside_out = self.s22.inside_out
4173  * elif (self.nSpace,self.nP) == (2,3): # <<<<<<<<<<<<<<
4174  * icase = self.s23.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4175  * self._H = np.asarray(<double[:self.nQ]>self.s23.get_H())
4176  */
4177  }
4178  __pyx_L3:;
4179 
4180  /* "equivalent_polynomials.pyx":88
4181  * self._D = np.asarray(<double[:self.nQ]>self.s23.get_D())
4182  * self.inside_out = self.s23.inside_out
4183  * if (self.nSpace,self.nP) == (3,1): # <<<<<<<<<<<<<<
4184  * icase = self.s31.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4185  * self._H = np.asarray(<double[:self.nQ]>self.s31.get_H())
4186  */
4187  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L1_error)
4188  __Pyx_GOTREF(__pyx_t_1);
4189  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 88, __pyx_L1_error)
4190  __Pyx_GOTREF(__pyx_t_2);
4191  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 88, __pyx_L1_error)
4192  __Pyx_GOTREF(__pyx_t_3);
4193  __Pyx_GIVEREF(__pyx_t_1);
4194  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
4195  __Pyx_GIVEREF(__pyx_t_2);
4196  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
4197  __pyx_t_1 = 0;
4198  __pyx_t_2 = 0;
4199  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_tuple__9, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 88, __pyx_L1_error)
4200  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4201  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 88, __pyx_L1_error)
4202  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4203  if (__pyx_t_4) {
4204 
4205  /* "equivalent_polynomials.pyx":89
4206  * self.inside_out = self.s23.inside_out
4207  * if (self.nSpace,self.nP) == (3,1):
4208  * icase = self.s31.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
4209  * self._H = np.asarray(<double[:self.nQ]>self.s31.get_H())
4210  * self._ImH = np.asarray(<double[:self.nQ]>self.s31.get_ImH())
4211  */
4212  __pyx_v_icase = __pyx_v_self->s31.calculate(((double *)__pyx_v_phi_dof->data), ((double *)__pyx_v_phi_nodes->data), ((double *)__pyx_v_self->xiBuffer->data), 0);
4213 
4214  /* "equivalent_polynomials.pyx":90
4215  * if (self.nSpace,self.nP) == (3,1):
4216  * icase = self.s31.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4217  * self._H = np.asarray(<double[:self.nQ]>self.s31.get_H()) # <<<<<<<<<<<<<<
4218  * self._ImH = np.asarray(<double[:self.nQ]>self.s31.get_ImH())
4219  * self._D = np.asarray(<double[:self.nQ]>self.s31.get_D())
4220  */
4221  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 90, __pyx_L1_error)
4222  __Pyx_GOTREF(__pyx_t_3);
4223  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 90, __pyx_L1_error)
4224  __Pyx_GOTREF(__pyx_t_1);
4225  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4226  __pyx_t_5 = __pyx_v_self->s31.get_H();
4227  if (!__pyx_t_5) {
4228  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4229  __PYX_ERR(1, 90, __pyx_L1_error)
4230  }
4231  __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 90, __pyx_L1_error)
4232  __Pyx_GOTREF(__pyx_t_7);
4233  __pyx_t_3 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 90, __pyx_L1_error)
4234  __Pyx_GOTREF(__pyx_t_3);
4235  __pyx_t_6 = __pyx_array_new(__pyx_t_3, sizeof(double), PyBytes_AS_STRING(__pyx_t_7), (char *) "c", (char *) __pyx_t_5);
4236  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 90, __pyx_L1_error)
4237  __Pyx_GOTREF(__pyx_t_6);
4238  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4239  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4240  __pyx_t_7 = NULL;
4241  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
4242  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
4243  if (likely(__pyx_t_7)) {
4244  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
4245  __Pyx_INCREF(__pyx_t_7);
4246  __Pyx_INCREF(function);
4247  __Pyx_DECREF_SET(__pyx_t_1, function);
4248  }
4249  }
4250  __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_t_6));
4251  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4252  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4253  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 90, __pyx_L1_error)
4254  __Pyx_GOTREF(__pyx_t_2);
4255  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4256  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 90, __pyx_L1_error)
4257  __Pyx_GIVEREF(__pyx_t_2);
4258  __Pyx_GOTREF(__pyx_v_self->_H);
4259  __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
4260  __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_2);
4261  __pyx_t_2 = 0;
4262 
4263  /* "equivalent_polynomials.pyx":91
4264  * icase = self.s31.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4265  * self._H = np.asarray(<double[:self.nQ]>self.s31.get_H())
4266  * self._ImH = np.asarray(<double[:self.nQ]>self.s31.get_ImH()) # <<<<<<<<<<<<<<
4267  * self._D = np.asarray(<double[:self.nQ]>self.s31.get_D())
4268  * self.inside_out = self.s31.inside_out
4269  */
4270  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 91, __pyx_L1_error)
4271  __Pyx_GOTREF(__pyx_t_1);
4272  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 91, __pyx_L1_error)
4273  __Pyx_GOTREF(__pyx_t_7);
4274  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4275  __pyx_t_5 = __pyx_v_self->s31.get_ImH();
4276  if (!__pyx_t_5) {
4277  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4278  __PYX_ERR(1, 91, __pyx_L1_error)
4279  }
4280  __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 91, __pyx_L1_error)
4281  __Pyx_GOTREF(__pyx_t_3);
4282  __pyx_t_1 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 91, __pyx_L1_error)
4283  __Pyx_GOTREF(__pyx_t_1);
4284  __pyx_t_6 = __pyx_array_new(__pyx_t_1, sizeof(double), PyBytes_AS_STRING(__pyx_t_3), (char *) "c", (char *) __pyx_t_5);
4285  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 91, __pyx_L1_error)
4286  __Pyx_GOTREF(__pyx_t_6);
4287  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4288  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4289  __pyx_t_3 = NULL;
4290  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
4291  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
4292  if (likely(__pyx_t_3)) {
4293  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
4294  __Pyx_INCREF(__pyx_t_3);
4295  __Pyx_INCREF(function);
4296  __Pyx_DECREF_SET(__pyx_t_7, function);
4297  }
4298  }
4299  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
4300  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4301  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4302  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 91, __pyx_L1_error)
4303  __Pyx_GOTREF(__pyx_t_2);
4304  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4305  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 91, __pyx_L1_error)
4306  __Pyx_GIVEREF(__pyx_t_2);
4307  __Pyx_GOTREF(__pyx_v_self->_ImH);
4308  __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
4309  __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_2);
4310  __pyx_t_2 = 0;
4311 
4312  /* "equivalent_polynomials.pyx":92
4313  * self._H = np.asarray(<double[:self.nQ]>self.s31.get_H())
4314  * self._ImH = np.asarray(<double[:self.nQ]>self.s31.get_ImH())
4315  * self._D = np.asarray(<double[:self.nQ]>self.s31.get_D()) # <<<<<<<<<<<<<<
4316  * self.inside_out = self.s31.inside_out
4317  * elif (self.nSpace,self.nP) == (3,2):
4318  */
4319  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 92, __pyx_L1_error)
4320  __Pyx_GOTREF(__pyx_t_7);
4321  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 92, __pyx_L1_error)
4322  __Pyx_GOTREF(__pyx_t_3);
4323  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4324  __pyx_t_5 = __pyx_v_self->s31.get_D();
4325  if (!__pyx_t_5) {
4326  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4327  __PYX_ERR(1, 92, __pyx_L1_error)
4328  }
4329  __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 92, __pyx_L1_error)
4330  __Pyx_GOTREF(__pyx_t_1);
4331  __pyx_t_7 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 92, __pyx_L1_error)
4332  __Pyx_GOTREF(__pyx_t_7);
4333  __pyx_t_6 = __pyx_array_new(__pyx_t_7, sizeof(double), PyBytes_AS_STRING(__pyx_t_1), (char *) "c", (char *) __pyx_t_5);
4334  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 92, __pyx_L1_error)
4335  __Pyx_GOTREF(__pyx_t_6);
4336  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4337  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4338  __pyx_t_1 = NULL;
4339  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4340  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
4341  if (likely(__pyx_t_1)) {
4342  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4343  __Pyx_INCREF(__pyx_t_1);
4344  __Pyx_INCREF(function);
4345  __Pyx_DECREF_SET(__pyx_t_3, function);
4346  }
4347  }
4348  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_6));
4349  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4350  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4351  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 92, __pyx_L1_error)
4352  __Pyx_GOTREF(__pyx_t_2);
4353  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4354  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 92, __pyx_L1_error)
4355  __Pyx_GIVEREF(__pyx_t_2);
4356  __Pyx_GOTREF(__pyx_v_self->_D);
4357  __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
4358  __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_2);
4359  __pyx_t_2 = 0;
4360 
4361  /* "equivalent_polynomials.pyx":93
4362  * self._ImH = np.asarray(<double[:self.nQ]>self.s31.get_ImH())
4363  * self._D = np.asarray(<double[:self.nQ]>self.s31.get_D())
4364  * self.inside_out = self.s31.inside_out # <<<<<<<<<<<<<<
4365  * elif (self.nSpace,self.nP) == (3,2):
4366  * icase = self.s32.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4367  */
4368  __pyx_t_8 = __pyx_v_self->s31.inside_out;
4369  __pyx_v_self->inside_out = __pyx_t_8;
4370 
4371  /* "equivalent_polynomials.pyx":88
4372  * self._D = np.asarray(<double[:self.nQ]>self.s23.get_D())
4373  * self.inside_out = self.s23.inside_out
4374  * if (self.nSpace,self.nP) == (3,1): # <<<<<<<<<<<<<<
4375  * icase = self.s31.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4376  * self._H = np.asarray(<double[:self.nQ]>self.s31.get_H())
4377  */
4378  goto __pyx_L4;
4379  }
4380 
4381  /* "equivalent_polynomials.pyx":94
4382  * self._D = np.asarray(<double[:self.nQ]>self.s31.get_D())
4383  * self.inside_out = self.s31.inside_out
4384  * elif (self.nSpace,self.nP) == (3,2): # <<<<<<<<<<<<<<
4385  * icase = self.s32.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4386  * self._H = np.asarray(<double[:self.nQ]>self.s32.get_H())
4387  */
4388  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 94, __pyx_L1_error)
4389  __Pyx_GOTREF(__pyx_t_2);
4390  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 94, __pyx_L1_error)
4391  __Pyx_GOTREF(__pyx_t_3);
4392  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 94, __pyx_L1_error)
4393  __Pyx_GOTREF(__pyx_t_1);
4394  __Pyx_GIVEREF(__pyx_t_2);
4395  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
4396  __Pyx_GIVEREF(__pyx_t_3);
4397  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
4398  __pyx_t_2 = 0;
4399  __pyx_t_3 = 0;
4400  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_tuple__10, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 94, __pyx_L1_error)
4401  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4402  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 94, __pyx_L1_error)
4403  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4404  if (__pyx_t_4) {
4405 
4406  /* "equivalent_polynomials.pyx":95
4407  * self.inside_out = self.s31.inside_out
4408  * elif (self.nSpace,self.nP) == (3,2):
4409  * icase = self.s32.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
4410  * self._H = np.asarray(<double[:self.nQ]>self.s32.get_H())
4411  * self._ImH = np.asarray(<double[:self.nQ]>self.s32.get_ImH())
4412  */
4413  __pyx_v_icase = __pyx_v_self->s32.calculate(((double *)__pyx_v_phi_dof->data), ((double *)__pyx_v_phi_nodes->data), ((double *)__pyx_v_self->xiBuffer->data), 0);
4414 
4415  /* "equivalent_polynomials.pyx":96
4416  * elif (self.nSpace,self.nP) == (3,2):
4417  * icase = self.s32.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4418  * self._H = np.asarray(<double[:self.nQ]>self.s32.get_H()) # <<<<<<<<<<<<<<
4419  * self._ImH = np.asarray(<double[:self.nQ]>self.s32.get_ImH())
4420  * self._D = np.asarray(<double[:self.nQ]>self.s32.get_D())
4421  */
4422  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 96, __pyx_L1_error)
4423  __Pyx_GOTREF(__pyx_t_1);
4424  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 96, __pyx_L1_error)
4425  __Pyx_GOTREF(__pyx_t_2);
4426  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4427  __pyx_t_5 = __pyx_v_self->s32.get_H();
4428  if (!__pyx_t_5) {
4429  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4430  __PYX_ERR(1, 96, __pyx_L1_error)
4431  }
4432  __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 96, __pyx_L1_error)
4433  __Pyx_GOTREF(__pyx_t_7);
4434  __pyx_t_1 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 96, __pyx_L1_error)
4435  __Pyx_GOTREF(__pyx_t_1);
4436  __pyx_t_6 = __pyx_array_new(__pyx_t_1, sizeof(double), PyBytes_AS_STRING(__pyx_t_7), (char *) "c", (char *) __pyx_t_5);
4437  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 96, __pyx_L1_error)
4438  __Pyx_GOTREF(__pyx_t_6);
4439  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4440  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4441  __pyx_t_7 = NULL;
4442  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4443  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
4444  if (likely(__pyx_t_7)) {
4445  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4446  __Pyx_INCREF(__pyx_t_7);
4447  __Pyx_INCREF(function);
4448  __Pyx_DECREF_SET(__pyx_t_2, function);
4449  }
4450  }
4451  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_6));
4452  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4453  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4454  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 96, __pyx_L1_error)
4455  __Pyx_GOTREF(__pyx_t_3);
4456  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4457  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 96, __pyx_L1_error)
4458  __Pyx_GIVEREF(__pyx_t_3);
4459  __Pyx_GOTREF(__pyx_v_self->_H);
4460  __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
4461  __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_3);
4462  __pyx_t_3 = 0;
4463 
4464  /* "equivalent_polynomials.pyx":97
4465  * icase = self.s32.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4466  * self._H = np.asarray(<double[:self.nQ]>self.s32.get_H())
4467  * self._ImH = np.asarray(<double[:self.nQ]>self.s32.get_ImH()) # <<<<<<<<<<<<<<
4468  * self._D = np.asarray(<double[:self.nQ]>self.s32.get_D())
4469  * self.inside_out = self.s32.inside_out
4470  */
4471  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 97, __pyx_L1_error)
4472  __Pyx_GOTREF(__pyx_t_2);
4473  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 97, __pyx_L1_error)
4474  __Pyx_GOTREF(__pyx_t_7);
4475  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4476  __pyx_t_5 = __pyx_v_self->s32.get_ImH();
4477  if (!__pyx_t_5) {
4478  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4479  __PYX_ERR(1, 97, __pyx_L1_error)
4480  }
4481  __pyx_t_1 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 97, __pyx_L1_error)
4482  __Pyx_GOTREF(__pyx_t_1);
4483  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 97, __pyx_L1_error)
4484  __Pyx_GOTREF(__pyx_t_2);
4485  __pyx_t_6 = __pyx_array_new(__pyx_t_2, sizeof(double), PyBytes_AS_STRING(__pyx_t_1), (char *) "c", (char *) __pyx_t_5);
4486  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 97, __pyx_L1_error)
4487  __Pyx_GOTREF(__pyx_t_6);
4488  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4489  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4490  __pyx_t_1 = NULL;
4491  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
4492  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
4493  if (likely(__pyx_t_1)) {
4494  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
4495  __Pyx_INCREF(__pyx_t_1);
4496  __Pyx_INCREF(function);
4497  __Pyx_DECREF_SET(__pyx_t_7, function);
4498  }
4499  }
4500  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_1, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
4501  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4502  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4503  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 97, __pyx_L1_error)
4504  __Pyx_GOTREF(__pyx_t_3);
4505  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4506  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 97, __pyx_L1_error)
4507  __Pyx_GIVEREF(__pyx_t_3);
4508  __Pyx_GOTREF(__pyx_v_self->_ImH);
4509  __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
4510  __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_3);
4511  __pyx_t_3 = 0;
4512 
4513  /* "equivalent_polynomials.pyx":98
4514  * self._H = np.asarray(<double[:self.nQ]>self.s32.get_H())
4515  * self._ImH = np.asarray(<double[:self.nQ]>self.s32.get_ImH())
4516  * self._D = np.asarray(<double[:self.nQ]>self.s32.get_D()) # <<<<<<<<<<<<<<
4517  * self.inside_out = self.s32.inside_out
4518  * elif (self.nSpace,self.nP) == (3,3):
4519  */
4520  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 98, __pyx_L1_error)
4521  __Pyx_GOTREF(__pyx_t_7);
4522  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 98, __pyx_L1_error)
4523  __Pyx_GOTREF(__pyx_t_1);
4524  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4525  __pyx_t_5 = __pyx_v_self->s32.get_D();
4526  if (!__pyx_t_5) {
4527  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4528  __PYX_ERR(1, 98, __pyx_L1_error)
4529  }
4530  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 98, __pyx_L1_error)
4531  __Pyx_GOTREF(__pyx_t_2);
4532  __pyx_t_7 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 98, __pyx_L1_error)
4533  __Pyx_GOTREF(__pyx_t_7);
4534  __pyx_t_6 = __pyx_array_new(__pyx_t_7, sizeof(double), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_5);
4535  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 98, __pyx_L1_error)
4536  __Pyx_GOTREF(__pyx_t_6);
4537  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4538  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4539  __pyx_t_2 = NULL;
4540  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
4541  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
4542  if (likely(__pyx_t_2)) {
4543  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
4544  __Pyx_INCREF(__pyx_t_2);
4545  __Pyx_INCREF(function);
4546  __Pyx_DECREF_SET(__pyx_t_1, function);
4547  }
4548  }
4549  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_t_6));
4550  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4551  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4552  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 98, __pyx_L1_error)
4553  __Pyx_GOTREF(__pyx_t_3);
4554  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4555  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 98, __pyx_L1_error)
4556  __Pyx_GIVEREF(__pyx_t_3);
4557  __Pyx_GOTREF(__pyx_v_self->_D);
4558  __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
4559  __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_3);
4560  __pyx_t_3 = 0;
4561 
4562  /* "equivalent_polynomials.pyx":99
4563  * self._ImH = np.asarray(<double[:self.nQ]>self.s32.get_ImH())
4564  * self._D = np.asarray(<double[:self.nQ]>self.s32.get_D())
4565  * self.inside_out = self.s32.inside_out # <<<<<<<<<<<<<<
4566  * elif (self.nSpace,self.nP) == (3,3):
4567  * icase = self.s33.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4568  */
4569  __pyx_t_8 = __pyx_v_self->s32.inside_out;
4570  __pyx_v_self->inside_out = __pyx_t_8;
4571 
4572  /* "equivalent_polynomials.pyx":94
4573  * self._D = np.asarray(<double[:self.nQ]>self.s31.get_D())
4574  * self.inside_out = self.s31.inside_out
4575  * elif (self.nSpace,self.nP) == (3,2): # <<<<<<<<<<<<<<
4576  * icase = self.s32.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4577  * self._H = np.asarray(<double[:self.nQ]>self.s32.get_H())
4578  */
4579  goto __pyx_L4;
4580  }
4581 
4582  /* "equivalent_polynomials.pyx":100
4583  * self._D = np.asarray(<double[:self.nQ]>self.s32.get_D())
4584  * self.inside_out = self.s32.inside_out
4585  * elif (self.nSpace,self.nP) == (3,3): # <<<<<<<<<<<<<<
4586  * icase = self.s33.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4587  * self._H = np.asarray(<double[:self.nQ]>self.s33.get_H())
4588  */
4589  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->nSpace); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 100, __pyx_L1_error)
4590  __Pyx_GOTREF(__pyx_t_3);
4591  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nP); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 100, __pyx_L1_error)
4592  __Pyx_GOTREF(__pyx_t_1);
4593  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 100, __pyx_L1_error)
4594  __Pyx_GOTREF(__pyx_t_2);
4595  __Pyx_GIVEREF(__pyx_t_3);
4596  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
4597  __Pyx_GIVEREF(__pyx_t_1);
4598  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
4599  __pyx_t_3 = 0;
4600  __pyx_t_1 = 0;
4601  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__11, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 100, __pyx_L1_error)
4602  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4603  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 100, __pyx_L1_error)
4604  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4605  if (__pyx_t_4) {
4606 
4607  /* "equivalent_polynomials.pyx":101
4608  * self.inside_out = self.s32.inside_out
4609  * elif (self.nSpace,self.nP) == (3,3):
4610  * icase = self.s33.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False) # <<<<<<<<<<<<<<
4611  * self._H = np.asarray(<double[:self.nQ]>self.s33.get_H())
4612  * self._ImH = np.asarray(<double[:self.nQ]>self.s33.get_ImH())
4613  */
4614  __pyx_v_icase = __pyx_v_self->s33.calculate(((double *)__pyx_v_phi_dof->data), ((double *)__pyx_v_phi_nodes->data), ((double *)__pyx_v_self->xiBuffer->data), 0);
4615 
4616  /* "equivalent_polynomials.pyx":102
4617  * elif (self.nSpace,self.nP) == (3,3):
4618  * icase = self.s33.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4619  * self._H = np.asarray(<double[:self.nQ]>self.s33.get_H()) # <<<<<<<<<<<<<<
4620  * self._ImH = np.asarray(<double[:self.nQ]>self.s33.get_ImH())
4621  * self._D = np.asarray(<double[:self.nQ]>self.s33.get_D())
4622  */
4623  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 102, __pyx_L1_error)
4624  __Pyx_GOTREF(__pyx_t_2);
4625  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 102, __pyx_L1_error)
4626  __Pyx_GOTREF(__pyx_t_3);
4627  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4628  __pyx_t_5 = __pyx_v_self->s33.get_H();
4629  if (!__pyx_t_5) {
4630  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4631  __PYX_ERR(1, 102, __pyx_L1_error)
4632  }
4633  __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 102, __pyx_L1_error)
4634  __Pyx_GOTREF(__pyx_t_7);
4635  __pyx_t_2 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 102, __pyx_L1_error)
4636  __Pyx_GOTREF(__pyx_t_2);
4637  __pyx_t_6 = __pyx_array_new(__pyx_t_2, sizeof(double), PyBytes_AS_STRING(__pyx_t_7), (char *) "c", (char *) __pyx_t_5);
4638  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 102, __pyx_L1_error)
4639  __Pyx_GOTREF(__pyx_t_6);
4640  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4641  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4642  __pyx_t_7 = NULL;
4643  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4644  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
4645  if (likely(__pyx_t_7)) {
4646  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4647  __Pyx_INCREF(__pyx_t_7);
4648  __Pyx_INCREF(function);
4649  __Pyx_DECREF_SET(__pyx_t_3, function);
4650  }
4651  }
4652  __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_t_6));
4653  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4654  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4655  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 102, __pyx_L1_error)
4656  __Pyx_GOTREF(__pyx_t_1);
4657  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4658  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 102, __pyx_L1_error)
4659  __Pyx_GIVEREF(__pyx_t_1);
4660  __Pyx_GOTREF(__pyx_v_self->_H);
4661  __Pyx_DECREF(((PyObject *)__pyx_v_self->_H));
4662  __pyx_v_self->_H = ((PyArrayObject *)__pyx_t_1);
4663  __pyx_t_1 = 0;
4664 
4665  /* "equivalent_polynomials.pyx":103
4666  * icase = self.s33.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4667  * self._H = np.asarray(<double[:self.nQ]>self.s33.get_H())
4668  * self._ImH = np.asarray(<double[:self.nQ]>self.s33.get_ImH()) # <<<<<<<<<<<<<<
4669  * self._D = np.asarray(<double[:self.nQ]>self.s33.get_D())
4670  * self.inside_out = self.s33.inside_out
4671  */
4672  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 103, __pyx_L1_error)
4673  __Pyx_GOTREF(__pyx_t_3);
4674  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 103, __pyx_L1_error)
4675  __Pyx_GOTREF(__pyx_t_7);
4676  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4677  __pyx_t_5 = __pyx_v_self->s33.get_ImH();
4678  if (!__pyx_t_5) {
4679  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4680  __PYX_ERR(1, 103, __pyx_L1_error)
4681  }
4682  __pyx_t_2 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 103, __pyx_L1_error)
4683  __Pyx_GOTREF(__pyx_t_2);
4684  __pyx_t_3 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 103, __pyx_L1_error)
4685  __Pyx_GOTREF(__pyx_t_3);
4686  __pyx_t_6 = __pyx_array_new(__pyx_t_3, sizeof(double), PyBytes_AS_STRING(__pyx_t_2), (char *) "c", (char *) __pyx_t_5);
4687  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 103, __pyx_L1_error)
4688  __Pyx_GOTREF(__pyx_t_6);
4689  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4690  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4691  __pyx_t_2 = NULL;
4692  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
4693  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
4694  if (likely(__pyx_t_2)) {
4695  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
4696  __Pyx_INCREF(__pyx_t_2);
4697  __Pyx_INCREF(function);
4698  __Pyx_DECREF_SET(__pyx_t_7, function);
4699  }
4700  }
4701  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_t_6));
4702  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4703  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4704  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 103, __pyx_L1_error)
4705  __Pyx_GOTREF(__pyx_t_1);
4706  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4707  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 103, __pyx_L1_error)
4708  __Pyx_GIVEREF(__pyx_t_1);
4709  __Pyx_GOTREF(__pyx_v_self->_ImH);
4710  __Pyx_DECREF(((PyObject *)__pyx_v_self->_ImH));
4711  __pyx_v_self->_ImH = ((PyArrayObject *)__pyx_t_1);
4712  __pyx_t_1 = 0;
4713 
4714  /* "equivalent_polynomials.pyx":104
4715  * self._H = np.asarray(<double[:self.nQ]>self.s33.get_H())
4716  * self._ImH = np.asarray(<double[:self.nQ]>self.s33.get_ImH())
4717  * self._D = np.asarray(<double[:self.nQ]>self.s33.get_D()) # <<<<<<<<<<<<<<
4718  * self.inside_out = self.s33.inside_out
4719  * def set_quad(self, int q):
4720  */
4721  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 104, __pyx_L1_error)
4722  __Pyx_GOTREF(__pyx_t_7);
4723  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 104, __pyx_L1_error)
4724  __Pyx_GOTREF(__pyx_t_2);
4725  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4726  __pyx_t_5 = __pyx_v_self->s33.get_D();
4727  if (!__pyx_t_5) {
4728  PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
4729  __PYX_ERR(1, 104, __pyx_L1_error)
4730  }
4731  __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 104, __pyx_L1_error)
4732  __Pyx_GOTREF(__pyx_t_3);
4733  __pyx_t_7 = Py_BuildValue((char*) "(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_self->nQ)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 104, __pyx_L1_error)
4734  __Pyx_GOTREF(__pyx_t_7);
4735  __pyx_t_6 = __pyx_array_new(__pyx_t_7, sizeof(double), PyBytes_AS_STRING(__pyx_t_3), (char *) "c", (char *) __pyx_t_5);
4736  if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 104, __pyx_L1_error)
4737  __Pyx_GOTREF(__pyx_t_6);
4738  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4739  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4740  __pyx_t_3 = NULL;
4741  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4742  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4743  if (likely(__pyx_t_3)) {
4744  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4745  __Pyx_INCREF(__pyx_t_3);
4746  __Pyx_INCREF(function);
4747  __Pyx_DECREF_SET(__pyx_t_2, function);
4748  }
4749  }
4750  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_t_6)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_t_6));
4751  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4752  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
4753  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 104, __pyx_L1_error)
4754  __Pyx_GOTREF(__pyx_t_1);
4755  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4756  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 104, __pyx_L1_error)
4757  __Pyx_GIVEREF(__pyx_t_1);
4758  __Pyx_GOTREF(__pyx_v_self->_D);
4759  __Pyx_DECREF(((PyObject *)__pyx_v_self->_D));
4760  __pyx_v_self->_D = ((PyArrayObject *)__pyx_t_1);
4761  __pyx_t_1 = 0;
4762 
4763  /* "equivalent_polynomials.pyx":105
4764  * self._ImH = np.asarray(<double[:self.nQ]>self.s33.get_ImH())
4765  * self._D = np.asarray(<double[:self.nQ]>self.s33.get_D())
4766  * self.inside_out = self.s33.inside_out # <<<<<<<<<<<<<<
4767  * def set_quad(self, int q):
4768  * self.q=q
4769  */
4770  __pyx_t_8 = __pyx_v_self->s33.inside_out;
4771  __pyx_v_self->inside_out = __pyx_t_8;
4772 
4773  /* "equivalent_polynomials.pyx":100
4774  * self._D = np.asarray(<double[:self.nQ]>self.s32.get_D())
4775  * self.inside_out = self.s32.inside_out
4776  * elif (self.nSpace,self.nP) == (3,3): # <<<<<<<<<<<<<<
4777  * icase = self.s33.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
4778  * self._H = np.asarray(<double[:self.nQ]>self.s33.get_H())
4779  */
4780  }
4781  __pyx_L4:;
4782 
4783  /* "equivalent_polynomials.pyx":50
4784  * self.nEBQ=nQ#cek hack
4785  * self.q=0
4786  * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi): # <<<<<<<<<<<<<<
4787  * self.xiBuffer[:xi.shape[0]]=xi
4788  * if (self.nSpace,self.nP) == (1,1):
4789  */
4790 
4791  /* function exit code */
4792  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4793  goto __pyx_L0;
4794  __pyx_L1_error:;
4795  __Pyx_XDECREF(__pyx_t_1);
4796  __Pyx_XDECREF(__pyx_t_2);
4797  __Pyx_XDECREF(__pyx_t_3);
4798  __Pyx_XDECREF(((PyObject *)__pyx_t_6));
4799  __Pyx_XDECREF(__pyx_t_7);
4800  __Pyx_AddTraceback("equivalent_polynomials.Simplex.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename);
4801  __pyx_r = NULL;
4802  __pyx_L0:;
4803  __Pyx_XGIVEREF(__pyx_r);
4804  __Pyx_RefNannyFinishContext();
4805  return __pyx_r;
4806 }
4807 
4808 /* "equivalent_polynomials.pyx":106
4809  * self._D = np.asarray(<double[:self.nQ]>self.s33.get_D())
4810  * self.inside_out = self.s33.inside_out
4811  * def set_quad(self, int q): # <<<<<<<<<<<<<<
4812  * self.q=q
4813  * @property
4814  */
4815 
4816 /* Python wrapper */
4817 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_5set_quad(PyObject *__pyx_v_self, PyObject *__pyx_arg_q); /*proto*/
4818 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_5set_quad(PyObject *__pyx_v_self, PyObject *__pyx_arg_q) {
4819  int __pyx_v_q;
4820  int __pyx_lineno = 0;
4821  const char *__pyx_filename = NULL;
4822  int __pyx_clineno = 0;
4823  PyObject *__pyx_r = 0;
4824  __Pyx_RefNannyDeclarations
4825  __Pyx_RefNannySetupContext("set_quad (wrapper)", 0);
4826  assert(__pyx_arg_q); {
4827  __pyx_v_q = __Pyx_PyInt_As_int(__pyx_arg_q); if (unlikely((__pyx_v_q == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 106, __pyx_L3_error)
4828  }
4829  goto __pyx_L4_argument_unpacking_done;
4830  __pyx_L3_error:;
4831  __Pyx_AddTraceback("equivalent_polynomials.Simplex.set_quad", __pyx_clineno, __pyx_lineno, __pyx_filename);
4832  __Pyx_RefNannyFinishContext();
4833  return NULL;
4834  __pyx_L4_argument_unpacking_done:;
4835  __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_4set_quad(((struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self), ((int)__pyx_v_q));
4836 
4837  /* function exit code */
4838  __Pyx_RefNannyFinishContext();
4839  return __pyx_r;
4840 }
4841 
4842 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_4set_quad(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, int __pyx_v_q) {
4843  PyObject *__pyx_r = NULL;
4844  __Pyx_RefNannyDeclarations
4845  __Pyx_RefNannySetupContext("set_quad", 0);
4846 
4847  /* "equivalent_polynomials.pyx":107
4848  * self.inside_out = self.s33.inside_out
4849  * def set_quad(self, int q):
4850  * self.q=q # <<<<<<<<<<<<<<
4851  * @property
4852  * def H(self):
4853  */
4854  __pyx_v_self->q = __pyx_v_q;
4855 
4856  /* "equivalent_polynomials.pyx":106
4857  * self._D = np.asarray(<double[:self.nQ]>self.s33.get_D())
4858  * self.inside_out = self.s33.inside_out
4859  * def set_quad(self, int q): # <<<<<<<<<<<<<<
4860  * self.q=q
4861  * @property
4862  */
4863 
4864  /* function exit code */
4865  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4866  __Pyx_XGIVEREF(__pyx_r);
4867  __Pyx_RefNannyFinishContext();
4868  return __pyx_r;
4869 }
4870 
4871 /* "equivalent_polynomials.pyx":109
4872  * self.q=q
4873  * @property
4874  * def H(self): # <<<<<<<<<<<<<<
4875  * if self.inside_out:
4876  * return self._ImH[self.q]
4877  */
4878 
4879 /* Python wrapper */
4880 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_1H_1__get__(PyObject *__pyx_v_self); /*proto*/
4881 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_1H_1__get__(PyObject *__pyx_v_self) {
4882  PyObject *__pyx_r = 0;
4883  __Pyx_RefNannyDeclarations
4884  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4885  __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_1H___get__(((struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self));
4886 
4887  /* function exit code */
4888  __Pyx_RefNannyFinishContext();
4889  return __pyx_r;
4890 }
4891 
4892 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_1H___get__(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self) {
4893  PyObject *__pyx_r = NULL;
4894  __Pyx_RefNannyDeclarations
4895  int __pyx_t_1;
4896  PyObject *__pyx_t_2 = NULL;
4897  int __pyx_lineno = 0;
4898  const char *__pyx_filename = NULL;
4899  int __pyx_clineno = 0;
4900  __Pyx_RefNannySetupContext("__get__", 0);
4901 
4902  /* "equivalent_polynomials.pyx":110
4903  * @property
4904  * def H(self):
4905  * if self.inside_out: # <<<<<<<<<<<<<<
4906  * return self._ImH[self.q]
4907  * else:
4908  */
4909  __pyx_t_1 = (__pyx_v_self->inside_out != 0);
4910  if (__pyx_t_1) {
4911 
4912  /* "equivalent_polynomials.pyx":111
4913  * def H(self):
4914  * if self.inside_out:
4915  * return self._ImH[self.q] # <<<<<<<<<<<<<<
4916  * else:
4917  * return self._H[self.q]
4918  */
4919  __Pyx_XDECREF(__pyx_r);
4920  __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_ImH), __pyx_v_self->q, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 111, __pyx_L1_error)
4921  __Pyx_GOTREF(__pyx_t_2);
4922  __pyx_r = __pyx_t_2;
4923  __pyx_t_2 = 0;
4924  goto __pyx_L0;
4925 
4926  /* "equivalent_polynomials.pyx":110
4927  * @property
4928  * def H(self):
4929  * if self.inside_out: # <<<<<<<<<<<<<<
4930  * return self._ImH[self.q]
4931  * else:
4932  */
4933  }
4934 
4935  /* "equivalent_polynomials.pyx":113
4936  * return self._ImH[self.q]
4937  * else:
4938  * return self._H[self.q] # <<<<<<<<<<<<<<
4939  * @property
4940  * def ImH(self):
4941  */
4942  /*else*/ {
4943  __Pyx_XDECREF(__pyx_r);
4944  __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_H), __pyx_v_self->q, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 113, __pyx_L1_error)
4945  __Pyx_GOTREF(__pyx_t_2);
4946  __pyx_r = __pyx_t_2;
4947  __pyx_t_2 = 0;
4948  goto __pyx_L0;
4949  }
4950 
4951  /* "equivalent_polynomials.pyx":109
4952  * self.q=q
4953  * @property
4954  * def H(self): # <<<<<<<<<<<<<<
4955  * if self.inside_out:
4956  * return self._ImH[self.q]
4957  */
4958 
4959  /* function exit code */
4960  __pyx_L1_error:;
4961  __Pyx_XDECREF(__pyx_t_2);
4962  __Pyx_AddTraceback("equivalent_polynomials.Simplex.H.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4963  __pyx_r = NULL;
4964  __pyx_L0:;
4965  __Pyx_XGIVEREF(__pyx_r);
4966  __Pyx_RefNannyFinishContext();
4967  return __pyx_r;
4968 }
4969 
4970 /* "equivalent_polynomials.pyx":115
4971  * return self._H[self.q]
4972  * @property
4973  * def ImH(self): # <<<<<<<<<<<<<<
4974  * if self.inside_out:
4975  * return self._H[self.q]
4976  */
4977 
4978 /* Python wrapper */
4979 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_3ImH_1__get__(PyObject *__pyx_v_self); /*proto*/
4980 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_3ImH_1__get__(PyObject *__pyx_v_self) {
4981  PyObject *__pyx_r = 0;
4982  __Pyx_RefNannyDeclarations
4983  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4984  __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_3ImH___get__(((struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self));
4985 
4986  /* function exit code */
4987  __Pyx_RefNannyFinishContext();
4988  return __pyx_r;
4989 }
4990 
4991 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_3ImH___get__(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self) {
4992  PyObject *__pyx_r = NULL;
4993  __Pyx_RefNannyDeclarations
4994  int __pyx_t_1;
4995  PyObject *__pyx_t_2 = NULL;
4996  int __pyx_lineno = 0;
4997  const char *__pyx_filename = NULL;
4998  int __pyx_clineno = 0;
4999  __Pyx_RefNannySetupContext("__get__", 0);
5000 
5001  /* "equivalent_polynomials.pyx":116
5002  * @property
5003  * def ImH(self):
5004  * if self.inside_out: # <<<<<<<<<<<<<<
5005  * return self._H[self.q]
5006  * else:
5007  */
5008  __pyx_t_1 = (__pyx_v_self->inside_out != 0);
5009  if (__pyx_t_1) {
5010 
5011  /* "equivalent_polynomials.pyx":117
5012  * def ImH(self):
5013  * if self.inside_out:
5014  * return self._H[self.q] # <<<<<<<<<<<<<<
5015  * else:
5016  * return self._ImH[self.q]
5017  */
5018  __Pyx_XDECREF(__pyx_r);
5019  __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_H), __pyx_v_self->q, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 117, __pyx_L1_error)
5020  __Pyx_GOTREF(__pyx_t_2);
5021  __pyx_r = __pyx_t_2;
5022  __pyx_t_2 = 0;
5023  goto __pyx_L0;
5024 
5025  /* "equivalent_polynomials.pyx":116
5026  * @property
5027  * def ImH(self):
5028  * if self.inside_out: # <<<<<<<<<<<<<<
5029  * return self._H[self.q]
5030  * else:
5031  */
5032  }
5033 
5034  /* "equivalent_polynomials.pyx":119
5035  * return self._H[self.q]
5036  * else:
5037  * return self._ImH[self.q] # <<<<<<<<<<<<<<
5038  * @property
5039  * def D(self):
5040  */
5041  /*else*/ {
5042  __Pyx_XDECREF(__pyx_r);
5043  __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_ImH), __pyx_v_self->q, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 119, __pyx_L1_error)
5044  __Pyx_GOTREF(__pyx_t_2);
5045  __pyx_r = __pyx_t_2;
5046  __pyx_t_2 = 0;
5047  goto __pyx_L0;
5048  }
5049 
5050  /* "equivalent_polynomials.pyx":115
5051  * return self._H[self.q]
5052  * @property
5053  * def ImH(self): # <<<<<<<<<<<<<<
5054  * if self.inside_out:
5055  * return self._H[self.q]
5056  */
5057 
5058  /* function exit code */
5059  __pyx_L1_error:;
5060  __Pyx_XDECREF(__pyx_t_2);
5061  __Pyx_AddTraceback("equivalent_polynomials.Simplex.ImH.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5062  __pyx_r = NULL;
5063  __pyx_L0:;
5064  __Pyx_XGIVEREF(__pyx_r);
5065  __Pyx_RefNannyFinishContext();
5066  return __pyx_r;
5067 }
5068 
5069 /* "equivalent_polynomials.pyx":121
5070  * return self._ImH[self.q]
5071  * @property
5072  * def D(self): # <<<<<<<<<<<<<<
5073  * return self._D[self.q]
5074  */
5075 
5076 /* Python wrapper */
5077 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_1D_1__get__(PyObject *__pyx_v_self); /*proto*/
5078 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_1D_1__get__(PyObject *__pyx_v_self) {
5079  PyObject *__pyx_r = 0;
5080  __Pyx_RefNannyDeclarations
5081  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5082  __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_1D___get__(((struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self));
5083 
5084  /* function exit code */
5085  __Pyx_RefNannyFinishContext();
5086  return __pyx_r;
5087 }
5088 
5089 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_1D___get__(struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self) {
5090  PyObject *__pyx_r = NULL;
5091  __Pyx_RefNannyDeclarations
5092  PyObject *__pyx_t_1 = NULL;
5093  int __pyx_lineno = 0;
5094  const char *__pyx_filename = NULL;
5095  int __pyx_clineno = 0;
5096  __Pyx_RefNannySetupContext("__get__", 0);
5097 
5098  /* "equivalent_polynomials.pyx":122
5099  * @property
5100  * def D(self):
5101  * return self._D[self.q] # <<<<<<<<<<<<<<
5102  */
5103  __Pyx_XDECREF(__pyx_r);
5104  __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->_D), __pyx_v_self->q, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 122, __pyx_L1_error)
5105  __Pyx_GOTREF(__pyx_t_1);
5106  __pyx_r = __pyx_t_1;
5107  __pyx_t_1 = 0;
5108  goto __pyx_L0;
5109 
5110  /* "equivalent_polynomials.pyx":121
5111  * return self._ImH[self.q]
5112  * @property
5113  * def D(self): # <<<<<<<<<<<<<<
5114  * return self._D[self.q]
5115  */
5116 
5117  /* function exit code */
5118  __pyx_L1_error:;
5119  __Pyx_XDECREF(__pyx_t_1);
5120  __Pyx_AddTraceback("equivalent_polynomials.Simplex.D.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5121  __pyx_r = NULL;
5122  __pyx_L0:;
5123  __Pyx_XGIVEREF(__pyx_r);
5124  __Pyx_RefNannyFinishContext();
5125  return __pyx_r;
5126 }
5127 
5128 /* "(tree fragment)":1
5129  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5130  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5131  * def __setstate_cython__(self, __pyx_state):
5132  */
5133 
5134 /* Python wrapper */
5135 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5136 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5137  PyObject *__pyx_r = 0;
5138  __Pyx_RefNannyDeclarations
5139  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5140  __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_6__reduce_cython__(((struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self));
5141 
5142  /* function exit code */
5143  __Pyx_RefNannyFinishContext();
5144  return __pyx_r;
5145 }
5146 
5147 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self) {
5148  PyObject *__pyx_r = NULL;
5149  __Pyx_RefNannyDeclarations
5150  PyObject *__pyx_t_1 = NULL;
5151  int __pyx_lineno = 0;
5152  const char *__pyx_filename = NULL;
5153  int __pyx_clineno = 0;
5154  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5155 
5156  /* "(tree fragment)":2
5157  * def __reduce_cython__(self):
5158  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
5159  * def __setstate_cython__(self, __pyx_state):
5160  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5161  */
5162  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
5163  __Pyx_GOTREF(__pyx_t_1);
5164  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5165  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5166  __PYX_ERR(0, 2, __pyx_L1_error)
5167 
5168  /* "(tree fragment)":1
5169  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5170  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5171  * def __setstate_cython__(self, __pyx_state):
5172  */
5173 
5174  /* function exit code */
5175  __pyx_L1_error:;
5176  __Pyx_XDECREF(__pyx_t_1);
5177  __Pyx_AddTraceback("equivalent_polynomials.Simplex.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5178  __pyx_r = NULL;
5179  __Pyx_XGIVEREF(__pyx_r);
5180  __Pyx_RefNannyFinishContext();
5181  return __pyx_r;
5182 }
5183 
5184 /* "(tree fragment)":3
5185  * def __reduce_cython__(self):
5186  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5187  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5188  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5189  */
5190 
5191 /* Python wrapper */
5192 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
5193 static PyObject *__pyx_pw_22equivalent_polynomials_7Simplex_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5194  PyObject *__pyx_r = 0;
5195  __Pyx_RefNannyDeclarations
5196  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5197  __pyx_r = __pyx_pf_22equivalent_polynomials_7Simplex_8__setstate_cython__(((struct __pyx_obj_22equivalent_polynomials_Simplex *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5198 
5199  /* function exit code */
5200  __Pyx_RefNannyFinishContext();
5201  return __pyx_r;
5202 }
5203 
5204 static PyObject *__pyx_pf_22equivalent_polynomials_7Simplex_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_22equivalent_polynomials_Simplex *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5205  PyObject *__pyx_r = NULL;
5206  __Pyx_RefNannyDeclarations
5207  PyObject *__pyx_t_1 = NULL;
5208  int __pyx_lineno = 0;
5209  const char *__pyx_filename = NULL;
5210  int __pyx_clineno = 0;
5211  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5212 
5213  /* "(tree fragment)":4
5214  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5215  * def __setstate_cython__(self, __pyx_state):
5216  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
5217  */
5218  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
5219  __Pyx_GOTREF(__pyx_t_1);
5220  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5221  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5222  __PYX_ERR(0, 4, __pyx_L1_error)
5223 
5224  /* "(tree fragment)":3
5225  * def __reduce_cython__(self):
5226  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5227  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5228  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5229  */
5230 
5231  /* function exit code */
5232  __pyx_L1_error:;
5233  __Pyx_XDECREF(__pyx_t_1);
5234  __Pyx_AddTraceback("equivalent_polynomials.Simplex.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5235  __pyx_r = NULL;
5236  __Pyx_XGIVEREF(__pyx_r);
5237  __Pyx_RefNannyFinishContext();
5238  return __pyx_r;
5239 }
5240 
5241 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
5242  * ctypedef npy_cdouble complex_t
5243  *
5244  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
5245  * return PyArray_MultiIterNew(1, <void*>a)
5246  *
5247  */
5248 
5249 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
5250  PyObject *__pyx_r = NULL;
5251  __Pyx_RefNannyDeclarations
5252  PyObject *__pyx_t_1 = NULL;
5253  int __pyx_lineno = 0;
5254  const char *__pyx_filename = NULL;
5255  int __pyx_clineno = 0;
5256  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
5257 
5258  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":736
5259  *
5260  * cdef inline object PyArray_MultiIterNew1(a):
5261  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
5262  *
5263  * cdef inline object PyArray_MultiIterNew2(a, b):
5264  */
5265  __Pyx_XDECREF(__pyx_r);
5266  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
5267  __Pyx_GOTREF(__pyx_t_1);
5268  __pyx_r = __pyx_t_1;
5269  __pyx_t_1 = 0;
5270  goto __pyx_L0;
5271 
5272  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
5273  * ctypedef npy_cdouble complex_t
5274  *
5275  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
5276  * return PyArray_MultiIterNew(1, <void*>a)
5277  *
5278  */
5279 
5280  /* function exit code */
5281  __pyx_L1_error:;
5282  __Pyx_XDECREF(__pyx_t_1);
5283  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5284  __pyx_r = 0;
5285  __pyx_L0:;
5286  __Pyx_XGIVEREF(__pyx_r);
5287  __Pyx_RefNannyFinishContext();
5288  return __pyx_r;
5289 }
5290 
5291 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
5292  * return PyArray_MultiIterNew(1, <void*>a)
5293  *
5294  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
5295  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
5296  *
5297  */
5298 
5299 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
5300  PyObject *__pyx_r = NULL;
5301  __Pyx_RefNannyDeclarations
5302  PyObject *__pyx_t_1 = NULL;
5303  int __pyx_lineno = 0;
5304  const char *__pyx_filename = NULL;
5305  int __pyx_clineno = 0;
5306  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
5307 
5308  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":739
5309  *
5310  * cdef inline object PyArray_MultiIterNew2(a, b):
5311  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
5312  *
5313  * cdef inline object PyArray_MultiIterNew3(a, b, c):
5314  */
5315  __Pyx_XDECREF(__pyx_r);
5316  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error)
5317  __Pyx_GOTREF(__pyx_t_1);
5318  __pyx_r = __pyx_t_1;
5319  __pyx_t_1 = 0;
5320  goto __pyx_L0;
5321 
5322  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
5323  * return PyArray_MultiIterNew(1, <void*>a)
5324  *
5325  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
5326  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
5327  *
5328  */
5329 
5330  /* function exit code */
5331  __pyx_L1_error:;
5332  __Pyx_XDECREF(__pyx_t_1);
5333  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5334  __pyx_r = 0;
5335  __pyx_L0:;
5336  __Pyx_XGIVEREF(__pyx_r);
5337  __Pyx_RefNannyFinishContext();
5338  return __pyx_r;
5339 }
5340 
5341 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
5342  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
5343  *
5344  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
5345  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5346  *
5347  */
5348 
5349 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
5350  PyObject *__pyx_r = NULL;
5351  __Pyx_RefNannyDeclarations
5352  PyObject *__pyx_t_1 = NULL;
5353  int __pyx_lineno = 0;
5354  const char *__pyx_filename = NULL;
5355  int __pyx_clineno = 0;
5356  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
5357 
5358  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":742
5359  *
5360  * cdef inline object PyArray_MultiIterNew3(a, b, c):
5361  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
5362  *
5363  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
5364  */
5365  __Pyx_XDECREF(__pyx_r);
5366  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error)
5367  __Pyx_GOTREF(__pyx_t_1);
5368  __pyx_r = __pyx_t_1;
5369  __pyx_t_1 = 0;
5370  goto __pyx_L0;
5371 
5372  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
5373  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
5374  *
5375  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
5376  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5377  *
5378  */
5379 
5380  /* function exit code */
5381  __pyx_L1_error:;
5382  __Pyx_XDECREF(__pyx_t_1);
5383  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
5384  __pyx_r = 0;
5385  __pyx_L0:;
5386  __Pyx_XGIVEREF(__pyx_r);
5387  __Pyx_RefNannyFinishContext();
5388  return __pyx_r;
5389 }
5390 
5391 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
5392  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5393  *
5394  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
5395  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5396  *
5397  */
5398 
5399 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) {
5400  PyObject *__pyx_r = NULL;
5401  __Pyx_RefNannyDeclarations
5402  PyObject *__pyx_t_1 = NULL;
5403  int __pyx_lineno = 0;
5404  const char *__pyx_filename = NULL;
5405  int __pyx_clineno = 0;
5406  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
5407 
5408  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":745
5409  *
5410  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
5411  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
5412  *
5413  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
5414  */
5415  __Pyx_XDECREF(__pyx_r);
5416  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error)
5417  __Pyx_GOTREF(__pyx_t_1);
5418  __pyx_r = __pyx_t_1;
5419  __pyx_t_1 = 0;
5420  goto __pyx_L0;
5421 
5422  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
5423  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5424  *
5425  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
5426  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5427  *
5428  */
5429 
5430  /* function exit code */
5431  __pyx_L1_error:;
5432  __Pyx_XDECREF(__pyx_t_1);
5433  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
5434  __pyx_r = 0;
5435  __pyx_L0:;
5436  __Pyx_XGIVEREF(__pyx_r);
5437  __Pyx_RefNannyFinishContext();
5438  return __pyx_r;
5439 }
5440 
5441 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
5442  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5443  *
5444  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
5445  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5446  *
5447  */
5448 
5449 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) {
5450  PyObject *__pyx_r = NULL;
5451  __Pyx_RefNannyDeclarations
5452  PyObject *__pyx_t_1 = NULL;
5453  int __pyx_lineno = 0;
5454  const char *__pyx_filename = NULL;
5455  int __pyx_clineno = 0;
5456  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
5457 
5458  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":748
5459  *
5460  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
5461  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
5462  *
5463  * cdef inline tuple PyDataType_SHAPE(dtype d):
5464  */
5465  __Pyx_XDECREF(__pyx_r);
5466  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error)
5467  __Pyx_GOTREF(__pyx_t_1);
5468  __pyx_r = __pyx_t_1;
5469  __pyx_t_1 = 0;
5470  goto __pyx_L0;
5471 
5472  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
5473  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5474  *
5475  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
5476  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5477  *
5478  */
5479 
5480  /* function exit code */
5481  __pyx_L1_error:;
5482  __Pyx_XDECREF(__pyx_t_1);
5483  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
5484  __pyx_r = 0;
5485  __pyx_L0:;
5486  __Pyx_XGIVEREF(__pyx_r);
5487  __Pyx_RefNannyFinishContext();
5488  return __pyx_r;
5489 }
5490 
5491 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
5492  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5493  *
5494  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
5495  * if PyDataType_HASSUBARRAY(d):
5496  * return <tuple>d.subarray.shape
5497  */
5498 
5499 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
5500  PyObject *__pyx_r = NULL;
5501  __Pyx_RefNannyDeclarations
5502  int __pyx_t_1;
5503  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
5504 
5505  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
5506  *
5507  * cdef inline tuple PyDataType_SHAPE(dtype d):
5508  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
5509  * return <tuple>d.subarray.shape
5510  * else:
5511  */
5512  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
5513  if (__pyx_t_1) {
5514 
5515  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":752
5516  * cdef inline tuple PyDataType_SHAPE(dtype d):
5517  * if PyDataType_HASSUBARRAY(d):
5518  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
5519  * else:
5520  * return ()
5521  */
5522  __Pyx_XDECREF(__pyx_r);
5523  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
5524  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
5525  goto __pyx_L0;
5526 
5527  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
5528  *
5529  * cdef inline tuple PyDataType_SHAPE(dtype d):
5530  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
5531  * return <tuple>d.subarray.shape
5532  * else:
5533  */
5534  }
5535 
5536  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":754
5537  * return <tuple>d.subarray.shape
5538  * else:
5539  * return () # <<<<<<<<<<<<<<
5540  *
5541  *
5542  */
5543  /*else*/ {
5544  __Pyx_XDECREF(__pyx_r);
5545  __Pyx_INCREF(__pyx_empty_tuple);
5546  __pyx_r = __pyx_empty_tuple;
5547  goto __pyx_L0;
5548  }
5549 
5550  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
5551  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5552  *
5553  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
5554  * if PyDataType_HASSUBARRAY(d):
5555  * return <tuple>d.subarray.shape
5556  */
5557 
5558  /* function exit code */
5559  __pyx_L0:;
5560  __Pyx_XGIVEREF(__pyx_r);
5561  __Pyx_RefNannyFinishContext();
5562  return __pyx_r;
5563 }
5564 
5565 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
5566  * int _import_umath() except -1
5567  *
5568  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
5569  * Py_INCREF(base) # important to do this before stealing the reference below!
5570  * PyArray_SetBaseObject(arr, base)
5571  */
5572 
5573 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
5574  __Pyx_RefNannyDeclarations
5575  __Pyx_RefNannySetupContext("set_array_base", 0);
5576 
5577  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":930
5578  *
5579  * cdef inline void set_array_base(ndarray arr, object base):
5580  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
5581  * PyArray_SetBaseObject(arr, base)
5582  *
5583  */
5584  Py_INCREF(__pyx_v_base);
5585 
5586  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":931
5587  * cdef inline void set_array_base(ndarray arr, object base):
5588  * Py_INCREF(base) # important to do this before stealing the reference below!
5589  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
5590  *
5591  * cdef inline object get_array_base(ndarray arr):
5592  */
5593  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
5594 
5595  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
5596  * int _import_umath() except -1
5597  *
5598  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
5599  * Py_INCREF(base) # important to do this before stealing the reference below!
5600  * PyArray_SetBaseObject(arr, base)
5601  */
5602 
5603  /* function exit code */
5604  __Pyx_RefNannyFinishContext();
5605 }
5606 
5607 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
5608  * PyArray_SetBaseObject(arr, base)
5609  *
5610  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5611  * base = PyArray_BASE(arr)
5612  * if base is NULL:
5613  */
5614 
5615 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
5616  PyObject *__pyx_v_base;
5617  PyObject *__pyx_r = NULL;
5618  __Pyx_RefNannyDeclarations
5619  int __pyx_t_1;
5620  __Pyx_RefNannySetupContext("get_array_base", 0);
5621 
5622  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":934
5623  *
5624  * cdef inline object get_array_base(ndarray arr):
5625  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
5626  * if base is NULL:
5627  * return None
5628  */
5629  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
5630 
5631  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
5632  * cdef inline object get_array_base(ndarray arr):
5633  * base = PyArray_BASE(arr)
5634  * if base is NULL: # <<<<<<<<<<<<<<
5635  * return None
5636  * return <object>base
5637  */
5638  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
5639  if (__pyx_t_1) {
5640 
5641  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":936
5642  * base = PyArray_BASE(arr)
5643  * if base is NULL:
5644  * return None # <<<<<<<<<<<<<<
5645  * return <object>base
5646  *
5647  */
5648  __Pyx_XDECREF(__pyx_r);
5649  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5650  goto __pyx_L0;
5651 
5652  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
5653  * cdef inline object get_array_base(ndarray arr):
5654  * base = PyArray_BASE(arr)
5655  * if base is NULL: # <<<<<<<<<<<<<<
5656  * return None
5657  * return <object>base
5658  */
5659  }
5660 
5661  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":937
5662  * if base is NULL:
5663  * return None
5664  * return <object>base # <<<<<<<<<<<<<<
5665  *
5666  * # Versions of the import_* functions which are more suitable for
5667  */
5668  __Pyx_XDECREF(__pyx_r);
5669  __Pyx_INCREF(((PyObject *)__pyx_v_base));
5670  __pyx_r = ((PyObject *)__pyx_v_base);
5671  goto __pyx_L0;
5672 
5673  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
5674  * PyArray_SetBaseObject(arr, base)
5675  *
5676  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5677  * base = PyArray_BASE(arr)
5678  * if base is NULL:
5679  */
5680 
5681  /* function exit code */
5682  __pyx_L0:;
5683  __Pyx_XGIVEREF(__pyx_r);
5684  __Pyx_RefNannyFinishContext();
5685  return __pyx_r;
5686 }
5687 
5688 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
5689  * # Versions of the import_* functions which are more suitable for
5690  * # Cython code.
5691  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
5692  * try:
5693  * __pyx_import_array()
5694  */
5695 
5696 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
5697  int __pyx_r;
5698  __Pyx_RefNannyDeclarations
5699  PyObject *__pyx_t_1 = NULL;
5700  PyObject *__pyx_t_2 = NULL;
5701  PyObject *__pyx_t_3 = NULL;
5702  int __pyx_t_4;
5703  PyObject *__pyx_t_5 = NULL;
5704  PyObject *__pyx_t_6 = NULL;
5705  PyObject *__pyx_t_7 = NULL;
5706  PyObject *__pyx_t_8 = NULL;
5707  int __pyx_lineno = 0;
5708  const char *__pyx_filename = NULL;
5709  int __pyx_clineno = 0;
5710  __Pyx_RefNannySetupContext("import_array", 0);
5711 
5712  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
5713  * # Cython code.
5714  * cdef inline int import_array() except -1:
5715  * try: # <<<<<<<<<<<<<<
5716  * __pyx_import_array()
5717  * except Exception:
5718  */
5719  {
5720  __Pyx_PyThreadState_declare
5721  __Pyx_PyThreadState_assign
5722  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5723  __Pyx_XGOTREF(__pyx_t_1);
5724  __Pyx_XGOTREF(__pyx_t_2);
5725  __Pyx_XGOTREF(__pyx_t_3);
5726  /*try:*/ {
5727 
5728  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":943
5729  * cdef inline int import_array() except -1:
5730  * try:
5731  * __pyx_import_array() # <<<<<<<<<<<<<<
5732  * except Exception:
5733  * raise ImportError("numpy.core.multiarray failed to import")
5734  */
5735  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
5736 
5737  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
5738  * # Cython code.
5739  * cdef inline int import_array() except -1:
5740  * try: # <<<<<<<<<<<<<<
5741  * __pyx_import_array()
5742  * except Exception:
5743  */
5744  }
5745  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5746  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5747  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5748  goto __pyx_L8_try_end;
5749  __pyx_L3_error:;
5750 
5751  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":944
5752  * try:
5753  * __pyx_import_array()
5754  * except Exception: # <<<<<<<<<<<<<<
5755  * raise ImportError("numpy.core.multiarray failed to import")
5756  *
5757  */
5758  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5759  if (__pyx_t_4) {
5760  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5761  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
5762  __Pyx_GOTREF(__pyx_t_5);
5763  __Pyx_GOTREF(__pyx_t_6);
5764  __Pyx_GOTREF(__pyx_t_7);
5765 
5766  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
5767  * __pyx_import_array()
5768  * except Exception:
5769  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
5770  *
5771  * cdef inline int import_umath() except -1:
5772  */
5773  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
5774  __Pyx_GOTREF(__pyx_t_8);
5775  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5776  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5777  __PYX_ERR(2, 945, __pyx_L5_except_error)
5778  }
5779  goto __pyx_L5_except_error;
5780  __pyx_L5_except_error:;
5781 
5782  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
5783  * # Cython code.
5784  * cdef inline int import_array() except -1:
5785  * try: # <<<<<<<<<<<<<<
5786  * __pyx_import_array()
5787  * except Exception:
5788  */
5789  __Pyx_XGIVEREF(__pyx_t_1);
5790  __Pyx_XGIVEREF(__pyx_t_2);
5791  __Pyx_XGIVEREF(__pyx_t_3);
5792  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5793  goto __pyx_L1_error;
5794  __pyx_L8_try_end:;
5795  }
5796 
5797  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
5798  * # Versions of the import_* functions which are more suitable for
5799  * # Cython code.
5800  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
5801  * try:
5802  * __pyx_import_array()
5803  */
5804 
5805  /* function exit code */
5806  __pyx_r = 0;
5807  goto __pyx_L0;
5808  __pyx_L1_error:;
5809  __Pyx_XDECREF(__pyx_t_5);
5810  __Pyx_XDECREF(__pyx_t_6);
5811  __Pyx_XDECREF(__pyx_t_7);
5812  __Pyx_XDECREF(__pyx_t_8);
5813  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5814  __pyx_r = -1;
5815  __pyx_L0:;
5816  __Pyx_RefNannyFinishContext();
5817  return __pyx_r;
5818 }
5819 
5820 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
5821  * raise ImportError("numpy.core.multiarray failed to import")
5822  *
5823  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
5824  * try:
5825  * _import_umath()
5826  */
5827 
5828 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
5829  int __pyx_r;
5830  __Pyx_RefNannyDeclarations
5831  PyObject *__pyx_t_1 = NULL;
5832  PyObject *__pyx_t_2 = NULL;
5833  PyObject *__pyx_t_3 = NULL;
5834  int __pyx_t_4;
5835  PyObject *__pyx_t_5 = NULL;
5836  PyObject *__pyx_t_6 = NULL;
5837  PyObject *__pyx_t_7 = NULL;
5838  PyObject *__pyx_t_8 = NULL;
5839  int __pyx_lineno = 0;
5840  const char *__pyx_filename = NULL;
5841  int __pyx_clineno = 0;
5842  __Pyx_RefNannySetupContext("import_umath", 0);
5843 
5844  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
5845  *
5846  * cdef inline int import_umath() except -1:
5847  * try: # <<<<<<<<<<<<<<
5848  * _import_umath()
5849  * except Exception:
5850  */
5851  {
5852  __Pyx_PyThreadState_declare
5853  __Pyx_PyThreadState_assign
5854  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5855  __Pyx_XGOTREF(__pyx_t_1);
5856  __Pyx_XGOTREF(__pyx_t_2);
5857  __Pyx_XGOTREF(__pyx_t_3);
5858  /*try:*/ {
5859 
5860  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":949
5861  * cdef inline int import_umath() except -1:
5862  * try:
5863  * _import_umath() # <<<<<<<<<<<<<<
5864  * except Exception:
5865  * raise ImportError("numpy.core.umath failed to import")
5866  */
5867  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
5868 
5869  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
5870  *
5871  * cdef inline int import_umath() except -1:
5872  * try: # <<<<<<<<<<<<<<
5873  * _import_umath()
5874  * except Exception:
5875  */
5876  }
5877  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5878  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5879  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5880  goto __pyx_L8_try_end;
5881  __pyx_L3_error:;
5882 
5883  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":950
5884  * try:
5885  * _import_umath()
5886  * except Exception: # <<<<<<<<<<<<<<
5887  * raise ImportError("numpy.core.umath failed to import")
5888  *
5889  */
5890  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5891  if (__pyx_t_4) {
5892  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5893  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
5894  __Pyx_GOTREF(__pyx_t_5);
5895  __Pyx_GOTREF(__pyx_t_6);
5896  __Pyx_GOTREF(__pyx_t_7);
5897 
5898  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
5899  * _import_umath()
5900  * except Exception:
5901  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
5902  *
5903  * cdef inline int import_ufunc() except -1:
5904  */
5905  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
5906  __Pyx_GOTREF(__pyx_t_8);
5907  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5908  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5909  __PYX_ERR(2, 951, __pyx_L5_except_error)
5910  }
5911  goto __pyx_L5_except_error;
5912  __pyx_L5_except_error:;
5913 
5914  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
5915  *
5916  * cdef inline int import_umath() except -1:
5917  * try: # <<<<<<<<<<<<<<
5918  * _import_umath()
5919  * except Exception:
5920  */
5921  __Pyx_XGIVEREF(__pyx_t_1);
5922  __Pyx_XGIVEREF(__pyx_t_2);
5923  __Pyx_XGIVEREF(__pyx_t_3);
5924  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5925  goto __pyx_L1_error;
5926  __pyx_L8_try_end:;
5927  }
5928 
5929  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
5930  * raise ImportError("numpy.core.multiarray failed to import")
5931  *
5932  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
5933  * try:
5934  * _import_umath()
5935  */
5936 
5937  /* function exit code */
5938  __pyx_r = 0;
5939  goto __pyx_L0;
5940  __pyx_L1_error:;
5941  __Pyx_XDECREF(__pyx_t_5);
5942  __Pyx_XDECREF(__pyx_t_6);
5943  __Pyx_XDECREF(__pyx_t_7);
5944  __Pyx_XDECREF(__pyx_t_8);
5945  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5946  __pyx_r = -1;
5947  __pyx_L0:;
5948  __Pyx_RefNannyFinishContext();
5949  return __pyx_r;
5950 }
5951 
5952 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
5953  * raise ImportError("numpy.core.umath failed to import")
5954  *
5955  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
5956  * try:
5957  * _import_umath()
5958  */
5959 
5960 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
5961  int __pyx_r;
5962  __Pyx_RefNannyDeclarations
5963  PyObject *__pyx_t_1 = NULL;
5964  PyObject *__pyx_t_2 = NULL;
5965  PyObject *__pyx_t_3 = NULL;
5966  int __pyx_t_4;
5967  PyObject *__pyx_t_5 = NULL;
5968  PyObject *__pyx_t_6 = NULL;
5969  PyObject *__pyx_t_7 = NULL;
5970  PyObject *__pyx_t_8 = NULL;
5971  int __pyx_lineno = 0;
5972  const char *__pyx_filename = NULL;
5973  int __pyx_clineno = 0;
5974  __Pyx_RefNannySetupContext("import_ufunc", 0);
5975 
5976  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
5977  *
5978  * cdef inline int import_ufunc() except -1:
5979  * try: # <<<<<<<<<<<<<<
5980  * _import_umath()
5981  * except Exception:
5982  */
5983  {
5984  __Pyx_PyThreadState_declare
5985  __Pyx_PyThreadState_assign
5986  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5987  __Pyx_XGOTREF(__pyx_t_1);
5988  __Pyx_XGOTREF(__pyx_t_2);
5989  __Pyx_XGOTREF(__pyx_t_3);
5990  /*try:*/ {
5991 
5992  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":955
5993  * cdef inline int import_ufunc() except -1:
5994  * try:
5995  * _import_umath() # <<<<<<<<<<<<<<
5996  * except Exception:
5997  * raise ImportError("numpy.core.umath failed to import")
5998  */
5999  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
6000 
6001  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
6002  *
6003  * cdef inline int import_ufunc() except -1:
6004  * try: # <<<<<<<<<<<<<<
6005  * _import_umath()
6006  * except Exception:
6007  */
6008  }
6009  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6010  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6011  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6012  goto __pyx_L8_try_end;
6013  __pyx_L3_error:;
6014 
6015  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":956
6016  * try:
6017  * _import_umath()
6018  * except Exception: # <<<<<<<<<<<<<<
6019  * raise ImportError("numpy.core.umath failed to import")
6020  *
6021  */
6022  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
6023  if (__pyx_t_4) {
6024  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6025  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
6026  __Pyx_GOTREF(__pyx_t_5);
6027  __Pyx_GOTREF(__pyx_t_6);
6028  __Pyx_GOTREF(__pyx_t_7);
6029 
6030  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":957
6031  * _import_umath()
6032  * except Exception:
6033  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
6034  *
6035  * cdef extern from *:
6036  */
6037  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
6038  __Pyx_GOTREF(__pyx_t_8);
6039  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6040  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6041  __PYX_ERR(2, 957, __pyx_L5_except_error)
6042  }
6043  goto __pyx_L5_except_error;
6044  __pyx_L5_except_error:;
6045 
6046  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
6047  *
6048  * cdef inline int import_ufunc() except -1:
6049  * try: # <<<<<<<<<<<<<<
6050  * _import_umath()
6051  * except Exception:
6052  */
6053  __Pyx_XGIVEREF(__pyx_t_1);
6054  __Pyx_XGIVEREF(__pyx_t_2);
6055  __Pyx_XGIVEREF(__pyx_t_3);
6056  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6057  goto __pyx_L1_error;
6058  __pyx_L8_try_end:;
6059  }
6060 
6061  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
6062  * raise ImportError("numpy.core.umath failed to import")
6063  *
6064  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6065  * try:
6066  * _import_umath()
6067  */
6068 
6069  /* function exit code */
6070  __pyx_r = 0;
6071  goto __pyx_L0;
6072  __pyx_L1_error:;
6073  __Pyx_XDECREF(__pyx_t_5);
6074  __Pyx_XDECREF(__pyx_t_6);
6075  __Pyx_XDECREF(__pyx_t_7);
6076  __Pyx_XDECREF(__pyx_t_8);
6077  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6078  __pyx_r = -1;
6079  __pyx_L0:;
6080  __Pyx_RefNannyFinishContext();
6081  return __pyx_r;
6082 }
6083 
6084 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
6085  *
6086  *
6087  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
6088  * """
6089  * Cython equivalent of `isinstance(obj, np.timedelta64)`
6090  */
6091 
6092 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
6093  int __pyx_r;
6094  __Pyx_RefNannyDeclarations
6095  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
6096 
6097  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":979
6098  * bool
6099  * """
6100  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
6101  *
6102  *
6103  */
6104  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
6105  goto __pyx_L0;
6106 
6107  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
6108  *
6109  *
6110  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
6111  * """
6112  * Cython equivalent of `isinstance(obj, np.timedelta64)`
6113  */
6114 
6115  /* function exit code */
6116  __pyx_L0:;
6117  __Pyx_RefNannyFinishContext();
6118  return __pyx_r;
6119 }
6120 
6121 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
6122  *
6123  *
6124  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
6125  * """
6126  * Cython equivalent of `isinstance(obj, np.datetime64)`
6127  */
6128 
6129 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
6130  int __pyx_r;
6131  __Pyx_RefNannyDeclarations
6132  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
6133 
6134  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":994
6135  * bool
6136  * """
6137  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
6138  *
6139  *
6140  */
6141  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
6142  goto __pyx_L0;
6143 
6144  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
6145  *
6146  *
6147  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
6148  * """
6149  * Cython equivalent of `isinstance(obj, np.datetime64)`
6150  */
6151 
6152  /* function exit code */
6153  __pyx_L0:;
6154  __Pyx_RefNannyFinishContext();
6155  return __pyx_r;
6156 }
6157 
6158 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
6159  *
6160  *
6161  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
6162  * """
6163  * returns the int64 value underlying scalar numpy datetime64 object
6164  */
6165 
6166 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
6167  npy_datetime __pyx_r;
6168 
6169  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1004
6170  * also needed. That can be found using `get_datetime64_unit`.
6171  * """
6172  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
6173  *
6174  *
6175  */
6176  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
6177  goto __pyx_L0;
6178 
6179  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
6180  *
6181  *
6182  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
6183  * """
6184  * returns the int64 value underlying scalar numpy datetime64 object
6185  */
6186 
6187  /* function exit code */
6188  __pyx_L0:;
6189  return __pyx_r;
6190 }
6191 
6192 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
6193  *
6194  *
6195  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
6196  * """
6197  * returns the int64 value underlying scalar numpy timedelta64 object
6198  */
6199 
6200 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
6201  npy_timedelta __pyx_r;
6202 
6203  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1011
6204  * returns the int64 value underlying scalar numpy timedelta64 object
6205  * """
6206  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
6207  *
6208  *
6209  */
6210  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
6211  goto __pyx_L0;
6212 
6213  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
6214  *
6215  *
6216  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
6217  * """
6218  * returns the int64 value underlying scalar numpy timedelta64 object
6219  */
6220 
6221  /* function exit code */
6222  __pyx_L0:;
6223  return __pyx_r;
6224 }
6225 
6226 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
6227  *
6228  *
6229  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
6230  * """
6231  * returns the unit part of the dtype for a numpy datetime64 object.
6232  */
6233 
6234 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
6235  NPY_DATETIMEUNIT __pyx_r;
6236 
6237  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1018
6238  * returns the unit part of the dtype for a numpy datetime64 object.
6239  * """
6240  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
6241  */
6242  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
6243  goto __pyx_L0;
6244 
6245  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
6246  *
6247  *
6248  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
6249  * """
6250  * returns the unit part of the dtype for a numpy datetime64 object.
6251  */
6252 
6253  /* function exit code */
6254  __pyx_L0:;
6255  return __pyx_r;
6256 }
6257 
6258 /* "View.MemoryView":122
6259  * cdef bint dtype_is_object
6260  *
6261  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
6262  * mode="c", bint allocate_buffer=True):
6263  *
6264  */
6265 
6266 /* Python wrapper */
6267 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6268 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6269  PyObject *__pyx_v_shape = 0;
6270  Py_ssize_t __pyx_v_itemsize;
6271  PyObject *__pyx_v_format = 0;
6272  PyObject *__pyx_v_mode = 0;
6273  int __pyx_v_allocate_buffer;
6274  int __pyx_lineno = 0;
6275  const char *__pyx_filename = NULL;
6276  int __pyx_clineno = 0;
6277  int __pyx_r;
6278  __Pyx_RefNannyDeclarations
6279  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
6280  {
6281  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};
6282  PyObject* values[5] = {0,0,0,0,0};
6283  values[3] = ((PyObject *)__pyx_n_s_c);
6284  if (unlikely(__pyx_kwds)) {
6285  Py_ssize_t kw_args;
6286  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6287  switch (pos_args) {
6288  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6289  CYTHON_FALLTHROUGH;
6290  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6291  CYTHON_FALLTHROUGH;
6292  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6293  CYTHON_FALLTHROUGH;
6294  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6295  CYTHON_FALLTHROUGH;
6296  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6297  CYTHON_FALLTHROUGH;
6298  case 0: break;
6299  default: goto __pyx_L5_argtuple_error;
6300  }
6301  kw_args = PyDict_Size(__pyx_kwds);
6302  switch (pos_args) {
6303  case 0:
6304  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
6305  else goto __pyx_L5_argtuple_error;
6306  CYTHON_FALLTHROUGH;
6307  case 1:
6308  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
6309  else {
6310  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(0, 122, __pyx_L3_error)
6311  }
6312  CYTHON_FALLTHROUGH;
6313  case 2:
6314  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
6315  else {
6316  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(0, 122, __pyx_L3_error)
6317  }
6318  CYTHON_FALLTHROUGH;
6319  case 3:
6320  if (kw_args > 0) {
6321  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
6322  if (value) { values[3] = value; kw_args--; }
6323  }
6324  CYTHON_FALLTHROUGH;
6325  case 4:
6326  if (kw_args > 0) {
6327  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
6328  if (value) { values[4] = value; kw_args--; }
6329  }
6330  }
6331  if (unlikely(kw_args > 0)) {
6332  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 122, __pyx_L3_error)
6333  }
6334  } else {
6335  switch (PyTuple_GET_SIZE(__pyx_args)) {
6336  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6337  CYTHON_FALLTHROUGH;
6338  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6339  CYTHON_FALLTHROUGH;
6340  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6341  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6342  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6343  break;
6344  default: goto __pyx_L5_argtuple_error;
6345  }
6346  }
6347  __pyx_v_shape = ((PyObject*)values[0]);
6348  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error)
6349  __pyx_v_format = values[2];
6350  __pyx_v_mode = values[3];
6351  if (values[4]) {
6352  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L3_error)
6353  } else {
6354 
6355  /* "View.MemoryView":123
6356  *
6357  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
6358  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
6359  *
6360  * cdef int idx
6361  */
6362  __pyx_v_allocate_buffer = ((int)1);
6363  }
6364  }
6365  goto __pyx_L4_argument_unpacking_done;
6366  __pyx_L5_argtuple_error:;
6367  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 122, __pyx_L3_error)
6368  __pyx_L3_error:;
6369  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6370  __Pyx_RefNannyFinishContext();
6371  return -1;
6372  __pyx_L4_argument_unpacking_done:;
6373  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(0, 122, __pyx_L1_error)
6374  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
6375  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(0, 122, __pyx_L1_error)
6376  }
6377  __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);
6378 
6379  /* "View.MemoryView":122
6380  * cdef bint dtype_is_object
6381  *
6382  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
6383  * mode="c", bint allocate_buffer=True):
6384  *
6385  */
6386 
6387  /* function exit code */
6388  goto __pyx_L0;
6389  __pyx_L1_error:;
6390  __pyx_r = -1;
6391  __pyx_L0:;
6392  __Pyx_RefNannyFinishContext();
6393  return __pyx_r;
6394 }
6395 
6396 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) {
6397  int __pyx_v_idx;
6398  Py_ssize_t __pyx_v_i;
6399  Py_ssize_t __pyx_v_dim;
6400  PyObject **__pyx_v_p;
6401  char __pyx_v_order;
6402  int __pyx_r;
6403  __Pyx_RefNannyDeclarations
6404  Py_ssize_t __pyx_t_1;
6405  int __pyx_t_2;
6406  PyObject *__pyx_t_3 = NULL;
6407  int __pyx_t_4;
6408  PyObject *__pyx_t_5 = NULL;
6409  PyObject *__pyx_t_6 = NULL;
6410  char *__pyx_t_7;
6411  int __pyx_t_8;
6412  Py_ssize_t __pyx_t_9;
6413  PyObject *__pyx_t_10 = NULL;
6414  Py_ssize_t __pyx_t_11;
6415  int __pyx_lineno = 0;
6416  const char *__pyx_filename = NULL;
6417  int __pyx_clineno = 0;
6418  __Pyx_RefNannySetupContext("__cinit__", 0);
6419  __Pyx_INCREF(__pyx_v_format);
6420 
6421  /* "View.MemoryView":129
6422  * cdef PyObject **p
6423  *
6424  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
6425  * self.itemsize = itemsize
6426  *
6427  */
6428  if (unlikely(__pyx_v_shape == Py_None)) {
6429  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
6430  __PYX_ERR(0, 129, __pyx_L1_error)
6431  }
6432  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 129, __pyx_L1_error)
6433  __pyx_v_self->ndim = ((int)__pyx_t_1);
6434 
6435  /* "View.MemoryView":130
6436  *
6437  * self.ndim = <int> len(shape)
6438  * self.itemsize = itemsize # <<<<<<<<<<<<<<
6439  *
6440  * if not self.ndim:
6441  */
6442  __pyx_v_self->itemsize = __pyx_v_itemsize;
6443 
6444  /* "View.MemoryView":132
6445  * self.itemsize = itemsize
6446  *
6447  * if not self.ndim: # <<<<<<<<<<<<<<
6448  * raise ValueError("Empty shape tuple for cython.array")
6449  *
6450  */
6451  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
6452  if (unlikely(__pyx_t_2)) {
6453 
6454  /* "View.MemoryView":133
6455  *
6456  * if not self.ndim:
6457  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
6458  *
6459  * if itemsize <= 0:
6460  */
6461  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
6462  __Pyx_GOTREF(__pyx_t_3);
6463  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6464  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6465  __PYX_ERR(0, 133, __pyx_L1_error)
6466 
6467  /* "View.MemoryView":132
6468  * self.itemsize = itemsize
6469  *
6470  * if not self.ndim: # <<<<<<<<<<<<<<
6471  * raise ValueError("Empty shape tuple for cython.array")
6472  *
6473  */
6474  }
6475 
6476  /* "View.MemoryView":135
6477  * raise ValueError("Empty shape tuple for cython.array")
6478  *
6479  * if itemsize <= 0: # <<<<<<<<<<<<<<
6480  * raise ValueError("itemsize <= 0 for cython.array")
6481  *
6482  */
6483  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
6484  if (unlikely(__pyx_t_2)) {
6485 
6486  /* "View.MemoryView":136
6487  *
6488  * if itemsize <= 0:
6489  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
6490  *
6491  * if not isinstance(format, bytes):
6492  */
6493  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
6494  __Pyx_GOTREF(__pyx_t_3);
6495  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6496  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6497  __PYX_ERR(0, 136, __pyx_L1_error)
6498 
6499  /* "View.MemoryView":135
6500  * raise ValueError("Empty shape tuple for cython.array")
6501  *
6502  * if itemsize <= 0: # <<<<<<<<<<<<<<
6503  * raise ValueError("itemsize <= 0 for cython.array")
6504  *
6505  */
6506  }
6507 
6508  /* "View.MemoryView":138
6509  * raise ValueError("itemsize <= 0 for cython.array")
6510  *
6511  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
6512  * format = format.encode('ASCII')
6513  * self._format = format # keep a reference to the byte string
6514  */
6515  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
6516  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
6517  if (__pyx_t_4) {
6518 
6519  /* "View.MemoryView":139
6520  *
6521  * if not isinstance(format, bytes):
6522  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
6523  * self._format = format # keep a reference to the byte string
6524  * self.format = self._format
6525  */
6526  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error)
6527  __Pyx_GOTREF(__pyx_t_5);
6528  __pyx_t_6 = NULL;
6529  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
6530  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
6531  if (likely(__pyx_t_6)) {
6532  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
6533  __Pyx_INCREF(__pyx_t_6);
6534  __Pyx_INCREF(function);
6535  __Pyx_DECREF_SET(__pyx_t_5, function);
6536  }
6537  }
6538  __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);
6539  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6540  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
6541  __Pyx_GOTREF(__pyx_t_3);
6542  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6543  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
6544  __pyx_t_3 = 0;
6545 
6546  /* "View.MemoryView":138
6547  * raise ValueError("itemsize <= 0 for cython.array")
6548  *
6549  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
6550  * format = format.encode('ASCII')
6551  * self._format = format # keep a reference to the byte string
6552  */
6553  }
6554 
6555  /* "View.MemoryView":140
6556  * if not isinstance(format, bytes):
6557  * format = format.encode('ASCII')
6558  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
6559  * self.format = self._format
6560  *
6561  */
6562  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(0, 140, __pyx_L1_error)
6563  __pyx_t_3 = __pyx_v_format;
6564  __Pyx_INCREF(__pyx_t_3);
6565  __Pyx_GIVEREF(__pyx_t_3);
6566  __Pyx_GOTREF(__pyx_v_self->_format);
6567  __Pyx_DECREF(__pyx_v_self->_format);
6568  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
6569  __pyx_t_3 = 0;
6570 
6571  /* "View.MemoryView":141
6572  * format = format.encode('ASCII')
6573  * self._format = format # keep a reference to the byte string
6574  * self.format = self._format # <<<<<<<<<<<<<<
6575  *
6576  *
6577  */
6578  if (unlikely(__pyx_v_self->_format == Py_None)) {
6579  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
6580  __PYX_ERR(0, 141, __pyx_L1_error)
6581  }
6582  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error)
6583  __pyx_v_self->format = __pyx_t_7;
6584 
6585  /* "View.MemoryView":144
6586  *
6587  *
6588  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
6589  * self._strides = self._shape + self.ndim
6590  *
6591  */
6592  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
6593 
6594  /* "View.MemoryView":145
6595  *
6596  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
6597  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
6598  *
6599  * if not self._shape:
6600  */
6601  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
6602 
6603  /* "View.MemoryView":147
6604  * self._strides = self._shape + self.ndim
6605  *
6606  * if not self._shape: # <<<<<<<<<<<<<<
6607  * raise MemoryError("unable to allocate shape and strides.")
6608  *
6609  */
6610  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
6611  if (unlikely(__pyx_t_4)) {
6612 
6613  /* "View.MemoryView":148
6614  *
6615  * if not self._shape:
6616  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
6617  *
6618  *
6619  */
6620  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
6621  __Pyx_GOTREF(__pyx_t_3);
6622  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6623  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6624  __PYX_ERR(0, 148, __pyx_L1_error)
6625 
6626  /* "View.MemoryView":147
6627  * self._strides = self._shape + self.ndim
6628  *
6629  * if not self._shape: # <<<<<<<<<<<<<<
6630  * raise MemoryError("unable to allocate shape and strides.")
6631  *
6632  */
6633  }
6634 
6635  /* "View.MemoryView":151
6636  *
6637  *
6638  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
6639  * if dim <= 0:
6640  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6641  */
6642  __pyx_t_8 = 0;
6643  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
6644  for (;;) {
6645  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
6646  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6647  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 151, __pyx_L1_error)
6648  #else
6649  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error)
6650  __Pyx_GOTREF(__pyx_t_5);
6651  #endif
6652  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error)
6653  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6654  __pyx_v_dim = __pyx_t_9;
6655  __pyx_v_idx = __pyx_t_8;
6656  __pyx_t_8 = (__pyx_t_8 + 1);
6657 
6658  /* "View.MemoryView":152
6659  *
6660  * for idx, dim in enumerate(shape):
6661  * if dim <= 0: # <<<<<<<<<<<<<<
6662  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6663  * self._shape[idx] = dim
6664  */
6665  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
6666  if (unlikely(__pyx_t_4)) {
6667 
6668  /* "View.MemoryView":153
6669  * for idx, dim in enumerate(shape):
6670  * if dim <= 0:
6671  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
6672  * self._shape[idx] = dim
6673  *
6674  */
6675  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
6676  __Pyx_GOTREF(__pyx_t_5);
6677  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error)
6678  __Pyx_GOTREF(__pyx_t_6);
6679  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 153, __pyx_L1_error)
6680  __Pyx_GOTREF(__pyx_t_10);
6681  __Pyx_GIVEREF(__pyx_t_5);
6682  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
6683  __Pyx_GIVEREF(__pyx_t_6);
6684  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
6685  __pyx_t_5 = 0;
6686  __pyx_t_6 = 0;
6687  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error)
6688  __Pyx_GOTREF(__pyx_t_6);
6689  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6690  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 153, __pyx_L1_error)
6691  __Pyx_GOTREF(__pyx_t_10);
6692  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6693  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6694  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6695  __PYX_ERR(0, 153, __pyx_L1_error)
6696 
6697  /* "View.MemoryView":152
6698  *
6699  * for idx, dim in enumerate(shape):
6700  * if dim <= 0: # <<<<<<<<<<<<<<
6701  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6702  * self._shape[idx] = dim
6703  */
6704  }
6705 
6706  /* "View.MemoryView":154
6707  * if dim <= 0:
6708  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6709  * self._shape[idx] = dim # <<<<<<<<<<<<<<
6710  *
6711  * cdef char order
6712  */
6713  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
6714 
6715  /* "View.MemoryView":151
6716  *
6717  *
6718  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
6719  * if dim <= 0:
6720  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
6721  */
6722  }
6723  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6724 
6725  /* "View.MemoryView":157
6726  *
6727  * cdef char order
6728  * if mode == 'fortran': # <<<<<<<<<<<<<<
6729  * order = b'F'
6730  * self.mode = u'fortran'
6731  */
6732  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 157, __pyx_L1_error)
6733  if (__pyx_t_4) {
6734 
6735  /* "View.MemoryView":158
6736  * cdef char order
6737  * if mode == 'fortran':
6738  * order = b'F' # <<<<<<<<<<<<<<
6739  * self.mode = u'fortran'
6740  * elif mode == 'c':
6741  */
6742  __pyx_v_order = 'F';
6743 
6744  /* "View.MemoryView":159
6745  * if mode == 'fortran':
6746  * order = b'F'
6747  * self.mode = u'fortran' # <<<<<<<<<<<<<<
6748  * elif mode == 'c':
6749  * order = b'C'
6750  */
6751  __Pyx_INCREF(__pyx_n_u_fortran);
6752  __Pyx_GIVEREF(__pyx_n_u_fortran);
6753  __Pyx_GOTREF(__pyx_v_self->mode);
6754  __Pyx_DECREF(__pyx_v_self->mode);
6755  __pyx_v_self->mode = __pyx_n_u_fortran;
6756 
6757  /* "View.MemoryView":157
6758  *
6759  * cdef char order
6760  * if mode == 'fortran': # <<<<<<<<<<<<<<
6761  * order = b'F'
6762  * self.mode = u'fortran'
6763  */
6764  goto __pyx_L10;
6765  }
6766 
6767  /* "View.MemoryView":160
6768  * order = b'F'
6769  * self.mode = u'fortran'
6770  * elif mode == 'c': # <<<<<<<<<<<<<<
6771  * order = b'C'
6772  * self.mode = u'c'
6773  */
6774  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 160, __pyx_L1_error)
6775  if (likely(__pyx_t_4)) {
6776 
6777  /* "View.MemoryView":161
6778  * self.mode = u'fortran'
6779  * elif mode == 'c':
6780  * order = b'C' # <<<<<<<<<<<<<<
6781  * self.mode = u'c'
6782  * else:
6783  */
6784  __pyx_v_order = 'C';
6785 
6786  /* "View.MemoryView":162
6787  * elif mode == 'c':
6788  * order = b'C'
6789  * self.mode = u'c' # <<<<<<<<<<<<<<
6790  * else:
6791  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
6792  */
6793  __Pyx_INCREF(__pyx_n_u_c);
6794  __Pyx_GIVEREF(__pyx_n_u_c);
6795  __Pyx_GOTREF(__pyx_v_self->mode);
6796  __Pyx_DECREF(__pyx_v_self->mode);
6797  __pyx_v_self->mode = __pyx_n_u_c;
6798 
6799  /* "View.MemoryView":160
6800  * order = b'F'
6801  * self.mode = u'fortran'
6802  * elif mode == 'c': # <<<<<<<<<<<<<<
6803  * order = b'C'
6804  * self.mode = u'c'
6805  */
6806  goto __pyx_L10;
6807  }
6808 
6809  /* "View.MemoryView":164
6810  * self.mode = u'c'
6811  * else:
6812  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
6813  *
6814  * self.len = fill_contig_strides_array(self._shape, self._strides,
6815  */
6816  /*else*/ {
6817  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
6818  __Pyx_GOTREF(__pyx_t_3);
6819  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 164, __pyx_L1_error)
6820  __Pyx_GOTREF(__pyx_t_10);
6821  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6822  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6823  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6824  __PYX_ERR(0, 164, __pyx_L1_error)
6825  }
6826  __pyx_L10:;
6827 
6828  /* "View.MemoryView":166
6829  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
6830  *
6831  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
6832  * itemsize, self.ndim, order)
6833  *
6834  */
6835  __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);
6836 
6837  /* "View.MemoryView":169
6838  * itemsize, self.ndim, order)
6839  *
6840  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
6841  * self.dtype_is_object = format == b'O'
6842  * if allocate_buffer:
6843  */
6844  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
6845 
6846  /* "View.MemoryView":170
6847  *
6848  * self.free_data = allocate_buffer
6849  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
6850  * if allocate_buffer:
6851  *
6852  */
6853  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 170, __pyx_L1_error)
6854  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L1_error)
6855  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6856  __pyx_v_self->dtype_is_object = __pyx_t_4;
6857 
6858  /* "View.MemoryView":171
6859  * self.free_data = allocate_buffer
6860  * self.dtype_is_object = format == b'O'
6861  * if allocate_buffer: # <<<<<<<<<<<<<<
6862  *
6863  *
6864  */
6865  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
6866  if (__pyx_t_4) {
6867 
6868  /* "View.MemoryView":174
6869  *
6870  *
6871  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
6872  * if not self.data:
6873  * raise MemoryError("unable to allocate array data.")
6874  */
6875  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
6876 
6877  /* "View.MemoryView":175
6878  *
6879  * self.data = <char *>malloc(self.len)
6880  * if not self.data: # <<<<<<<<<<<<<<
6881  * raise MemoryError("unable to allocate array data.")
6882  *
6883  */
6884  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
6885  if (unlikely(__pyx_t_4)) {
6886 
6887  /* "View.MemoryView":176
6888  * self.data = <char *>malloc(self.len)
6889  * if not self.data:
6890  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
6891  *
6892  * if self.dtype_is_object:
6893  */
6894  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 176, __pyx_L1_error)
6895  __Pyx_GOTREF(__pyx_t_10);
6896  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
6897  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6898  __PYX_ERR(0, 176, __pyx_L1_error)
6899 
6900  /* "View.MemoryView":175
6901  *
6902  * self.data = <char *>malloc(self.len)
6903  * if not self.data: # <<<<<<<<<<<<<<
6904  * raise MemoryError("unable to allocate array data.")
6905  *
6906  */
6907  }
6908 
6909  /* "View.MemoryView":178
6910  * raise MemoryError("unable to allocate array data.")
6911  *
6912  * if self.dtype_is_object: # <<<<<<<<<<<<<<
6913  * p = <PyObject **> self.data
6914  * for i in range(self.len / itemsize):
6915  */
6916  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
6917  if (__pyx_t_4) {
6918 
6919  /* "View.MemoryView":179
6920  *
6921  * if self.dtype_is_object:
6922  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
6923  * for i in range(self.len / itemsize):
6924  * p[i] = Py_None
6925  */
6926  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6927 
6928  /* "View.MemoryView":180
6929  * if self.dtype_is_object:
6930  * p = <PyObject **> self.data
6931  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
6932  * p[i] = Py_None
6933  * Py_INCREF(Py_None)
6934  */
6935  if (unlikely(__pyx_v_itemsize == 0)) {
6936  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
6937  __PYX_ERR(0, 180, __pyx_L1_error)
6938  }
6939  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))) {
6940  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
6941  __PYX_ERR(0, 180, __pyx_L1_error)
6942  }
6943  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
6944  __pyx_t_9 = __pyx_t_1;
6945  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
6946  __pyx_v_i = __pyx_t_11;
6947 
6948  /* "View.MemoryView":181
6949  * p = <PyObject **> self.data
6950  * for i in range(self.len / itemsize):
6951  * p[i] = Py_None # <<<<<<<<<<<<<<
6952  * Py_INCREF(Py_None)
6953  *
6954  */
6955  (__pyx_v_p[__pyx_v_i]) = Py_None;
6956 
6957  /* "View.MemoryView":182
6958  * for i in range(self.len / itemsize):
6959  * p[i] = Py_None
6960  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
6961  *
6962  * @cname('getbuffer')
6963  */
6964  Py_INCREF(Py_None);
6965  }
6966 
6967  /* "View.MemoryView":178
6968  * raise MemoryError("unable to allocate array data.")
6969  *
6970  * if self.dtype_is_object: # <<<<<<<<<<<<<<
6971  * p = <PyObject **> self.data
6972  * for i in range(self.len / itemsize):
6973  */
6974  }
6975 
6976  /* "View.MemoryView":171
6977  * self.free_data = allocate_buffer
6978  * self.dtype_is_object = format == b'O'
6979  * if allocate_buffer: # <<<<<<<<<<<<<<
6980  *
6981  *
6982  */
6983  }
6984 
6985  /* "View.MemoryView":122
6986  * cdef bint dtype_is_object
6987  *
6988  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
6989  * mode="c", bint allocate_buffer=True):
6990  *
6991  */
6992 
6993  /* function exit code */
6994  __pyx_r = 0;
6995  goto __pyx_L0;
6996  __pyx_L1_error:;
6997  __Pyx_XDECREF(__pyx_t_3);
6998  __Pyx_XDECREF(__pyx_t_5);
6999  __Pyx_XDECREF(__pyx_t_6);
7000  __Pyx_XDECREF(__pyx_t_10);
7001  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7002  __pyx_r = -1;
7003  __pyx_L0:;
7004  __Pyx_XDECREF(__pyx_v_format);
7005  __Pyx_RefNannyFinishContext();
7006  return __pyx_r;
7007 }
7008 
7009 /* "View.MemoryView":185
7010  *
7011  * @cname('getbuffer')
7012  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
7013  * cdef int bufmode = -1
7014  * if self.mode == u"c":
7015  */
7016 
7017 /* Python wrapper */
7018 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
7019 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
7020  int __pyx_r;
7021  __Pyx_RefNannyDeclarations
7022  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
7023  __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));
7024 
7025  /* function exit code */
7026  __Pyx_RefNannyFinishContext();
7027  return __pyx_r;
7028 }
7029 
7030 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) {
7031  int __pyx_v_bufmode;
7032  int __pyx_r;
7033  __Pyx_RefNannyDeclarations
7034  int __pyx_t_1;
7035  int __pyx_t_2;
7036  PyObject *__pyx_t_3 = NULL;
7037  char *__pyx_t_4;
7038  Py_ssize_t __pyx_t_5;
7039  int __pyx_t_6;
7040  Py_ssize_t *__pyx_t_7;
7041  int __pyx_lineno = 0;
7042  const char *__pyx_filename = NULL;
7043  int __pyx_clineno = 0;
7044  if (__pyx_v_info == NULL) {
7045  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
7046  return -1;
7047  }
7048  __Pyx_RefNannySetupContext("__getbuffer__", 0);
7049  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
7050  __Pyx_GIVEREF(__pyx_v_info->obj);
7051 
7052  /* "View.MemoryView":186
7053  * @cname('getbuffer')
7054  * def __getbuffer__(self, Py_buffer *info, int flags):
7055  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
7056  * if self.mode == u"c":
7057  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7058  */
7059  __pyx_v_bufmode = -1;
7060 
7061  /* "View.MemoryView":187
7062  * def __getbuffer__(self, Py_buffer *info, int flags):
7063  * cdef int bufmode = -1
7064  * if self.mode == u"c": # <<<<<<<<<<<<<<
7065  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7066  * elif self.mode == u"fortran":
7067  */
7068  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
7069  __pyx_t_2 = (__pyx_t_1 != 0);
7070  if (__pyx_t_2) {
7071 
7072  /* "View.MemoryView":188
7073  * cdef int bufmode = -1
7074  * if self.mode == u"c":
7075  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
7076  * elif self.mode == u"fortran":
7077  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7078  */
7079  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7080 
7081  /* "View.MemoryView":187
7082  * def __getbuffer__(self, Py_buffer *info, int flags):
7083  * cdef int bufmode = -1
7084  * if self.mode == u"c": # <<<<<<<<<<<<<<
7085  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7086  * elif self.mode == u"fortran":
7087  */
7088  goto __pyx_L3;
7089  }
7090 
7091  /* "View.MemoryView":189
7092  * if self.mode == u"c":
7093  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7094  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
7095  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7096  * if not (flags & bufmode):
7097  */
7098  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 189, __pyx_L1_error)
7099  __pyx_t_1 = (__pyx_t_2 != 0);
7100  if (__pyx_t_1) {
7101 
7102  /* "View.MemoryView":190
7103  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7104  * elif self.mode == u"fortran":
7105  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
7106  * if not (flags & bufmode):
7107  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7108  */
7109  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7110 
7111  /* "View.MemoryView":189
7112  * if self.mode == u"c":
7113  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7114  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
7115  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7116  * if not (flags & bufmode):
7117  */
7118  }
7119  __pyx_L3:;
7120 
7121  /* "View.MemoryView":191
7122  * elif self.mode == u"fortran":
7123  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7124  * if not (flags & bufmode): # <<<<<<<<<<<<<<
7125  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7126  * info.buf = self.data
7127  */
7128  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
7129  if (unlikely(__pyx_t_1)) {
7130 
7131  /* "View.MemoryView":192
7132  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7133  * if not (flags & bufmode):
7134  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
7135  * info.buf = self.data
7136  * info.len = self.len
7137  */
7138  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
7139  __Pyx_GOTREF(__pyx_t_3);
7140  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7141  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7142  __PYX_ERR(0, 192, __pyx_L1_error)
7143 
7144  /* "View.MemoryView":191
7145  * elif self.mode == u"fortran":
7146  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7147  * if not (flags & bufmode): # <<<<<<<<<<<<<<
7148  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7149  * info.buf = self.data
7150  */
7151  }
7152 
7153  /* "View.MemoryView":193
7154  * if not (flags & bufmode):
7155  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7156  * info.buf = self.data # <<<<<<<<<<<<<<
7157  * info.len = self.len
7158  * info.ndim = self.ndim
7159  */
7160  __pyx_t_4 = __pyx_v_self->data;
7161  __pyx_v_info->buf = __pyx_t_4;
7162 
7163  /* "View.MemoryView":194
7164  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7165  * info.buf = self.data
7166  * info.len = self.len # <<<<<<<<<<<<<<
7167  * info.ndim = self.ndim
7168  * info.shape = self._shape
7169  */
7170  __pyx_t_5 = __pyx_v_self->len;
7171  __pyx_v_info->len = __pyx_t_5;
7172 
7173  /* "View.MemoryView":195
7174  * info.buf = self.data
7175  * info.len = self.len
7176  * info.ndim = self.ndim # <<<<<<<<<<<<<<
7177  * info.shape = self._shape
7178  * info.strides = self._strides
7179  */
7180  __pyx_t_6 = __pyx_v_self->ndim;
7181  __pyx_v_info->ndim = __pyx_t_6;
7182 
7183  /* "View.MemoryView":196
7184  * info.len = self.len
7185  * info.ndim = self.ndim
7186  * info.shape = self._shape # <<<<<<<<<<<<<<
7187  * info.strides = self._strides
7188  * info.suboffsets = NULL
7189  */
7190  __pyx_t_7 = __pyx_v_self->_shape;
7191  __pyx_v_info->shape = __pyx_t_7;
7192 
7193  /* "View.MemoryView":197
7194  * info.ndim = self.ndim
7195  * info.shape = self._shape
7196  * info.strides = self._strides # <<<<<<<<<<<<<<
7197  * info.suboffsets = NULL
7198  * info.itemsize = self.itemsize
7199  */
7200  __pyx_t_7 = __pyx_v_self->_strides;
7201  __pyx_v_info->strides = __pyx_t_7;
7202 
7203  /* "View.MemoryView":198
7204  * info.shape = self._shape
7205  * info.strides = self._strides
7206  * info.suboffsets = NULL # <<<<<<<<<<<<<<
7207  * info.itemsize = self.itemsize
7208  * info.readonly = 0
7209  */
7210  __pyx_v_info->suboffsets = NULL;
7211 
7212  /* "View.MemoryView":199
7213  * info.strides = self._strides
7214  * info.suboffsets = NULL
7215  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
7216  * info.readonly = 0
7217  *
7218  */
7219  __pyx_t_5 = __pyx_v_self->itemsize;
7220  __pyx_v_info->itemsize = __pyx_t_5;
7221 
7222  /* "View.MemoryView":200
7223  * info.suboffsets = NULL
7224  * info.itemsize = self.itemsize
7225  * info.readonly = 0 # <<<<<<<<<<<<<<
7226  *
7227  * if flags & PyBUF_FORMAT:
7228  */
7229  __pyx_v_info->readonly = 0;
7230 
7231  /* "View.MemoryView":202
7232  * info.readonly = 0
7233  *
7234  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7235  * info.format = self.format
7236  * else:
7237  */
7238  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7239  if (__pyx_t_1) {
7240 
7241  /* "View.MemoryView":203
7242  *
7243  * if flags & PyBUF_FORMAT:
7244  * info.format = self.format # <<<<<<<<<<<<<<
7245  * else:
7246  * info.format = NULL
7247  */
7248  __pyx_t_4 = __pyx_v_self->format;
7249  __pyx_v_info->format = __pyx_t_4;
7250 
7251  /* "View.MemoryView":202
7252  * info.readonly = 0
7253  *
7254  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7255  * info.format = self.format
7256  * else:
7257  */
7258  goto __pyx_L5;
7259  }
7260 
7261  /* "View.MemoryView":205
7262  * info.format = self.format
7263  * else:
7264  * info.format = NULL # <<<<<<<<<<<<<<
7265  *
7266  * info.obj = self
7267  */
7268  /*else*/ {
7269  __pyx_v_info->format = NULL;
7270  }
7271  __pyx_L5:;
7272 
7273  /* "View.MemoryView":207
7274  * info.format = NULL
7275  *
7276  * info.obj = self # <<<<<<<<<<<<<<
7277  *
7278  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
7279  */
7280  __Pyx_INCREF(((PyObject *)__pyx_v_self));
7281  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7282  __Pyx_GOTREF(__pyx_v_info->obj);
7283  __Pyx_DECREF(__pyx_v_info->obj);
7284  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
7285 
7286  /* "View.MemoryView":185
7287  *
7288  * @cname('getbuffer')
7289  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
7290  * cdef int bufmode = -1
7291  * if self.mode == u"c":
7292  */
7293 
7294  /* function exit code */
7295  __pyx_r = 0;
7296  goto __pyx_L0;
7297  __pyx_L1_error:;
7298  __Pyx_XDECREF(__pyx_t_3);
7299  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7300  __pyx_r = -1;
7301  if (__pyx_v_info->obj != NULL) {
7302  __Pyx_GOTREF(__pyx_v_info->obj);
7303  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7304  }
7305  goto __pyx_L2;
7306  __pyx_L0:;
7307  if (__pyx_v_info->obj == Py_None) {
7308  __Pyx_GOTREF(__pyx_v_info->obj);
7309  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7310  }
7311  __pyx_L2:;
7312  __Pyx_RefNannyFinishContext();
7313  return __pyx_r;
7314 }
7315 
7316 /* "View.MemoryView":211
7317  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
7318  *
7319  * def __dealloc__(array self): # <<<<<<<<<<<<<<
7320  * if self.callback_free_data != NULL:
7321  * self.callback_free_data(self.data)
7322  */
7323 
7324 /* Python wrapper */
7325 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
7326 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
7327  __Pyx_RefNannyDeclarations
7328  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
7329  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
7330 
7331  /* function exit code */
7332  __Pyx_RefNannyFinishContext();
7333 }
7334 
7335 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
7336  __Pyx_RefNannyDeclarations
7337  int __pyx_t_1;
7338  __Pyx_RefNannySetupContext("__dealloc__", 0);
7339 
7340  /* "View.MemoryView":212
7341  *
7342  * def __dealloc__(array self):
7343  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
7344  * self.callback_free_data(self.data)
7345  * elif self.free_data:
7346  */
7347  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
7348  if (__pyx_t_1) {
7349 
7350  /* "View.MemoryView":213
7351  * def __dealloc__(array self):
7352  * if self.callback_free_data != NULL:
7353  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
7354  * elif self.free_data:
7355  * if self.dtype_is_object:
7356  */
7357  __pyx_v_self->callback_free_data(__pyx_v_self->data);
7358 
7359  /* "View.MemoryView":212
7360  *
7361  * def __dealloc__(array self):
7362  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
7363  * self.callback_free_data(self.data)
7364  * elif self.free_data:
7365  */
7366  goto __pyx_L3;
7367  }
7368 
7369  /* "View.MemoryView":214
7370  * if self.callback_free_data != NULL:
7371  * self.callback_free_data(self.data)
7372  * elif self.free_data: # <<<<<<<<<<<<<<
7373  * if self.dtype_is_object:
7374  * refcount_objects_in_slice(self.data, self._shape,
7375  */
7376  __pyx_t_1 = (__pyx_v_self->free_data != 0);
7377  if (__pyx_t_1) {
7378 
7379  /* "View.MemoryView":215
7380  * self.callback_free_data(self.data)
7381  * elif self.free_data:
7382  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7383  * refcount_objects_in_slice(self.data, self._shape,
7384  * self._strides, self.ndim, False)
7385  */
7386  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
7387  if (__pyx_t_1) {
7388 
7389  /* "View.MemoryView":216
7390  * elif self.free_data:
7391  * if self.dtype_is_object:
7392  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
7393  * self._strides, self.ndim, False)
7394  * free(self.data)
7395  */
7396  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
7397 
7398  /* "View.MemoryView":215
7399  * self.callback_free_data(self.data)
7400  * elif self.free_data:
7401  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7402  * refcount_objects_in_slice(self.data, self._shape,
7403  * self._strides, self.ndim, False)
7404  */
7405  }
7406 
7407  /* "View.MemoryView":218
7408  * refcount_objects_in_slice(self.data, self._shape,
7409  * self._strides, self.ndim, False)
7410  * free(self.data) # <<<<<<<<<<<<<<
7411  * PyObject_Free(self._shape)
7412  *
7413  */
7414  free(__pyx_v_self->data);
7415 
7416  /* "View.MemoryView":214
7417  * if self.callback_free_data != NULL:
7418  * self.callback_free_data(self.data)
7419  * elif self.free_data: # <<<<<<<<<<<<<<
7420  * if self.dtype_is_object:
7421  * refcount_objects_in_slice(self.data, self._shape,
7422  */
7423  }
7424  __pyx_L3:;
7425 
7426  /* "View.MemoryView":219
7427  * self._strides, self.ndim, False)
7428  * free(self.data)
7429  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
7430  *
7431  * @property
7432  */
7433  PyObject_Free(__pyx_v_self->_shape);
7434 
7435  /* "View.MemoryView":211
7436  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
7437  *
7438  * def __dealloc__(array self): # <<<<<<<<<<<<<<
7439  * if self.callback_free_data != NULL:
7440  * self.callback_free_data(self.data)
7441  */
7442 
7443  /* function exit code */
7444  __Pyx_RefNannyFinishContext();
7445 }
7446 
7447 /* "View.MemoryView":222
7448  *
7449  * @property
7450  * def memview(self): # <<<<<<<<<<<<<<
7451  * return self.get_memview()
7452  *
7453  */
7454 
7455 /* Python wrapper */
7456 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
7457 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
7458  PyObject *__pyx_r = 0;
7459  __Pyx_RefNannyDeclarations
7460  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
7461  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
7462 
7463  /* function exit code */
7464  __Pyx_RefNannyFinishContext();
7465  return __pyx_r;
7466 }
7467 
7468 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
7469  PyObject *__pyx_r = NULL;
7470  __Pyx_RefNannyDeclarations
7471  PyObject *__pyx_t_1 = NULL;
7472  int __pyx_lineno = 0;
7473  const char *__pyx_filename = NULL;
7474  int __pyx_clineno = 0;
7475  __Pyx_RefNannySetupContext("__get__", 0);
7476 
7477  /* "View.MemoryView":223
7478  * @property
7479  * def memview(self):
7480  * return self.get_memview() # <<<<<<<<<<<<<<
7481  *
7482  * @cname('get_memview')
7483  */
7484  __Pyx_XDECREF(__pyx_r);
7485  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
7486  __Pyx_GOTREF(__pyx_t_1);
7487  __pyx_r = __pyx_t_1;
7488  __pyx_t_1 = 0;
7489  goto __pyx_L0;
7490 
7491  /* "View.MemoryView":222
7492  *
7493  * @property
7494  * def memview(self): # <<<<<<<<<<<<<<
7495  * return self.get_memview()
7496  *
7497  */
7498 
7499  /* function exit code */
7500  __pyx_L1_error:;
7501  __Pyx_XDECREF(__pyx_t_1);
7502  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7503  __pyx_r = NULL;
7504  __pyx_L0:;
7505  __Pyx_XGIVEREF(__pyx_r);
7506  __Pyx_RefNannyFinishContext();
7507  return __pyx_r;
7508 }
7509 
7510 /* "View.MemoryView":226
7511  *
7512  * @cname('get_memview')
7513  * cdef get_memview(self): # <<<<<<<<<<<<<<
7514  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7515  * return memoryview(self, flags, self.dtype_is_object)
7516  */
7517 
7518 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
7519  int __pyx_v_flags;
7520  PyObject *__pyx_r = NULL;
7521  __Pyx_RefNannyDeclarations
7522  PyObject *__pyx_t_1 = NULL;
7523  PyObject *__pyx_t_2 = NULL;
7524  PyObject *__pyx_t_3 = NULL;
7525  int __pyx_lineno = 0;
7526  const char *__pyx_filename = NULL;
7527  int __pyx_clineno = 0;
7528  __Pyx_RefNannySetupContext("get_memview", 0);
7529 
7530  /* "View.MemoryView":227
7531  * @cname('get_memview')
7532  * cdef get_memview(self):
7533  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
7534  * return memoryview(self, flags, self.dtype_is_object)
7535  *
7536  */
7537  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
7538 
7539  /* "View.MemoryView":228
7540  * cdef get_memview(self):
7541  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7542  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
7543  *
7544  * def __len__(self):
7545  */
7546  __Pyx_XDECREF(__pyx_r);
7547  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
7548  __Pyx_GOTREF(__pyx_t_1);
7549  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
7550  __Pyx_GOTREF(__pyx_t_2);
7551  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
7552  __Pyx_GOTREF(__pyx_t_3);
7553  __Pyx_INCREF(((PyObject *)__pyx_v_self));
7554  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7555  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
7556  __Pyx_GIVEREF(__pyx_t_1);
7557  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
7558  __Pyx_GIVEREF(__pyx_t_2);
7559  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
7560  __pyx_t_1 = 0;
7561  __pyx_t_2 = 0;
7562  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
7563  __Pyx_GOTREF(__pyx_t_2);
7564  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7565  __pyx_r = __pyx_t_2;
7566  __pyx_t_2 = 0;
7567  goto __pyx_L0;
7568 
7569  /* "View.MemoryView":226
7570  *
7571  * @cname('get_memview')
7572  * cdef get_memview(self): # <<<<<<<<<<<<<<
7573  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
7574  * return memoryview(self, flags, self.dtype_is_object)
7575  */
7576 
7577  /* function exit code */
7578  __pyx_L1_error:;
7579  __Pyx_XDECREF(__pyx_t_1);
7580  __Pyx_XDECREF(__pyx_t_2);
7581  __Pyx_XDECREF(__pyx_t_3);
7582  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
7583  __pyx_r = 0;
7584  __pyx_L0:;
7585  __Pyx_XGIVEREF(__pyx_r);
7586  __Pyx_RefNannyFinishContext();
7587  return __pyx_r;
7588 }
7589 
7590 /* "View.MemoryView":230
7591  * return memoryview(self, flags, self.dtype_is_object)
7592  *
7593  * def __len__(self): # <<<<<<<<<<<<<<
7594  * return self._shape[0]
7595  *
7596  */
7597 
7598 /* Python wrapper */
7599 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
7600 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
7601  Py_ssize_t __pyx_r;
7602  __Pyx_RefNannyDeclarations
7603  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
7604  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
7605 
7606  /* function exit code */
7607  __Pyx_RefNannyFinishContext();
7608  return __pyx_r;
7609 }
7610 
7611 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
7612  Py_ssize_t __pyx_r;
7613  __Pyx_RefNannyDeclarations
7614  __Pyx_RefNannySetupContext("__len__", 0);
7615 
7616  /* "View.MemoryView":231
7617  *
7618  * def __len__(self):
7619  * return self._shape[0] # <<<<<<<<<<<<<<
7620  *
7621  * def __getattr__(self, attr):
7622  */
7623  __pyx_r = (__pyx_v_self->_shape[0]);
7624  goto __pyx_L0;
7625 
7626  /* "View.MemoryView":230
7627  * return memoryview(self, flags, self.dtype_is_object)
7628  *
7629  * def __len__(self): # <<<<<<<<<<<<<<
7630  * return self._shape[0]
7631  *
7632  */
7633 
7634  /* function exit code */
7635  __pyx_L0:;
7636  __Pyx_RefNannyFinishContext();
7637  return __pyx_r;
7638 }
7639 
7640 /* "View.MemoryView":233
7641  * return self._shape[0]
7642  *
7643  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
7644  * return getattr(self.memview, attr)
7645  *
7646  */
7647 
7648 /* Python wrapper */
7649 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
7650 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
7651  PyObject *__pyx_r = 0;
7652  __Pyx_RefNannyDeclarations
7653  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
7654  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
7655 
7656  /* function exit code */
7657  __Pyx_RefNannyFinishContext();
7658  return __pyx_r;
7659 }
7660 
7661 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
7662  PyObject *__pyx_r = NULL;
7663  __Pyx_RefNannyDeclarations
7664  PyObject *__pyx_t_1 = NULL;
7665  PyObject *__pyx_t_2 = NULL;
7666  int __pyx_lineno = 0;
7667  const char *__pyx_filename = NULL;
7668  int __pyx_clineno = 0;
7669  __Pyx_RefNannySetupContext("__getattr__", 0);
7670 
7671  /* "View.MemoryView":234
7672  *
7673  * def __getattr__(self, attr):
7674  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
7675  *
7676  * def __getitem__(self, item):
7677  */
7678  __Pyx_XDECREF(__pyx_r);
7679  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
7680  __Pyx_GOTREF(__pyx_t_1);
7681  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
7682  __Pyx_GOTREF(__pyx_t_2);
7683  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7684  __pyx_r = __pyx_t_2;
7685  __pyx_t_2 = 0;
7686  goto __pyx_L0;
7687 
7688  /* "View.MemoryView":233
7689  * return self._shape[0]
7690  *
7691  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
7692  * return getattr(self.memview, attr)
7693  *
7694  */
7695 
7696  /* function exit code */
7697  __pyx_L1_error:;
7698  __Pyx_XDECREF(__pyx_t_1);
7699  __Pyx_XDECREF(__pyx_t_2);
7700  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7701  __pyx_r = NULL;
7702  __pyx_L0:;
7703  __Pyx_XGIVEREF(__pyx_r);
7704  __Pyx_RefNannyFinishContext();
7705  return __pyx_r;
7706 }
7707 
7708 /* "View.MemoryView":236
7709  * return getattr(self.memview, attr)
7710  *
7711  * def __getitem__(self, item): # <<<<<<<<<<<<<<
7712  * return self.memview[item]
7713  *
7714  */
7715 
7716 /* Python wrapper */
7717 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
7718 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
7719  PyObject *__pyx_r = 0;
7720  __Pyx_RefNannyDeclarations
7721  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
7722  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
7723 
7724  /* function exit code */
7725  __Pyx_RefNannyFinishContext();
7726  return __pyx_r;
7727 }
7728 
7729 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
7730  PyObject *__pyx_r = NULL;
7731  __Pyx_RefNannyDeclarations
7732  PyObject *__pyx_t_1 = NULL;
7733  PyObject *__pyx_t_2 = NULL;
7734  int __pyx_lineno = 0;
7735  const char *__pyx_filename = NULL;
7736  int __pyx_clineno = 0;
7737  __Pyx_RefNannySetupContext("__getitem__", 0);
7738 
7739  /* "View.MemoryView":237
7740  *
7741  * def __getitem__(self, item):
7742  * return self.memview[item] # <<<<<<<<<<<<<<
7743  *
7744  * def __setitem__(self, item, value):
7745  */
7746  __Pyx_XDECREF(__pyx_r);
7747  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
7748  __Pyx_GOTREF(__pyx_t_1);
7749  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
7750  __Pyx_GOTREF(__pyx_t_2);
7751  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7752  __pyx_r = __pyx_t_2;
7753  __pyx_t_2 = 0;
7754  goto __pyx_L0;
7755 
7756  /* "View.MemoryView":236
7757  * return getattr(self.memview, attr)
7758  *
7759  * def __getitem__(self, item): # <<<<<<<<<<<<<<
7760  * return self.memview[item]
7761  *
7762  */
7763 
7764  /* function exit code */
7765  __pyx_L1_error:;
7766  __Pyx_XDECREF(__pyx_t_1);
7767  __Pyx_XDECREF(__pyx_t_2);
7768  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7769  __pyx_r = NULL;
7770  __pyx_L0:;
7771  __Pyx_XGIVEREF(__pyx_r);
7772  __Pyx_RefNannyFinishContext();
7773  return __pyx_r;
7774 }
7775 
7776 /* "View.MemoryView":239
7777  * return self.memview[item]
7778  *
7779  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
7780  * self.memview[item] = value
7781  *
7782  */
7783 
7784 /* Python wrapper */
7785 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
7786 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7787  int __pyx_r;
7788  __Pyx_RefNannyDeclarations
7789  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
7790  __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));
7791 
7792  /* function exit code */
7793  __Pyx_RefNannyFinishContext();
7794  return __pyx_r;
7795 }
7796 
7797 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) {
7798  int __pyx_r;
7799  __Pyx_RefNannyDeclarations
7800  PyObject *__pyx_t_1 = NULL;
7801  int __pyx_lineno = 0;
7802  const char *__pyx_filename = NULL;
7803  int __pyx_clineno = 0;
7804  __Pyx_RefNannySetupContext("__setitem__", 0);
7805 
7806  /* "View.MemoryView":240
7807  *
7808  * def __setitem__(self, item, value):
7809  * self.memview[item] = value # <<<<<<<<<<<<<<
7810  *
7811  *
7812  */
7813  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
7814  __Pyx_GOTREF(__pyx_t_1);
7815  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
7816  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7817 
7818  /* "View.MemoryView":239
7819  * return self.memview[item]
7820  *
7821  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
7822  * self.memview[item] = value
7823  *
7824  */
7825 
7826  /* function exit code */
7827  __pyx_r = 0;
7828  goto __pyx_L0;
7829  __pyx_L1_error:;
7830  __Pyx_XDECREF(__pyx_t_1);
7831  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7832  __pyx_r = -1;
7833  __pyx_L0:;
7834  __Pyx_RefNannyFinishContext();
7835  return __pyx_r;
7836 }
7837 
7838 /* "(tree fragment)":1
7839  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7840  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7841  * def __setstate_cython__(self, __pyx_state):
7842  */
7843 
7844 /* Python wrapper */
7845 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7846 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7847  PyObject *__pyx_r = 0;
7848  __Pyx_RefNannyDeclarations
7849  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7850  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
7851 
7852  /* function exit code */
7853  __Pyx_RefNannyFinishContext();
7854  return __pyx_r;
7855 }
7856 
7857 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
7858  PyObject *__pyx_r = NULL;
7859  __Pyx_RefNannyDeclarations
7860  PyObject *__pyx_t_1 = NULL;
7861  int __pyx_lineno = 0;
7862  const char *__pyx_filename = NULL;
7863  int __pyx_clineno = 0;
7864  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
7865 
7866  /* "(tree fragment)":2
7867  * def __reduce_cython__(self):
7868  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
7869  * def __setstate_cython__(self, __pyx_state):
7870  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7871  */
7872  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
7873  __Pyx_GOTREF(__pyx_t_1);
7874  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7875  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7876  __PYX_ERR(0, 2, __pyx_L1_error)
7877 
7878  /* "(tree fragment)":1
7879  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7880  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7881  * def __setstate_cython__(self, __pyx_state):
7882  */
7883 
7884  /* function exit code */
7885  __pyx_L1_error:;
7886  __Pyx_XDECREF(__pyx_t_1);
7887  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7888  __pyx_r = NULL;
7889  __Pyx_XGIVEREF(__pyx_r);
7890  __Pyx_RefNannyFinishContext();
7891  return __pyx_r;
7892 }
7893 
7894 /* "(tree fragment)":3
7895  * def __reduce_cython__(self):
7896  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7897  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7898  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7899  */
7900 
7901 /* Python wrapper */
7902 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
7903 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7904  PyObject *__pyx_r = 0;
7905  __Pyx_RefNannyDeclarations
7906  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7907  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7908 
7909  /* function exit code */
7910  __Pyx_RefNannyFinishContext();
7911  return __pyx_r;
7912 }
7913 
7914 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) {
7915  PyObject *__pyx_r = NULL;
7916  __Pyx_RefNannyDeclarations
7917  PyObject *__pyx_t_1 = NULL;
7918  int __pyx_lineno = 0;
7919  const char *__pyx_filename = NULL;
7920  int __pyx_clineno = 0;
7921  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
7922 
7923  /* "(tree fragment)":4
7924  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7925  * def __setstate_cython__(self, __pyx_state):
7926  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
7927  */
7928  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
7929  __Pyx_GOTREF(__pyx_t_1);
7930  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7931  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7932  __PYX_ERR(0, 4, __pyx_L1_error)
7933 
7934  /* "(tree fragment)":3
7935  * def __reduce_cython__(self):
7936  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7937  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7938  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
7939  */
7940 
7941  /* function exit code */
7942  __pyx_L1_error:;
7943  __Pyx_XDECREF(__pyx_t_1);
7944  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7945  __pyx_r = NULL;
7946  __Pyx_XGIVEREF(__pyx_r);
7947  __Pyx_RefNannyFinishContext();
7948  return __pyx_r;
7949 }
7950 
7951 /* "View.MemoryView":244
7952  *
7953  * @cname("__pyx_array_new")
7954  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
7955  * char *mode, char *buf):
7956  * cdef array result
7957  */
7958 
7959 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) {
7960  struct __pyx_array_obj *__pyx_v_result = 0;
7961  struct __pyx_array_obj *__pyx_r = NULL;
7962  __Pyx_RefNannyDeclarations
7963  int __pyx_t_1;
7964  PyObject *__pyx_t_2 = NULL;
7965  PyObject *__pyx_t_3 = NULL;
7966  PyObject *__pyx_t_4 = NULL;
7967  PyObject *__pyx_t_5 = NULL;
7968  int __pyx_lineno = 0;
7969  const char *__pyx_filename = NULL;
7970  int __pyx_clineno = 0;
7971  __Pyx_RefNannySetupContext("array_cwrapper", 0);
7972 
7973  /* "View.MemoryView":248
7974  * cdef array result
7975  *
7976  * if buf == NULL: # <<<<<<<<<<<<<<
7977  * result = array(shape, itemsize, format, mode.decode('ASCII'))
7978  * else:
7979  */
7980  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
7981  if (__pyx_t_1) {
7982 
7983  /* "View.MemoryView":249
7984  *
7985  * if buf == NULL:
7986  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
7987  * else:
7988  * result = array(shape, itemsize, format, mode.decode('ASCII'),
7989  */
7990  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
7991  __Pyx_GOTREF(__pyx_t_2);
7992  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
7993  __Pyx_GOTREF(__pyx_t_3);
7994  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
7995  __Pyx_GOTREF(__pyx_t_4);
7996  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error)
7997  __Pyx_GOTREF(__pyx_t_5);
7998  __Pyx_INCREF(__pyx_v_shape);
7999  __Pyx_GIVEREF(__pyx_v_shape);
8000  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
8001  __Pyx_GIVEREF(__pyx_t_2);
8002  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8003  __Pyx_GIVEREF(__pyx_t_3);
8004  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
8005  __Pyx_GIVEREF(__pyx_t_4);
8006  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
8007  __pyx_t_2 = 0;
8008  __pyx_t_3 = 0;
8009  __pyx_t_4 = 0;
8010  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
8011  __Pyx_GOTREF(__pyx_t_4);
8012  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8013  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
8014  __pyx_t_4 = 0;
8015 
8016  /* "View.MemoryView":248
8017  * cdef array result
8018  *
8019  * if buf == NULL: # <<<<<<<<<<<<<<
8020  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8021  * else:
8022  */
8023  goto __pyx_L3;
8024  }
8025 
8026  /* "View.MemoryView":251
8027  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8028  * else:
8029  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
8030  * allocate_buffer=False)
8031  * result.data = buf
8032  */
8033  /*else*/ {
8034  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
8035  __Pyx_GOTREF(__pyx_t_4);
8036  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error)
8037  __Pyx_GOTREF(__pyx_t_5);
8038  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
8039  __Pyx_GOTREF(__pyx_t_3);
8040  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
8041  __Pyx_GOTREF(__pyx_t_2);
8042  __Pyx_INCREF(__pyx_v_shape);
8043  __Pyx_GIVEREF(__pyx_v_shape);
8044  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
8045  __Pyx_GIVEREF(__pyx_t_4);
8046  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
8047  __Pyx_GIVEREF(__pyx_t_5);
8048  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
8049  __Pyx_GIVEREF(__pyx_t_3);
8050  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
8051  __pyx_t_4 = 0;
8052  __pyx_t_5 = 0;
8053  __pyx_t_3 = 0;
8054 
8055  /* "View.MemoryView":252
8056  * else:
8057  * result = array(shape, itemsize, format, mode.decode('ASCII'),
8058  * allocate_buffer=False) # <<<<<<<<<<<<<<
8059  * result.data = buf
8060  *
8061  */
8062  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
8063  __Pyx_GOTREF(__pyx_t_3);
8064  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
8065 
8066  /* "View.MemoryView":251
8067  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8068  * else:
8069  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
8070  * allocate_buffer=False)
8071  * result.data = buf
8072  */
8073  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error)
8074  __Pyx_GOTREF(__pyx_t_5);
8075  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8076  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8077  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
8078  __pyx_t_5 = 0;
8079 
8080  /* "View.MemoryView":253
8081  * result = array(shape, itemsize, format, mode.decode('ASCII'),
8082  * allocate_buffer=False)
8083  * result.data = buf # <<<<<<<<<<<<<<
8084  *
8085  * return result
8086  */
8087  __pyx_v_result->data = __pyx_v_buf;
8088  }
8089  __pyx_L3:;
8090 
8091  /* "View.MemoryView":255
8092  * result.data = buf
8093  *
8094  * return result # <<<<<<<<<<<<<<
8095  *
8096  *
8097  */
8098  __Pyx_XDECREF(((PyObject *)__pyx_r));
8099  __Pyx_INCREF(((PyObject *)__pyx_v_result));
8100  __pyx_r = __pyx_v_result;
8101  goto __pyx_L0;
8102 
8103  /* "View.MemoryView":244
8104  *
8105  * @cname("__pyx_array_new")
8106  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
8107  * char *mode, char *buf):
8108  * cdef array result
8109  */
8110 
8111  /* function exit code */
8112  __pyx_L1_error:;
8113  __Pyx_XDECREF(__pyx_t_2);
8114  __Pyx_XDECREF(__pyx_t_3);
8115  __Pyx_XDECREF(__pyx_t_4);
8116  __Pyx_XDECREF(__pyx_t_5);
8117  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
8118  __pyx_r = 0;
8119  __pyx_L0:;
8120  __Pyx_XDECREF((PyObject *)__pyx_v_result);
8121  __Pyx_XGIVEREF((PyObject *)__pyx_r);
8122  __Pyx_RefNannyFinishContext();
8123  return __pyx_r;
8124 }
8125 
8126 /* "View.MemoryView":281
8127  * cdef class Enum(object):
8128  * cdef object name
8129  * def __init__(self, name): # <<<<<<<<<<<<<<
8130  * self.name = name
8131  * def __repr__(self):
8132  */
8133 
8134 /* Python wrapper */
8135 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8136 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8137  PyObject *__pyx_v_name = 0;
8138  int __pyx_lineno = 0;
8139  const char *__pyx_filename = NULL;
8140  int __pyx_clineno = 0;
8141  int __pyx_r;
8142  __Pyx_RefNannyDeclarations
8143  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
8144  {
8145  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
8146  PyObject* values[1] = {0};
8147  if (unlikely(__pyx_kwds)) {
8148  Py_ssize_t kw_args;
8149  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8150  switch (pos_args) {
8151  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8152  CYTHON_FALLTHROUGH;
8153  case 0: break;
8154  default: goto __pyx_L5_argtuple_error;
8155  }
8156  kw_args = PyDict_Size(__pyx_kwds);
8157  switch (pos_args) {
8158  case 0:
8159  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
8160  else goto __pyx_L5_argtuple_error;
8161  }
8162  if (unlikely(kw_args > 0)) {
8163  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 281, __pyx_L3_error)
8164  }
8165  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
8166  goto __pyx_L5_argtuple_error;
8167  } else {
8168  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8169  }
8170  __pyx_v_name = values[0];
8171  }
8172  goto __pyx_L4_argument_unpacking_done;
8173  __pyx_L5_argtuple_error:;
8174  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 281, __pyx_L3_error)
8175  __pyx_L3_error:;
8176  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8177  __Pyx_RefNannyFinishContext();
8178  return -1;
8179  __pyx_L4_argument_unpacking_done:;
8180  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
8181 
8182  /* function exit code */
8183  __Pyx_RefNannyFinishContext();
8184  return __pyx_r;
8185 }
8186 
8187 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
8188  int __pyx_r;
8189  __Pyx_RefNannyDeclarations
8190  __Pyx_RefNannySetupContext("__init__", 0);
8191 
8192  /* "View.MemoryView":282
8193  * cdef object name
8194  * def __init__(self, name):
8195  * self.name = name # <<<<<<<<<<<<<<
8196  * def __repr__(self):
8197  * return self.name
8198  */
8199  __Pyx_INCREF(__pyx_v_name);
8200  __Pyx_GIVEREF(__pyx_v_name);
8201  __Pyx_GOTREF(__pyx_v_self->name);
8202  __Pyx_DECREF(__pyx_v_self->name);
8203  __pyx_v_self->name = __pyx_v_name;
8204 
8205  /* "View.MemoryView":281
8206  * cdef class Enum(object):
8207  * cdef object name
8208  * def __init__(self, name): # <<<<<<<<<<<<<<
8209  * self.name = name
8210  * def __repr__(self):
8211  */
8212 
8213  /* function exit code */
8214  __pyx_r = 0;
8215  __Pyx_RefNannyFinishContext();
8216  return __pyx_r;
8217 }
8218 
8219 /* "View.MemoryView":283
8220  * def __init__(self, name):
8221  * self.name = name
8222  * def __repr__(self): # <<<<<<<<<<<<<<
8223  * return self.name
8224  *
8225  */
8226 
8227 /* Python wrapper */
8228 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
8229 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
8230  PyObject *__pyx_r = 0;
8231  __Pyx_RefNannyDeclarations
8232  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
8233  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8234 
8235  /* function exit code */
8236  __Pyx_RefNannyFinishContext();
8237  return __pyx_r;
8238 }
8239 
8240 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8241  PyObject *__pyx_r = NULL;
8242  __Pyx_RefNannyDeclarations
8243  __Pyx_RefNannySetupContext("__repr__", 0);
8244 
8245  /* "View.MemoryView":284
8246  * self.name = name
8247  * def __repr__(self):
8248  * return self.name # <<<<<<<<<<<<<<
8249  *
8250  * cdef generic = Enum("<strided and direct or indirect>")
8251  */
8252  __Pyx_XDECREF(__pyx_r);
8253  __Pyx_INCREF(__pyx_v_self->name);
8254  __pyx_r = __pyx_v_self->name;
8255  goto __pyx_L0;
8256 
8257  /* "View.MemoryView":283
8258  * def __init__(self, name):
8259  * self.name = name
8260  * def __repr__(self): # <<<<<<<<<<<<<<
8261  * return self.name
8262  *
8263  */
8264 
8265  /* function exit code */
8266  __pyx_L0:;
8267  __Pyx_XGIVEREF(__pyx_r);
8268  __Pyx_RefNannyFinishContext();
8269  return __pyx_r;
8270 }
8271 
8272 /* "(tree fragment)":1
8273  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8274  * cdef tuple state
8275  * cdef object _dict
8276  */
8277 
8278 /* Python wrapper */
8279 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
8280 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8281  PyObject *__pyx_r = 0;
8282  __Pyx_RefNannyDeclarations
8283  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
8284  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8285 
8286  /* function exit code */
8287  __Pyx_RefNannyFinishContext();
8288  return __pyx_r;
8289 }
8290 
8291 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8292  PyObject *__pyx_v_state = 0;
8293  PyObject *__pyx_v__dict = 0;
8294  int __pyx_v_use_setstate;
8295  PyObject *__pyx_r = NULL;
8296  __Pyx_RefNannyDeclarations
8297  PyObject *__pyx_t_1 = NULL;
8298  int __pyx_t_2;
8299  int __pyx_t_3;
8300  PyObject *__pyx_t_4 = NULL;
8301  PyObject *__pyx_t_5 = NULL;
8302  int __pyx_lineno = 0;
8303  const char *__pyx_filename = NULL;
8304  int __pyx_clineno = 0;
8305  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
8306 
8307  /* "(tree fragment)":5
8308  * cdef object _dict
8309  * cdef bint use_setstate
8310  * state = (self.name,) # <<<<<<<<<<<<<<
8311  * _dict = getattr(self, '__dict__', None)
8312  * if _dict is not None:
8313  */
8314  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
8315  __Pyx_GOTREF(__pyx_t_1);
8316  __Pyx_INCREF(__pyx_v_self->name);
8317  __Pyx_GIVEREF(__pyx_v_self->name);
8318  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
8319  __pyx_v_state = ((PyObject*)__pyx_t_1);
8320  __pyx_t_1 = 0;
8321 
8322  /* "(tree fragment)":6
8323  * cdef bint use_setstate
8324  * state = (self.name,)
8325  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
8326  * if _dict is not None:
8327  * state += (_dict,)
8328  */
8329  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
8330  __Pyx_GOTREF(__pyx_t_1);
8331  __pyx_v__dict = __pyx_t_1;
8332  __pyx_t_1 = 0;
8333 
8334  /* "(tree fragment)":7
8335  * state = (self.name,)
8336  * _dict = getattr(self, '__dict__', None)
8337  * if _dict is not None: # <<<<<<<<<<<<<<
8338  * state += (_dict,)
8339  * use_setstate = True
8340  */
8341  __pyx_t_2 = (__pyx_v__dict != Py_None);
8342  __pyx_t_3 = (__pyx_t_2 != 0);
8343  if (__pyx_t_3) {
8344 
8345  /* "(tree fragment)":8
8346  * _dict = getattr(self, '__dict__', None)
8347  * if _dict is not None:
8348  * state += (_dict,) # <<<<<<<<<<<<<<
8349  * use_setstate = True
8350  * else:
8351  */
8352  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
8353  __Pyx_GOTREF(__pyx_t_1);
8354  __Pyx_INCREF(__pyx_v__dict);
8355  __Pyx_GIVEREF(__pyx_v__dict);
8356  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
8357  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error)
8358  __Pyx_GOTREF(__pyx_t_4);
8359  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8360  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
8361  __pyx_t_4 = 0;
8362 
8363  /* "(tree fragment)":9
8364  * if _dict is not None:
8365  * state += (_dict,)
8366  * use_setstate = True # <<<<<<<<<<<<<<
8367  * else:
8368  * use_setstate = self.name is not None
8369  */
8370  __pyx_v_use_setstate = 1;
8371 
8372  /* "(tree fragment)":7
8373  * state = (self.name,)
8374  * _dict = getattr(self, '__dict__', None)
8375  * if _dict is not None: # <<<<<<<<<<<<<<
8376  * state += (_dict,)
8377  * use_setstate = True
8378  */
8379  goto __pyx_L3;
8380  }
8381 
8382  /* "(tree fragment)":11
8383  * use_setstate = True
8384  * else:
8385  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
8386  * if use_setstate:
8387  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
8388  */
8389  /*else*/ {
8390  __pyx_t_3 = (__pyx_v_self->name != Py_None);
8391  __pyx_v_use_setstate = __pyx_t_3;
8392  }
8393  __pyx_L3:;
8394 
8395  /* "(tree fragment)":12
8396  * else:
8397  * use_setstate = self.name is not None
8398  * if use_setstate: # <<<<<<<<<<<<<<
8399  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
8400  * else:
8401  */
8402  __pyx_t_3 = (__pyx_v_use_setstate != 0);
8403  if (__pyx_t_3) {
8404 
8405  /* "(tree fragment)":13
8406  * use_setstate = self.name is not None
8407  * if use_setstate:
8408  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
8409  * else:
8410  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8411  */
8412  __Pyx_XDECREF(__pyx_r);
8413  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error)
8414  __Pyx_GOTREF(__pyx_t_4);
8415  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
8416  __Pyx_GOTREF(__pyx_t_1);
8417  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8418  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8419  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8420  __Pyx_INCREF(__pyx_int_184977713);
8421  __Pyx_GIVEREF(__pyx_int_184977713);
8422  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
8423  __Pyx_INCREF(Py_None);
8424  __Pyx_GIVEREF(Py_None);
8425  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
8426  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error)
8427  __Pyx_GOTREF(__pyx_t_5);
8428  __Pyx_GIVEREF(__pyx_t_4);
8429  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
8430  __Pyx_GIVEREF(__pyx_t_1);
8431  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
8432  __Pyx_INCREF(__pyx_v_state);
8433  __Pyx_GIVEREF(__pyx_v_state);
8434  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
8435  __pyx_t_4 = 0;
8436  __pyx_t_1 = 0;
8437  __pyx_r = __pyx_t_5;
8438  __pyx_t_5 = 0;
8439  goto __pyx_L0;
8440 
8441  /* "(tree fragment)":12
8442  * else:
8443  * use_setstate = self.name is not None
8444  * if use_setstate: # <<<<<<<<<<<<<<
8445  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
8446  * else:
8447  */
8448  }
8449 
8450  /* "(tree fragment)":15
8451  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
8452  * else:
8453  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
8454  * def __setstate_cython__(self, __pyx_state):
8455  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8456  */
8457  /*else*/ {
8458  __Pyx_XDECREF(__pyx_r);
8459  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 15, __pyx_L1_error)
8460  __Pyx_GOTREF(__pyx_t_5);
8461  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
8462  __Pyx_GOTREF(__pyx_t_1);
8463  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8464  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8465  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8466  __Pyx_INCREF(__pyx_int_184977713);
8467  __Pyx_GIVEREF(__pyx_int_184977713);
8468  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
8469  __Pyx_INCREF(__pyx_v_state);
8470  __Pyx_GIVEREF(__pyx_v_state);
8471  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
8472  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 15, __pyx_L1_error)
8473  __Pyx_GOTREF(__pyx_t_4);
8474  __Pyx_GIVEREF(__pyx_t_5);
8475  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
8476  __Pyx_GIVEREF(__pyx_t_1);
8477  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
8478  __pyx_t_5 = 0;
8479  __pyx_t_1 = 0;
8480  __pyx_r = __pyx_t_4;
8481  __pyx_t_4 = 0;
8482  goto __pyx_L0;
8483  }
8484 
8485  /* "(tree fragment)":1
8486  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8487  * cdef tuple state
8488  * cdef object _dict
8489  */
8490 
8491  /* function exit code */
8492  __pyx_L1_error:;
8493  __Pyx_XDECREF(__pyx_t_1);
8494  __Pyx_XDECREF(__pyx_t_4);
8495  __Pyx_XDECREF(__pyx_t_5);
8496  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8497  __pyx_r = NULL;
8498  __pyx_L0:;
8499  __Pyx_XDECREF(__pyx_v_state);
8500  __Pyx_XDECREF(__pyx_v__dict);
8501  __Pyx_XGIVEREF(__pyx_r);
8502  __Pyx_RefNannyFinishContext();
8503  return __pyx_r;
8504 }
8505 
8506 /* "(tree fragment)":16
8507  * else:
8508  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8509  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8510  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8511  */
8512 
8513 /* Python wrapper */
8514 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
8515 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8516  PyObject *__pyx_r = 0;
8517  __Pyx_RefNannyDeclarations
8518  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
8519  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8520 
8521  /* function exit code */
8522  __Pyx_RefNannyFinishContext();
8523  return __pyx_r;
8524 }
8525 
8526 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8527  PyObject *__pyx_r = NULL;
8528  __Pyx_RefNannyDeclarations
8529  PyObject *__pyx_t_1 = NULL;
8530  int __pyx_lineno = 0;
8531  const char *__pyx_filename = NULL;
8532  int __pyx_clineno = 0;
8533  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
8534 
8535  /* "(tree fragment)":17
8536  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8537  * def __setstate_cython__(self, __pyx_state):
8538  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
8539  */
8540  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 17, __pyx_L1_error)
8541  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
8542  __Pyx_GOTREF(__pyx_t_1);
8543  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8544 
8545  /* "(tree fragment)":16
8546  * else:
8547  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
8548  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8549  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8550  */
8551 
8552  /* function exit code */
8553  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8554  goto __pyx_L0;
8555  __pyx_L1_error:;
8556  __Pyx_XDECREF(__pyx_t_1);
8557  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8558  __pyx_r = NULL;
8559  __pyx_L0:;
8560  __Pyx_XGIVEREF(__pyx_r);
8561  __Pyx_RefNannyFinishContext();
8562  return __pyx_r;
8563 }
8564 
8565 /* "View.MemoryView":298
8566  *
8567  * @cname('__pyx_align_pointer')
8568  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
8569  * "Align pointer memory on a given boundary"
8570  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
8571  */
8572 
8573 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
8574  Py_intptr_t __pyx_v_aligned_p;
8575  size_t __pyx_v_offset;
8576  void *__pyx_r;
8577  int __pyx_t_1;
8578 
8579  /* "View.MemoryView":300
8580  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
8581  * "Align pointer memory on a given boundary"
8582  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
8583  * cdef size_t offset
8584  *
8585  */
8586  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
8587 
8588  /* "View.MemoryView":304
8589  *
8590  * with cython.cdivision(True):
8591  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
8592  *
8593  * if offset > 0:
8594  */
8595  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
8596 
8597  /* "View.MemoryView":306
8598  * offset = aligned_p % alignment
8599  *
8600  * if offset > 0: # <<<<<<<<<<<<<<
8601  * aligned_p += alignment - offset
8602  *
8603  */
8604  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
8605  if (__pyx_t_1) {
8606 
8607  /* "View.MemoryView":307
8608  *
8609  * if offset > 0:
8610  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
8611  *
8612  * return <void *> aligned_p
8613  */
8614  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
8615 
8616  /* "View.MemoryView":306
8617  * offset = aligned_p % alignment
8618  *
8619  * if offset > 0: # <<<<<<<<<<<<<<
8620  * aligned_p += alignment - offset
8621  *
8622  */
8623  }
8624 
8625  /* "View.MemoryView":309
8626  * aligned_p += alignment - offset
8627  *
8628  * return <void *> aligned_p # <<<<<<<<<<<<<<
8629  *
8630  *
8631  */
8632  __pyx_r = ((void *)__pyx_v_aligned_p);
8633  goto __pyx_L0;
8634 
8635  /* "View.MemoryView":298
8636  *
8637  * @cname('__pyx_align_pointer')
8638  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
8639  * "Align pointer memory on a given boundary"
8640  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
8641  */
8642 
8643  /* function exit code */
8644  __pyx_L0:;
8645  return __pyx_r;
8646 }
8647 
8648 /* "View.MemoryView":345
8649  * cdef __Pyx_TypeInfo *typeinfo
8650  *
8651  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
8652  * self.obj = obj
8653  * self.flags = flags
8654  */
8655 
8656 /* Python wrapper */
8657 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8658 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8659  PyObject *__pyx_v_obj = 0;
8660  int __pyx_v_flags;
8661  int __pyx_v_dtype_is_object;
8662  int __pyx_lineno = 0;
8663  const char *__pyx_filename = NULL;
8664  int __pyx_clineno = 0;
8665  int __pyx_r;
8666  __Pyx_RefNannyDeclarations
8667  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8668  {
8669  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
8670  PyObject* values[3] = {0,0,0};
8671  if (unlikely(__pyx_kwds)) {
8672  Py_ssize_t kw_args;
8673  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8674  switch (pos_args) {
8675  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8676  CYTHON_FALLTHROUGH;
8677  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8678  CYTHON_FALLTHROUGH;
8679  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8680  CYTHON_FALLTHROUGH;
8681  case 0: break;
8682  default: goto __pyx_L5_argtuple_error;
8683  }
8684  kw_args = PyDict_Size(__pyx_kwds);
8685  switch (pos_args) {
8686  case 0:
8687  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
8688  else goto __pyx_L5_argtuple_error;
8689  CYTHON_FALLTHROUGH;
8690  case 1:
8691  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
8692  else {
8693  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(0, 345, __pyx_L3_error)
8694  }
8695  CYTHON_FALLTHROUGH;
8696  case 2:
8697  if (kw_args > 0) {
8698  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
8699  if (value) { values[2] = value; kw_args--; }
8700  }
8701  }
8702  if (unlikely(kw_args > 0)) {
8703  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 345, __pyx_L3_error)
8704  }
8705  } else {
8706  switch (PyTuple_GET_SIZE(__pyx_args)) {
8707  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8708  CYTHON_FALLTHROUGH;
8709  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8710  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8711  break;
8712  default: goto __pyx_L5_argtuple_error;
8713  }
8714  }
8715  __pyx_v_obj = values[0];
8716  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error)
8717  if (values[2]) {
8718  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L3_error)
8719  } else {
8720  __pyx_v_dtype_is_object = ((int)0);
8721  }
8722  }
8723  goto __pyx_L4_argument_unpacking_done;
8724  __pyx_L5_argtuple_error:;
8725  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 345, __pyx_L3_error)
8726  __pyx_L3_error:;
8727  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8728  __Pyx_RefNannyFinishContext();
8729  return -1;
8730  __pyx_L4_argument_unpacking_done:;
8731  __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);
8732 
8733  /* function exit code */
8734  __Pyx_RefNannyFinishContext();
8735  return __pyx_r;
8736 }
8737 
8738 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) {
8739  int __pyx_r;
8740  __Pyx_RefNannyDeclarations
8741  int __pyx_t_1;
8742  int __pyx_t_2;
8743  int __pyx_t_3;
8744  int __pyx_t_4;
8745  int __pyx_lineno = 0;
8746  const char *__pyx_filename = NULL;
8747  int __pyx_clineno = 0;
8748  __Pyx_RefNannySetupContext("__cinit__", 0);
8749 
8750  /* "View.MemoryView":346
8751  *
8752  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
8753  * self.obj = obj # <<<<<<<<<<<<<<
8754  * self.flags = flags
8755  * if type(self) is memoryview or obj is not None:
8756  */
8757  __Pyx_INCREF(__pyx_v_obj);
8758  __Pyx_GIVEREF(__pyx_v_obj);
8759  __Pyx_GOTREF(__pyx_v_self->obj);
8760  __Pyx_DECREF(__pyx_v_self->obj);
8761  __pyx_v_self->obj = __pyx_v_obj;
8762 
8763  /* "View.MemoryView":347
8764  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
8765  * self.obj = obj
8766  * self.flags = flags # <<<<<<<<<<<<<<
8767  * if type(self) is memoryview or obj is not None:
8768  * __Pyx_GetBuffer(obj, &self.view, flags)
8769  */
8770  __pyx_v_self->flags = __pyx_v_flags;
8771 
8772  /* "View.MemoryView":348
8773  * self.obj = obj
8774  * self.flags = flags
8775  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
8776  * __Pyx_GetBuffer(obj, &self.view, flags)
8777  * if <PyObject *> self.view.obj == NULL:
8778  */
8779  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
8780  __pyx_t_3 = (__pyx_t_2 != 0);
8781  if (!__pyx_t_3) {
8782  } else {
8783  __pyx_t_1 = __pyx_t_3;
8784  goto __pyx_L4_bool_binop_done;
8785  }
8786  __pyx_t_3 = (__pyx_v_obj != Py_None);
8787  __pyx_t_2 = (__pyx_t_3 != 0);
8788  __pyx_t_1 = __pyx_t_2;
8789  __pyx_L4_bool_binop_done:;
8790  if (__pyx_t_1) {
8791 
8792  /* "View.MemoryView":349
8793  * self.flags = flags
8794  * if type(self) is memoryview or obj is not None:
8795  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
8796  * if <PyObject *> self.view.obj == NULL:
8797  * (<__pyx_buffer *> &self.view).obj = Py_None
8798  */
8799  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 349, __pyx_L1_error)
8800 
8801  /* "View.MemoryView":350
8802  * if type(self) is memoryview or obj is not None:
8803  * __Pyx_GetBuffer(obj, &self.view, flags)
8804  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
8805  * (<__pyx_buffer *> &self.view).obj = Py_None
8806  * Py_INCREF(Py_None)
8807  */
8808  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
8809  if (__pyx_t_1) {
8810 
8811  /* "View.MemoryView":351
8812  * __Pyx_GetBuffer(obj, &self.view, flags)
8813  * if <PyObject *> self.view.obj == NULL:
8814  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
8815  * Py_INCREF(Py_None)
8816  *
8817  */
8818  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
8819 
8820  /* "View.MemoryView":352
8821  * if <PyObject *> self.view.obj == NULL:
8822  * (<__pyx_buffer *> &self.view).obj = Py_None
8823  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
8824  *
8825  * global __pyx_memoryview_thread_locks_used
8826  */
8827  Py_INCREF(Py_None);
8828 
8829  /* "View.MemoryView":350
8830  * if type(self) is memoryview or obj is not None:
8831  * __Pyx_GetBuffer(obj, &self.view, flags)
8832  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
8833  * (<__pyx_buffer *> &self.view).obj = Py_None
8834  * Py_INCREF(Py_None)
8835  */
8836  }
8837 
8838  /* "View.MemoryView":348
8839  * self.obj = obj
8840  * self.flags = flags
8841  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
8842  * __Pyx_GetBuffer(obj, &self.view, flags)
8843  * if <PyObject *> self.view.obj == NULL:
8844  */
8845  }
8846 
8847  /* "View.MemoryView":355
8848  *
8849  * global __pyx_memoryview_thread_locks_used
8850  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
8851  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8852  * __pyx_memoryview_thread_locks_used += 1
8853  */
8854  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
8855  if (__pyx_t_1) {
8856 
8857  /* "View.MemoryView":356
8858  * global __pyx_memoryview_thread_locks_used
8859  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
8860  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
8861  * __pyx_memoryview_thread_locks_used += 1
8862  * if self.lock is NULL:
8863  */
8864  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8865 
8866  /* "View.MemoryView":357
8867  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
8868  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8869  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
8870  * if self.lock is NULL:
8871  * self.lock = PyThread_allocate_lock()
8872  */
8873  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
8874 
8875  /* "View.MemoryView":355
8876  *
8877  * global __pyx_memoryview_thread_locks_used
8878  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
8879  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8880  * __pyx_memoryview_thread_locks_used += 1
8881  */
8882  }
8883 
8884  /* "View.MemoryView":358
8885  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8886  * __pyx_memoryview_thread_locks_used += 1
8887  * if self.lock is NULL: # <<<<<<<<<<<<<<
8888  * self.lock = PyThread_allocate_lock()
8889  * if self.lock is NULL:
8890  */
8891  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
8892  if (__pyx_t_1) {
8893 
8894  /* "View.MemoryView":359
8895  * __pyx_memoryview_thread_locks_used += 1
8896  * if self.lock is NULL:
8897  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
8898  * if self.lock is NULL:
8899  * raise MemoryError
8900  */
8901  __pyx_v_self->lock = PyThread_allocate_lock();
8902 
8903  /* "View.MemoryView":360
8904  * if self.lock is NULL:
8905  * self.lock = PyThread_allocate_lock()
8906  * if self.lock is NULL: # <<<<<<<<<<<<<<
8907  * raise MemoryError
8908  *
8909  */
8910  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
8911  if (unlikely(__pyx_t_1)) {
8912 
8913  /* "View.MemoryView":361
8914  * self.lock = PyThread_allocate_lock()
8915  * if self.lock is NULL:
8916  * raise MemoryError # <<<<<<<<<<<<<<
8917  *
8918  * if flags & PyBUF_FORMAT:
8919  */
8920  PyErr_NoMemory(); __PYX_ERR(0, 361, __pyx_L1_error)
8921 
8922  /* "View.MemoryView":360
8923  * if self.lock is NULL:
8924  * self.lock = PyThread_allocate_lock()
8925  * if self.lock is NULL: # <<<<<<<<<<<<<<
8926  * raise MemoryError
8927  *
8928  */
8929  }
8930 
8931  /* "View.MemoryView":358
8932  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8933  * __pyx_memoryview_thread_locks_used += 1
8934  * if self.lock is NULL: # <<<<<<<<<<<<<<
8935  * self.lock = PyThread_allocate_lock()
8936  * if self.lock is NULL:
8937  */
8938  }
8939 
8940  /* "View.MemoryView":363
8941  * raise MemoryError
8942  *
8943  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8944  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8945  * else:
8946  */
8947  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8948  if (__pyx_t_1) {
8949 
8950  /* "View.MemoryView":364
8951  *
8952  * if flags & PyBUF_FORMAT:
8953  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
8954  * else:
8955  * self.dtype_is_object = dtype_is_object
8956  */
8957  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
8958  if (__pyx_t_2) {
8959  } else {
8960  __pyx_t_1 = __pyx_t_2;
8961  goto __pyx_L11_bool_binop_done;
8962  }
8963  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
8964  __pyx_t_1 = __pyx_t_2;
8965  __pyx_L11_bool_binop_done:;
8966  __pyx_v_self->dtype_is_object = __pyx_t_1;
8967 
8968  /* "View.MemoryView":363
8969  * raise MemoryError
8970  *
8971  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8972  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8973  * else:
8974  */
8975  goto __pyx_L10;
8976  }
8977 
8978  /* "View.MemoryView":366
8979  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8980  * else:
8981  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
8982  *
8983  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
8984  */
8985  /*else*/ {
8986  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
8987  }
8988  __pyx_L10:;
8989 
8990  /* "View.MemoryView":368
8991  * self.dtype_is_object = dtype_is_object
8992  *
8993  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
8994  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
8995  * self.typeinfo = NULL
8996  */
8997  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
8998 
8999  /* "View.MemoryView":370
9000  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
9001  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
9002  * self.typeinfo = NULL # <<<<<<<<<<<<<<
9003  *
9004  * def __dealloc__(memoryview self):
9005  */
9006  __pyx_v_self->typeinfo = NULL;
9007 
9008  /* "View.MemoryView":345
9009  * cdef __Pyx_TypeInfo *typeinfo
9010  *
9011  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
9012  * self.obj = obj
9013  * self.flags = flags
9014  */
9015 
9016  /* function exit code */
9017  __pyx_r = 0;
9018  goto __pyx_L0;
9019  __pyx_L1_error:;
9020  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9021  __pyx_r = -1;
9022  __pyx_L0:;
9023  __Pyx_RefNannyFinishContext();
9024  return __pyx_r;
9025 }
9026 
9027 /* "View.MemoryView":372
9028  * self.typeinfo = NULL
9029  *
9030  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
9031  * if self.obj is not None:
9032  * __Pyx_ReleaseBuffer(&self.view)
9033  */
9034 
9035 /* Python wrapper */
9036 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
9037 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
9038  __Pyx_RefNannyDeclarations
9039  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9040  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
9041 
9042  /* function exit code */
9043  __Pyx_RefNannyFinishContext();
9044 }
9045 
9046 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
9047  int __pyx_v_i;
9048  __Pyx_RefNannyDeclarations
9049  int __pyx_t_1;
9050  int __pyx_t_2;
9051  int __pyx_t_3;
9052  int __pyx_t_4;
9053  int __pyx_t_5;
9054  PyThread_type_lock __pyx_t_6;
9055  PyThread_type_lock __pyx_t_7;
9056  __Pyx_RefNannySetupContext("__dealloc__", 0);
9057 
9058  /* "View.MemoryView":373
9059  *
9060  * def __dealloc__(memoryview self):
9061  * if self.obj is not None: # <<<<<<<<<<<<<<
9062  * __Pyx_ReleaseBuffer(&self.view)
9063  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9064  */
9065  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
9066  __pyx_t_2 = (__pyx_t_1 != 0);
9067  if (__pyx_t_2) {
9068 
9069  /* "View.MemoryView":374
9070  * def __dealloc__(memoryview self):
9071  * if self.obj is not None:
9072  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
9073  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9074  *
9075  */
9076  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
9077 
9078  /* "View.MemoryView":373
9079  *
9080  * def __dealloc__(memoryview self):
9081  * if self.obj is not None: # <<<<<<<<<<<<<<
9082  * __Pyx_ReleaseBuffer(&self.view)
9083  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9084  */
9085  goto __pyx_L3;
9086  }
9087 
9088  /* "View.MemoryView":375
9089  * if self.obj is not None:
9090  * __Pyx_ReleaseBuffer(&self.view)
9091  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
9092  *
9093  * (<__pyx_buffer *> &self.view).obj = NULL
9094  */
9095  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
9096  if (__pyx_t_2) {
9097 
9098  /* "View.MemoryView":377
9099  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9100  *
9101  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
9102  * Py_DECREF(Py_None)
9103  *
9104  */
9105  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
9106 
9107  /* "View.MemoryView":378
9108  *
9109  * (<__pyx_buffer *> &self.view).obj = NULL
9110  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
9111  *
9112  * cdef int i
9113  */
9114  Py_DECREF(Py_None);
9115 
9116  /* "View.MemoryView":375
9117  * if self.obj is not None:
9118  * __Pyx_ReleaseBuffer(&self.view)
9119  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
9120  *
9121  * (<__pyx_buffer *> &self.view).obj = NULL
9122  */
9123  }
9124  __pyx_L3:;
9125 
9126  /* "View.MemoryView":382
9127  * cdef int i
9128  * global __pyx_memoryview_thread_locks_used
9129  * if self.lock != NULL: # <<<<<<<<<<<<<<
9130  * for i in range(__pyx_memoryview_thread_locks_used):
9131  * if __pyx_memoryview_thread_locks[i] is self.lock:
9132  */
9133  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
9134  if (__pyx_t_2) {
9135 
9136  /* "View.MemoryView":383
9137  * global __pyx_memoryview_thread_locks_used
9138  * if self.lock != NULL:
9139  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
9140  * if __pyx_memoryview_thread_locks[i] is self.lock:
9141  * __pyx_memoryview_thread_locks_used -= 1
9142  */
9143  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
9144  __pyx_t_4 = __pyx_t_3;
9145  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
9146  __pyx_v_i = __pyx_t_5;
9147 
9148  /* "View.MemoryView":384
9149  * if self.lock != NULL:
9150  * for i in range(__pyx_memoryview_thread_locks_used):
9151  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
9152  * __pyx_memoryview_thread_locks_used -= 1
9153  * if i != __pyx_memoryview_thread_locks_used:
9154  */
9155  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
9156  if (__pyx_t_2) {
9157 
9158  /* "View.MemoryView":385
9159  * for i in range(__pyx_memoryview_thread_locks_used):
9160  * if __pyx_memoryview_thread_locks[i] is self.lock:
9161  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
9162  * if i != __pyx_memoryview_thread_locks_used:
9163  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9164  */
9165  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
9166 
9167  /* "View.MemoryView":386
9168  * if __pyx_memoryview_thread_locks[i] is self.lock:
9169  * __pyx_memoryview_thread_locks_used -= 1
9170  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
9171  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9172  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9173  */
9174  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
9175  if (__pyx_t_2) {
9176 
9177  /* "View.MemoryView":388
9178  * if i != __pyx_memoryview_thread_locks_used:
9179  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9180  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
9181  * break
9182  * else:
9183  */
9184  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9185  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
9186 
9187  /* "View.MemoryView":387
9188  * __pyx_memoryview_thread_locks_used -= 1
9189  * if i != __pyx_memoryview_thread_locks_used:
9190  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
9191  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9192  * break
9193  */
9194  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
9195  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
9196 
9197  /* "View.MemoryView":386
9198  * if __pyx_memoryview_thread_locks[i] is self.lock:
9199  * __pyx_memoryview_thread_locks_used -= 1
9200  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
9201  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9202  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9203  */
9204  }
9205 
9206  /* "View.MemoryView":389
9207  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9208  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9209  * break # <<<<<<<<<<<<<<
9210  * else:
9211  * PyThread_free_lock(self.lock)
9212  */
9213  goto __pyx_L6_break;
9214 
9215  /* "View.MemoryView":384
9216  * if self.lock != NULL:
9217  * for i in range(__pyx_memoryview_thread_locks_used):
9218  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
9219  * __pyx_memoryview_thread_locks_used -= 1
9220  * if i != __pyx_memoryview_thread_locks_used:
9221  */
9222  }
9223  }
9224  /*else*/ {
9225 
9226  /* "View.MemoryView":391
9227  * break
9228  * else:
9229  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
9230  *
9231  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
9232  */
9233  PyThread_free_lock(__pyx_v_self->lock);
9234  }
9235  __pyx_L6_break:;
9236 
9237  /* "View.MemoryView":382
9238  * cdef int i
9239  * global __pyx_memoryview_thread_locks_used
9240  * if self.lock != NULL: # <<<<<<<<<<<<<<
9241  * for i in range(__pyx_memoryview_thread_locks_used):
9242  * if __pyx_memoryview_thread_locks[i] is self.lock:
9243  */
9244  }
9245 
9246  /* "View.MemoryView":372
9247  * self.typeinfo = NULL
9248  *
9249  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
9250  * if self.obj is not None:
9251  * __Pyx_ReleaseBuffer(&self.view)
9252  */
9253 
9254  /* function exit code */
9255  __Pyx_RefNannyFinishContext();
9256 }
9257 
9258 /* "View.MemoryView":393
9259  * PyThread_free_lock(self.lock)
9260  *
9261  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
9262  * cdef Py_ssize_t dim
9263  * cdef char *itemp = <char *> self.view.buf
9264  */
9265 
9266 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9267  Py_ssize_t __pyx_v_dim;
9268  char *__pyx_v_itemp;
9269  PyObject *__pyx_v_idx = NULL;
9270  char *__pyx_r;
9271  __Pyx_RefNannyDeclarations
9272  Py_ssize_t __pyx_t_1;
9273  PyObject *__pyx_t_2 = NULL;
9274  Py_ssize_t __pyx_t_3;
9275  PyObject *(*__pyx_t_4)(PyObject *);
9276  PyObject *__pyx_t_5 = NULL;
9277  Py_ssize_t __pyx_t_6;
9278  char *__pyx_t_7;
9279  int __pyx_lineno = 0;
9280  const char *__pyx_filename = NULL;
9281  int __pyx_clineno = 0;
9282  __Pyx_RefNannySetupContext("get_item_pointer", 0);
9283 
9284  /* "View.MemoryView":395
9285  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
9286  * cdef Py_ssize_t dim
9287  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
9288  *
9289  * for dim, idx in enumerate(index):
9290  */
9291  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
9292 
9293  /* "View.MemoryView":397
9294  * cdef char *itemp = <char *> self.view.buf
9295  *
9296  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
9297  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
9298  *
9299  */
9300  __pyx_t_1 = 0;
9301  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
9302  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
9303  __pyx_t_4 = NULL;
9304  } else {
9305  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error)
9306  __Pyx_GOTREF(__pyx_t_2);
9307  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error)
9308  }
9309  for (;;) {
9310  if (likely(!__pyx_t_4)) {
9311  if (likely(PyList_CheckExact(__pyx_t_2))) {
9312  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
9313  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9314  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 397, __pyx_L1_error)
9315  #else
9316  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error)
9317  __Pyx_GOTREF(__pyx_t_5);
9318  #endif
9319  } else {
9320  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
9321  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9322  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 397, __pyx_L1_error)
9323  #else
9324  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error)
9325  __Pyx_GOTREF(__pyx_t_5);
9326  #endif
9327  }
9328  } else {
9329  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
9330  if (unlikely(!__pyx_t_5)) {
9331  PyObject* exc_type = PyErr_Occurred();
9332  if (exc_type) {
9333  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9334  else __PYX_ERR(0, 397, __pyx_L1_error)
9335  }
9336  break;
9337  }
9338  __Pyx_GOTREF(__pyx_t_5);
9339  }
9340  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
9341  __pyx_t_5 = 0;
9342  __pyx_v_dim = __pyx_t_1;
9343  __pyx_t_1 = (__pyx_t_1 + 1);
9344 
9345  /* "View.MemoryView":398
9346  *
9347  * for dim, idx in enumerate(index):
9348  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
9349  *
9350  * return itemp
9351  */
9352  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error)
9353  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(0, 398, __pyx_L1_error)
9354  __pyx_v_itemp = __pyx_t_7;
9355 
9356  /* "View.MemoryView":397
9357  * cdef char *itemp = <char *> self.view.buf
9358  *
9359  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
9360  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
9361  *
9362  */
9363  }
9364  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9365 
9366  /* "View.MemoryView":400
9367  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
9368  *
9369  * return itemp # <<<<<<<<<<<<<<
9370  *
9371  *
9372  */
9373  __pyx_r = __pyx_v_itemp;
9374  goto __pyx_L0;
9375 
9376  /* "View.MemoryView":393
9377  * PyThread_free_lock(self.lock)
9378  *
9379  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
9380  * cdef Py_ssize_t dim
9381  * cdef char *itemp = <char *> self.view.buf
9382  */
9383 
9384  /* function exit code */
9385  __pyx_L1_error:;
9386  __Pyx_XDECREF(__pyx_t_2);
9387  __Pyx_XDECREF(__pyx_t_5);
9388  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
9389  __pyx_r = NULL;
9390  __pyx_L0:;
9391  __Pyx_XDECREF(__pyx_v_idx);
9392  __Pyx_RefNannyFinishContext();
9393  return __pyx_r;
9394 }
9395 
9396 /* "View.MemoryView":403
9397  *
9398  *
9399  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
9400  * if index is Ellipsis:
9401  * return self
9402  */
9403 
9404 /* Python wrapper */
9405 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
9406 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
9407  PyObject *__pyx_r = 0;
9408  __Pyx_RefNannyDeclarations
9409  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9410  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
9411 
9412  /* function exit code */
9413  __Pyx_RefNannyFinishContext();
9414  return __pyx_r;
9415 }
9416 
9417 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9418  PyObject *__pyx_v_have_slices = NULL;
9419  PyObject *__pyx_v_indices = NULL;
9420  char *__pyx_v_itemp;
9421  PyObject *__pyx_r = NULL;
9422  __Pyx_RefNannyDeclarations
9423  int __pyx_t_1;
9424  int __pyx_t_2;
9425  PyObject *__pyx_t_3 = NULL;
9426  PyObject *__pyx_t_4 = NULL;
9427  PyObject *__pyx_t_5 = NULL;
9428  char *__pyx_t_6;
9429  int __pyx_lineno = 0;
9430  const char *__pyx_filename = NULL;
9431  int __pyx_clineno = 0;
9432  __Pyx_RefNannySetupContext("__getitem__", 0);
9433 
9434  /* "View.MemoryView":404
9435  *
9436  * def __getitem__(memoryview self, object index):
9437  * if index is Ellipsis: # <<<<<<<<<<<<<<
9438  * return self
9439  *
9440  */
9441  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
9442  __pyx_t_2 = (__pyx_t_1 != 0);
9443  if (__pyx_t_2) {
9444 
9445  /* "View.MemoryView":405
9446  * def __getitem__(memoryview self, object index):
9447  * if index is Ellipsis:
9448  * return self # <<<<<<<<<<<<<<
9449  *
9450  * have_slices, indices = _unellipsify(index, self.view.ndim)
9451  */
9452  __Pyx_XDECREF(__pyx_r);
9453  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9454  __pyx_r = ((PyObject *)__pyx_v_self);
9455  goto __pyx_L0;
9456 
9457  /* "View.MemoryView":404
9458  *
9459  * def __getitem__(memoryview self, object index):
9460  * if index is Ellipsis: # <<<<<<<<<<<<<<
9461  * return self
9462  *
9463  */
9464  }
9465 
9466  /* "View.MemoryView":407
9467  * return self
9468  *
9469  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
9470  *
9471  * cdef char *itemp
9472  */
9473  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error)
9474  __Pyx_GOTREF(__pyx_t_3);
9475  if (likely(__pyx_t_3 != Py_None)) {
9476  PyObject* sequence = __pyx_t_3;
9477  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9478  if (unlikely(size != 2)) {
9479  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9480  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9481  __PYX_ERR(0, 407, __pyx_L1_error)
9482  }
9483  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9484  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
9485  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
9486  __Pyx_INCREF(__pyx_t_4);
9487  __Pyx_INCREF(__pyx_t_5);
9488  #else
9489  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error)
9490  __Pyx_GOTREF(__pyx_t_4);
9491  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error)
9492  __Pyx_GOTREF(__pyx_t_5);
9493  #endif
9494  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9495  } else {
9496  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 407, __pyx_L1_error)
9497  }
9498  __pyx_v_have_slices = __pyx_t_4;
9499  __pyx_t_4 = 0;
9500  __pyx_v_indices = __pyx_t_5;
9501  __pyx_t_5 = 0;
9502 
9503  /* "View.MemoryView":410
9504  *
9505  * cdef char *itemp
9506  * if have_slices: # <<<<<<<<<<<<<<
9507  * return memview_slice(self, indices)
9508  * else:
9509  */
9510  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 410, __pyx_L1_error)
9511  if (__pyx_t_2) {
9512 
9513  /* "View.MemoryView":411
9514  * cdef char *itemp
9515  * if have_slices:
9516  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
9517  * else:
9518  * itemp = self.get_item_pointer(indices)
9519  */
9520  __Pyx_XDECREF(__pyx_r);
9521  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error)
9522  __Pyx_GOTREF(__pyx_t_3);
9523  __pyx_r = __pyx_t_3;
9524  __pyx_t_3 = 0;
9525  goto __pyx_L0;
9526 
9527  /* "View.MemoryView":410
9528  *
9529  * cdef char *itemp
9530  * if have_slices: # <<<<<<<<<<<<<<
9531  * return memview_slice(self, indices)
9532  * else:
9533  */
9534  }
9535 
9536  /* "View.MemoryView":413
9537  * return memview_slice(self, indices)
9538  * else:
9539  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
9540  * return self.convert_item_to_object(itemp)
9541  *
9542  */
9543  /*else*/ {
9544  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(0, 413, __pyx_L1_error)
9545  __pyx_v_itemp = __pyx_t_6;
9546 
9547  /* "View.MemoryView":414
9548  * else:
9549  * itemp = self.get_item_pointer(indices)
9550  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
9551  *
9552  * def __setitem__(memoryview self, object index, object value):
9553  */
9554  __Pyx_XDECREF(__pyx_r);
9555  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error)
9556  __Pyx_GOTREF(__pyx_t_3);
9557  __pyx_r = __pyx_t_3;
9558  __pyx_t_3 = 0;
9559  goto __pyx_L0;
9560  }
9561 
9562  /* "View.MemoryView":403
9563  *
9564  *
9565  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
9566  * if index is Ellipsis:
9567  * return self
9568  */
9569 
9570  /* function exit code */
9571  __pyx_L1_error:;
9572  __Pyx_XDECREF(__pyx_t_3);
9573  __Pyx_XDECREF(__pyx_t_4);
9574  __Pyx_XDECREF(__pyx_t_5);
9575  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9576  __pyx_r = NULL;
9577  __pyx_L0:;
9578  __Pyx_XDECREF(__pyx_v_have_slices);
9579  __Pyx_XDECREF(__pyx_v_indices);
9580  __Pyx_XGIVEREF(__pyx_r);
9581  __Pyx_RefNannyFinishContext();
9582  return __pyx_r;
9583 }
9584 
9585 /* "View.MemoryView":416
9586  * return self.convert_item_to_object(itemp)
9587  *
9588  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
9589  * if self.view.readonly:
9590  * raise TypeError("Cannot assign to read-only memoryview")
9591  */
9592 
9593 /* Python wrapper */
9594 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
9595 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9596  int __pyx_r;
9597  __Pyx_RefNannyDeclarations
9598  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9599  __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));
9600 
9601  /* function exit code */
9602  __Pyx_RefNannyFinishContext();
9603  return __pyx_r;
9604 }
9605 
9606 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) {
9607  PyObject *__pyx_v_have_slices = NULL;
9608  PyObject *__pyx_v_obj = NULL;
9609  int __pyx_r;
9610  __Pyx_RefNannyDeclarations
9611  int __pyx_t_1;
9612  PyObject *__pyx_t_2 = NULL;
9613  PyObject *__pyx_t_3 = NULL;
9614  PyObject *__pyx_t_4 = NULL;
9615  int __pyx_lineno = 0;
9616  const char *__pyx_filename = NULL;
9617  int __pyx_clineno = 0;
9618  __Pyx_RefNannySetupContext("__setitem__", 0);
9619  __Pyx_INCREF(__pyx_v_index);
9620 
9621  /* "View.MemoryView":417
9622  *
9623  * def __setitem__(memoryview self, object index, object value):
9624  * if self.view.readonly: # <<<<<<<<<<<<<<
9625  * raise TypeError("Cannot assign to read-only memoryview")
9626  *
9627  */
9628  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
9629  if (unlikely(__pyx_t_1)) {
9630 
9631  /* "View.MemoryView":418
9632  * def __setitem__(memoryview self, object index, object value):
9633  * if self.view.readonly:
9634  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
9635  *
9636  * have_slices, index = _unellipsify(index, self.view.ndim)
9637  */
9638  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
9639  __Pyx_GOTREF(__pyx_t_2);
9640  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
9641  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9642  __PYX_ERR(0, 418, __pyx_L1_error)
9643 
9644  /* "View.MemoryView":417
9645  *
9646  * def __setitem__(memoryview self, object index, object value):
9647  * if self.view.readonly: # <<<<<<<<<<<<<<
9648  * raise TypeError("Cannot assign to read-only memoryview")
9649  *
9650  */
9651  }
9652 
9653  /* "View.MemoryView":420
9654  * raise TypeError("Cannot assign to read-only memoryview")
9655  *
9656  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
9657  *
9658  * if have_slices:
9659  */
9660  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
9661  __Pyx_GOTREF(__pyx_t_2);
9662  if (likely(__pyx_t_2 != Py_None)) {
9663  PyObject* sequence = __pyx_t_2;
9664  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9665  if (unlikely(size != 2)) {
9666  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9667  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9668  __PYX_ERR(0, 420, __pyx_L1_error)
9669  }
9670  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9671  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
9672  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
9673  __Pyx_INCREF(__pyx_t_3);
9674  __Pyx_INCREF(__pyx_t_4);
9675  #else
9676  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
9677  __Pyx_GOTREF(__pyx_t_3);
9678  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
9679  __Pyx_GOTREF(__pyx_t_4);
9680  #endif
9681  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9682  } else {
9683  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 420, __pyx_L1_error)
9684  }
9685  __pyx_v_have_slices = __pyx_t_3;
9686  __pyx_t_3 = 0;
9687  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
9688  __pyx_t_4 = 0;
9689 
9690  /* "View.MemoryView":422
9691  * have_slices, index = _unellipsify(index, self.view.ndim)
9692  *
9693  * if have_slices: # <<<<<<<<<<<<<<
9694  * obj = self.is_slice(value)
9695  * if obj:
9696  */
9697  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 422, __pyx_L1_error)
9698  if (__pyx_t_1) {
9699 
9700  /* "View.MemoryView":423
9701  *
9702  * if have_slices:
9703  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
9704  * if obj:
9705  * self.setitem_slice_assignment(self[index], obj)
9706  */
9707  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
9708  __Pyx_GOTREF(__pyx_t_2);
9709  __pyx_v_obj = __pyx_t_2;
9710  __pyx_t_2 = 0;
9711 
9712  /* "View.MemoryView":424
9713  * if have_slices:
9714  * obj = self.is_slice(value)
9715  * if obj: # <<<<<<<<<<<<<<
9716  * self.setitem_slice_assignment(self[index], obj)
9717  * else:
9718  */
9719  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 424, __pyx_L1_error)
9720  if (__pyx_t_1) {
9721 
9722  /* "View.MemoryView":425
9723  * obj = self.is_slice(value)
9724  * if obj:
9725  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
9726  * else:
9727  * self.setitem_slice_assign_scalar(self[index], value)
9728  */
9729  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error)
9730  __Pyx_GOTREF(__pyx_t_2);
9731  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L1_error)
9732  __Pyx_GOTREF(__pyx_t_4);
9733  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9734  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9735 
9736  /* "View.MemoryView":424
9737  * if have_slices:
9738  * obj = self.is_slice(value)
9739  * if obj: # <<<<<<<<<<<<<<
9740  * self.setitem_slice_assignment(self[index], obj)
9741  * else:
9742  */
9743  goto __pyx_L5;
9744  }
9745 
9746  /* "View.MemoryView":427
9747  * self.setitem_slice_assignment(self[index], obj)
9748  * else:
9749  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
9750  * else:
9751  * self.setitem_indexed(index, value)
9752  */
9753  /*else*/ {
9754  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
9755  __Pyx_GOTREF(__pyx_t_4);
9756  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(0, 427, __pyx_L1_error)
9757  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
9758  __Pyx_GOTREF(__pyx_t_2);
9759  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9760  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9761  }
9762  __pyx_L5:;
9763 
9764  /* "View.MemoryView":422
9765  * have_slices, index = _unellipsify(index, self.view.ndim)
9766  *
9767  * if have_slices: # <<<<<<<<<<<<<<
9768  * obj = self.is_slice(value)
9769  * if obj:
9770  */
9771  goto __pyx_L4;
9772  }
9773 
9774  /* "View.MemoryView":429
9775  * self.setitem_slice_assign_scalar(self[index], value)
9776  * else:
9777  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
9778  *
9779  * cdef is_slice(self, obj):
9780  */
9781  /*else*/ {
9782  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
9783  __Pyx_GOTREF(__pyx_t_2);
9784  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9785  }
9786  __pyx_L4:;
9787 
9788  /* "View.MemoryView":416
9789  * return self.convert_item_to_object(itemp)
9790  *
9791  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
9792  * if self.view.readonly:
9793  * raise TypeError("Cannot assign to read-only memoryview")
9794  */
9795 
9796  /* function exit code */
9797  __pyx_r = 0;
9798  goto __pyx_L0;
9799  __pyx_L1_error:;
9800  __Pyx_XDECREF(__pyx_t_2);
9801  __Pyx_XDECREF(__pyx_t_3);
9802  __Pyx_XDECREF(__pyx_t_4);
9803  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9804  __pyx_r = -1;
9805  __pyx_L0:;
9806  __Pyx_XDECREF(__pyx_v_have_slices);
9807  __Pyx_XDECREF(__pyx_v_obj);
9808  __Pyx_XDECREF(__pyx_v_index);
9809  __Pyx_RefNannyFinishContext();
9810  return __pyx_r;
9811 }
9812 
9813 /* "View.MemoryView":431
9814  * self.setitem_indexed(index, value)
9815  *
9816  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
9817  * if not isinstance(obj, memoryview):
9818  * try:
9819  */
9820 
9821 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
9822  PyObject *__pyx_r = NULL;
9823  __Pyx_RefNannyDeclarations
9824  int __pyx_t_1;
9825  int __pyx_t_2;
9826  PyObject *__pyx_t_3 = NULL;
9827  PyObject *__pyx_t_4 = NULL;
9828  PyObject *__pyx_t_5 = NULL;
9829  PyObject *__pyx_t_6 = NULL;
9830  PyObject *__pyx_t_7 = NULL;
9831  PyObject *__pyx_t_8 = NULL;
9832  int __pyx_t_9;
9833  int __pyx_lineno = 0;
9834  const char *__pyx_filename = NULL;
9835  int __pyx_clineno = 0;
9836  __Pyx_RefNannySetupContext("is_slice", 0);
9837  __Pyx_INCREF(__pyx_v_obj);
9838 
9839  /* "View.MemoryView":432
9840  *
9841  * cdef is_slice(self, obj):
9842  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
9843  * try:
9844  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9845  */
9846  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
9847  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
9848  if (__pyx_t_2) {
9849 
9850  /* "View.MemoryView":433
9851  * cdef is_slice(self, obj):
9852  * if not isinstance(obj, memoryview):
9853  * try: # <<<<<<<<<<<<<<
9854  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9855  * self.dtype_is_object)
9856  */
9857  {
9858  __Pyx_PyThreadState_declare
9859  __Pyx_PyThreadState_assign
9860  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
9861  __Pyx_XGOTREF(__pyx_t_3);
9862  __Pyx_XGOTREF(__pyx_t_4);
9863  __Pyx_XGOTREF(__pyx_t_5);
9864  /*try:*/ {
9865 
9866  /* "View.MemoryView":434
9867  * if not isinstance(obj, memoryview):
9868  * try:
9869  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
9870  * self.dtype_is_object)
9871  * except TypeError:
9872  */
9873  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 434, __pyx_L4_error)
9874  __Pyx_GOTREF(__pyx_t_6);
9875 
9876  /* "View.MemoryView":435
9877  * try:
9878  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9879  * self.dtype_is_object) # <<<<<<<<<<<<<<
9880  * except TypeError:
9881  * return None
9882  */
9883  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L4_error)
9884  __Pyx_GOTREF(__pyx_t_7);
9885 
9886  /* "View.MemoryView":434
9887  * if not isinstance(obj, memoryview):
9888  * try:
9889  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
9890  * self.dtype_is_object)
9891  * except TypeError:
9892  */
9893  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 434, __pyx_L4_error)
9894  __Pyx_GOTREF(__pyx_t_8);
9895  __Pyx_INCREF(__pyx_v_obj);
9896  __Pyx_GIVEREF(__pyx_v_obj);
9897  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
9898  __Pyx_GIVEREF(__pyx_t_6);
9899  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
9900  __Pyx_GIVEREF(__pyx_t_7);
9901  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
9902  __pyx_t_6 = 0;
9903  __pyx_t_7 = 0;
9904  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L4_error)
9905  __Pyx_GOTREF(__pyx_t_7);
9906  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9907  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
9908  __pyx_t_7 = 0;
9909 
9910  /* "View.MemoryView":433
9911  * cdef is_slice(self, obj):
9912  * if not isinstance(obj, memoryview):
9913  * try: # <<<<<<<<<<<<<<
9914  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9915  * self.dtype_is_object)
9916  */
9917  }
9918  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9919  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9920  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9921  goto __pyx_L9_try_end;
9922  __pyx_L4_error:;
9923  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9924  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9925  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9926 
9927  /* "View.MemoryView":436
9928  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9929  * self.dtype_is_object)
9930  * except TypeError: # <<<<<<<<<<<<<<
9931  * return None
9932  *
9933  */
9934  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
9935  if (__pyx_t_9) {
9936  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9937  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 436, __pyx_L6_except_error)
9938  __Pyx_GOTREF(__pyx_t_7);
9939  __Pyx_GOTREF(__pyx_t_8);
9940  __Pyx_GOTREF(__pyx_t_6);
9941 
9942  /* "View.MemoryView":437
9943  * self.dtype_is_object)
9944  * except TypeError:
9945  * return None # <<<<<<<<<<<<<<
9946  *
9947  * return obj
9948  */
9949  __Pyx_XDECREF(__pyx_r);
9950  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9951  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9952  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9953  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9954  goto __pyx_L7_except_return;
9955  }
9956  goto __pyx_L6_except_error;
9957  __pyx_L6_except_error:;
9958 
9959  /* "View.MemoryView":433
9960  * cdef is_slice(self, obj):
9961  * if not isinstance(obj, memoryview):
9962  * try: # <<<<<<<<<<<<<<
9963  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9964  * self.dtype_is_object)
9965  */
9966  __Pyx_XGIVEREF(__pyx_t_3);
9967  __Pyx_XGIVEREF(__pyx_t_4);
9968  __Pyx_XGIVEREF(__pyx_t_5);
9969  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9970  goto __pyx_L1_error;
9971  __pyx_L7_except_return:;
9972  __Pyx_XGIVEREF(__pyx_t_3);
9973  __Pyx_XGIVEREF(__pyx_t_4);
9974  __Pyx_XGIVEREF(__pyx_t_5);
9975  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9976  goto __pyx_L0;
9977  __pyx_L9_try_end:;
9978  }
9979 
9980  /* "View.MemoryView":432
9981  *
9982  * cdef is_slice(self, obj):
9983  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
9984  * try:
9985  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9986  */
9987  }
9988 
9989  /* "View.MemoryView":439
9990  * return None
9991  *
9992  * return obj # <<<<<<<<<<<<<<
9993  *
9994  * cdef setitem_slice_assignment(self, dst, src):
9995  */
9996  __Pyx_XDECREF(__pyx_r);
9997  __Pyx_INCREF(__pyx_v_obj);
9998  __pyx_r = __pyx_v_obj;
9999  goto __pyx_L0;
10000 
10001  /* "View.MemoryView":431
10002  * self.setitem_indexed(index, value)
10003  *
10004  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
10005  * if not isinstance(obj, memoryview):
10006  * try:
10007  */
10008 
10009  /* function exit code */
10010  __pyx_L1_error:;
10011  __Pyx_XDECREF(__pyx_t_6);
10012  __Pyx_XDECREF(__pyx_t_7);
10013  __Pyx_XDECREF(__pyx_t_8);
10014  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10015  __pyx_r = 0;
10016  __pyx_L0:;
10017  __Pyx_XDECREF(__pyx_v_obj);
10018  __Pyx_XGIVEREF(__pyx_r);
10019  __Pyx_RefNannyFinishContext();
10020  return __pyx_r;
10021 }
10022 
10023 /* "View.MemoryView":441
10024  * return obj
10025  *
10026  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
10027  * cdef __Pyx_memviewslice dst_slice
10028  * cdef __Pyx_memviewslice src_slice
10029  */
10030 
10031 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
10032  __Pyx_memviewslice __pyx_v_dst_slice;
10033  __Pyx_memviewslice __pyx_v_src_slice;
10034  PyObject *__pyx_r = NULL;
10035  __Pyx_RefNannyDeclarations
10036  __Pyx_memviewslice *__pyx_t_1;
10037  __Pyx_memviewslice *__pyx_t_2;
10038  PyObject *__pyx_t_3 = NULL;
10039  int __pyx_t_4;
10040  int __pyx_t_5;
10041  int __pyx_t_6;
10042  int __pyx_lineno = 0;
10043  const char *__pyx_filename = NULL;
10044  int __pyx_clineno = 0;
10045  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
10046 
10047  /* "View.MemoryView":445
10048  * cdef __Pyx_memviewslice src_slice
10049  *
10050  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
10051  * get_slice_from_memview(dst, &dst_slice)[0],
10052  * src.ndim, dst.ndim, self.dtype_is_object)
10053  */
10054  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(0, 445, __pyx_L1_error)
10055  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(0, 445, __pyx_L1_error)
10056 
10057  /* "View.MemoryView":446
10058  *
10059  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
10060  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
10061  * src.ndim, dst.ndim, self.dtype_is_object)
10062  *
10063  */
10064  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(0, 446, __pyx_L1_error)
10065  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(0, 446, __pyx_L1_error)
10066 
10067  /* "View.MemoryView":447
10068  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
10069  * get_slice_from_memview(dst, &dst_slice)[0],
10070  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
10071  *
10072  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
10073  */
10074  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error)
10075  __Pyx_GOTREF(__pyx_t_3);
10076  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error)
10077  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10078  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error)
10079  __Pyx_GOTREF(__pyx_t_3);
10080  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error)
10081  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10082 
10083  /* "View.MemoryView":445
10084  * cdef __Pyx_memviewslice src_slice
10085  *
10086  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
10087  * get_slice_from_memview(dst, &dst_slice)[0],
10088  * src.ndim, dst.ndim, self.dtype_is_object)
10089  */
10090  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 445, __pyx_L1_error)
10091 
10092  /* "View.MemoryView":441
10093  * return obj
10094  *
10095  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
10096  * cdef __Pyx_memviewslice dst_slice
10097  * cdef __Pyx_memviewslice src_slice
10098  */
10099 
10100  /* function exit code */
10101  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10102  goto __pyx_L0;
10103  __pyx_L1_error:;
10104  __Pyx_XDECREF(__pyx_t_3);
10105  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
10106  __pyx_r = 0;
10107  __pyx_L0:;
10108  __Pyx_XGIVEREF(__pyx_r);
10109  __Pyx_RefNannyFinishContext();
10110  return __pyx_r;
10111 }
10112 
10113 /* "View.MemoryView":449
10114  * src.ndim, dst.ndim, self.dtype_is_object)
10115  *
10116  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
10117  * cdef int array[128]
10118  * cdef void *tmp = NULL
10119  */
10120 
10121 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) {
10122  int __pyx_v_array[0x80];
10123  void *__pyx_v_tmp;
10124  void *__pyx_v_item;
10125  __Pyx_memviewslice *__pyx_v_dst_slice;
10126  __Pyx_memviewslice __pyx_v_tmp_slice;
10127  PyObject *__pyx_r = NULL;
10128  __Pyx_RefNannyDeclarations
10129  __Pyx_memviewslice *__pyx_t_1;
10130  int __pyx_t_2;
10131  PyObject *__pyx_t_3 = NULL;
10132  int __pyx_t_4;
10133  int __pyx_t_5;
10134  char const *__pyx_t_6;
10135  PyObject *__pyx_t_7 = NULL;
10136  PyObject *__pyx_t_8 = NULL;
10137  PyObject *__pyx_t_9 = NULL;
10138  PyObject *__pyx_t_10 = NULL;
10139  PyObject *__pyx_t_11 = NULL;
10140  PyObject *__pyx_t_12 = NULL;
10141  int __pyx_lineno = 0;
10142  const char *__pyx_filename = NULL;
10143  int __pyx_clineno = 0;
10144  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
10145 
10146  /* "View.MemoryView":451
10147  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
10148  * cdef int array[128]
10149  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
10150  * cdef void *item
10151  *
10152  */
10153  __pyx_v_tmp = NULL;
10154 
10155  /* "View.MemoryView":456
10156  * cdef __Pyx_memviewslice *dst_slice
10157  * cdef __Pyx_memviewslice tmp_slice
10158  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
10159  *
10160  * if <size_t>self.view.itemsize > sizeof(array):
10161  */
10162  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(0, 456, __pyx_L1_error)
10163  __pyx_v_dst_slice = __pyx_t_1;
10164 
10165  /* "View.MemoryView":458
10166  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
10167  *
10168  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
10169  * tmp = PyMem_Malloc(self.view.itemsize)
10170  * if tmp == NULL:
10171  */
10172  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
10173  if (__pyx_t_2) {
10174 
10175  /* "View.MemoryView":459
10176  *
10177  * if <size_t>self.view.itemsize > sizeof(array):
10178  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
10179  * if tmp == NULL:
10180  * raise MemoryError
10181  */
10182  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
10183 
10184  /* "View.MemoryView":460
10185  * if <size_t>self.view.itemsize > sizeof(array):
10186  * tmp = PyMem_Malloc(self.view.itemsize)
10187  * if tmp == NULL: # <<<<<<<<<<<<<<
10188  * raise MemoryError
10189  * item = tmp
10190  */
10191  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
10192  if (unlikely(__pyx_t_2)) {
10193 
10194  /* "View.MemoryView":461
10195  * tmp = PyMem_Malloc(self.view.itemsize)
10196  * if tmp == NULL:
10197  * raise MemoryError # <<<<<<<<<<<<<<
10198  * item = tmp
10199  * else:
10200  */
10201  PyErr_NoMemory(); __PYX_ERR(0, 461, __pyx_L1_error)
10202 
10203  /* "View.MemoryView":460
10204  * if <size_t>self.view.itemsize > sizeof(array):
10205  * tmp = PyMem_Malloc(self.view.itemsize)
10206  * if tmp == NULL: # <<<<<<<<<<<<<<
10207  * raise MemoryError
10208  * item = tmp
10209  */
10210  }
10211 
10212  /* "View.MemoryView":462
10213  * if tmp == NULL:
10214  * raise MemoryError
10215  * item = tmp # <<<<<<<<<<<<<<
10216  * else:
10217  * item = <void *> array
10218  */
10219  __pyx_v_item = __pyx_v_tmp;
10220 
10221  /* "View.MemoryView":458
10222  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
10223  *
10224  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
10225  * tmp = PyMem_Malloc(self.view.itemsize)
10226  * if tmp == NULL:
10227  */
10228  goto __pyx_L3;
10229  }
10230 
10231  /* "View.MemoryView":464
10232  * item = tmp
10233  * else:
10234  * item = <void *> array # <<<<<<<<<<<<<<
10235  *
10236  * try:
10237  */
10238  /*else*/ {
10239  __pyx_v_item = ((void *)__pyx_v_array);
10240  }
10241  __pyx_L3:;
10242 
10243  /* "View.MemoryView":466
10244  * item = <void *> array
10245  *
10246  * try: # <<<<<<<<<<<<<<
10247  * if self.dtype_is_object:
10248  * (<PyObject **> item)[0] = <PyObject *> value
10249  */
10250  /*try:*/ {
10251 
10252  /* "View.MemoryView":467
10253  *
10254  * try:
10255  * if self.dtype_is_object: # <<<<<<<<<<<<<<
10256  * (<PyObject **> item)[0] = <PyObject *> value
10257  * else:
10258  */
10259  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
10260  if (__pyx_t_2) {
10261 
10262  /* "View.MemoryView":468
10263  * try:
10264  * if self.dtype_is_object:
10265  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
10266  * else:
10267  * self.assign_item_from_object(<char *> item, value)
10268  */
10269  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
10270 
10271  /* "View.MemoryView":467
10272  *
10273  * try:
10274  * if self.dtype_is_object: # <<<<<<<<<<<<<<
10275  * (<PyObject **> item)[0] = <PyObject *> value
10276  * else:
10277  */
10278  goto __pyx_L8;
10279  }
10280 
10281  /* "View.MemoryView":470
10282  * (<PyObject **> item)[0] = <PyObject *> value
10283  * else:
10284  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
10285  *
10286  *
10287  */
10288  /*else*/ {
10289  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L6_error)
10290  __Pyx_GOTREF(__pyx_t_3);
10291  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10292  }
10293  __pyx_L8:;
10294 
10295  /* "View.MemoryView":474
10296  *
10297  *
10298  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
10299  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10300  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10301  */
10302  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
10303  if (__pyx_t_2) {
10304 
10305  /* "View.MemoryView":475
10306  *
10307  * if self.view.suboffsets != NULL:
10308  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
10309  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10310  * item, self.dtype_is_object)
10311  */
10312  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L6_error)
10313  __Pyx_GOTREF(__pyx_t_3);
10314  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10315 
10316  /* "View.MemoryView":474
10317  *
10318  *
10319  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
10320  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10321  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10322  */
10323  }
10324 
10325  /* "View.MemoryView":476
10326  * if self.view.suboffsets != NULL:
10327  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10328  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
10329  * item, self.dtype_is_object)
10330  * finally:
10331  */
10332  __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);
10333  }
10334 
10335  /* "View.MemoryView":479
10336  * item, self.dtype_is_object)
10337  * finally:
10338  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
10339  *
10340  * cdef setitem_indexed(self, index, value):
10341  */
10342  /*finally:*/ {
10343  /*normal exit:*/{
10344  PyMem_Free(__pyx_v_tmp);
10345  goto __pyx_L7;
10346  }
10347  __pyx_L6_error:;
10348  /*exception exit:*/{
10349  __Pyx_PyThreadState_declare
10350  __Pyx_PyThreadState_assign
10351  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10352  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10353  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
10354  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);
10355  __Pyx_XGOTREF(__pyx_t_7);
10356  __Pyx_XGOTREF(__pyx_t_8);
10357  __Pyx_XGOTREF(__pyx_t_9);
10358  __Pyx_XGOTREF(__pyx_t_10);
10359  __Pyx_XGOTREF(__pyx_t_11);
10360  __Pyx_XGOTREF(__pyx_t_12);
10361  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
10362  {
10363  PyMem_Free(__pyx_v_tmp);
10364  }
10365  if (PY_MAJOR_VERSION >= 3) {
10366  __Pyx_XGIVEREF(__pyx_t_10);
10367  __Pyx_XGIVEREF(__pyx_t_11);
10368  __Pyx_XGIVEREF(__pyx_t_12);
10369  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
10370  }
10371  __Pyx_XGIVEREF(__pyx_t_7);
10372  __Pyx_XGIVEREF(__pyx_t_8);
10373  __Pyx_XGIVEREF(__pyx_t_9);
10374  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
10375  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10376  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
10377  goto __pyx_L1_error;
10378  }
10379  __pyx_L7:;
10380  }
10381 
10382  /* "View.MemoryView":449
10383  * src.ndim, dst.ndim, self.dtype_is_object)
10384  *
10385  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
10386  * cdef int array[128]
10387  * cdef void *tmp = NULL
10388  */
10389 
10390  /* function exit code */
10391  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10392  goto __pyx_L0;
10393  __pyx_L1_error:;
10394  __Pyx_XDECREF(__pyx_t_3);
10395  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
10396  __pyx_r = 0;
10397  __pyx_L0:;
10398  __Pyx_XGIVEREF(__pyx_r);
10399  __Pyx_RefNannyFinishContext();
10400  return __pyx_r;
10401 }
10402 
10403 /* "View.MemoryView":481
10404  * PyMem_Free(tmp)
10405  *
10406  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
10407  * cdef char *itemp = self.get_item_pointer(index)
10408  * self.assign_item_from_object(itemp, value)
10409  */
10410 
10411 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10412  char *__pyx_v_itemp;
10413  PyObject *__pyx_r = NULL;
10414  __Pyx_RefNannyDeclarations
10415  char *__pyx_t_1;
10416  PyObject *__pyx_t_2 = NULL;
10417  int __pyx_lineno = 0;
10418  const char *__pyx_filename = NULL;
10419  int __pyx_clineno = 0;
10420  __Pyx_RefNannySetupContext("setitem_indexed", 0);
10421 
10422  /* "View.MemoryView":482
10423  *
10424  * cdef setitem_indexed(self, index, value):
10425  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
10426  * self.assign_item_from_object(itemp, value)
10427  *
10428  */
10429  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(0, 482, __pyx_L1_error)
10430  __pyx_v_itemp = __pyx_t_1;
10431 
10432  /* "View.MemoryView":483
10433  * cdef setitem_indexed(self, index, value):
10434  * cdef char *itemp = self.get_item_pointer(index)
10435  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
10436  *
10437  * cdef convert_item_to_object(self, char *itemp):
10438  */
10439  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
10440  __Pyx_GOTREF(__pyx_t_2);
10441  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10442 
10443  /* "View.MemoryView":481
10444  * PyMem_Free(tmp)
10445  *
10446  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
10447  * cdef char *itemp = self.get_item_pointer(index)
10448  * self.assign_item_from_object(itemp, value)
10449  */
10450 
10451  /* function exit code */
10452  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10453  goto __pyx_L0;
10454  __pyx_L1_error:;
10455  __Pyx_XDECREF(__pyx_t_2);
10456  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
10457  __pyx_r = 0;
10458  __pyx_L0:;
10459  __Pyx_XGIVEREF(__pyx_r);
10460  __Pyx_RefNannyFinishContext();
10461  return __pyx_r;
10462 }
10463 
10464 /* "View.MemoryView":485
10465  * self.assign_item_from_object(itemp, value)
10466  *
10467  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
10468  * """Only used if instantiated manually by the user, or if Cython doesn't
10469  * know how to convert the type"""
10470  */
10471 
10472 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
10473  PyObject *__pyx_v_struct = NULL;
10474  PyObject *__pyx_v_bytesitem = 0;
10475  PyObject *__pyx_v_result = NULL;
10476  PyObject *__pyx_r = NULL;
10477  __Pyx_RefNannyDeclarations
10478  PyObject *__pyx_t_1 = NULL;
10479  PyObject *__pyx_t_2 = NULL;
10480  PyObject *__pyx_t_3 = NULL;
10481  PyObject *__pyx_t_4 = NULL;
10482  PyObject *__pyx_t_5 = NULL;
10483  PyObject *__pyx_t_6 = NULL;
10484  PyObject *__pyx_t_7 = NULL;
10485  int __pyx_t_8;
10486  PyObject *__pyx_t_9 = NULL;
10487  size_t __pyx_t_10;
10488  int __pyx_t_11;
10489  int __pyx_lineno = 0;
10490  const char *__pyx_filename = NULL;
10491  int __pyx_clineno = 0;
10492  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
10493 
10494  /* "View.MemoryView":488
10495  * """Only used if instantiated manually by the user, or if Cython doesn't
10496  * know how to convert the type"""
10497  * import struct # <<<<<<<<<<<<<<
10498  * cdef bytes bytesitem
10499  *
10500  */
10501  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error)
10502  __Pyx_GOTREF(__pyx_t_1);
10503  __pyx_v_struct = __pyx_t_1;
10504  __pyx_t_1 = 0;
10505 
10506  /* "View.MemoryView":491
10507  * cdef bytes bytesitem
10508  *
10509  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
10510  * try:
10511  * result = struct.unpack(self.view.format, bytesitem)
10512  */
10513  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
10514  __Pyx_GOTREF(__pyx_t_1);
10515  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
10516  __pyx_t_1 = 0;
10517 
10518  /* "View.MemoryView":492
10519  *
10520  * bytesitem = itemp[:self.view.itemsize]
10521  * try: # <<<<<<<<<<<<<<
10522  * result = struct.unpack(self.view.format, bytesitem)
10523  * except struct.error:
10524  */
10525  {
10526  __Pyx_PyThreadState_declare
10527  __Pyx_PyThreadState_assign
10528  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
10529  __Pyx_XGOTREF(__pyx_t_2);
10530  __Pyx_XGOTREF(__pyx_t_3);
10531  __Pyx_XGOTREF(__pyx_t_4);
10532  /*try:*/ {
10533 
10534  /* "View.MemoryView":493
10535  * bytesitem = itemp[:self.view.itemsize]
10536  * try:
10537  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
10538  * except struct.error:
10539  * raise ValueError("Unable to convert item to object")
10540  */
10541  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L3_error)
10542  __Pyx_GOTREF(__pyx_t_5);
10543  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 493, __pyx_L3_error)
10544  __Pyx_GOTREF(__pyx_t_6);
10545  __pyx_t_7 = NULL;
10546  __pyx_t_8 = 0;
10547  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
10548  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
10549  if (likely(__pyx_t_7)) {
10550  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10551  __Pyx_INCREF(__pyx_t_7);
10552  __Pyx_INCREF(function);
10553  __Pyx_DECREF_SET(__pyx_t_5, function);
10554  __pyx_t_8 = 1;
10555  }
10556  }
10557  #if CYTHON_FAST_PYCALL
10558  if (PyFunction_Check(__pyx_t_5)) {
10559  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10560  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L3_error)
10561  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10562  __Pyx_GOTREF(__pyx_t_1);
10563  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10564  } else
10565  #endif
10566  #if CYTHON_FAST_PYCCALL
10567  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
10568  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10569  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L3_error)
10570  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10571  __Pyx_GOTREF(__pyx_t_1);
10572  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10573  } else
10574  #endif
10575  {
10576  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 493, __pyx_L3_error)
10577  __Pyx_GOTREF(__pyx_t_9);
10578  if (__pyx_t_7) {
10579  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
10580  }
10581  __Pyx_GIVEREF(__pyx_t_6);
10582  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
10583  __Pyx_INCREF(__pyx_v_bytesitem);
10584  __Pyx_GIVEREF(__pyx_v_bytesitem);
10585  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
10586  __pyx_t_6 = 0;
10587  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L3_error)
10588  __Pyx_GOTREF(__pyx_t_1);
10589  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10590  }
10591  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10592  __pyx_v_result = __pyx_t_1;
10593  __pyx_t_1 = 0;
10594 
10595  /* "View.MemoryView":492
10596  *
10597  * bytesitem = itemp[:self.view.itemsize]
10598  * try: # <<<<<<<<<<<<<<
10599  * result = struct.unpack(self.view.format, bytesitem)
10600  * except struct.error:
10601  */
10602  }
10603 
10604  /* "View.MemoryView":497
10605  * raise ValueError("Unable to convert item to object")
10606  * else:
10607  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
10608  * return result[0]
10609  * return result
10610  */
10611  /*else:*/ {
10612  __pyx_t_10 = strlen(__pyx_v_self->view.format);
10613  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
10614  if (__pyx_t_11) {
10615 
10616  /* "View.MemoryView":498
10617  * else:
10618  * if len(self.view.format) == 1:
10619  * return result[0] # <<<<<<<<<<<<<<
10620  * return result
10621  *
10622  */
10623  __Pyx_XDECREF(__pyx_r);
10624  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L5_except_error)
10625  __Pyx_GOTREF(__pyx_t_1);
10626  __pyx_r = __pyx_t_1;
10627  __pyx_t_1 = 0;
10628  goto __pyx_L6_except_return;
10629 
10630  /* "View.MemoryView":497
10631  * raise ValueError("Unable to convert item to object")
10632  * else:
10633  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
10634  * return result[0]
10635  * return result
10636  */
10637  }
10638 
10639  /* "View.MemoryView":499
10640  * if len(self.view.format) == 1:
10641  * return result[0]
10642  * return result # <<<<<<<<<<<<<<
10643  *
10644  * cdef assign_item_from_object(self, char *itemp, object value):
10645  */
10646  __Pyx_XDECREF(__pyx_r);
10647  __Pyx_INCREF(__pyx_v_result);
10648  __pyx_r = __pyx_v_result;
10649  goto __pyx_L6_except_return;
10650  }
10651  __pyx_L3_error:;
10652  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10653  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10654  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10655  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10656  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10657 
10658  /* "View.MemoryView":494
10659  * try:
10660  * result = struct.unpack(self.view.format, bytesitem)
10661  * except struct.error: # <<<<<<<<<<<<<<
10662  * raise ValueError("Unable to convert item to object")
10663  * else:
10664  */
10665  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
10666  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L5_except_error)
10667  __Pyx_GOTREF(__pyx_t_6);
10668  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
10669  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10670  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
10671  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
10672  if (__pyx_t_8) {
10673  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10674  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 494, __pyx_L5_except_error)
10675  __Pyx_GOTREF(__pyx_t_9);
10676  __Pyx_GOTREF(__pyx_t_5);
10677  __Pyx_GOTREF(__pyx_t_1);
10678 
10679  /* "View.MemoryView":495
10680  * result = struct.unpack(self.view.format, bytesitem)
10681  * except struct.error:
10682  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
10683  * else:
10684  * if len(self.view.format) == 1:
10685  */
10686  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 495, __pyx_L5_except_error)
10687  __Pyx_GOTREF(__pyx_t_6);
10688  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
10689  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10690  __PYX_ERR(0, 495, __pyx_L5_except_error)
10691  }
10692  goto __pyx_L5_except_error;
10693  __pyx_L5_except_error:;
10694 
10695  /* "View.MemoryView":492
10696  *
10697  * bytesitem = itemp[:self.view.itemsize]
10698  * try: # <<<<<<<<<<<<<<
10699  * result = struct.unpack(self.view.format, bytesitem)
10700  * except struct.error:
10701  */
10702  __Pyx_XGIVEREF(__pyx_t_2);
10703  __Pyx_XGIVEREF(__pyx_t_3);
10704  __Pyx_XGIVEREF(__pyx_t_4);
10705  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10706  goto __pyx_L1_error;
10707  __pyx_L6_except_return:;
10708  __Pyx_XGIVEREF(__pyx_t_2);
10709  __Pyx_XGIVEREF(__pyx_t_3);
10710  __Pyx_XGIVEREF(__pyx_t_4);
10711  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10712  goto __pyx_L0;
10713  }
10714 
10715  /* "View.MemoryView":485
10716  * self.assign_item_from_object(itemp, value)
10717  *
10718  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
10719  * """Only used if instantiated manually by the user, or if Cython doesn't
10720  * know how to convert the type"""
10721  */
10722 
10723  /* function exit code */
10724  __pyx_L1_error:;
10725  __Pyx_XDECREF(__pyx_t_1);
10726  __Pyx_XDECREF(__pyx_t_5);
10727  __Pyx_XDECREF(__pyx_t_6);
10728  __Pyx_XDECREF(__pyx_t_7);
10729  __Pyx_XDECREF(__pyx_t_9);
10730  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10731  __pyx_r = 0;
10732  __pyx_L0:;
10733  __Pyx_XDECREF(__pyx_v_struct);
10734  __Pyx_XDECREF(__pyx_v_bytesitem);
10735  __Pyx_XDECREF(__pyx_v_result);
10736  __Pyx_XGIVEREF(__pyx_r);
10737  __Pyx_RefNannyFinishContext();
10738  return __pyx_r;
10739 }
10740 
10741 /* "View.MemoryView":501
10742  * return result
10743  *
10744  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
10745  * """Only used if instantiated manually by the user, or if Cython doesn't
10746  * know how to convert the type"""
10747  */
10748 
10749 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
10750  PyObject *__pyx_v_struct = NULL;
10751  char __pyx_v_c;
10752  PyObject *__pyx_v_bytesvalue = 0;
10753  Py_ssize_t __pyx_v_i;
10754  PyObject *__pyx_r = NULL;
10755  __Pyx_RefNannyDeclarations
10756  PyObject *__pyx_t_1 = NULL;
10757  int __pyx_t_2;
10758  int __pyx_t_3;
10759  PyObject *__pyx_t_4 = NULL;
10760  PyObject *__pyx_t_5 = NULL;
10761  PyObject *__pyx_t_6 = NULL;
10762  int __pyx_t_7;
10763  PyObject *__pyx_t_8 = NULL;
10764  Py_ssize_t __pyx_t_9;
10765  PyObject *__pyx_t_10 = NULL;
10766  char *__pyx_t_11;
10767  char *__pyx_t_12;
10768  char *__pyx_t_13;
10769  char *__pyx_t_14;
10770  int __pyx_lineno = 0;
10771  const char *__pyx_filename = NULL;
10772  int __pyx_clineno = 0;
10773  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
10774 
10775  /* "View.MemoryView":504
10776  * """Only used if instantiated manually by the user, or if Cython doesn't
10777  * know how to convert the type"""
10778  * import struct # <<<<<<<<<<<<<<
10779  * cdef char c
10780  * cdef bytes bytesvalue
10781  */
10782  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
10783  __Pyx_GOTREF(__pyx_t_1);
10784  __pyx_v_struct = __pyx_t_1;
10785  __pyx_t_1 = 0;
10786 
10787  /* "View.MemoryView":509
10788  * cdef Py_ssize_t i
10789  *
10790  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
10791  * bytesvalue = struct.pack(self.view.format, *value)
10792  * else:
10793  */
10794  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
10795  __pyx_t_3 = (__pyx_t_2 != 0);
10796  if (__pyx_t_3) {
10797 
10798  /* "View.MemoryView":510
10799  *
10800  * if isinstance(value, tuple):
10801  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
10802  * else:
10803  * bytesvalue = struct.pack(self.view.format, value)
10804  */
10805  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
10806  __Pyx_GOTREF(__pyx_t_1);
10807  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error)
10808  __Pyx_GOTREF(__pyx_t_4);
10809  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error)
10810  __Pyx_GOTREF(__pyx_t_5);
10811  __Pyx_GIVEREF(__pyx_t_4);
10812  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10813  __pyx_t_4 = 0;
10814  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error)
10815  __Pyx_GOTREF(__pyx_t_4);
10816  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 510, __pyx_L1_error)
10817  __Pyx_GOTREF(__pyx_t_6);
10818  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10819  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10820  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error)
10821  __Pyx_GOTREF(__pyx_t_4);
10822  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10823  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10824  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 510, __pyx_L1_error)
10825  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10826  __pyx_t_4 = 0;
10827 
10828  /* "View.MemoryView":509
10829  * cdef Py_ssize_t i
10830  *
10831  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
10832  * bytesvalue = struct.pack(self.view.format, *value)
10833  * else:
10834  */
10835  goto __pyx_L3;
10836  }
10837 
10838  /* "View.MemoryView":512
10839  * bytesvalue = struct.pack(self.view.format, *value)
10840  * else:
10841  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
10842  *
10843  * for i, c in enumerate(bytesvalue):
10844  */
10845  /*else*/ {
10846  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error)
10847  __Pyx_GOTREF(__pyx_t_6);
10848  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
10849  __Pyx_GOTREF(__pyx_t_1);
10850  __pyx_t_5 = NULL;
10851  __pyx_t_7 = 0;
10852  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
10853  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
10854  if (likely(__pyx_t_5)) {
10855  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
10856  __Pyx_INCREF(__pyx_t_5);
10857  __Pyx_INCREF(function);
10858  __Pyx_DECREF_SET(__pyx_t_6, function);
10859  __pyx_t_7 = 1;
10860  }
10861  }
10862  #if CYTHON_FAST_PYCALL
10863  if (PyFunction_Check(__pyx_t_6)) {
10864  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
10865  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
10866  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10867  __Pyx_GOTREF(__pyx_t_4);
10868  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10869  } else
10870  #endif
10871  #if CYTHON_FAST_PYCCALL
10872  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
10873  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
10874  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
10875  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10876  __Pyx_GOTREF(__pyx_t_4);
10877  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10878  } else
10879  #endif
10880  {
10881  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 512, __pyx_L1_error)
10882  __Pyx_GOTREF(__pyx_t_8);
10883  if (__pyx_t_5) {
10884  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
10885  }
10886  __Pyx_GIVEREF(__pyx_t_1);
10887  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
10888  __Pyx_INCREF(__pyx_v_value);
10889  __Pyx_GIVEREF(__pyx_v_value);
10890  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
10891  __pyx_t_1 = 0;
10892  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
10893  __Pyx_GOTREF(__pyx_t_4);
10894  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10895  }
10896  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10897  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 512, __pyx_L1_error)
10898  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10899  __pyx_t_4 = 0;
10900  }
10901  __pyx_L3:;
10902 
10903  /* "View.MemoryView":514
10904  * bytesvalue = struct.pack(self.view.format, value)
10905  *
10906  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
10907  * itemp[i] = c
10908  *
10909  */
10910  __pyx_t_9 = 0;
10911  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
10912  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
10913  __PYX_ERR(0, 514, __pyx_L1_error)
10914  }
10915  __Pyx_INCREF(__pyx_v_bytesvalue);
10916  __pyx_t_10 = __pyx_v_bytesvalue;
10917  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
10918  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
10919  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
10920  __pyx_t_11 = __pyx_t_14;
10921  __pyx_v_c = (__pyx_t_11[0]);
10922 
10923  /* "View.MemoryView":515
10924  *
10925  * for i, c in enumerate(bytesvalue):
10926  * itemp[i] = c # <<<<<<<<<<<<<<
10927  *
10928  * @cname('getbuffer')
10929  */
10930  __pyx_v_i = __pyx_t_9;
10931 
10932  /* "View.MemoryView":514
10933  * bytesvalue = struct.pack(self.view.format, value)
10934  *
10935  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
10936  * itemp[i] = c
10937  *
10938  */
10939  __pyx_t_9 = (__pyx_t_9 + 1);
10940 
10941  /* "View.MemoryView":515
10942  *
10943  * for i, c in enumerate(bytesvalue):
10944  * itemp[i] = c # <<<<<<<<<<<<<<
10945  *
10946  * @cname('getbuffer')
10947  */
10948  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
10949  }
10950  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10951 
10952  /* "View.MemoryView":501
10953  * return result
10954  *
10955  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
10956  * """Only used if instantiated manually by the user, or if Cython doesn't
10957  * know how to convert the type"""
10958  */
10959 
10960  /* function exit code */
10961  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10962  goto __pyx_L0;
10963  __pyx_L1_error:;
10964  __Pyx_XDECREF(__pyx_t_1);
10965  __Pyx_XDECREF(__pyx_t_4);
10966  __Pyx_XDECREF(__pyx_t_5);
10967  __Pyx_XDECREF(__pyx_t_6);
10968  __Pyx_XDECREF(__pyx_t_8);
10969  __Pyx_XDECREF(__pyx_t_10);
10970  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10971  __pyx_r = 0;
10972  __pyx_L0:;
10973  __Pyx_XDECREF(__pyx_v_struct);
10974  __Pyx_XDECREF(__pyx_v_bytesvalue);
10975  __Pyx_XGIVEREF(__pyx_r);
10976  __Pyx_RefNannyFinishContext();
10977  return __pyx_r;
10978 }
10979 
10980 /* "View.MemoryView":518
10981  *
10982  * @cname('getbuffer')
10983  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
10984  * if flags & PyBUF_WRITABLE and self.view.readonly:
10985  * raise ValueError("Cannot create writable memory view from read-only memoryview")
10986  */
10987 
10988 /* Python wrapper */
10989 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
10990 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10991  int __pyx_r;
10992  __Pyx_RefNannyDeclarations
10993  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
10994  __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));
10995 
10996  /* function exit code */
10997  __Pyx_RefNannyFinishContext();
10998  return __pyx_r;
10999 }
11000 
11001 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) {
11002  int __pyx_r;
11003  __Pyx_RefNannyDeclarations
11004  int __pyx_t_1;
11005  int __pyx_t_2;
11006  PyObject *__pyx_t_3 = NULL;
11007  Py_ssize_t *__pyx_t_4;
11008  char *__pyx_t_5;
11009  void *__pyx_t_6;
11010  int __pyx_t_7;
11011  Py_ssize_t __pyx_t_8;
11012  int __pyx_lineno = 0;
11013  const char *__pyx_filename = NULL;
11014  int __pyx_clineno = 0;
11015  if (__pyx_v_info == NULL) {
11016  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
11017  return -1;
11018  }
11019  __Pyx_RefNannySetupContext("__getbuffer__", 0);
11020  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
11021  __Pyx_GIVEREF(__pyx_v_info->obj);
11022 
11023  /* "View.MemoryView":519
11024  * @cname('getbuffer')
11025  * def __getbuffer__(self, Py_buffer *info, int flags):
11026  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
11027  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11028  *
11029  */
11030  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
11031  if (__pyx_t_2) {
11032  } else {
11033  __pyx_t_1 = __pyx_t_2;
11034  goto __pyx_L4_bool_binop_done;
11035  }
11036  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
11037  __pyx_t_1 = __pyx_t_2;
11038  __pyx_L4_bool_binop_done:;
11039  if (unlikely(__pyx_t_1)) {
11040 
11041  /* "View.MemoryView":520
11042  * def __getbuffer__(self, Py_buffer *info, int flags):
11043  * if flags & PyBUF_WRITABLE and self.view.readonly:
11044  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
11045  *
11046  * if flags & PyBUF_ND:
11047  */
11048  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error)
11049  __Pyx_GOTREF(__pyx_t_3);
11050  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11051  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11052  __PYX_ERR(0, 520, __pyx_L1_error)
11053 
11054  /* "View.MemoryView":519
11055  * @cname('getbuffer')
11056  * def __getbuffer__(self, Py_buffer *info, int flags):
11057  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
11058  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11059  *
11060  */
11061  }
11062 
11063  /* "View.MemoryView":522
11064  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11065  *
11066  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
11067  * info.shape = self.view.shape
11068  * else:
11069  */
11070  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
11071  if (__pyx_t_1) {
11072 
11073  /* "View.MemoryView":523
11074  *
11075  * if flags & PyBUF_ND:
11076  * info.shape = self.view.shape # <<<<<<<<<<<<<<
11077  * else:
11078  * info.shape = NULL
11079  */
11080  __pyx_t_4 = __pyx_v_self->view.shape;
11081  __pyx_v_info->shape = __pyx_t_4;
11082 
11083  /* "View.MemoryView":522
11084  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11085  *
11086  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
11087  * info.shape = self.view.shape
11088  * else:
11089  */
11090  goto __pyx_L6;
11091  }
11092 
11093  /* "View.MemoryView":525
11094  * info.shape = self.view.shape
11095  * else:
11096  * info.shape = NULL # <<<<<<<<<<<<<<
11097  *
11098  * if flags & PyBUF_STRIDES:
11099  */
11100  /*else*/ {
11101  __pyx_v_info->shape = NULL;
11102  }
11103  __pyx_L6:;
11104 
11105  /* "View.MemoryView":527
11106  * info.shape = NULL
11107  *
11108  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
11109  * info.strides = self.view.strides
11110  * else:
11111  */
11112  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
11113  if (__pyx_t_1) {
11114 
11115  /* "View.MemoryView":528
11116  *
11117  * if flags & PyBUF_STRIDES:
11118  * info.strides = self.view.strides # <<<<<<<<<<<<<<
11119  * else:
11120  * info.strides = NULL
11121  */
11122  __pyx_t_4 = __pyx_v_self->view.strides;
11123  __pyx_v_info->strides = __pyx_t_4;
11124 
11125  /* "View.MemoryView":527
11126  * info.shape = NULL
11127  *
11128  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
11129  * info.strides = self.view.strides
11130  * else:
11131  */
11132  goto __pyx_L7;
11133  }
11134 
11135  /* "View.MemoryView":530
11136  * info.strides = self.view.strides
11137  * else:
11138  * info.strides = NULL # <<<<<<<<<<<<<<
11139  *
11140  * if flags & PyBUF_INDIRECT:
11141  */
11142  /*else*/ {
11143  __pyx_v_info->strides = NULL;
11144  }
11145  __pyx_L7:;
11146 
11147  /* "View.MemoryView":532
11148  * info.strides = NULL
11149  *
11150  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
11151  * info.suboffsets = self.view.suboffsets
11152  * else:
11153  */
11154  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
11155  if (__pyx_t_1) {
11156 
11157  /* "View.MemoryView":533
11158  *
11159  * if flags & PyBUF_INDIRECT:
11160  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
11161  * else:
11162  * info.suboffsets = NULL
11163  */
11164  __pyx_t_4 = __pyx_v_self->view.suboffsets;
11165  __pyx_v_info->suboffsets = __pyx_t_4;
11166 
11167  /* "View.MemoryView":532
11168  * info.strides = NULL
11169  *
11170  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
11171  * info.suboffsets = self.view.suboffsets
11172  * else:
11173  */
11174  goto __pyx_L8;
11175  }
11176 
11177  /* "View.MemoryView":535
11178  * info.suboffsets = self.view.suboffsets
11179  * else:
11180  * info.suboffsets = NULL # <<<<<<<<<<<<<<
11181  *
11182  * if flags & PyBUF_FORMAT:
11183  */
11184  /*else*/ {
11185  __pyx_v_info->suboffsets = NULL;
11186  }
11187  __pyx_L8:;
11188 
11189  /* "View.MemoryView":537
11190  * info.suboffsets = NULL
11191  *
11192  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11193  * info.format = self.view.format
11194  * else:
11195  */
11196  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
11197  if (__pyx_t_1) {
11198 
11199  /* "View.MemoryView":538
11200  *
11201  * if flags & PyBUF_FORMAT:
11202  * info.format = self.view.format # <<<<<<<<<<<<<<
11203  * else:
11204  * info.format = NULL
11205  */
11206  __pyx_t_5 = __pyx_v_self->view.format;
11207  __pyx_v_info->format = __pyx_t_5;
11208 
11209  /* "View.MemoryView":537
11210  * info.suboffsets = NULL
11211  *
11212  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
11213  * info.format = self.view.format
11214  * else:
11215  */
11216  goto __pyx_L9;
11217  }
11218 
11219  /* "View.MemoryView":540
11220  * info.format = self.view.format
11221  * else:
11222  * info.format = NULL # <<<<<<<<<<<<<<
11223  *
11224  * info.buf = self.view.buf
11225  */
11226  /*else*/ {
11227  __pyx_v_info->format = NULL;
11228  }
11229  __pyx_L9:;
11230 
11231  /* "View.MemoryView":542
11232  * info.format = NULL
11233  *
11234  * info.buf = self.view.buf # <<<<<<<<<<<<<<
11235  * info.ndim = self.view.ndim
11236  * info.itemsize = self.view.itemsize
11237  */
11238  __pyx_t_6 = __pyx_v_self->view.buf;
11239  __pyx_v_info->buf = __pyx_t_6;
11240 
11241  /* "View.MemoryView":543
11242  *
11243  * info.buf = self.view.buf
11244  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
11245  * info.itemsize = self.view.itemsize
11246  * info.len = self.view.len
11247  */
11248  __pyx_t_7 = __pyx_v_self->view.ndim;
11249  __pyx_v_info->ndim = __pyx_t_7;
11250 
11251  /* "View.MemoryView":544
11252  * info.buf = self.view.buf
11253  * info.ndim = self.view.ndim
11254  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
11255  * info.len = self.view.len
11256  * info.readonly = self.view.readonly
11257  */
11258  __pyx_t_8 = __pyx_v_self->view.itemsize;
11259  __pyx_v_info->itemsize = __pyx_t_8;
11260 
11261  /* "View.MemoryView":545
11262  * info.ndim = self.view.ndim
11263  * info.itemsize = self.view.itemsize
11264  * info.len = self.view.len # <<<<<<<<<<<<<<
11265  * info.readonly = self.view.readonly
11266  * info.obj = self
11267  */
11268  __pyx_t_8 = __pyx_v_self->view.len;
11269  __pyx_v_info->len = __pyx_t_8;
11270 
11271  /* "View.MemoryView":546
11272  * info.itemsize = self.view.itemsize
11273  * info.len = self.view.len
11274  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
11275  * info.obj = self
11276  *
11277  */
11278  __pyx_t_1 = __pyx_v_self->view.readonly;
11279  __pyx_v_info->readonly = __pyx_t_1;
11280 
11281  /* "View.MemoryView":547
11282  * info.len = self.view.len
11283  * info.readonly = self.view.readonly
11284  * info.obj = self # <<<<<<<<<<<<<<
11285  *
11286  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
11287  */
11288  __Pyx_INCREF(((PyObject *)__pyx_v_self));
11289  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
11290  __Pyx_GOTREF(__pyx_v_info->obj);
11291  __Pyx_DECREF(__pyx_v_info->obj);
11292  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
11293 
11294  /* "View.MemoryView":518
11295  *
11296  * @cname('getbuffer')
11297  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
11298  * if flags & PyBUF_WRITABLE and self.view.readonly:
11299  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11300  */
11301 
11302  /* function exit code */
11303  __pyx_r = 0;
11304  goto __pyx_L0;
11305  __pyx_L1_error:;
11306  __Pyx_XDECREF(__pyx_t_3);
11307  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11308  __pyx_r = -1;
11309  if (__pyx_v_info->obj != NULL) {
11310  __Pyx_GOTREF(__pyx_v_info->obj);
11311  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11312  }
11313  goto __pyx_L2;
11314  __pyx_L0:;
11315  if (__pyx_v_info->obj == Py_None) {
11316  __Pyx_GOTREF(__pyx_v_info->obj);
11317  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11318  }
11319  __pyx_L2:;
11320  __Pyx_RefNannyFinishContext();
11321  return __pyx_r;
11322 }
11323 
11324 /* "View.MemoryView":553
11325  *
11326  * @property
11327  * def T(self): # <<<<<<<<<<<<<<
11328  * cdef _memoryviewslice result = memoryview_copy(self)
11329  * transpose_memslice(&result.from_slice)
11330  */
11331 
11332 /* Python wrapper */
11333 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
11334 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
11335  PyObject *__pyx_r = 0;
11336  __Pyx_RefNannyDeclarations
11337  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11338  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11339 
11340  /* function exit code */
11341  __Pyx_RefNannyFinishContext();
11342  return __pyx_r;
11343 }
11344 
11345 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11346  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
11347  PyObject *__pyx_r = NULL;
11348  __Pyx_RefNannyDeclarations
11349  PyObject *__pyx_t_1 = NULL;
11350  int __pyx_t_2;
11351  int __pyx_lineno = 0;
11352  const char *__pyx_filename = NULL;
11353  int __pyx_clineno = 0;
11354  __Pyx_RefNannySetupContext("__get__", 0);
11355 
11356  /* "View.MemoryView":554
11357  * @property
11358  * def T(self):
11359  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
11360  * transpose_memslice(&result.from_slice)
11361  * return result
11362  */
11363  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
11364  __Pyx_GOTREF(__pyx_t_1);
11365  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(0, 554, __pyx_L1_error)
11366  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
11367  __pyx_t_1 = 0;
11368 
11369  /* "View.MemoryView":555
11370  * def T(self):
11371  * cdef _memoryviewslice result = memoryview_copy(self)
11372  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
11373  * return result
11374  *
11375  */
11376  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(0, 555, __pyx_L1_error)
11377 
11378  /* "View.MemoryView":556
11379  * cdef _memoryviewslice result = memoryview_copy(self)
11380  * transpose_memslice(&result.from_slice)
11381  * return result # <<<<<<<<<<<<<<
11382  *
11383  * @property
11384  */
11385  __Pyx_XDECREF(__pyx_r);
11386  __Pyx_INCREF(((PyObject *)__pyx_v_result));
11387  __pyx_r = ((PyObject *)__pyx_v_result);
11388  goto __pyx_L0;
11389 
11390  /* "View.MemoryView":553
11391  *
11392  * @property
11393  * def T(self): # <<<<<<<<<<<<<<
11394  * cdef _memoryviewslice result = memoryview_copy(self)
11395  * transpose_memslice(&result.from_slice)
11396  */
11397 
11398  /* function exit code */
11399  __pyx_L1_error:;
11400  __Pyx_XDECREF(__pyx_t_1);
11401  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11402  __pyx_r = NULL;
11403  __pyx_L0:;
11404  __Pyx_XDECREF((PyObject *)__pyx_v_result);
11405  __Pyx_XGIVEREF(__pyx_r);
11406  __Pyx_RefNannyFinishContext();
11407  return __pyx_r;
11408 }
11409 
11410 /* "View.MemoryView":559
11411  *
11412  * @property
11413  * def base(self): # <<<<<<<<<<<<<<
11414  * return self.obj
11415  *
11416  */
11417 
11418 /* Python wrapper */
11419 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
11420 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
11421  PyObject *__pyx_r = 0;
11422  __Pyx_RefNannyDeclarations
11423  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11424  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11425 
11426  /* function exit code */
11427  __Pyx_RefNannyFinishContext();
11428  return __pyx_r;
11429 }
11430 
11431 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11432  PyObject *__pyx_r = NULL;
11433  __Pyx_RefNannyDeclarations
11434  __Pyx_RefNannySetupContext("__get__", 0);
11435 
11436  /* "View.MemoryView":560
11437  * @property
11438  * def base(self):
11439  * return self.obj # <<<<<<<<<<<<<<
11440  *
11441  * @property
11442  */
11443  __Pyx_XDECREF(__pyx_r);
11444  __Pyx_INCREF(__pyx_v_self->obj);
11445  __pyx_r = __pyx_v_self->obj;
11446  goto __pyx_L0;
11447 
11448  /* "View.MemoryView":559
11449  *
11450  * @property
11451  * def base(self): # <<<<<<<<<<<<<<
11452  * return self.obj
11453  *
11454  */
11455 
11456  /* function exit code */
11457  __pyx_L0:;
11458  __Pyx_XGIVEREF(__pyx_r);
11459  __Pyx_RefNannyFinishContext();
11460  return __pyx_r;
11461 }
11462 
11463 /* "View.MemoryView":563
11464  *
11465  * @property
11466  * def shape(self): # <<<<<<<<<<<<<<
11467  * return tuple([length for length in self.view.shape[:self.view.ndim]])
11468  *
11469  */
11470 
11471 /* Python wrapper */
11472 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
11473 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
11474  PyObject *__pyx_r = 0;
11475  __Pyx_RefNannyDeclarations
11476  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11477  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11478 
11479  /* function exit code */
11480  __Pyx_RefNannyFinishContext();
11481  return __pyx_r;
11482 }
11483 
11484 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11485  Py_ssize_t __pyx_v_length;
11486  PyObject *__pyx_r = NULL;
11487  __Pyx_RefNannyDeclarations
11488  PyObject *__pyx_t_1 = NULL;
11489  Py_ssize_t *__pyx_t_2;
11490  Py_ssize_t *__pyx_t_3;
11491  Py_ssize_t *__pyx_t_4;
11492  PyObject *__pyx_t_5 = NULL;
11493  int __pyx_lineno = 0;
11494  const char *__pyx_filename = NULL;
11495  int __pyx_clineno = 0;
11496  __Pyx_RefNannySetupContext("__get__", 0);
11497 
11498  /* "View.MemoryView":564
11499  * @property
11500  * def shape(self):
11501  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
11502  *
11503  * @property
11504  */
11505  __Pyx_XDECREF(__pyx_r);
11506  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
11507  __Pyx_GOTREF(__pyx_t_1);
11508  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11509  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11510  __pyx_t_2 = __pyx_t_4;
11511  __pyx_v_length = (__pyx_t_2[0]);
11512  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error)
11513  __Pyx_GOTREF(__pyx_t_5);
11514  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 564, __pyx_L1_error)
11515  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11516  }
11517  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error)
11518  __Pyx_GOTREF(__pyx_t_5);
11519  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11520  __pyx_r = __pyx_t_5;
11521  __pyx_t_5 = 0;
11522  goto __pyx_L0;
11523 
11524  /* "View.MemoryView":563
11525  *
11526  * @property
11527  * def shape(self): # <<<<<<<<<<<<<<
11528  * return tuple([length for length in self.view.shape[:self.view.ndim]])
11529  *
11530  */
11531 
11532  /* function exit code */
11533  __pyx_L1_error:;
11534  __Pyx_XDECREF(__pyx_t_1);
11535  __Pyx_XDECREF(__pyx_t_5);
11536  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11537  __pyx_r = NULL;
11538  __pyx_L0:;
11539  __Pyx_XGIVEREF(__pyx_r);
11540  __Pyx_RefNannyFinishContext();
11541  return __pyx_r;
11542 }
11543 
11544 /* "View.MemoryView":567
11545  *
11546  * @property
11547  * def strides(self): # <<<<<<<<<<<<<<
11548  * if self.view.strides == NULL:
11549  *
11550  */
11551 
11552 /* Python wrapper */
11553 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
11554 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
11555  PyObject *__pyx_r = 0;
11556  __Pyx_RefNannyDeclarations
11557  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11558  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11559 
11560  /* function exit code */
11561  __Pyx_RefNannyFinishContext();
11562  return __pyx_r;
11563 }
11564 
11565 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11566  Py_ssize_t __pyx_v_stride;
11567  PyObject *__pyx_r = NULL;
11568  __Pyx_RefNannyDeclarations
11569  int __pyx_t_1;
11570  PyObject *__pyx_t_2 = NULL;
11571  Py_ssize_t *__pyx_t_3;
11572  Py_ssize_t *__pyx_t_4;
11573  Py_ssize_t *__pyx_t_5;
11574  PyObject *__pyx_t_6 = NULL;
11575  int __pyx_lineno = 0;
11576  const char *__pyx_filename = NULL;
11577  int __pyx_clineno = 0;
11578  __Pyx_RefNannySetupContext("__get__", 0);
11579 
11580  /* "View.MemoryView":568
11581  * @property
11582  * def strides(self):
11583  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
11584  *
11585  * raise ValueError("Buffer view does not expose strides")
11586  */
11587  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
11588  if (unlikely(__pyx_t_1)) {
11589 
11590  /* "View.MemoryView":570
11591  * if self.view.strides == NULL:
11592  *
11593  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
11594  *
11595  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11596  */
11597  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
11598  __Pyx_GOTREF(__pyx_t_2);
11599  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11600  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11601  __PYX_ERR(0, 570, __pyx_L1_error)
11602 
11603  /* "View.MemoryView":568
11604  * @property
11605  * def strides(self):
11606  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
11607  *
11608  * raise ValueError("Buffer view does not expose strides")
11609  */
11610  }
11611 
11612  /* "View.MemoryView":572
11613  * raise ValueError("Buffer view does not expose strides")
11614  *
11615  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
11616  *
11617  * @property
11618  */
11619  __Pyx_XDECREF(__pyx_r);
11620  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
11621  __Pyx_GOTREF(__pyx_t_2);
11622  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
11623  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11624  __pyx_t_3 = __pyx_t_5;
11625  __pyx_v_stride = (__pyx_t_3[0]);
11626  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error)
11627  __Pyx_GOTREF(__pyx_t_6);
11628  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 572, __pyx_L1_error)
11629  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11630  }
11631  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error)
11632  __Pyx_GOTREF(__pyx_t_6);
11633  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11634  __pyx_r = __pyx_t_6;
11635  __pyx_t_6 = 0;
11636  goto __pyx_L0;
11637 
11638  /* "View.MemoryView":567
11639  *
11640  * @property
11641  * def strides(self): # <<<<<<<<<<<<<<
11642  * if self.view.strides == NULL:
11643  *
11644  */
11645 
11646  /* function exit code */
11647  __pyx_L1_error:;
11648  __Pyx_XDECREF(__pyx_t_2);
11649  __Pyx_XDECREF(__pyx_t_6);
11650  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11651  __pyx_r = NULL;
11652  __pyx_L0:;
11653  __Pyx_XGIVEREF(__pyx_r);
11654  __Pyx_RefNannyFinishContext();
11655  return __pyx_r;
11656 }
11657 
11658 /* "View.MemoryView":575
11659  *
11660  * @property
11661  * def suboffsets(self): # <<<<<<<<<<<<<<
11662  * if self.view.suboffsets == NULL:
11663  * return (-1,) * self.view.ndim
11664  */
11665 
11666 /* Python wrapper */
11667 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
11668 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
11669  PyObject *__pyx_r = 0;
11670  __Pyx_RefNannyDeclarations
11671  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11672  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11673 
11674  /* function exit code */
11675  __Pyx_RefNannyFinishContext();
11676  return __pyx_r;
11677 }
11678 
11679 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11680  Py_ssize_t __pyx_v_suboffset;
11681  PyObject *__pyx_r = NULL;
11682  __Pyx_RefNannyDeclarations
11683  int __pyx_t_1;
11684  PyObject *__pyx_t_2 = NULL;
11685  PyObject *__pyx_t_3 = NULL;
11686  Py_ssize_t *__pyx_t_4;
11687  Py_ssize_t *__pyx_t_5;
11688  Py_ssize_t *__pyx_t_6;
11689  int __pyx_lineno = 0;
11690  const char *__pyx_filename = NULL;
11691  int __pyx_clineno = 0;
11692  __Pyx_RefNannySetupContext("__get__", 0);
11693 
11694  /* "View.MemoryView":576
11695  * @property
11696  * def suboffsets(self):
11697  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
11698  * return (-1,) * self.view.ndim
11699  *
11700  */
11701  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
11702  if (__pyx_t_1) {
11703 
11704  /* "View.MemoryView":577
11705  * def suboffsets(self):
11706  * if self.view.suboffsets == NULL:
11707  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
11708  *
11709  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11710  */
11711  __Pyx_XDECREF(__pyx_r);
11712  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
11713  __Pyx_GOTREF(__pyx_t_2);
11714  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__27, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error)
11715  __Pyx_GOTREF(__pyx_t_3);
11716  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11717  __pyx_r = __pyx_t_3;
11718  __pyx_t_3 = 0;
11719  goto __pyx_L0;
11720 
11721  /* "View.MemoryView":576
11722  * @property
11723  * def suboffsets(self):
11724  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
11725  * return (-1,) * self.view.ndim
11726  *
11727  */
11728  }
11729 
11730  /* "View.MemoryView":579
11731  * return (-1,) * self.view.ndim
11732  *
11733  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
11734  *
11735  * @property
11736  */
11737  __Pyx_XDECREF(__pyx_r);
11738  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error)
11739  __Pyx_GOTREF(__pyx_t_3);
11740  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
11741  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
11742  __pyx_t_4 = __pyx_t_6;
11743  __pyx_v_suboffset = (__pyx_t_4[0]);
11744  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error)
11745  __Pyx_GOTREF(__pyx_t_2);
11746  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 579, __pyx_L1_error)
11747  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11748  }
11749  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error)
11750  __Pyx_GOTREF(__pyx_t_2);
11751  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11752  __pyx_r = __pyx_t_2;
11753  __pyx_t_2 = 0;
11754  goto __pyx_L0;
11755 
11756  /* "View.MemoryView":575
11757  *
11758  * @property
11759  * def suboffsets(self): # <<<<<<<<<<<<<<
11760  * if self.view.suboffsets == NULL:
11761  * return (-1,) * self.view.ndim
11762  */
11763 
11764  /* function exit code */
11765  __pyx_L1_error:;
11766  __Pyx_XDECREF(__pyx_t_2);
11767  __Pyx_XDECREF(__pyx_t_3);
11768  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11769  __pyx_r = NULL;
11770  __pyx_L0:;
11771  __Pyx_XGIVEREF(__pyx_r);
11772  __Pyx_RefNannyFinishContext();
11773  return __pyx_r;
11774 }
11775 
11776 /* "View.MemoryView":582
11777  *
11778  * @property
11779  * def ndim(self): # <<<<<<<<<<<<<<
11780  * return self.view.ndim
11781  *
11782  */
11783 
11784 /* Python wrapper */
11785 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
11786 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
11787  PyObject *__pyx_r = 0;
11788  __Pyx_RefNannyDeclarations
11789  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11790  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11791 
11792  /* function exit code */
11793  __Pyx_RefNannyFinishContext();
11794  return __pyx_r;
11795 }
11796 
11797 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11798  PyObject *__pyx_r = NULL;
11799  __Pyx_RefNannyDeclarations
11800  PyObject *__pyx_t_1 = NULL;
11801  int __pyx_lineno = 0;
11802  const char *__pyx_filename = NULL;
11803  int __pyx_clineno = 0;
11804  __Pyx_RefNannySetupContext("__get__", 0);
11805 
11806  /* "View.MemoryView":583
11807  * @property
11808  * def ndim(self):
11809  * return self.view.ndim # <<<<<<<<<<<<<<
11810  *
11811  * @property
11812  */
11813  __Pyx_XDECREF(__pyx_r);
11814  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
11815  __Pyx_GOTREF(__pyx_t_1);
11816  __pyx_r = __pyx_t_1;
11817  __pyx_t_1 = 0;
11818  goto __pyx_L0;
11819 
11820  /* "View.MemoryView":582
11821  *
11822  * @property
11823  * def ndim(self): # <<<<<<<<<<<<<<
11824  * return self.view.ndim
11825  *
11826  */
11827 
11828  /* function exit code */
11829  __pyx_L1_error:;
11830  __Pyx_XDECREF(__pyx_t_1);
11831  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11832  __pyx_r = NULL;
11833  __pyx_L0:;
11834  __Pyx_XGIVEREF(__pyx_r);
11835  __Pyx_RefNannyFinishContext();
11836  return __pyx_r;
11837 }
11838 
11839 /* "View.MemoryView":586
11840  *
11841  * @property
11842  * def itemsize(self): # <<<<<<<<<<<<<<
11843  * return self.view.itemsize
11844  *
11845  */
11846 
11847 /* Python wrapper */
11848 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
11849 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
11850  PyObject *__pyx_r = 0;
11851  __Pyx_RefNannyDeclarations
11852  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11853  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11854 
11855  /* function exit code */
11856  __Pyx_RefNannyFinishContext();
11857  return __pyx_r;
11858 }
11859 
11860 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11861  PyObject *__pyx_r = NULL;
11862  __Pyx_RefNannyDeclarations
11863  PyObject *__pyx_t_1 = NULL;
11864  int __pyx_lineno = 0;
11865  const char *__pyx_filename = NULL;
11866  int __pyx_clineno = 0;
11867  __Pyx_RefNannySetupContext("__get__", 0);
11868 
11869  /* "View.MemoryView":587
11870  * @property
11871  * def itemsize(self):
11872  * return self.view.itemsize # <<<<<<<<<<<<<<
11873  *
11874  * @property
11875  */
11876  __Pyx_XDECREF(__pyx_r);
11877  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error)
11878  __Pyx_GOTREF(__pyx_t_1);
11879  __pyx_r = __pyx_t_1;
11880  __pyx_t_1 = 0;
11881  goto __pyx_L0;
11882 
11883  /* "View.MemoryView":586
11884  *
11885  * @property
11886  * def itemsize(self): # <<<<<<<<<<<<<<
11887  * return self.view.itemsize
11888  *
11889  */
11890 
11891  /* function exit code */
11892  __pyx_L1_error:;
11893  __Pyx_XDECREF(__pyx_t_1);
11894  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11895  __pyx_r = NULL;
11896  __pyx_L0:;
11897  __Pyx_XGIVEREF(__pyx_r);
11898  __Pyx_RefNannyFinishContext();
11899  return __pyx_r;
11900 }
11901 
11902 /* "View.MemoryView":590
11903  *
11904  * @property
11905  * def nbytes(self): # <<<<<<<<<<<<<<
11906  * return self.size * self.view.itemsize
11907  *
11908  */
11909 
11910 /* Python wrapper */
11911 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
11912 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
11913  PyObject *__pyx_r = 0;
11914  __Pyx_RefNannyDeclarations
11915  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11916  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11917 
11918  /* function exit code */
11919  __Pyx_RefNannyFinishContext();
11920  return __pyx_r;
11921 }
11922 
11923 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11924  PyObject *__pyx_r = NULL;
11925  __Pyx_RefNannyDeclarations
11926  PyObject *__pyx_t_1 = NULL;
11927  PyObject *__pyx_t_2 = NULL;
11928  PyObject *__pyx_t_3 = NULL;
11929  int __pyx_lineno = 0;
11930  const char *__pyx_filename = NULL;
11931  int __pyx_clineno = 0;
11932  __Pyx_RefNannySetupContext("__get__", 0);
11933 
11934  /* "View.MemoryView":591
11935  * @property
11936  * def nbytes(self):
11937  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
11938  *
11939  * @property
11940  */
11941  __Pyx_XDECREF(__pyx_r);
11942  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error)
11943  __Pyx_GOTREF(__pyx_t_1);
11944  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error)
11945  __Pyx_GOTREF(__pyx_t_2);
11946  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error)
11947  __Pyx_GOTREF(__pyx_t_3);
11948  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11949  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11950  __pyx_r = __pyx_t_3;
11951  __pyx_t_3 = 0;
11952  goto __pyx_L0;
11953 
11954  /* "View.MemoryView":590
11955  *
11956  * @property
11957  * def nbytes(self): # <<<<<<<<<<<<<<
11958  * return self.size * self.view.itemsize
11959  *
11960  */
11961 
11962  /* function exit code */
11963  __pyx_L1_error:;
11964  __Pyx_XDECREF(__pyx_t_1);
11965  __Pyx_XDECREF(__pyx_t_2);
11966  __Pyx_XDECREF(__pyx_t_3);
11967  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11968  __pyx_r = NULL;
11969  __pyx_L0:;
11970  __Pyx_XGIVEREF(__pyx_r);
11971  __Pyx_RefNannyFinishContext();
11972  return __pyx_r;
11973 }
11974 
11975 /* "View.MemoryView":594
11976  *
11977  * @property
11978  * def size(self): # <<<<<<<<<<<<<<
11979  * if self._size is None:
11980  * result = 1
11981  */
11982 
11983 /* Python wrapper */
11984 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
11985 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11986  PyObject *__pyx_r = 0;
11987  __Pyx_RefNannyDeclarations
11988  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11989  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11990 
11991  /* function exit code */
11992  __Pyx_RefNannyFinishContext();
11993  return __pyx_r;
11994 }
11995 
11996 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11997  PyObject *__pyx_v_result = NULL;
11998  PyObject *__pyx_v_length = NULL;
11999  PyObject *__pyx_r = NULL;
12000  __Pyx_RefNannyDeclarations
12001  int __pyx_t_1;
12002  int __pyx_t_2;
12003  Py_ssize_t *__pyx_t_3;
12004  Py_ssize_t *__pyx_t_4;
12005  Py_ssize_t *__pyx_t_5;
12006  PyObject *__pyx_t_6 = NULL;
12007  int __pyx_lineno = 0;
12008  const char *__pyx_filename = NULL;
12009  int __pyx_clineno = 0;
12010  __Pyx_RefNannySetupContext("__get__", 0);
12011 
12012  /* "View.MemoryView":595
12013  * @property
12014  * def size(self):
12015  * if self._size is None: # <<<<<<<<<<<<<<
12016  * result = 1
12017  *
12018  */
12019  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
12020  __pyx_t_2 = (__pyx_t_1 != 0);
12021  if (__pyx_t_2) {
12022 
12023  /* "View.MemoryView":596
12024  * def size(self):
12025  * if self._size is None:
12026  * result = 1 # <<<<<<<<<<<<<<
12027  *
12028  * for length in self.view.shape[:self.view.ndim]:
12029  */
12030  __Pyx_INCREF(__pyx_int_1);
12031  __pyx_v_result = __pyx_int_1;
12032 
12033  /* "View.MemoryView":598
12034  * result = 1
12035  *
12036  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
12037  * result *= length
12038  *
12039  */
12040  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12041  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12042  __pyx_t_3 = __pyx_t_5;
12043  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 598, __pyx_L1_error)
12044  __Pyx_GOTREF(__pyx_t_6);
12045  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
12046  __pyx_t_6 = 0;
12047 
12048  /* "View.MemoryView":599
12049  *
12050  * for length in self.view.shape[:self.view.ndim]:
12051  * result *= length # <<<<<<<<<<<<<<
12052  *
12053  * self._size = result
12054  */
12055  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error)
12056  __Pyx_GOTREF(__pyx_t_6);
12057  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
12058  __pyx_t_6 = 0;
12059  }
12060 
12061  /* "View.MemoryView":601
12062  * result *= length
12063  *
12064  * self._size = result # <<<<<<<<<<<<<<
12065  *
12066  * return self._size
12067  */
12068  __Pyx_INCREF(__pyx_v_result);
12069  __Pyx_GIVEREF(__pyx_v_result);
12070  __Pyx_GOTREF(__pyx_v_self->_size);
12071  __Pyx_DECREF(__pyx_v_self->_size);
12072  __pyx_v_self->_size = __pyx_v_result;
12073 
12074  /* "View.MemoryView":595
12075  * @property
12076  * def size(self):
12077  * if self._size is None: # <<<<<<<<<<<<<<
12078  * result = 1
12079  *
12080  */
12081  }
12082 
12083  /* "View.MemoryView":603
12084  * self._size = result
12085  *
12086  * return self._size # <<<<<<<<<<<<<<
12087  *
12088  * def __len__(self):
12089  */
12090  __Pyx_XDECREF(__pyx_r);
12091  __Pyx_INCREF(__pyx_v_self->_size);
12092  __pyx_r = __pyx_v_self->_size;
12093  goto __pyx_L0;
12094 
12095  /* "View.MemoryView":594
12096  *
12097  * @property
12098  * def size(self): # <<<<<<<<<<<<<<
12099  * if self._size is None:
12100  * result = 1
12101  */
12102 
12103  /* function exit code */
12104  __pyx_L1_error:;
12105  __Pyx_XDECREF(__pyx_t_6);
12106  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12107  __pyx_r = NULL;
12108  __pyx_L0:;
12109  __Pyx_XDECREF(__pyx_v_result);
12110  __Pyx_XDECREF(__pyx_v_length);
12111  __Pyx_XGIVEREF(__pyx_r);
12112  __Pyx_RefNannyFinishContext();
12113  return __pyx_r;
12114 }
12115 
12116 /* "View.MemoryView":605
12117  * return self._size
12118  *
12119  * def __len__(self): # <<<<<<<<<<<<<<
12120  * if self.view.ndim >= 1:
12121  * return self.view.shape[0]
12122  */
12123 
12124 /* Python wrapper */
12125 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
12126 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
12127  Py_ssize_t __pyx_r;
12128  __Pyx_RefNannyDeclarations
12129  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
12130  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12131 
12132  /* function exit code */
12133  __Pyx_RefNannyFinishContext();
12134  return __pyx_r;
12135 }
12136 
12137 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
12138  Py_ssize_t __pyx_r;
12139  __Pyx_RefNannyDeclarations
12140  int __pyx_t_1;
12141  __Pyx_RefNannySetupContext("__len__", 0);
12142 
12143  /* "View.MemoryView":606
12144  *
12145  * def __len__(self):
12146  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
12147  * return self.view.shape[0]
12148  *
12149  */
12150  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
12151  if (__pyx_t_1) {
12152 
12153  /* "View.MemoryView":607
12154  * def __len__(self):
12155  * if self.view.ndim >= 1:
12156  * return self.view.shape[0] # <<<<<<<<<<<<<<
12157  *
12158  * return 0
12159  */
12160  __pyx_r = (__pyx_v_self->view.shape[0]);
12161  goto __pyx_L0;
12162 
12163  /* "View.MemoryView":606
12164  *
12165  * def __len__(self):
12166  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
12167  * return self.view.shape[0]
12168  *
12169  */
12170  }
12171 
12172  /* "View.MemoryView":609
12173  * return self.view.shape[0]
12174  *
12175  * return 0 # <<<<<<<<<<<<<<
12176  *
12177  * def __repr__(self):
12178  */
12179  __pyx_r = 0;
12180  goto __pyx_L0;
12181 
12182  /* "View.MemoryView":605
12183  * return self._size
12184  *
12185  * def __len__(self): # <<<<<<<<<<<<<<
12186  * if self.view.ndim >= 1:
12187  * return self.view.shape[0]
12188  */
12189 
12190  /* function exit code */
12191  __pyx_L0:;
12192  __Pyx_RefNannyFinishContext();
12193  return __pyx_r;
12194 }
12195 
12196 /* "View.MemoryView":611
12197  * return 0
12198  *
12199  * def __repr__(self): # <<<<<<<<<<<<<<
12200  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12201  * id(self))
12202  */
12203 
12204 /* Python wrapper */
12205 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
12206 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
12207  PyObject *__pyx_r = 0;
12208  __Pyx_RefNannyDeclarations
12209  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
12210  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12211 
12212  /* function exit code */
12213  __Pyx_RefNannyFinishContext();
12214  return __pyx_r;
12215 }
12216 
12217 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
12218  PyObject *__pyx_r = NULL;
12219  __Pyx_RefNannyDeclarations
12220  PyObject *__pyx_t_1 = NULL;
12221  PyObject *__pyx_t_2 = NULL;
12222  PyObject *__pyx_t_3 = NULL;
12223  int __pyx_lineno = 0;
12224  const char *__pyx_filename = NULL;
12225  int __pyx_clineno = 0;
12226  __Pyx_RefNannySetupContext("__repr__", 0);
12227 
12228  /* "View.MemoryView":612
12229  *
12230  * def __repr__(self):
12231  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
12232  * id(self))
12233  *
12234  */
12235  __Pyx_XDECREF(__pyx_r);
12236  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
12237  __Pyx_GOTREF(__pyx_t_1);
12238  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error)
12239  __Pyx_GOTREF(__pyx_t_2);
12240  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12241  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
12242  __Pyx_GOTREF(__pyx_t_1);
12243  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12244 
12245  /* "View.MemoryView":613
12246  * def __repr__(self):
12247  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12248  * id(self)) # <<<<<<<<<<<<<<
12249  *
12250  * def __str__(self):
12251  */
12252  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error)
12253  __Pyx_GOTREF(__pyx_t_2);
12254 
12255  /* "View.MemoryView":612
12256  *
12257  * def __repr__(self):
12258  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
12259  * id(self))
12260  *
12261  */
12262  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error)
12263  __Pyx_GOTREF(__pyx_t_3);
12264  __Pyx_GIVEREF(__pyx_t_1);
12265  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
12266  __Pyx_GIVEREF(__pyx_t_2);
12267  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
12268  __pyx_t_1 = 0;
12269  __pyx_t_2 = 0;
12270  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error)
12271  __Pyx_GOTREF(__pyx_t_2);
12272  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12273  __pyx_r = __pyx_t_2;
12274  __pyx_t_2 = 0;
12275  goto __pyx_L0;
12276 
12277  /* "View.MemoryView":611
12278  * return 0
12279  *
12280  * def __repr__(self): # <<<<<<<<<<<<<<
12281  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12282  * id(self))
12283  */
12284 
12285  /* function exit code */
12286  __pyx_L1_error:;
12287  __Pyx_XDECREF(__pyx_t_1);
12288  __Pyx_XDECREF(__pyx_t_2);
12289  __Pyx_XDECREF(__pyx_t_3);
12290  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12291  __pyx_r = NULL;
12292  __pyx_L0:;
12293  __Pyx_XGIVEREF(__pyx_r);
12294  __Pyx_RefNannyFinishContext();
12295  return __pyx_r;
12296 }
12297 
12298 /* "View.MemoryView":615
12299  * id(self))
12300  *
12301  * def __str__(self): # <<<<<<<<<<<<<<
12302  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
12303  *
12304  */
12305 
12306 /* Python wrapper */
12307 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
12308 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
12309  PyObject *__pyx_r = 0;
12310  __Pyx_RefNannyDeclarations
12311  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
12312  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12313 
12314  /* function exit code */
12315  __Pyx_RefNannyFinishContext();
12316  return __pyx_r;
12317 }
12318 
12319 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
12320  PyObject *__pyx_r = NULL;
12321  __Pyx_RefNannyDeclarations
12322  PyObject *__pyx_t_1 = NULL;
12323  PyObject *__pyx_t_2 = NULL;
12324  int __pyx_lineno = 0;
12325  const char *__pyx_filename = NULL;
12326  int __pyx_clineno = 0;
12327  __Pyx_RefNannySetupContext("__str__", 0);
12328 
12329  /* "View.MemoryView":616
12330  *
12331  * def __str__(self):
12332  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
12333  *
12334  *
12335  */
12336  __Pyx_XDECREF(__pyx_r);
12337  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
12338  __Pyx_GOTREF(__pyx_t_1);
12339  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error)
12340  __Pyx_GOTREF(__pyx_t_2);
12341  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12342  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
12343  __Pyx_GOTREF(__pyx_t_1);
12344  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12345  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 616, __pyx_L1_error)
12346  __Pyx_GOTREF(__pyx_t_2);
12347  __Pyx_GIVEREF(__pyx_t_1);
12348  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
12349  __pyx_t_1 = 0;
12350  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
12351  __Pyx_GOTREF(__pyx_t_1);
12352  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12353  __pyx_r = __pyx_t_1;
12354  __pyx_t_1 = 0;
12355  goto __pyx_L0;
12356 
12357  /* "View.MemoryView":615
12358  * id(self))
12359  *
12360  * def __str__(self): # <<<<<<<<<<<<<<
12361  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
12362  *
12363  */
12364 
12365  /* function exit code */
12366  __pyx_L1_error:;
12367  __Pyx_XDECREF(__pyx_t_1);
12368  __Pyx_XDECREF(__pyx_t_2);
12369  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12370  __pyx_r = NULL;
12371  __pyx_L0:;
12372  __Pyx_XGIVEREF(__pyx_r);
12373  __Pyx_RefNannyFinishContext();
12374  return __pyx_r;
12375 }
12376 
12377 /* "View.MemoryView":619
12378  *
12379  *
12380  * def is_c_contig(self): # <<<<<<<<<<<<<<
12381  * cdef __Pyx_memviewslice *mslice
12382  * cdef __Pyx_memviewslice tmp
12383  */
12384 
12385 /* Python wrapper */
12386 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12387 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12388  PyObject *__pyx_r = 0;
12389  __Pyx_RefNannyDeclarations
12390  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
12391  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
12392 
12393  /* function exit code */
12394  __Pyx_RefNannyFinishContext();
12395  return __pyx_r;
12396 }
12397 
12398 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
12399  __Pyx_memviewslice *__pyx_v_mslice;
12400  __Pyx_memviewslice __pyx_v_tmp;
12401  PyObject *__pyx_r = NULL;
12402  __Pyx_RefNannyDeclarations
12403  __Pyx_memviewslice *__pyx_t_1;
12404  PyObject *__pyx_t_2 = NULL;
12405  int __pyx_lineno = 0;
12406  const char *__pyx_filename = NULL;
12407  int __pyx_clineno = 0;
12408  __Pyx_RefNannySetupContext("is_c_contig", 0);
12409 
12410  /* "View.MemoryView":622
12411  * cdef __Pyx_memviewslice *mslice
12412  * cdef __Pyx_memviewslice tmp
12413  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
12414  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12415  *
12416  */
12417  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(0, 622, __pyx_L1_error)
12418  __pyx_v_mslice = __pyx_t_1;
12419 
12420  /* "View.MemoryView":623
12421  * cdef __Pyx_memviewslice tmp
12422  * mslice = get_slice_from_memview(self, &tmp)
12423  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
12424  *
12425  * def is_f_contig(self):
12426  */
12427  __Pyx_XDECREF(__pyx_r);
12428  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error)
12429  __Pyx_GOTREF(__pyx_t_2);
12430  __pyx_r = __pyx_t_2;
12431  __pyx_t_2 = 0;
12432  goto __pyx_L0;
12433 
12434  /* "View.MemoryView":619
12435  *
12436  *
12437  * def is_c_contig(self): # <<<<<<<<<<<<<<
12438  * cdef __Pyx_memviewslice *mslice
12439  * cdef __Pyx_memviewslice tmp
12440  */
12441 
12442  /* function exit code */
12443  __pyx_L1_error:;
12444  __Pyx_XDECREF(__pyx_t_2);
12445  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12446  __pyx_r = NULL;
12447  __pyx_L0:;
12448  __Pyx_XGIVEREF(__pyx_r);
12449  __Pyx_RefNannyFinishContext();
12450  return __pyx_r;
12451 }
12452 
12453 /* "View.MemoryView":625
12454  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12455  *
12456  * def is_f_contig(self): # <<<<<<<<<<<<<<
12457  * cdef __Pyx_memviewslice *mslice
12458  * cdef __Pyx_memviewslice tmp
12459  */
12460 
12461 /* Python wrapper */
12462 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12463 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12464  PyObject *__pyx_r = 0;
12465  __Pyx_RefNannyDeclarations
12466  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
12467  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
12468 
12469  /* function exit code */
12470  __Pyx_RefNannyFinishContext();
12471  return __pyx_r;
12472 }
12473 
12474 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
12475  __Pyx_memviewslice *__pyx_v_mslice;
12476  __Pyx_memviewslice __pyx_v_tmp;
12477  PyObject *__pyx_r = NULL;
12478  __Pyx_RefNannyDeclarations
12479  __Pyx_memviewslice *__pyx_t_1;
12480  PyObject *__pyx_t_2 = NULL;
12481  int __pyx_lineno = 0;
12482  const char *__pyx_filename = NULL;
12483  int __pyx_clineno = 0;
12484  __Pyx_RefNannySetupContext("is_f_contig", 0);
12485 
12486  /* "View.MemoryView":628
12487  * cdef __Pyx_memviewslice *mslice
12488  * cdef __Pyx_memviewslice tmp
12489  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
12490  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12491  *
12492  */
12493  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(0, 628, __pyx_L1_error)
12494  __pyx_v_mslice = __pyx_t_1;
12495 
12496  /* "View.MemoryView":629
12497  * cdef __Pyx_memviewslice tmp
12498  * mslice = get_slice_from_memview(self, &tmp)
12499  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
12500  *
12501  * def copy(self):
12502  */
12503  __Pyx_XDECREF(__pyx_r);
12504  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
12505  __Pyx_GOTREF(__pyx_t_2);
12506  __pyx_r = __pyx_t_2;
12507  __pyx_t_2 = 0;
12508  goto __pyx_L0;
12509 
12510  /* "View.MemoryView":625
12511  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12512  *
12513  * def is_f_contig(self): # <<<<<<<<<<<<<<
12514  * cdef __Pyx_memviewslice *mslice
12515  * cdef __Pyx_memviewslice tmp
12516  */
12517 
12518  /* function exit code */
12519  __pyx_L1_error:;
12520  __Pyx_XDECREF(__pyx_t_2);
12521  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12522  __pyx_r = NULL;
12523  __pyx_L0:;
12524  __Pyx_XGIVEREF(__pyx_r);
12525  __Pyx_RefNannyFinishContext();
12526  return __pyx_r;
12527 }
12528 
12529 /* "View.MemoryView":631
12530  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12531  *
12532  * def copy(self): # <<<<<<<<<<<<<<
12533  * cdef __Pyx_memviewslice mslice
12534  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12535  */
12536 
12537 /* Python wrapper */
12538 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12539 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12540  PyObject *__pyx_r = 0;
12541  __Pyx_RefNannyDeclarations
12542  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
12543  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
12544 
12545  /* function exit code */
12546  __Pyx_RefNannyFinishContext();
12547  return __pyx_r;
12548 }
12549 
12550 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
12551  __Pyx_memviewslice __pyx_v_mslice;
12552  int __pyx_v_flags;
12553  PyObject *__pyx_r = NULL;
12554  __Pyx_RefNannyDeclarations
12555  __Pyx_memviewslice __pyx_t_1;
12556  PyObject *__pyx_t_2 = NULL;
12557  int __pyx_lineno = 0;
12558  const char *__pyx_filename = NULL;
12559  int __pyx_clineno = 0;
12560  __Pyx_RefNannySetupContext("copy", 0);
12561 
12562  /* "View.MemoryView":633
12563  * def copy(self):
12564  * cdef __Pyx_memviewslice mslice
12565  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
12566  *
12567  * slice_copy(self, &mslice)
12568  */
12569  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
12570 
12571  /* "View.MemoryView":635
12572  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12573  *
12574  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
12575  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
12576  * self.view.itemsize,
12577  */
12578  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
12579 
12580  /* "View.MemoryView":636
12581  *
12582  * slice_copy(self, &mslice)
12583  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
12584  * self.view.itemsize,
12585  * flags|PyBUF_C_CONTIGUOUS,
12586  */
12587  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 636, __pyx_L1_error)
12588  __pyx_v_mslice = __pyx_t_1;
12589 
12590  /* "View.MemoryView":641
12591  * self.dtype_is_object)
12592  *
12593  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
12594  *
12595  * def copy_fortran(self):
12596  */
12597  __Pyx_XDECREF(__pyx_r);
12598  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error)
12599  __Pyx_GOTREF(__pyx_t_2);
12600  __pyx_r = __pyx_t_2;
12601  __pyx_t_2 = 0;
12602  goto __pyx_L0;
12603 
12604  /* "View.MemoryView":631
12605  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12606  *
12607  * def copy(self): # <<<<<<<<<<<<<<
12608  * cdef __Pyx_memviewslice mslice
12609  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12610  */
12611 
12612  /* function exit code */
12613  __pyx_L1_error:;
12614  __Pyx_XDECREF(__pyx_t_2);
12615  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
12616  __pyx_r = NULL;
12617  __pyx_L0:;
12618  __Pyx_XGIVEREF(__pyx_r);
12619  __Pyx_RefNannyFinishContext();
12620  return __pyx_r;
12621 }
12622 
12623 /* "View.MemoryView":643
12624  * return memoryview_copy_from_slice(self, &mslice)
12625  *
12626  * def copy_fortran(self): # <<<<<<<<<<<<<<
12627  * cdef __Pyx_memviewslice src, dst
12628  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12629  */
12630 
12631 /* Python wrapper */
12632 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12633 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12634  PyObject *__pyx_r = 0;
12635  __Pyx_RefNannyDeclarations
12636  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
12637  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
12638 
12639  /* function exit code */
12640  __Pyx_RefNannyFinishContext();
12641  return __pyx_r;
12642 }
12643 
12644 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
12645  __Pyx_memviewslice __pyx_v_src;
12646  __Pyx_memviewslice __pyx_v_dst;
12647  int __pyx_v_flags;
12648  PyObject *__pyx_r = NULL;
12649  __Pyx_RefNannyDeclarations
12650  __Pyx_memviewslice __pyx_t_1;
12651  PyObject *__pyx_t_2 = NULL;
12652  int __pyx_lineno = 0;
12653  const char *__pyx_filename = NULL;
12654  int __pyx_clineno = 0;
12655  __Pyx_RefNannySetupContext("copy_fortran", 0);
12656 
12657  /* "View.MemoryView":645
12658  * def copy_fortran(self):
12659  * cdef __Pyx_memviewslice src, dst
12660  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
12661  *
12662  * slice_copy(self, &src)
12663  */
12664  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
12665 
12666  /* "View.MemoryView":647
12667  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12668  *
12669  * slice_copy(self, &src) # <<<<<<<<<<<<<<
12670  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
12671  * self.view.itemsize,
12672  */
12673  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
12674 
12675  /* "View.MemoryView":648
12676  *
12677  * slice_copy(self, &src)
12678  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
12679  * self.view.itemsize,
12680  * flags|PyBUF_F_CONTIGUOUS,
12681  */
12682  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error)
12683  __pyx_v_dst = __pyx_t_1;
12684 
12685  /* "View.MemoryView":653
12686  * self.dtype_is_object)
12687  *
12688  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
12689  *
12690  *
12691  */
12692  __Pyx_XDECREF(__pyx_r);
12693  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error)
12694  __Pyx_GOTREF(__pyx_t_2);
12695  __pyx_r = __pyx_t_2;
12696  __pyx_t_2 = 0;
12697  goto __pyx_L0;
12698 
12699  /* "View.MemoryView":643
12700  * return memoryview_copy_from_slice(self, &mslice)
12701  *
12702  * def copy_fortran(self): # <<<<<<<<<<<<<<
12703  * cdef __Pyx_memviewslice src, dst
12704  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12705  */
12706 
12707  /* function exit code */
12708  __pyx_L1_error:;
12709  __Pyx_XDECREF(__pyx_t_2);
12710  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
12711  __pyx_r = NULL;
12712  __pyx_L0:;
12713  __Pyx_XGIVEREF(__pyx_r);
12714  __Pyx_RefNannyFinishContext();
12715  return __pyx_r;
12716 }
12717 
12718 /* "(tree fragment)":1
12719  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12720  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12721  * def __setstate_cython__(self, __pyx_state):
12722  */
12723 
12724 /* Python wrapper */
12725 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12726 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12727  PyObject *__pyx_r = 0;
12728  __Pyx_RefNannyDeclarations
12729  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12730  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12731 
12732  /* function exit code */
12733  __Pyx_RefNannyFinishContext();
12734  return __pyx_r;
12735 }
12736 
12737 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
12738  PyObject *__pyx_r = NULL;
12739  __Pyx_RefNannyDeclarations
12740  PyObject *__pyx_t_1 = NULL;
12741  int __pyx_lineno = 0;
12742  const char *__pyx_filename = NULL;
12743  int __pyx_clineno = 0;
12744  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
12745 
12746  /* "(tree fragment)":2
12747  * def __reduce_cython__(self):
12748  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
12749  * def __setstate_cython__(self, __pyx_state):
12750  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12751  */
12752  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
12753  __Pyx_GOTREF(__pyx_t_1);
12754  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12755  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12756  __PYX_ERR(0, 2, __pyx_L1_error)
12757 
12758  /* "(tree fragment)":1
12759  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12760  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12761  * def __setstate_cython__(self, __pyx_state):
12762  */
12763 
12764  /* function exit code */
12765  __pyx_L1_error:;
12766  __Pyx_XDECREF(__pyx_t_1);
12767  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12768  __pyx_r = NULL;
12769  __Pyx_XGIVEREF(__pyx_r);
12770  __Pyx_RefNannyFinishContext();
12771  return __pyx_r;
12772 }
12773 
12774 /* "(tree fragment)":3
12775  * def __reduce_cython__(self):
12776  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12777  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12778  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12779  */
12780 
12781 /* Python wrapper */
12782 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
12783 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12784  PyObject *__pyx_r = 0;
12785  __Pyx_RefNannyDeclarations
12786  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12787  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
12788 
12789  /* function exit code */
12790  __Pyx_RefNannyFinishContext();
12791  return __pyx_r;
12792 }
12793 
12794 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) {
12795  PyObject *__pyx_r = NULL;
12796  __Pyx_RefNannyDeclarations
12797  PyObject *__pyx_t_1 = NULL;
12798  int __pyx_lineno = 0;
12799  const char *__pyx_filename = NULL;
12800  int __pyx_clineno = 0;
12801  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
12802 
12803  /* "(tree fragment)":4
12804  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12805  * def __setstate_cython__(self, __pyx_state):
12806  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
12807  */
12808  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
12809  __Pyx_GOTREF(__pyx_t_1);
12810  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12811  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12812  __PYX_ERR(0, 4, __pyx_L1_error)
12813 
12814  /* "(tree fragment)":3
12815  * def __reduce_cython__(self):
12816  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12817  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12818  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12819  */
12820 
12821  /* function exit code */
12822  __pyx_L1_error:;
12823  __Pyx_XDECREF(__pyx_t_1);
12824  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12825  __pyx_r = NULL;
12826  __Pyx_XGIVEREF(__pyx_r);
12827  __Pyx_RefNannyFinishContext();
12828  return __pyx_r;
12829 }
12830 
12831 /* "View.MemoryView":657
12832  *
12833  * @cname('__pyx_memoryview_new')
12834  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
12835  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12836  * result.typeinfo = typeinfo
12837  */
12838 
12839 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
12840  struct __pyx_memoryview_obj *__pyx_v_result = 0;
12841  PyObject *__pyx_r = NULL;
12842  __Pyx_RefNannyDeclarations
12843  PyObject *__pyx_t_1 = NULL;
12844  PyObject *__pyx_t_2 = NULL;
12845  PyObject *__pyx_t_3 = NULL;
12846  int __pyx_lineno = 0;
12847  const char *__pyx_filename = NULL;
12848  int __pyx_clineno = 0;
12849  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
12850 
12851  /* "View.MemoryView":658
12852  * @cname('__pyx_memoryview_new')
12853  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
12854  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
12855  * result.typeinfo = typeinfo
12856  * return result
12857  */
12858  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
12859  __Pyx_GOTREF(__pyx_t_1);
12860  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error)
12861  __Pyx_GOTREF(__pyx_t_2);
12862  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error)
12863  __Pyx_GOTREF(__pyx_t_3);
12864  __Pyx_INCREF(__pyx_v_o);
12865  __Pyx_GIVEREF(__pyx_v_o);
12866  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
12867  __Pyx_GIVEREF(__pyx_t_1);
12868  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
12869  __Pyx_GIVEREF(__pyx_t_2);
12870  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
12871  __pyx_t_1 = 0;
12872  __pyx_t_2 = 0;
12873  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error)
12874  __Pyx_GOTREF(__pyx_t_2);
12875  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12876  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
12877  __pyx_t_2 = 0;
12878 
12879  /* "View.MemoryView":659
12880  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
12881  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12882  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
12883  * return result
12884  *
12885  */
12886  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12887 
12888  /* "View.MemoryView":660
12889  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12890  * result.typeinfo = typeinfo
12891  * return result # <<<<<<<<<<<<<<
12892  *
12893  * @cname('__pyx_memoryview_check')
12894  */
12895  __Pyx_XDECREF(__pyx_r);
12896  __Pyx_INCREF(((PyObject *)__pyx_v_result));
12897  __pyx_r = ((PyObject *)__pyx_v_result);
12898  goto __pyx_L0;
12899 
12900  /* "View.MemoryView":657
12901  *
12902  * @cname('__pyx_memoryview_new')
12903  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
12904  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12905  * result.typeinfo = typeinfo
12906  */
12907 
12908  /* function exit code */
12909  __pyx_L1_error:;
12910  __Pyx_XDECREF(__pyx_t_1);
12911  __Pyx_XDECREF(__pyx_t_2);
12912  __Pyx_XDECREF(__pyx_t_3);
12913  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12914  __pyx_r = 0;
12915  __pyx_L0:;
12916  __Pyx_XDECREF((PyObject *)__pyx_v_result);
12917  __Pyx_XGIVEREF(__pyx_r);
12918  __Pyx_RefNannyFinishContext();
12919  return __pyx_r;
12920 }
12921 
12922 /* "View.MemoryView":663
12923  *
12924  * @cname('__pyx_memoryview_check')
12925  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
12926  * return isinstance(o, memoryview)
12927  *
12928  */
12929 
12930 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12931  int __pyx_r;
12932  __Pyx_RefNannyDeclarations
12933  int __pyx_t_1;
12934  __Pyx_RefNannySetupContext("memoryview_check", 0);
12935 
12936  /* "View.MemoryView":664
12937  * @cname('__pyx_memoryview_check')
12938  * cdef inline bint memoryview_check(object o):
12939  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
12940  *
12941  * cdef tuple _unellipsify(object index, int ndim):
12942  */
12943  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
12944  __pyx_r = __pyx_t_1;
12945  goto __pyx_L0;
12946 
12947  /* "View.MemoryView":663
12948  *
12949  * @cname('__pyx_memoryview_check')
12950  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
12951  * return isinstance(o, memoryview)
12952  *
12953  */
12954 
12955  /* function exit code */
12956  __pyx_L0:;
12957  __Pyx_RefNannyFinishContext();
12958  return __pyx_r;
12959 }
12960 
12961 /* "View.MemoryView":666
12962  * return isinstance(o, memoryview)
12963  *
12964  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
12965  * """
12966  * Replace all ellipses with full slices and fill incomplete indices with
12967  */
12968 
12969 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
12970  PyObject *__pyx_v_tup = NULL;
12971  PyObject *__pyx_v_result = NULL;
12972  int __pyx_v_have_slices;
12973  int __pyx_v_seen_ellipsis;
12974  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
12975  PyObject *__pyx_v_item = NULL;
12976  Py_ssize_t __pyx_v_nslices;
12977  PyObject *__pyx_r = NULL;
12978  __Pyx_RefNannyDeclarations
12979  int __pyx_t_1;
12980  int __pyx_t_2;
12981  PyObject *__pyx_t_3 = NULL;
12982  PyObject *__pyx_t_4 = NULL;
12983  Py_ssize_t __pyx_t_5;
12984  PyObject *(*__pyx_t_6)(PyObject *);
12985  PyObject *__pyx_t_7 = NULL;
12986  Py_ssize_t __pyx_t_8;
12987  int __pyx_t_9;
12988  int __pyx_t_10;
12989  PyObject *__pyx_t_11 = NULL;
12990  int __pyx_lineno = 0;
12991  const char *__pyx_filename = NULL;
12992  int __pyx_clineno = 0;
12993  __Pyx_RefNannySetupContext("_unellipsify", 0);
12994 
12995  /* "View.MemoryView":671
12996  * full slices.
12997  * """
12998  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
12999  * tup = (index,)
13000  * else:
13001  */
13002  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
13003  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
13004  if (__pyx_t_2) {
13005 
13006  /* "View.MemoryView":672
13007  * """
13008  * if not isinstance(index, tuple):
13009  * tup = (index,) # <<<<<<<<<<<<<<
13010  * else:
13011  * tup = index
13012  */
13013  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error)
13014  __Pyx_GOTREF(__pyx_t_3);
13015  __Pyx_INCREF(__pyx_v_index);
13016  __Pyx_GIVEREF(__pyx_v_index);
13017  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
13018  __pyx_v_tup = __pyx_t_3;
13019  __pyx_t_3 = 0;
13020 
13021  /* "View.MemoryView":671
13022  * full slices.
13023  * """
13024  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
13025  * tup = (index,)
13026  * else:
13027  */
13028  goto __pyx_L3;
13029  }
13030 
13031  /* "View.MemoryView":674
13032  * tup = (index,)
13033  * else:
13034  * tup = index # <<<<<<<<<<<<<<
13035  *
13036  * result = []
13037  */
13038  /*else*/ {
13039  __Pyx_INCREF(__pyx_v_index);
13040  __pyx_v_tup = __pyx_v_index;
13041  }
13042  __pyx_L3:;
13043 
13044  /* "View.MemoryView":676
13045  * tup = index
13046  *
13047  * result = [] # <<<<<<<<<<<<<<
13048  * have_slices = False
13049  * seen_ellipsis = False
13050  */
13051  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 676, __pyx_L1_error)
13052  __Pyx_GOTREF(__pyx_t_3);
13053  __pyx_v_result = ((PyObject*)__pyx_t_3);
13054  __pyx_t_3 = 0;
13055 
13056  /* "View.MemoryView":677
13057  *
13058  * result = []
13059  * have_slices = False # <<<<<<<<<<<<<<
13060  * seen_ellipsis = False
13061  * for idx, item in enumerate(tup):
13062  */
13063  __pyx_v_have_slices = 0;
13064 
13065  /* "View.MemoryView":678
13066  * result = []
13067  * have_slices = False
13068  * seen_ellipsis = False # <<<<<<<<<<<<<<
13069  * for idx, item in enumerate(tup):
13070  * if item is Ellipsis:
13071  */
13072  __pyx_v_seen_ellipsis = 0;
13073 
13074  /* "View.MemoryView":679
13075  * have_slices = False
13076  * seen_ellipsis = False
13077  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
13078  * if item is Ellipsis:
13079  * if not seen_ellipsis:
13080  */
13081  __Pyx_INCREF(__pyx_int_0);
13082  __pyx_t_3 = __pyx_int_0;
13083  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
13084  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
13085  __pyx_t_6 = NULL;
13086  } else {
13087  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error)
13088  __Pyx_GOTREF(__pyx_t_4);
13089  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 679, __pyx_L1_error)
13090  }
13091  for (;;) {
13092  if (likely(!__pyx_t_6)) {
13093  if (likely(PyList_CheckExact(__pyx_t_4))) {
13094  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
13095  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13096  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 679, __pyx_L1_error)
13097  #else
13098  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error)
13099  __Pyx_GOTREF(__pyx_t_7);
13100  #endif
13101  } else {
13102  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
13103  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13104  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 679, __pyx_L1_error)
13105  #else
13106  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error)
13107  __Pyx_GOTREF(__pyx_t_7);
13108  #endif
13109  }
13110  } else {
13111  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
13112  if (unlikely(!__pyx_t_7)) {
13113  PyObject* exc_type = PyErr_Occurred();
13114  if (exc_type) {
13115  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13116  else __PYX_ERR(0, 679, __pyx_L1_error)
13117  }
13118  break;
13119  }
13120  __Pyx_GOTREF(__pyx_t_7);
13121  }
13122  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
13123  __pyx_t_7 = 0;
13124  __Pyx_INCREF(__pyx_t_3);
13125  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
13126  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error)
13127  __Pyx_GOTREF(__pyx_t_7);
13128  __Pyx_DECREF(__pyx_t_3);
13129  __pyx_t_3 = __pyx_t_7;
13130  __pyx_t_7 = 0;
13131 
13132  /* "View.MemoryView":680
13133  * seen_ellipsis = False
13134  * for idx, item in enumerate(tup):
13135  * if item is Ellipsis: # <<<<<<<<<<<<<<
13136  * if not seen_ellipsis:
13137  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13138  */
13139  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
13140  __pyx_t_1 = (__pyx_t_2 != 0);
13141  if (__pyx_t_1) {
13142 
13143  /* "View.MemoryView":681
13144  * for idx, item in enumerate(tup):
13145  * if item is Ellipsis:
13146  * if not seen_ellipsis: # <<<<<<<<<<<<<<
13147  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13148  * seen_ellipsis = True
13149  */
13150  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
13151  if (__pyx_t_1) {
13152 
13153  /* "View.MemoryView":682
13154  * if item is Ellipsis:
13155  * if not seen_ellipsis:
13156  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
13157  * seen_ellipsis = True
13158  * else:
13159  */
13160  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 682, __pyx_L1_error)
13161  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 682, __pyx_L1_error)
13162  __Pyx_GOTREF(__pyx_t_7);
13163  { Py_ssize_t __pyx_temp;
13164  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
13165  __Pyx_INCREF(__pyx_slice__30);
13166  __Pyx_GIVEREF(__pyx_slice__30);
13167  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__30);
13168  }
13169  }
13170  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 682, __pyx_L1_error)
13171  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13172 
13173  /* "View.MemoryView":683
13174  * if not seen_ellipsis:
13175  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13176  * seen_ellipsis = True # <<<<<<<<<<<<<<
13177  * else:
13178  * result.append(slice(None))
13179  */
13180  __pyx_v_seen_ellipsis = 1;
13181 
13182  /* "View.MemoryView":681
13183  * for idx, item in enumerate(tup):
13184  * if item is Ellipsis:
13185  * if not seen_ellipsis: # <<<<<<<<<<<<<<
13186  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13187  * seen_ellipsis = True
13188  */
13189  goto __pyx_L7;
13190  }
13191 
13192  /* "View.MemoryView":685
13193  * seen_ellipsis = True
13194  * else:
13195  * result.append(slice(None)) # <<<<<<<<<<<<<<
13196  * have_slices = True
13197  * else:
13198  */
13199  /*else*/ {
13200  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__30); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 685, __pyx_L1_error)
13201  }
13202  __pyx_L7:;
13203 
13204  /* "View.MemoryView":686
13205  * else:
13206  * result.append(slice(None))
13207  * have_slices = True # <<<<<<<<<<<<<<
13208  * else:
13209  * if not isinstance(item, slice) and not PyIndex_Check(item):
13210  */
13211  __pyx_v_have_slices = 1;
13212 
13213  /* "View.MemoryView":680
13214  * seen_ellipsis = False
13215  * for idx, item in enumerate(tup):
13216  * if item is Ellipsis: # <<<<<<<<<<<<<<
13217  * if not seen_ellipsis:
13218  * result.extend([slice(None)] * (ndim - len(tup) + 1))
13219  */
13220  goto __pyx_L6;
13221  }
13222 
13223  /* "View.MemoryView":688
13224  * have_slices = True
13225  * else:
13226  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
13227  * raise TypeError("Cannot index with type '%s'" % type(item))
13228  *
13229  */
13230  /*else*/ {
13231  __pyx_t_2 = PySlice_Check(__pyx_v_item);
13232  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
13233  if (__pyx_t_10) {
13234  } else {
13235  __pyx_t_1 = __pyx_t_10;
13236  goto __pyx_L9_bool_binop_done;
13237  }
13238  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
13239  __pyx_t_1 = __pyx_t_10;
13240  __pyx_L9_bool_binop_done:;
13241  if (unlikely(__pyx_t_1)) {
13242 
13243  /* "View.MemoryView":689
13244  * else:
13245  * if not isinstance(item, slice) and not PyIndex_Check(item):
13246  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
13247  *
13248  * have_slices = have_slices or isinstance(item, slice)
13249  */
13250  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 689, __pyx_L1_error)
13251  __Pyx_GOTREF(__pyx_t_7);
13252  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 689, __pyx_L1_error)
13253  __Pyx_GOTREF(__pyx_t_11);
13254  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13255  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
13256  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13257  __PYX_ERR(0, 689, __pyx_L1_error)
13258 
13259  /* "View.MemoryView":688
13260  * have_slices = True
13261  * else:
13262  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
13263  * raise TypeError("Cannot index with type '%s'" % type(item))
13264  *
13265  */
13266  }
13267 
13268  /* "View.MemoryView":691
13269  * raise TypeError("Cannot index with type '%s'" % type(item))
13270  *
13271  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
13272  * result.append(item)
13273  *
13274  */
13275  __pyx_t_10 = (__pyx_v_have_slices != 0);
13276  if (!__pyx_t_10) {
13277  } else {
13278  __pyx_t_1 = __pyx_t_10;
13279  goto __pyx_L11_bool_binop_done;
13280  }
13281  __pyx_t_10 = PySlice_Check(__pyx_v_item);
13282  __pyx_t_2 = (__pyx_t_10 != 0);
13283  __pyx_t_1 = __pyx_t_2;
13284  __pyx_L11_bool_binop_done:;
13285  __pyx_v_have_slices = __pyx_t_1;
13286 
13287  /* "View.MemoryView":692
13288  *
13289  * have_slices = have_slices or isinstance(item, slice)
13290  * result.append(item) # <<<<<<<<<<<<<<
13291  *
13292  * nslices = ndim - len(result)
13293  */
13294  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 692, __pyx_L1_error)
13295  }
13296  __pyx_L6:;
13297 
13298  /* "View.MemoryView":679
13299  * have_slices = False
13300  * seen_ellipsis = False
13301  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
13302  * if item is Ellipsis:
13303  * if not seen_ellipsis:
13304  */
13305  }
13306  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13307  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13308 
13309  /* "View.MemoryView":694
13310  * result.append(item)
13311  *
13312  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
13313  * if nslices:
13314  * result.extend([slice(None)] * nslices)
13315  */
13316  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 694, __pyx_L1_error)
13317  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
13318 
13319  /* "View.MemoryView":695
13320  *
13321  * nslices = ndim - len(result)
13322  * if nslices: # <<<<<<<<<<<<<<
13323  * result.extend([slice(None)] * nslices)
13324  *
13325  */
13326  __pyx_t_1 = (__pyx_v_nslices != 0);
13327  if (__pyx_t_1) {
13328 
13329  /* "View.MemoryView":696
13330  * nslices = ndim - len(result)
13331  * if nslices:
13332  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
13333  *
13334  * return have_slices or nslices, tuple(result)
13335  */
13336  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L1_error)
13337  __Pyx_GOTREF(__pyx_t_3);
13338  { Py_ssize_t __pyx_temp;
13339  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
13340  __Pyx_INCREF(__pyx_slice__30);
13341  __Pyx_GIVEREF(__pyx_slice__30);
13342  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__30);
13343  }
13344  }
13345  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 696, __pyx_L1_error)
13346  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13347 
13348  /* "View.MemoryView":695
13349  *
13350  * nslices = ndim - len(result)
13351  * if nslices: # <<<<<<<<<<<<<<
13352  * result.extend([slice(None)] * nslices)
13353  *
13354  */
13355  }
13356 
13357  /* "View.MemoryView":698
13358  * result.extend([slice(None)] * nslices)
13359  *
13360  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
13361  *
13362  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
13363  */
13364  __Pyx_XDECREF(__pyx_r);
13365  if (!__pyx_v_have_slices) {
13366  } else {
13367  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
13368  __Pyx_GOTREF(__pyx_t_4);
13369  __pyx_t_3 = __pyx_t_4;
13370  __pyx_t_4 = 0;
13371  goto __pyx_L14_bool_binop_done;
13372  }
13373  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
13374  __Pyx_GOTREF(__pyx_t_4);
13375  __pyx_t_3 = __pyx_t_4;
13376  __pyx_t_4 = 0;
13377  __pyx_L14_bool_binop_done:;
13378  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
13379  __Pyx_GOTREF(__pyx_t_4);
13380  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 698, __pyx_L1_error)
13381  __Pyx_GOTREF(__pyx_t_11);
13382  __Pyx_GIVEREF(__pyx_t_3);
13383  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
13384  __Pyx_GIVEREF(__pyx_t_4);
13385  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
13386  __pyx_t_3 = 0;
13387  __pyx_t_4 = 0;
13388  __pyx_r = ((PyObject*)__pyx_t_11);
13389  __pyx_t_11 = 0;
13390  goto __pyx_L0;
13391 
13392  /* "View.MemoryView":666
13393  * return isinstance(o, memoryview)
13394  *
13395  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13396  * """
13397  * Replace all ellipses with full slices and fill incomplete indices with
13398  */
13399 
13400  /* function exit code */
13401  __pyx_L1_error:;
13402  __Pyx_XDECREF(__pyx_t_3);
13403  __Pyx_XDECREF(__pyx_t_4);
13404  __Pyx_XDECREF(__pyx_t_7);
13405  __Pyx_XDECREF(__pyx_t_11);
13406  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13407  __pyx_r = 0;
13408  __pyx_L0:;
13409  __Pyx_XDECREF(__pyx_v_tup);
13410  __Pyx_XDECREF(__pyx_v_result);
13411  __Pyx_XDECREF(__pyx_v_idx);
13412  __Pyx_XDECREF(__pyx_v_item);
13413  __Pyx_XGIVEREF(__pyx_r);
13414  __Pyx_RefNannyFinishContext();
13415  return __pyx_r;
13416 }
13417 
13418 /* "View.MemoryView":700
13419  * return have_slices or nslices, tuple(result)
13420  *
13421  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
13422  * for suboffset in suboffsets[:ndim]:
13423  * if suboffset >= 0:
13424  */
13425 
13426 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
13427  Py_ssize_t __pyx_v_suboffset;
13428  PyObject *__pyx_r = NULL;
13429  __Pyx_RefNannyDeclarations
13430  Py_ssize_t *__pyx_t_1;
13431  Py_ssize_t *__pyx_t_2;
13432  Py_ssize_t *__pyx_t_3;
13433  int __pyx_t_4;
13434  PyObject *__pyx_t_5 = NULL;
13435  int __pyx_lineno = 0;
13436  const char *__pyx_filename = NULL;
13437  int __pyx_clineno = 0;
13438  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
13439 
13440  /* "View.MemoryView":701
13441  *
13442  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
13443  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
13444  * if suboffset >= 0:
13445  * raise ValueError("Indirect dimensions not supported")
13446  */
13447  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
13448  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
13449  __pyx_t_1 = __pyx_t_3;
13450  __pyx_v_suboffset = (__pyx_t_1[0]);
13451 
13452  /* "View.MemoryView":702
13453  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
13454  * for suboffset in suboffsets[:ndim]:
13455  * if suboffset >= 0: # <<<<<<<<<<<<<<
13456  * raise ValueError("Indirect dimensions not supported")
13457  *
13458  */
13459  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
13460  if (unlikely(__pyx_t_4)) {
13461 
13462  /* "View.MemoryView":703
13463  * for suboffset in suboffsets[:ndim]:
13464  * if suboffset >= 0:
13465  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
13466  *
13467  *
13468  */
13469  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
13470  __Pyx_GOTREF(__pyx_t_5);
13471  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
13472  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13473  __PYX_ERR(0, 703, __pyx_L1_error)
13474 
13475  /* "View.MemoryView":702
13476  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
13477  * for suboffset in suboffsets[:ndim]:
13478  * if suboffset >= 0: # <<<<<<<<<<<<<<
13479  * raise ValueError("Indirect dimensions not supported")
13480  *
13481  */
13482  }
13483  }
13484 
13485  /* "View.MemoryView":700
13486  * return have_slices or nslices, tuple(result)
13487  *
13488  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
13489  * for suboffset in suboffsets[:ndim]:
13490  * if suboffset >= 0:
13491  */
13492 
13493  /* function exit code */
13494  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13495  goto __pyx_L0;
13496  __pyx_L1_error:;
13497  __Pyx_XDECREF(__pyx_t_5);
13498  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13499  __pyx_r = 0;
13500  __pyx_L0:;
13501  __Pyx_XGIVEREF(__pyx_r);
13502  __Pyx_RefNannyFinishContext();
13503  return __pyx_r;
13504 }
13505 
13506 /* "View.MemoryView":710
13507  *
13508  * @cname('__pyx_memview_slice')
13509  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
13510  * cdef int new_ndim = 0, suboffset_dim = -1, dim
13511  * cdef bint negative_step
13512  */
13513 
13514 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
13515  int __pyx_v_new_ndim;
13516  int __pyx_v_suboffset_dim;
13517  int __pyx_v_dim;
13518  __Pyx_memviewslice __pyx_v_src;
13519  __Pyx_memviewslice __pyx_v_dst;
13520  __Pyx_memviewslice *__pyx_v_p_src;
13521  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
13522  __Pyx_memviewslice *__pyx_v_p_dst;
13523  int *__pyx_v_p_suboffset_dim;
13524  Py_ssize_t __pyx_v_start;
13525  Py_ssize_t __pyx_v_stop;
13526  Py_ssize_t __pyx_v_step;
13527  int __pyx_v_have_start;
13528  int __pyx_v_have_stop;
13529  int __pyx_v_have_step;
13530  PyObject *__pyx_v_index = NULL;
13531  struct __pyx_memoryview_obj *__pyx_r = NULL;
13532  __Pyx_RefNannyDeclarations
13533  int __pyx_t_1;
13534  int __pyx_t_2;
13535  PyObject *__pyx_t_3 = NULL;
13536  struct __pyx_memoryview_obj *__pyx_t_4;
13537  char *__pyx_t_5;
13538  int __pyx_t_6;
13539  Py_ssize_t __pyx_t_7;
13540  PyObject *(*__pyx_t_8)(PyObject *);
13541  PyObject *__pyx_t_9 = NULL;
13542  Py_ssize_t __pyx_t_10;
13543  int __pyx_t_11;
13544  Py_ssize_t __pyx_t_12;
13545  int __pyx_lineno = 0;
13546  const char *__pyx_filename = NULL;
13547  int __pyx_clineno = 0;
13548  __Pyx_RefNannySetupContext("memview_slice", 0);
13549 
13550  /* "View.MemoryView":711
13551  * @cname('__pyx_memview_slice')
13552  * cdef memoryview memview_slice(memoryview memview, object indices):
13553  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
13554  * cdef bint negative_step
13555  * cdef __Pyx_memviewslice src, dst
13556  */
13557  __pyx_v_new_ndim = 0;
13558  __pyx_v_suboffset_dim = -1;
13559 
13560  /* "View.MemoryView":718
13561  *
13562  *
13563  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
13564  *
13565  * cdef _memoryviewslice memviewsliceobj
13566  */
13567  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
13568 
13569  /* "View.MemoryView":722
13570  * cdef _memoryviewslice memviewsliceobj
13571  *
13572  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
13573  *
13574  * if isinstance(memview, _memoryviewslice):
13575  */
13576  #ifndef CYTHON_WITHOUT_ASSERTIONS
13577  if (unlikely(!Py_OptimizeFlag)) {
13578  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
13579  PyErr_SetNone(PyExc_AssertionError);
13580  __PYX_ERR(0, 722, __pyx_L1_error)
13581  }
13582  }
13583  #endif
13584 
13585  /* "View.MemoryView":724
13586  * assert memview.view.ndim > 0
13587  *
13588  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13589  * memviewsliceobj = memview
13590  * p_src = &memviewsliceobj.from_slice
13591  */
13592  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
13593  __pyx_t_2 = (__pyx_t_1 != 0);
13594  if (__pyx_t_2) {
13595 
13596  /* "View.MemoryView":725
13597  *
13598  * if isinstance(memview, _memoryviewslice):
13599  * memviewsliceobj = memview # <<<<<<<<<<<<<<
13600  * p_src = &memviewsliceobj.from_slice
13601  * else:
13602  */
13603  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(0, 725, __pyx_L1_error)
13604  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
13605  __Pyx_INCREF(__pyx_t_3);
13606  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
13607  __pyx_t_3 = 0;
13608 
13609  /* "View.MemoryView":726
13610  * if isinstance(memview, _memoryviewslice):
13611  * memviewsliceobj = memview
13612  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
13613  * else:
13614  * slice_copy(memview, &src)
13615  */
13616  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
13617 
13618  /* "View.MemoryView":724
13619  * assert memview.view.ndim > 0
13620  *
13621  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13622  * memviewsliceobj = memview
13623  * p_src = &memviewsliceobj.from_slice
13624  */
13625  goto __pyx_L3;
13626  }
13627 
13628  /* "View.MemoryView":728
13629  * p_src = &memviewsliceobj.from_slice
13630  * else:
13631  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
13632  * p_src = &src
13633  *
13634  */
13635  /*else*/ {
13636  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
13637 
13638  /* "View.MemoryView":729
13639  * else:
13640  * slice_copy(memview, &src)
13641  * p_src = &src # <<<<<<<<<<<<<<
13642  *
13643  *
13644  */
13645  __pyx_v_p_src = (&__pyx_v_src);
13646  }
13647  __pyx_L3:;
13648 
13649  /* "View.MemoryView":735
13650  *
13651  *
13652  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
13653  * dst.data = p_src.data
13654  *
13655  */
13656  __pyx_t_4 = __pyx_v_p_src->memview;
13657  __pyx_v_dst.memview = __pyx_t_4;
13658 
13659  /* "View.MemoryView":736
13660  *
13661  * dst.memview = p_src.memview
13662  * dst.data = p_src.data # <<<<<<<<<<<<<<
13663  *
13664  *
13665  */
13666  __pyx_t_5 = __pyx_v_p_src->data;
13667  __pyx_v_dst.data = __pyx_t_5;
13668 
13669  /* "View.MemoryView":741
13670  *
13671  *
13672  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
13673  * cdef int *p_suboffset_dim = &suboffset_dim
13674  * cdef Py_ssize_t start, stop, step
13675  */
13676  __pyx_v_p_dst = (&__pyx_v_dst);
13677 
13678  /* "View.MemoryView":742
13679  *
13680  * cdef __Pyx_memviewslice *p_dst = &dst
13681  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
13682  * cdef Py_ssize_t start, stop, step
13683  * cdef bint have_start, have_stop, have_step
13684  */
13685  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
13686 
13687  /* "View.MemoryView":746
13688  * cdef bint have_start, have_stop, have_step
13689  *
13690  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
13691  * if PyIndex_Check(index):
13692  * slice_memviewslice(
13693  */
13694  __pyx_t_6 = 0;
13695  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
13696  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
13697  __pyx_t_8 = NULL;
13698  } else {
13699  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error)
13700  __Pyx_GOTREF(__pyx_t_3);
13701  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 746, __pyx_L1_error)
13702  }
13703  for (;;) {
13704  if (likely(!__pyx_t_8)) {
13705  if (likely(PyList_CheckExact(__pyx_t_3))) {
13706  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
13707  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13708  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 746, __pyx_L1_error)
13709  #else
13710  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 746, __pyx_L1_error)
13711  __Pyx_GOTREF(__pyx_t_9);
13712  #endif
13713  } else {
13714  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
13715  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13716  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 746, __pyx_L1_error)
13717  #else
13718  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 746, __pyx_L1_error)
13719  __Pyx_GOTREF(__pyx_t_9);
13720  #endif
13721  }
13722  } else {
13723  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
13724  if (unlikely(!__pyx_t_9)) {
13725  PyObject* exc_type = PyErr_Occurred();
13726  if (exc_type) {
13727  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13728  else __PYX_ERR(0, 746, __pyx_L1_error)
13729  }
13730  break;
13731  }
13732  __Pyx_GOTREF(__pyx_t_9);
13733  }
13734  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
13735  __pyx_t_9 = 0;
13736  __pyx_v_dim = __pyx_t_6;
13737  __pyx_t_6 = (__pyx_t_6 + 1);
13738 
13739  /* "View.MemoryView":747
13740  *
13741  * for dim, index in enumerate(indices):
13742  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
13743  * slice_memviewslice(
13744  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13745  */
13746  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
13747  if (__pyx_t_2) {
13748 
13749  /* "View.MemoryView":751
13750  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13751  * dim, new_ndim, p_suboffset_dim,
13752  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
13753  * 0, 0, 0, # have_{start,stop,step}
13754  * False)
13755  */
13756  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 751, __pyx_L1_error)
13757 
13758  /* "View.MemoryView":748
13759  * for dim, index in enumerate(indices):
13760  * if PyIndex_Check(index):
13761  * slice_memviewslice( # <<<<<<<<<<<<<<
13762  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13763  * dim, new_ndim, p_suboffset_dim,
13764  */
13765  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 748, __pyx_L1_error)
13766 
13767  /* "View.MemoryView":747
13768  *
13769  * for dim, index in enumerate(indices):
13770  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
13771  * slice_memviewslice(
13772  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13773  */
13774  goto __pyx_L6;
13775  }
13776 
13777  /* "View.MemoryView":754
13778  * 0, 0, 0, # have_{start,stop,step}
13779  * False)
13780  * elif index is None: # <<<<<<<<<<<<<<
13781  * p_dst.shape[new_ndim] = 1
13782  * p_dst.strides[new_ndim] = 0
13783  */
13784  __pyx_t_2 = (__pyx_v_index == Py_None);
13785  __pyx_t_1 = (__pyx_t_2 != 0);
13786  if (__pyx_t_1) {
13787 
13788  /* "View.MemoryView":755
13789  * False)
13790  * elif index is None:
13791  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
13792  * p_dst.strides[new_ndim] = 0
13793  * p_dst.suboffsets[new_ndim] = -1
13794  */
13795  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
13796 
13797  /* "View.MemoryView":756
13798  * elif index is None:
13799  * p_dst.shape[new_ndim] = 1
13800  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
13801  * p_dst.suboffsets[new_ndim] = -1
13802  * new_ndim += 1
13803  */
13804  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
13805 
13806  /* "View.MemoryView":757
13807  * p_dst.shape[new_ndim] = 1
13808  * p_dst.strides[new_ndim] = 0
13809  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
13810  * new_ndim += 1
13811  * else:
13812  */
13813  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
13814 
13815  /* "View.MemoryView":758
13816  * p_dst.strides[new_ndim] = 0
13817  * p_dst.suboffsets[new_ndim] = -1
13818  * new_ndim += 1 # <<<<<<<<<<<<<<
13819  * else:
13820  * start = index.start or 0
13821  */
13822  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13823 
13824  /* "View.MemoryView":754
13825  * 0, 0, 0, # have_{start,stop,step}
13826  * False)
13827  * elif index is None: # <<<<<<<<<<<<<<
13828  * p_dst.shape[new_ndim] = 1
13829  * p_dst.strides[new_ndim] = 0
13830  */
13831  goto __pyx_L6;
13832  }
13833 
13834  /* "View.MemoryView":760
13835  * new_ndim += 1
13836  * else:
13837  * start = index.start or 0 # <<<<<<<<<<<<<<
13838  * stop = index.stop or 0
13839  * step = index.step or 0
13840  */
13841  /*else*/ {
13842  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 760, __pyx_L1_error)
13843  __Pyx_GOTREF(__pyx_t_9);
13844  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 760, __pyx_L1_error)
13845  if (!__pyx_t_1) {
13846  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13847  } else {
13848  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 760, __pyx_L1_error)
13849  __pyx_t_10 = __pyx_t_12;
13850  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13851  goto __pyx_L7_bool_binop_done;
13852  }
13853  __pyx_t_10 = 0;
13854  __pyx_L7_bool_binop_done:;
13855  __pyx_v_start = __pyx_t_10;
13856 
13857  /* "View.MemoryView":761
13858  * else:
13859  * start = index.start or 0
13860  * stop = index.stop or 0 # <<<<<<<<<<<<<<
13861  * step = index.step or 0
13862  *
13863  */
13864  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 761, __pyx_L1_error)
13865  __Pyx_GOTREF(__pyx_t_9);
13866  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 761, __pyx_L1_error)
13867  if (!__pyx_t_1) {
13868  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13869  } else {
13870  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 761, __pyx_L1_error)
13871  __pyx_t_10 = __pyx_t_12;
13872  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13873  goto __pyx_L9_bool_binop_done;
13874  }
13875  __pyx_t_10 = 0;
13876  __pyx_L9_bool_binop_done:;
13877  __pyx_v_stop = __pyx_t_10;
13878 
13879  /* "View.MemoryView":762
13880  * start = index.start or 0
13881  * stop = index.stop or 0
13882  * step = index.step or 0 # <<<<<<<<<<<<<<
13883  *
13884  * have_start = index.start is not None
13885  */
13886  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 762, __pyx_L1_error)
13887  __Pyx_GOTREF(__pyx_t_9);
13888  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 762, __pyx_L1_error)
13889  if (!__pyx_t_1) {
13890  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13891  } else {
13892  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 762, __pyx_L1_error)
13893  __pyx_t_10 = __pyx_t_12;
13894  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13895  goto __pyx_L11_bool_binop_done;
13896  }
13897  __pyx_t_10 = 0;
13898  __pyx_L11_bool_binop_done:;
13899  __pyx_v_step = __pyx_t_10;
13900 
13901  /* "View.MemoryView":764
13902  * step = index.step or 0
13903  *
13904  * have_start = index.start is not None # <<<<<<<<<<<<<<
13905  * have_stop = index.stop is not None
13906  * have_step = index.step is not None
13907  */
13908  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 764, __pyx_L1_error)
13909  __Pyx_GOTREF(__pyx_t_9);
13910  __pyx_t_1 = (__pyx_t_9 != Py_None);
13911  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13912  __pyx_v_have_start = __pyx_t_1;
13913 
13914  /* "View.MemoryView":765
13915  *
13916  * have_start = index.start is not None
13917  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
13918  * have_step = index.step is not None
13919  *
13920  */
13921  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 765, __pyx_L1_error)
13922  __Pyx_GOTREF(__pyx_t_9);
13923  __pyx_t_1 = (__pyx_t_9 != Py_None);
13924  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13925  __pyx_v_have_stop = __pyx_t_1;
13926 
13927  /* "View.MemoryView":766
13928  * have_start = index.start is not None
13929  * have_stop = index.stop is not None
13930  * have_step = index.step is not None # <<<<<<<<<<<<<<
13931  *
13932  * slice_memviewslice(
13933  */
13934  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 766, __pyx_L1_error)
13935  __Pyx_GOTREF(__pyx_t_9);
13936  __pyx_t_1 = (__pyx_t_9 != Py_None);
13937  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13938  __pyx_v_have_step = __pyx_t_1;
13939 
13940  /* "View.MemoryView":768
13941  * have_step = index.step is not None
13942  *
13943  * slice_memviewslice( # <<<<<<<<<<<<<<
13944  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13945  * dim, new_ndim, p_suboffset_dim,
13946  */
13947  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 768, __pyx_L1_error)
13948 
13949  /* "View.MemoryView":774
13950  * have_start, have_stop, have_step,
13951  * True)
13952  * new_ndim += 1 # <<<<<<<<<<<<<<
13953  *
13954  * if isinstance(memview, _memoryviewslice):
13955  */
13956  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13957  }
13958  __pyx_L6:;
13959 
13960  /* "View.MemoryView":746
13961  * cdef bint have_start, have_stop, have_step
13962  *
13963  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
13964  * if PyIndex_Check(index):
13965  * slice_memviewslice(
13966  */
13967  }
13968  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13969 
13970  /* "View.MemoryView":776
13971  * new_ndim += 1
13972  *
13973  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13974  * return memoryview_fromslice(dst, new_ndim,
13975  * memviewsliceobj.to_object_func,
13976  */
13977  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
13978  __pyx_t_2 = (__pyx_t_1 != 0);
13979  if (__pyx_t_2) {
13980 
13981  /* "View.MemoryView":777
13982  *
13983  * if isinstance(memview, _memoryviewslice):
13984  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
13985  * memviewsliceobj.to_object_func,
13986  * memviewsliceobj.to_dtype_func,
13987  */
13988  __Pyx_XDECREF(((PyObject *)__pyx_r));
13989 
13990  /* "View.MemoryView":778
13991  * if isinstance(memview, _memoryviewslice):
13992  * return memoryview_fromslice(dst, new_ndim,
13993  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
13994  * memviewsliceobj.to_dtype_func,
13995  * memview.dtype_is_object)
13996  */
13997  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(0, 778, __pyx_L1_error) }
13998 
13999  /* "View.MemoryView":779
14000  * return memoryview_fromslice(dst, new_ndim,
14001  * memviewsliceobj.to_object_func,
14002  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
14003  * memview.dtype_is_object)
14004  * else:
14005  */
14006  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(0, 779, __pyx_L1_error) }
14007 
14008  /* "View.MemoryView":777
14009  *
14010  * if isinstance(memview, _memoryviewslice):
14011  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
14012  * memviewsliceobj.to_object_func,
14013  * memviewsliceobj.to_dtype_func,
14014  */
14015  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L1_error)
14016  __Pyx_GOTREF(__pyx_t_3);
14017  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 777, __pyx_L1_error)
14018  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
14019  __pyx_t_3 = 0;
14020  goto __pyx_L0;
14021 
14022  /* "View.MemoryView":776
14023  * new_ndim += 1
14024  *
14025  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14026  * return memoryview_fromslice(dst, new_ndim,
14027  * memviewsliceobj.to_object_func,
14028  */
14029  }
14030 
14031  /* "View.MemoryView":782
14032  * memview.dtype_is_object)
14033  * else:
14034  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14035  * memview.dtype_is_object)
14036  *
14037  */
14038  /*else*/ {
14039  __Pyx_XDECREF(((PyObject *)__pyx_r));
14040 
14041  /* "View.MemoryView":783
14042  * else:
14043  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
14044  * memview.dtype_is_object) # <<<<<<<<<<<<<<
14045  *
14046  *
14047  */
14048  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L1_error)
14049  __Pyx_GOTREF(__pyx_t_3);
14050 
14051  /* "View.MemoryView":782
14052  * memview.dtype_is_object)
14053  * else:
14054  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14055  * memview.dtype_is_object)
14056  *
14057  */
14058  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 782, __pyx_L1_error)
14059  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
14060  __pyx_t_3 = 0;
14061  goto __pyx_L0;
14062  }
14063 
14064  /* "View.MemoryView":710
14065  *
14066  * @cname('__pyx_memview_slice')
14067  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
14068  * cdef int new_ndim = 0, suboffset_dim = -1, dim
14069  * cdef bint negative_step
14070  */
14071 
14072  /* function exit code */
14073  __pyx_L1_error:;
14074  __Pyx_XDECREF(__pyx_t_3);
14075  __Pyx_XDECREF(__pyx_t_9);
14076  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14077  __pyx_r = 0;
14078  __pyx_L0:;
14079  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
14080  __Pyx_XDECREF(__pyx_v_index);
14081  __Pyx_XGIVEREF((PyObject *)__pyx_r);
14082  __Pyx_RefNannyFinishContext();
14083  return __pyx_r;
14084 }
14085 
14086 /* "View.MemoryView":807
14087  *
14088  * @cname('__pyx_memoryview_slice_memviewslice')
14089  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
14090  * __Pyx_memviewslice *dst,
14091  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
14092  */
14093 
14094 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) {
14095  Py_ssize_t __pyx_v_new_shape;
14096  int __pyx_v_negative_step;
14097  int __pyx_r;
14098  int __pyx_t_1;
14099  int __pyx_t_2;
14100  int __pyx_t_3;
14101  int __pyx_lineno = 0;
14102  const char *__pyx_filename = NULL;
14103  int __pyx_clineno = 0;
14104 
14105  /* "View.MemoryView":827
14106  * cdef bint negative_step
14107  *
14108  * if not is_slice: # <<<<<<<<<<<<<<
14109  *
14110  * if start < 0:
14111  */
14112  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
14113  if (__pyx_t_1) {
14114 
14115  /* "View.MemoryView":829
14116  * if not is_slice:
14117  *
14118  * if start < 0: # <<<<<<<<<<<<<<
14119  * start += shape
14120  * if not 0 <= start < shape:
14121  */
14122  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
14123  if (__pyx_t_1) {
14124 
14125  /* "View.MemoryView":830
14126  *
14127  * if start < 0:
14128  * start += shape # <<<<<<<<<<<<<<
14129  * if not 0 <= start < shape:
14130  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
14131  */
14132  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14133 
14134  /* "View.MemoryView":829
14135  * if not is_slice:
14136  *
14137  * if start < 0: # <<<<<<<<<<<<<<
14138  * start += shape
14139  * if not 0 <= start < shape:
14140  */
14141  }
14142 
14143  /* "View.MemoryView":831
14144  * if start < 0:
14145  * start += shape
14146  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
14147  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
14148  * else:
14149  */
14150  __pyx_t_1 = (0 <= __pyx_v_start);
14151  if (__pyx_t_1) {
14152  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
14153  }
14154  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14155  if (__pyx_t_2) {
14156 
14157  /* "View.MemoryView":832
14158  * start += shape
14159  * if not 0 <= start < shape:
14160  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
14161  * else:
14162  *
14163  */
14164  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 832, __pyx_L1_error)
14165 
14166  /* "View.MemoryView":831
14167  * if start < 0:
14168  * start += shape
14169  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
14170  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
14171  * else:
14172  */
14173  }
14174 
14175  /* "View.MemoryView":827
14176  * cdef bint negative_step
14177  *
14178  * if not is_slice: # <<<<<<<<<<<<<<
14179  *
14180  * if start < 0:
14181  */
14182  goto __pyx_L3;
14183  }
14184 
14185  /* "View.MemoryView":835
14186  * else:
14187  *
14188  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
14189  *
14190  * if have_step and step == 0:
14191  */
14192  /*else*/ {
14193  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
14194  if (__pyx_t_1) {
14195  } else {
14196  __pyx_t_2 = __pyx_t_1;
14197  goto __pyx_L6_bool_binop_done;
14198  }
14199  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
14200  __pyx_t_2 = __pyx_t_1;
14201  __pyx_L6_bool_binop_done:;
14202  __pyx_v_negative_step = __pyx_t_2;
14203 
14204  /* "View.MemoryView":837
14205  * negative_step = have_step != 0 and step < 0
14206  *
14207  * if have_step and step == 0: # <<<<<<<<<<<<<<
14208  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
14209  *
14210  */
14211  __pyx_t_1 = (__pyx_v_have_step != 0);
14212  if (__pyx_t_1) {
14213  } else {
14214  __pyx_t_2 = __pyx_t_1;
14215  goto __pyx_L9_bool_binop_done;
14216  }
14217  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
14218  __pyx_t_2 = __pyx_t_1;
14219  __pyx_L9_bool_binop_done:;
14220  if (__pyx_t_2) {
14221 
14222  /* "View.MemoryView":838
14223  *
14224  * if have_step and step == 0:
14225  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
14226  *
14227  *
14228  */
14229  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 838, __pyx_L1_error)
14230 
14231  /* "View.MemoryView":837
14232  * negative_step = have_step != 0 and step < 0
14233  *
14234  * if have_step and step == 0: # <<<<<<<<<<<<<<
14235  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
14236  *
14237  */
14238  }
14239 
14240  /* "View.MemoryView":841
14241  *
14242  *
14243  * if have_start: # <<<<<<<<<<<<<<
14244  * if start < 0:
14245  * start += shape
14246  */
14247  __pyx_t_2 = (__pyx_v_have_start != 0);
14248  if (__pyx_t_2) {
14249 
14250  /* "View.MemoryView":842
14251  *
14252  * if have_start:
14253  * if start < 0: # <<<<<<<<<<<<<<
14254  * start += shape
14255  * if start < 0:
14256  */
14257  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
14258  if (__pyx_t_2) {
14259 
14260  /* "View.MemoryView":843
14261  * if have_start:
14262  * if start < 0:
14263  * start += shape # <<<<<<<<<<<<<<
14264  * if start < 0:
14265  * start = 0
14266  */
14267  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14268 
14269  /* "View.MemoryView":844
14270  * if start < 0:
14271  * start += shape
14272  * if start < 0: # <<<<<<<<<<<<<<
14273  * start = 0
14274  * elif start >= shape:
14275  */
14276  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
14277  if (__pyx_t_2) {
14278 
14279  /* "View.MemoryView":845
14280  * start += shape
14281  * if start < 0:
14282  * start = 0 # <<<<<<<<<<<<<<
14283  * elif start >= shape:
14284  * if negative_step:
14285  */
14286  __pyx_v_start = 0;
14287 
14288  /* "View.MemoryView":844
14289  * if start < 0:
14290  * start += shape
14291  * if start < 0: # <<<<<<<<<<<<<<
14292  * start = 0
14293  * elif start >= shape:
14294  */
14295  }
14296 
14297  /* "View.MemoryView":842
14298  *
14299  * if have_start:
14300  * if start < 0: # <<<<<<<<<<<<<<
14301  * start += shape
14302  * if start < 0:
14303  */
14304  goto __pyx_L12;
14305  }
14306 
14307  /* "View.MemoryView":846
14308  * if start < 0:
14309  * start = 0
14310  * elif start >= shape: # <<<<<<<<<<<<<<
14311  * if negative_step:
14312  * start = shape - 1
14313  */
14314  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
14315  if (__pyx_t_2) {
14316 
14317  /* "View.MemoryView":847
14318  * start = 0
14319  * elif start >= shape:
14320  * if negative_step: # <<<<<<<<<<<<<<
14321  * start = shape - 1
14322  * else:
14323  */
14324  __pyx_t_2 = (__pyx_v_negative_step != 0);
14325  if (__pyx_t_2) {
14326 
14327  /* "View.MemoryView":848
14328  * elif start >= shape:
14329  * if negative_step:
14330  * start = shape - 1 # <<<<<<<<<<<<<<
14331  * else:
14332  * start = shape
14333  */
14334  __pyx_v_start = (__pyx_v_shape - 1);
14335 
14336  /* "View.MemoryView":847
14337  * start = 0
14338  * elif start >= shape:
14339  * if negative_step: # <<<<<<<<<<<<<<
14340  * start = shape - 1
14341  * else:
14342  */
14343  goto __pyx_L14;
14344  }
14345 
14346  /* "View.MemoryView":850
14347  * start = shape - 1
14348  * else:
14349  * start = shape # <<<<<<<<<<<<<<
14350  * else:
14351  * if negative_step:
14352  */
14353  /*else*/ {
14354  __pyx_v_start = __pyx_v_shape;
14355  }
14356  __pyx_L14:;
14357 
14358  /* "View.MemoryView":846
14359  * if start < 0:
14360  * start = 0
14361  * elif start >= shape: # <<<<<<<<<<<<<<
14362  * if negative_step:
14363  * start = shape - 1
14364  */
14365  }
14366  __pyx_L12:;
14367 
14368  /* "View.MemoryView":841
14369  *
14370  *
14371  * if have_start: # <<<<<<<<<<<<<<
14372  * if start < 0:
14373  * start += shape
14374  */
14375  goto __pyx_L11;
14376  }
14377 
14378  /* "View.MemoryView":852
14379  * start = shape
14380  * else:
14381  * if negative_step: # <<<<<<<<<<<<<<
14382  * start = shape - 1
14383  * else:
14384  */
14385  /*else*/ {
14386  __pyx_t_2 = (__pyx_v_negative_step != 0);
14387  if (__pyx_t_2) {
14388 
14389  /* "View.MemoryView":853
14390  * else:
14391  * if negative_step:
14392  * start = shape - 1 # <<<<<<<<<<<<<<
14393  * else:
14394  * start = 0
14395  */
14396  __pyx_v_start = (__pyx_v_shape - 1);
14397 
14398  /* "View.MemoryView":852
14399  * start = shape
14400  * else:
14401  * if negative_step: # <<<<<<<<<<<<<<
14402  * start = shape - 1
14403  * else:
14404  */
14405  goto __pyx_L15;
14406  }
14407 
14408  /* "View.MemoryView":855
14409  * start = shape - 1
14410  * else:
14411  * start = 0 # <<<<<<<<<<<<<<
14412  *
14413  * if have_stop:
14414  */
14415  /*else*/ {
14416  __pyx_v_start = 0;
14417  }
14418  __pyx_L15:;
14419  }
14420  __pyx_L11:;
14421 
14422  /* "View.MemoryView":857
14423  * start = 0
14424  *
14425  * if have_stop: # <<<<<<<<<<<<<<
14426  * if stop < 0:
14427  * stop += shape
14428  */
14429  __pyx_t_2 = (__pyx_v_have_stop != 0);
14430  if (__pyx_t_2) {
14431 
14432  /* "View.MemoryView":858
14433  *
14434  * if have_stop:
14435  * if stop < 0: # <<<<<<<<<<<<<<
14436  * stop += shape
14437  * if stop < 0:
14438  */
14439  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
14440  if (__pyx_t_2) {
14441 
14442  /* "View.MemoryView":859
14443  * if have_stop:
14444  * if stop < 0:
14445  * stop += shape # <<<<<<<<<<<<<<
14446  * if stop < 0:
14447  * stop = 0
14448  */
14449  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
14450 
14451  /* "View.MemoryView":860
14452  * if stop < 0:
14453  * stop += shape
14454  * if stop < 0: # <<<<<<<<<<<<<<
14455  * stop = 0
14456  * elif stop > shape:
14457  */
14458  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
14459  if (__pyx_t_2) {
14460 
14461  /* "View.MemoryView":861
14462  * stop += shape
14463  * if stop < 0:
14464  * stop = 0 # <<<<<<<<<<<<<<
14465  * elif stop > shape:
14466  * stop = shape
14467  */
14468  __pyx_v_stop = 0;
14469 
14470  /* "View.MemoryView":860
14471  * if stop < 0:
14472  * stop += shape
14473  * if stop < 0: # <<<<<<<<<<<<<<
14474  * stop = 0
14475  * elif stop > shape:
14476  */
14477  }
14478 
14479  /* "View.MemoryView":858
14480  *
14481  * if have_stop:
14482  * if stop < 0: # <<<<<<<<<<<<<<
14483  * stop += shape
14484  * if stop < 0:
14485  */
14486  goto __pyx_L17;
14487  }
14488 
14489  /* "View.MemoryView":862
14490  * if stop < 0:
14491  * stop = 0
14492  * elif stop > shape: # <<<<<<<<<<<<<<
14493  * stop = shape
14494  * else:
14495  */
14496  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
14497  if (__pyx_t_2) {
14498 
14499  /* "View.MemoryView":863
14500  * stop = 0
14501  * elif stop > shape:
14502  * stop = shape # <<<<<<<<<<<<<<
14503  * else:
14504  * if negative_step:
14505  */
14506  __pyx_v_stop = __pyx_v_shape;
14507 
14508  /* "View.MemoryView":862
14509  * if stop < 0:
14510  * stop = 0
14511  * elif stop > shape: # <<<<<<<<<<<<<<
14512  * stop = shape
14513  * else:
14514  */
14515  }
14516  __pyx_L17:;
14517 
14518  /* "View.MemoryView":857
14519  * start = 0
14520  *
14521  * if have_stop: # <<<<<<<<<<<<<<
14522  * if stop < 0:
14523  * stop += shape
14524  */
14525  goto __pyx_L16;
14526  }
14527 
14528  /* "View.MemoryView":865
14529  * stop = shape
14530  * else:
14531  * if negative_step: # <<<<<<<<<<<<<<
14532  * stop = -1
14533  * else:
14534  */
14535  /*else*/ {
14536  __pyx_t_2 = (__pyx_v_negative_step != 0);
14537  if (__pyx_t_2) {
14538 
14539  /* "View.MemoryView":866
14540  * else:
14541  * if negative_step:
14542  * stop = -1 # <<<<<<<<<<<<<<
14543  * else:
14544  * stop = shape
14545  */
14546  __pyx_v_stop = -1L;
14547 
14548  /* "View.MemoryView":865
14549  * stop = shape
14550  * else:
14551  * if negative_step: # <<<<<<<<<<<<<<
14552  * stop = -1
14553  * else:
14554  */
14555  goto __pyx_L19;
14556  }
14557 
14558  /* "View.MemoryView":868
14559  * stop = -1
14560  * else:
14561  * stop = shape # <<<<<<<<<<<<<<
14562  *
14563  * if not have_step:
14564  */
14565  /*else*/ {
14566  __pyx_v_stop = __pyx_v_shape;
14567  }
14568  __pyx_L19:;
14569  }
14570  __pyx_L16:;
14571 
14572  /* "View.MemoryView":870
14573  * stop = shape
14574  *
14575  * if not have_step: # <<<<<<<<<<<<<<
14576  * step = 1
14577  *
14578  */
14579  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
14580  if (__pyx_t_2) {
14581 
14582  /* "View.MemoryView":871
14583  *
14584  * if not have_step:
14585  * step = 1 # <<<<<<<<<<<<<<
14586  *
14587  *
14588  */
14589  __pyx_v_step = 1;
14590 
14591  /* "View.MemoryView":870
14592  * stop = shape
14593  *
14594  * if not have_step: # <<<<<<<<<<<<<<
14595  * step = 1
14596  *
14597  */
14598  }
14599 
14600  /* "View.MemoryView":875
14601  *
14602  * with cython.cdivision(True):
14603  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
14604  *
14605  * if (stop - start) - step * new_shape:
14606  */
14607  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
14608 
14609  /* "View.MemoryView":877
14610  * new_shape = (stop - start) // step
14611  *
14612  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
14613  * new_shape += 1
14614  *
14615  */
14616  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
14617  if (__pyx_t_2) {
14618 
14619  /* "View.MemoryView":878
14620  *
14621  * if (stop - start) - step * new_shape:
14622  * new_shape += 1 # <<<<<<<<<<<<<<
14623  *
14624  * if new_shape < 0:
14625  */
14626  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
14627 
14628  /* "View.MemoryView":877
14629  * new_shape = (stop - start) // step
14630  *
14631  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
14632  * new_shape += 1
14633  *
14634  */
14635  }
14636 
14637  /* "View.MemoryView":880
14638  * new_shape += 1
14639  *
14640  * if new_shape < 0: # <<<<<<<<<<<<<<
14641  * new_shape = 0
14642  *
14643  */
14644  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
14645  if (__pyx_t_2) {
14646 
14647  /* "View.MemoryView":881
14648  *
14649  * if new_shape < 0:
14650  * new_shape = 0 # <<<<<<<<<<<<<<
14651  *
14652  *
14653  */
14654  __pyx_v_new_shape = 0;
14655 
14656  /* "View.MemoryView":880
14657  * new_shape += 1
14658  *
14659  * if new_shape < 0: # <<<<<<<<<<<<<<
14660  * new_shape = 0
14661  *
14662  */
14663  }
14664 
14665  /* "View.MemoryView":884
14666  *
14667  *
14668  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
14669  * dst.shape[new_ndim] = new_shape
14670  * dst.suboffsets[new_ndim] = suboffset
14671  */
14672  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
14673 
14674  /* "View.MemoryView":885
14675  *
14676  * dst.strides[new_ndim] = stride * step
14677  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
14678  * dst.suboffsets[new_ndim] = suboffset
14679  *
14680  */
14681  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
14682 
14683  /* "View.MemoryView":886
14684  * dst.strides[new_ndim] = stride * step
14685  * dst.shape[new_ndim] = new_shape
14686  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
14687  *
14688  *
14689  */
14690  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
14691  }
14692  __pyx_L3:;
14693 
14694  /* "View.MemoryView":889
14695  *
14696  *
14697  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
14698  * dst.data += start * stride
14699  * else:
14700  */
14701  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
14702  if (__pyx_t_2) {
14703 
14704  /* "View.MemoryView":890
14705  *
14706  * if suboffset_dim[0] < 0:
14707  * dst.data += start * stride # <<<<<<<<<<<<<<
14708  * else:
14709  * dst.suboffsets[suboffset_dim[0]] += start * stride
14710  */
14711  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
14712 
14713  /* "View.MemoryView":889
14714  *
14715  *
14716  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
14717  * dst.data += start * stride
14718  * else:
14719  */
14720  goto __pyx_L23;
14721  }
14722 
14723  /* "View.MemoryView":892
14724  * dst.data += start * stride
14725  * else:
14726  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
14727  *
14728  * if suboffset >= 0:
14729  */
14730  /*else*/ {
14731  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
14732  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
14733  }
14734  __pyx_L23:;
14735 
14736  /* "View.MemoryView":894
14737  * dst.suboffsets[suboffset_dim[0]] += start * stride
14738  *
14739  * if suboffset >= 0: # <<<<<<<<<<<<<<
14740  * if not is_slice:
14741  * if new_ndim == 0:
14742  */
14743  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
14744  if (__pyx_t_2) {
14745 
14746  /* "View.MemoryView":895
14747  *
14748  * if suboffset >= 0:
14749  * if not is_slice: # <<<<<<<<<<<<<<
14750  * if new_ndim == 0:
14751  * dst.data = (<char **> dst.data)[0] + suboffset
14752  */
14753  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
14754  if (__pyx_t_2) {
14755 
14756  /* "View.MemoryView":896
14757  * if suboffset >= 0:
14758  * if not is_slice:
14759  * if new_ndim == 0: # <<<<<<<<<<<<<<
14760  * dst.data = (<char **> dst.data)[0] + suboffset
14761  * else:
14762  */
14763  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
14764  if (__pyx_t_2) {
14765 
14766  /* "View.MemoryView":897
14767  * if not is_slice:
14768  * if new_ndim == 0:
14769  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
14770  * else:
14771  * _err_dim(IndexError, "All dimensions preceding dimension %d "
14772  */
14773  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
14774 
14775  /* "View.MemoryView":896
14776  * if suboffset >= 0:
14777  * if not is_slice:
14778  * if new_ndim == 0: # <<<<<<<<<<<<<<
14779  * dst.data = (<char **> dst.data)[0] + suboffset
14780  * else:
14781  */
14782  goto __pyx_L26;
14783  }
14784 
14785  /* "View.MemoryView":899
14786  * dst.data = (<char **> dst.data)[0] + suboffset
14787  * else:
14788  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
14789  * "must be indexed and not sliced", dim)
14790  * else:
14791  */
14792  /*else*/ {
14793 
14794  /* "View.MemoryView":900
14795  * else:
14796  * _err_dim(IndexError, "All dimensions preceding dimension %d "
14797  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
14798  * else:
14799  * suboffset_dim[0] = new_ndim
14800  */
14801  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 899, __pyx_L1_error)
14802  }
14803  __pyx_L26:;
14804 
14805  /* "View.MemoryView":895
14806  *
14807  * if suboffset >= 0:
14808  * if not is_slice: # <<<<<<<<<<<<<<
14809  * if new_ndim == 0:
14810  * dst.data = (<char **> dst.data)[0] + suboffset
14811  */
14812  goto __pyx_L25;
14813  }
14814 
14815  /* "View.MemoryView":902
14816  * "must be indexed and not sliced", dim)
14817  * else:
14818  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
14819  *
14820  * return 0
14821  */
14822  /*else*/ {
14823  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
14824  }
14825  __pyx_L25:;
14826 
14827  /* "View.MemoryView":894
14828  * dst.suboffsets[suboffset_dim[0]] += start * stride
14829  *
14830  * if suboffset >= 0: # <<<<<<<<<<<<<<
14831  * if not is_slice:
14832  * if new_ndim == 0:
14833  */
14834  }
14835 
14836  /* "View.MemoryView":904
14837  * suboffset_dim[0] = new_ndim
14838  *
14839  * return 0 # <<<<<<<<<<<<<<
14840  *
14841  *
14842  */
14843  __pyx_r = 0;
14844  goto __pyx_L0;
14845 
14846  /* "View.MemoryView":807
14847  *
14848  * @cname('__pyx_memoryview_slice_memviewslice')
14849  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
14850  * __Pyx_memviewslice *dst,
14851  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
14852  */
14853 
14854  /* function exit code */
14855  __pyx_L1_error:;
14856  {
14857  #ifdef WITH_THREAD
14858  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14859  #endif
14860  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14861  #ifdef WITH_THREAD
14862  __Pyx_PyGILState_Release(__pyx_gilstate_save);
14863  #endif
14864  }
14865  __pyx_r = -1;
14866  __pyx_L0:;
14867  return __pyx_r;
14868 }
14869 
14870 /* "View.MemoryView":910
14871  *
14872  * @cname('__pyx_pybuffer_index')
14873  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
14874  * Py_ssize_t dim) except NULL:
14875  * cdef Py_ssize_t shape, stride, suboffset = -1
14876  */
14877 
14878 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) {
14879  Py_ssize_t __pyx_v_shape;
14880  Py_ssize_t __pyx_v_stride;
14881  Py_ssize_t __pyx_v_suboffset;
14882  Py_ssize_t __pyx_v_itemsize;
14883  char *__pyx_v_resultp;
14884  char *__pyx_r;
14885  __Pyx_RefNannyDeclarations
14886  Py_ssize_t __pyx_t_1;
14887  int __pyx_t_2;
14888  PyObject *__pyx_t_3 = NULL;
14889  PyObject *__pyx_t_4 = NULL;
14890  int __pyx_lineno = 0;
14891  const char *__pyx_filename = NULL;
14892  int __pyx_clineno = 0;
14893  __Pyx_RefNannySetupContext("pybuffer_index", 0);
14894 
14895  /* "View.MemoryView":912
14896  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14897  * Py_ssize_t dim) except NULL:
14898  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
14899  * cdef Py_ssize_t itemsize = view.itemsize
14900  * cdef char *resultp
14901  */
14902  __pyx_v_suboffset = -1L;
14903 
14904  /* "View.MemoryView":913
14905  * Py_ssize_t dim) except NULL:
14906  * cdef Py_ssize_t shape, stride, suboffset = -1
14907  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
14908  * cdef char *resultp
14909  *
14910  */
14911  __pyx_t_1 = __pyx_v_view->itemsize;
14912  __pyx_v_itemsize = __pyx_t_1;
14913 
14914  /* "View.MemoryView":916
14915  * cdef char *resultp
14916  *
14917  * if view.ndim == 0: # <<<<<<<<<<<<<<
14918  * shape = view.len / itemsize
14919  * stride = itemsize
14920  */
14921  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
14922  if (__pyx_t_2) {
14923 
14924  /* "View.MemoryView":917
14925  *
14926  * if view.ndim == 0:
14927  * shape = view.len / itemsize # <<<<<<<<<<<<<<
14928  * stride = itemsize
14929  * else:
14930  */
14931  if (unlikely(__pyx_v_itemsize == 0)) {
14932  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
14933  __PYX_ERR(0, 917, __pyx_L1_error)
14934  }
14935  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))) {
14936  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
14937  __PYX_ERR(0, 917, __pyx_L1_error)
14938  }
14939  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
14940 
14941  /* "View.MemoryView":918
14942  * if view.ndim == 0:
14943  * shape = view.len / itemsize
14944  * stride = itemsize # <<<<<<<<<<<<<<
14945  * else:
14946  * shape = view.shape[dim]
14947  */
14948  __pyx_v_stride = __pyx_v_itemsize;
14949 
14950  /* "View.MemoryView":916
14951  * cdef char *resultp
14952  *
14953  * if view.ndim == 0: # <<<<<<<<<<<<<<
14954  * shape = view.len / itemsize
14955  * stride = itemsize
14956  */
14957  goto __pyx_L3;
14958  }
14959 
14960  /* "View.MemoryView":920
14961  * stride = itemsize
14962  * else:
14963  * shape = view.shape[dim] # <<<<<<<<<<<<<<
14964  * stride = view.strides[dim]
14965  * if view.suboffsets != NULL:
14966  */
14967  /*else*/ {
14968  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14969 
14970  /* "View.MemoryView":921
14971  * else:
14972  * shape = view.shape[dim]
14973  * stride = view.strides[dim] # <<<<<<<<<<<<<<
14974  * if view.suboffsets != NULL:
14975  * suboffset = view.suboffsets[dim]
14976  */
14977  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14978 
14979  /* "View.MemoryView":922
14980  * shape = view.shape[dim]
14981  * stride = view.strides[dim]
14982  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14983  * suboffset = view.suboffsets[dim]
14984  *
14985  */
14986  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
14987  if (__pyx_t_2) {
14988 
14989  /* "View.MemoryView":923
14990  * stride = view.strides[dim]
14991  * if view.suboffsets != NULL:
14992  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
14993  *
14994  * if index < 0:
14995  */
14996  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14997 
14998  /* "View.MemoryView":922
14999  * shape = view.shape[dim]
15000  * stride = view.strides[dim]
15001  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
15002  * suboffset = view.suboffsets[dim]
15003  *
15004  */
15005  }
15006  }
15007  __pyx_L3:;
15008 
15009  /* "View.MemoryView":925
15010  * suboffset = view.suboffsets[dim]
15011  *
15012  * if index < 0: # <<<<<<<<<<<<<<
15013  * index += view.shape[dim]
15014  * if index < 0:
15015  */
15016  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15017  if (__pyx_t_2) {
15018 
15019  /* "View.MemoryView":926
15020  *
15021  * if index < 0:
15022  * index += view.shape[dim] # <<<<<<<<<<<<<<
15023  * if index < 0:
15024  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15025  */
15026  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
15027 
15028  /* "View.MemoryView":927
15029  * if index < 0:
15030  * index += view.shape[dim]
15031  * if index < 0: # <<<<<<<<<<<<<<
15032  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15033  *
15034  */
15035  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
15036  if (unlikely(__pyx_t_2)) {
15037 
15038  /* "View.MemoryView":928
15039  * index += view.shape[dim]
15040  * if index < 0:
15041  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
15042  *
15043  * if index >= shape:
15044  */
15045  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error)
15046  __Pyx_GOTREF(__pyx_t_3);
15047  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error)
15048  __Pyx_GOTREF(__pyx_t_4);
15049  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15050  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error)
15051  __Pyx_GOTREF(__pyx_t_3);
15052  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15053  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15054  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15055  __PYX_ERR(0, 928, __pyx_L1_error)
15056 
15057  /* "View.MemoryView":927
15058  * if index < 0:
15059  * index += view.shape[dim]
15060  * if index < 0: # <<<<<<<<<<<<<<
15061  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15062  *
15063  */
15064  }
15065 
15066  /* "View.MemoryView":925
15067  * suboffset = view.suboffsets[dim]
15068  *
15069  * if index < 0: # <<<<<<<<<<<<<<
15070  * index += view.shape[dim]
15071  * if index < 0:
15072  */
15073  }
15074 
15075  /* "View.MemoryView":930
15076  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15077  *
15078  * if index >= shape: # <<<<<<<<<<<<<<
15079  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15080  *
15081  */
15082  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
15083  if (unlikely(__pyx_t_2)) {
15084 
15085  /* "View.MemoryView":931
15086  *
15087  * if index >= shape:
15088  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
15089  *
15090  * resultp = bufp + index * stride
15091  */
15092  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error)
15093  __Pyx_GOTREF(__pyx_t_3);
15094  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 931, __pyx_L1_error)
15095  __Pyx_GOTREF(__pyx_t_4);
15096  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15097  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error)
15098  __Pyx_GOTREF(__pyx_t_3);
15099  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15100  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15101  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15102  __PYX_ERR(0, 931, __pyx_L1_error)
15103 
15104  /* "View.MemoryView":930
15105  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15106  *
15107  * if index >= shape: # <<<<<<<<<<<<<<
15108  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15109  *
15110  */
15111  }
15112 
15113  /* "View.MemoryView":933
15114  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
15115  *
15116  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
15117  * if suboffset >= 0:
15118  * resultp = (<char **> resultp)[0] + suboffset
15119  */
15120  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
15121 
15122  /* "View.MemoryView":934
15123  *
15124  * resultp = bufp + index * stride
15125  * if suboffset >= 0: # <<<<<<<<<<<<<<
15126  * resultp = (<char **> resultp)[0] + suboffset
15127  *
15128  */
15129  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
15130  if (__pyx_t_2) {
15131 
15132  /* "View.MemoryView":935
15133  * resultp = bufp + index * stride
15134  * if suboffset >= 0:
15135  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
15136  *
15137  * return resultp
15138  */
15139  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
15140 
15141  /* "View.MemoryView":934
15142  *
15143  * resultp = bufp + index * stride
15144  * if suboffset >= 0: # <<<<<<<<<<<<<<
15145  * resultp = (<char **> resultp)[0] + suboffset
15146  *
15147  */
15148  }
15149 
15150  /* "View.MemoryView":937
15151  * resultp = (<char **> resultp)[0] + suboffset
15152  *
15153  * return resultp # <<<<<<<<<<<<<<
15154  *
15155  *
15156  */
15157  __pyx_r = __pyx_v_resultp;
15158  goto __pyx_L0;
15159 
15160  /* "View.MemoryView":910
15161  *
15162  * @cname('__pyx_pybuffer_index')
15163  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
15164  * Py_ssize_t dim) except NULL:
15165  * cdef Py_ssize_t shape, stride, suboffset = -1
15166  */
15167 
15168  /* function exit code */
15169  __pyx_L1_error:;
15170  __Pyx_XDECREF(__pyx_t_3);
15171  __Pyx_XDECREF(__pyx_t_4);
15172  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
15173  __pyx_r = NULL;
15174  __pyx_L0:;
15175  __Pyx_RefNannyFinishContext();
15176  return __pyx_r;
15177 }
15178 
15179 /* "View.MemoryView":943
15180  *
15181  * @cname('__pyx_memslice_transpose')
15182  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
15183  * cdef int ndim = memslice.memview.view.ndim
15184  *
15185  */
15186 
15187 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
15188  int __pyx_v_ndim;
15189  Py_ssize_t *__pyx_v_shape;
15190  Py_ssize_t *__pyx_v_strides;
15191  int __pyx_v_i;
15192  int __pyx_v_j;
15193  int __pyx_r;
15194  int __pyx_t_1;
15195  Py_ssize_t *__pyx_t_2;
15196  long __pyx_t_3;
15197  long __pyx_t_4;
15198  Py_ssize_t __pyx_t_5;
15199  Py_ssize_t __pyx_t_6;
15200  int __pyx_t_7;
15201  int __pyx_t_8;
15202  int __pyx_t_9;
15203  int __pyx_lineno = 0;
15204  const char *__pyx_filename = NULL;
15205  int __pyx_clineno = 0;
15206 
15207  /* "View.MemoryView":944
15208  * @cname('__pyx_memslice_transpose')
15209  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
15210  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
15211  *
15212  * cdef Py_ssize_t *shape = memslice.shape
15213  */
15214  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
15215  __pyx_v_ndim = __pyx_t_1;
15216 
15217  /* "View.MemoryView":946
15218  * cdef int ndim = memslice.memview.view.ndim
15219  *
15220  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
15221  * cdef Py_ssize_t *strides = memslice.strides
15222  *
15223  */
15224  __pyx_t_2 = __pyx_v_memslice->shape;
15225  __pyx_v_shape = __pyx_t_2;
15226 
15227  /* "View.MemoryView":947
15228  *
15229  * cdef Py_ssize_t *shape = memslice.shape
15230  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
15231  *
15232  *
15233  */
15234  __pyx_t_2 = __pyx_v_memslice->strides;
15235  __pyx_v_strides = __pyx_t_2;
15236 
15237  /* "View.MemoryView":951
15238  *
15239  * cdef int i, j
15240  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
15241  * j = ndim - 1 - i
15242  * strides[i], strides[j] = strides[j], strides[i]
15243  */
15244  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
15245  __pyx_t_4 = __pyx_t_3;
15246  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
15247  __pyx_v_i = __pyx_t_1;
15248 
15249  /* "View.MemoryView":952
15250  * cdef int i, j
15251  * for i in range(ndim / 2):
15252  * j = ndim - 1 - i # <<<<<<<<<<<<<<
15253  * strides[i], strides[j] = strides[j], strides[i]
15254  * shape[i], shape[j] = shape[j], shape[i]
15255  */
15256  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
15257 
15258  /* "View.MemoryView":953
15259  * for i in range(ndim / 2):
15260  * j = ndim - 1 - i
15261  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
15262  * shape[i], shape[j] = shape[j], shape[i]
15263  *
15264  */
15265  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
15266  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
15267  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
15268  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
15269 
15270  /* "View.MemoryView":954
15271  * j = ndim - 1 - i
15272  * strides[i], strides[j] = strides[j], strides[i]
15273  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
15274  *
15275  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
15276  */
15277  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
15278  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
15279  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
15280  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
15281 
15282  /* "View.MemoryView":956
15283  * shape[i], shape[j] = shape[j], shape[i]
15284  *
15285  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
15286  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
15287  *
15288  */
15289  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
15290  if (!__pyx_t_8) {
15291  } else {
15292  __pyx_t_7 = __pyx_t_8;
15293  goto __pyx_L6_bool_binop_done;
15294  }
15295  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
15296  __pyx_t_7 = __pyx_t_8;
15297  __pyx_L6_bool_binop_done:;
15298  if (__pyx_t_7) {
15299 
15300  /* "View.MemoryView":957
15301  *
15302  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
15303  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
15304  *
15305  * return 1
15306  */
15307  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 957, __pyx_L1_error)
15308 
15309  /* "View.MemoryView":956
15310  * shape[i], shape[j] = shape[j], shape[i]
15311  *
15312  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
15313  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
15314  *
15315  */
15316  }
15317  }
15318 
15319  /* "View.MemoryView":959
15320  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
15321  *
15322  * return 1 # <<<<<<<<<<<<<<
15323  *
15324  *
15325  */
15326  __pyx_r = 1;
15327  goto __pyx_L0;
15328 
15329  /* "View.MemoryView":943
15330  *
15331  * @cname('__pyx_memslice_transpose')
15332  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
15333  * cdef int ndim = memslice.memview.view.ndim
15334  *
15335  */
15336 
15337  /* function exit code */
15338  __pyx_L1_error:;
15339  {
15340  #ifdef WITH_THREAD
15341  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15342  #endif
15343  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15344  #ifdef WITH_THREAD
15345  __Pyx_PyGILState_Release(__pyx_gilstate_save);
15346  #endif
15347  }
15348  __pyx_r = 0;
15349  __pyx_L0:;
15350  return __pyx_r;
15351 }
15352 
15353 /* "View.MemoryView":976
15354  * cdef int (*to_dtype_func)(char *, object) except 0
15355  *
15356  * def __dealloc__(self): # <<<<<<<<<<<<<<
15357  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
15358  *
15359  */
15360 
15361 /* Python wrapper */
15362 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
15363 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
15364  __Pyx_RefNannyDeclarations
15365  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
15366  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15367 
15368  /* function exit code */
15369  __Pyx_RefNannyFinishContext();
15370 }
15371 
15372 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15373  __Pyx_RefNannyDeclarations
15374  __Pyx_RefNannySetupContext("__dealloc__", 0);
15375 
15376  /* "View.MemoryView":977
15377  *
15378  * def __dealloc__(self):
15379  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
15380  *
15381  * cdef convert_item_to_object(self, char *itemp):
15382  */
15383  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
15384 
15385  /* "View.MemoryView":976
15386  * cdef int (*to_dtype_func)(char *, object) except 0
15387  *
15388  * def __dealloc__(self): # <<<<<<<<<<<<<<
15389  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
15390  *
15391  */
15392 
15393  /* function exit code */
15394  __Pyx_RefNannyFinishContext();
15395 }
15396 
15397 /* "View.MemoryView":979
15398  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
15399  *
15400  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15401  * if self.to_object_func != NULL:
15402  * return self.to_object_func(itemp)
15403  */
15404 
15405 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
15406  PyObject *__pyx_r = NULL;
15407  __Pyx_RefNannyDeclarations
15408  int __pyx_t_1;
15409  PyObject *__pyx_t_2 = NULL;
15410  int __pyx_lineno = 0;
15411  const char *__pyx_filename = NULL;
15412  int __pyx_clineno = 0;
15413  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
15414 
15415  /* "View.MemoryView":980
15416  *
15417  * cdef convert_item_to_object(self, char *itemp):
15418  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
15419  * return self.to_object_func(itemp)
15420  * else:
15421  */
15422  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
15423  if (__pyx_t_1) {
15424 
15425  /* "View.MemoryView":981
15426  * cdef convert_item_to_object(self, char *itemp):
15427  * if self.to_object_func != NULL:
15428  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
15429  * else:
15430  * return memoryview.convert_item_to_object(self, itemp)
15431  */
15432  __Pyx_XDECREF(__pyx_r);
15433  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error)
15434  __Pyx_GOTREF(__pyx_t_2);
15435  __pyx_r = __pyx_t_2;
15436  __pyx_t_2 = 0;
15437  goto __pyx_L0;
15438 
15439  /* "View.MemoryView":980
15440  *
15441  * cdef convert_item_to_object(self, char *itemp):
15442  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
15443  * return self.to_object_func(itemp)
15444  * else:
15445  */
15446  }
15447 
15448  /* "View.MemoryView":983
15449  * return self.to_object_func(itemp)
15450  * else:
15451  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
15452  *
15453  * cdef assign_item_from_object(self, char *itemp, object value):
15454  */
15455  /*else*/ {
15456  __Pyx_XDECREF(__pyx_r);
15457  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error)
15458  __Pyx_GOTREF(__pyx_t_2);
15459  __pyx_r = __pyx_t_2;
15460  __pyx_t_2 = 0;
15461  goto __pyx_L0;
15462  }
15463 
15464  /* "View.MemoryView":979
15465  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
15466  *
15467  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15468  * if self.to_object_func != NULL:
15469  * return self.to_object_func(itemp)
15470  */
15471 
15472  /* function exit code */
15473  __pyx_L1_error:;
15474  __Pyx_XDECREF(__pyx_t_2);
15475  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15476  __pyx_r = 0;
15477  __pyx_L0:;
15478  __Pyx_XGIVEREF(__pyx_r);
15479  __Pyx_RefNannyFinishContext();
15480  return __pyx_r;
15481 }
15482 
15483 /* "View.MemoryView":985
15484  * return memoryview.convert_item_to_object(self, itemp)
15485  *
15486  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
15487  * if self.to_dtype_func != NULL:
15488  * self.to_dtype_func(itemp, value)
15489  */
15490 
15491 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
15492  PyObject *__pyx_r = NULL;
15493  __Pyx_RefNannyDeclarations
15494  int __pyx_t_1;
15495  int __pyx_t_2;
15496  PyObject *__pyx_t_3 = NULL;
15497  int __pyx_lineno = 0;
15498  const char *__pyx_filename = NULL;
15499  int __pyx_clineno = 0;
15500  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
15501 
15502  /* "View.MemoryView":986
15503  *
15504  * cdef assign_item_from_object(self, char *itemp, object value):
15505  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
15506  * self.to_dtype_func(itemp, value)
15507  * else:
15508  */
15509  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
15510  if (__pyx_t_1) {
15511 
15512  /* "View.MemoryView":987
15513  * cdef assign_item_from_object(self, char *itemp, object value):
15514  * if self.to_dtype_func != NULL:
15515  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
15516  * else:
15517  * memoryview.assign_item_from_object(self, itemp, value)
15518  */
15519  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(0, 987, __pyx_L1_error)
15520 
15521  /* "View.MemoryView":986
15522  *
15523  * cdef assign_item_from_object(self, char *itemp, object value):
15524  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
15525  * self.to_dtype_func(itemp, value)
15526  * else:
15527  */
15528  goto __pyx_L3;
15529  }
15530 
15531  /* "View.MemoryView":989
15532  * self.to_dtype_func(itemp, value)
15533  * else:
15534  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
15535  *
15536  * @property
15537  */
15538  /*else*/ {
15539  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 989, __pyx_L1_error)
15540  __Pyx_GOTREF(__pyx_t_3);
15541  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15542  }
15543  __pyx_L3:;
15544 
15545  /* "View.MemoryView":985
15546  * return memoryview.convert_item_to_object(self, itemp)
15547  *
15548  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
15549  * if self.to_dtype_func != NULL:
15550  * self.to_dtype_func(itemp, value)
15551  */
15552 
15553  /* function exit code */
15554  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15555  goto __pyx_L0;
15556  __pyx_L1_error:;
15557  __Pyx_XDECREF(__pyx_t_3);
15558  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15559  __pyx_r = 0;
15560  __pyx_L0:;
15561  __Pyx_XGIVEREF(__pyx_r);
15562  __Pyx_RefNannyFinishContext();
15563  return __pyx_r;
15564 }
15565 
15566 /* "View.MemoryView":992
15567  *
15568  * @property
15569  * def base(self): # <<<<<<<<<<<<<<
15570  * return self.from_object
15571  *
15572  */
15573 
15574 /* Python wrapper */
15575 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
15576 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
15577  PyObject *__pyx_r = 0;
15578  __Pyx_RefNannyDeclarations
15579  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15580  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15581 
15582  /* function exit code */
15583  __Pyx_RefNannyFinishContext();
15584  return __pyx_r;
15585 }
15586 
15587 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15588  PyObject *__pyx_r = NULL;
15589  __Pyx_RefNannyDeclarations
15590  __Pyx_RefNannySetupContext("__get__", 0);
15591 
15592  /* "View.MemoryView":993
15593  * @property
15594  * def base(self):
15595  * return self.from_object # <<<<<<<<<<<<<<
15596  *
15597  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
15598  */
15599  __Pyx_XDECREF(__pyx_r);
15600  __Pyx_INCREF(__pyx_v_self->from_object);
15601  __pyx_r = __pyx_v_self->from_object;
15602  goto __pyx_L0;
15603 
15604  /* "View.MemoryView":992
15605  *
15606  * @property
15607  * def base(self): # <<<<<<<<<<<<<<
15608  * return self.from_object
15609  *
15610  */
15611 
15612  /* function exit code */
15613  __pyx_L0:;
15614  __Pyx_XGIVEREF(__pyx_r);
15615  __Pyx_RefNannyFinishContext();
15616  return __pyx_r;
15617 }
15618 
15619 /* "(tree fragment)":1
15620  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15621  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15622  * def __setstate_cython__(self, __pyx_state):
15623  */
15624 
15625 /* Python wrapper */
15626 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15627 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15628  PyObject *__pyx_r = 0;
15629  __Pyx_RefNannyDeclarations
15630  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
15631  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15632 
15633  /* function exit code */
15634  __Pyx_RefNannyFinishContext();
15635  return __pyx_r;
15636 }
15637 
15638 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15639  PyObject *__pyx_r = NULL;
15640  __Pyx_RefNannyDeclarations
15641  PyObject *__pyx_t_1 = NULL;
15642  int __pyx_lineno = 0;
15643  const char *__pyx_filename = NULL;
15644  int __pyx_clineno = 0;
15645  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
15646 
15647  /* "(tree fragment)":2
15648  * def __reduce_cython__(self):
15649  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15650  * def __setstate_cython__(self, __pyx_state):
15651  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15652  */
15653  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
15654  __Pyx_GOTREF(__pyx_t_1);
15655  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15656  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15657  __PYX_ERR(0, 2, __pyx_L1_error)
15658 
15659  /* "(tree fragment)":1
15660  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15661  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15662  * def __setstate_cython__(self, __pyx_state):
15663  */
15664 
15665  /* function exit code */
15666  __pyx_L1_error:;
15667  __Pyx_XDECREF(__pyx_t_1);
15668  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15669  __pyx_r = NULL;
15670  __Pyx_XGIVEREF(__pyx_r);
15671  __Pyx_RefNannyFinishContext();
15672  return __pyx_r;
15673 }
15674 
15675 /* "(tree fragment)":3
15676  * def __reduce_cython__(self):
15677  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15678  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15679  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15680  */
15681 
15682 /* Python wrapper */
15683 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
15684 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15685  PyObject *__pyx_r = 0;
15686  __Pyx_RefNannyDeclarations
15687  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15688  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15689 
15690  /* function exit code */
15691  __Pyx_RefNannyFinishContext();
15692  return __pyx_r;
15693 }
15694 
15695 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) {
15696  PyObject *__pyx_r = NULL;
15697  __Pyx_RefNannyDeclarations
15698  PyObject *__pyx_t_1 = NULL;
15699  int __pyx_lineno = 0;
15700  const char *__pyx_filename = NULL;
15701  int __pyx_clineno = 0;
15702  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
15703 
15704  /* "(tree fragment)":4
15705  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15706  * def __setstate_cython__(self, __pyx_state):
15707  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
15708  */
15709  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
15710  __Pyx_GOTREF(__pyx_t_1);
15711  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
15712  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15713  __PYX_ERR(0, 4, __pyx_L1_error)
15714 
15715  /* "(tree fragment)":3
15716  * def __reduce_cython__(self):
15717  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15718  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15719  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
15720  */
15721 
15722  /* function exit code */
15723  __pyx_L1_error:;
15724  __Pyx_XDECREF(__pyx_t_1);
15725  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15726  __pyx_r = NULL;
15727  __Pyx_XGIVEREF(__pyx_r);
15728  __Pyx_RefNannyFinishContext();
15729  return __pyx_r;
15730 }
15731 
15732 /* "View.MemoryView":999
15733  *
15734  * @cname('__pyx_memoryview_fromslice')
15735  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
15736  * int ndim,
15737  * object (*to_object_func)(char *),
15738  */
15739 
15740 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) {
15741  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
15742  Py_ssize_t __pyx_v_suboffset;
15743  PyObject *__pyx_v_length = NULL;
15744  PyObject *__pyx_r = NULL;
15745  __Pyx_RefNannyDeclarations
15746  int __pyx_t_1;
15747  PyObject *__pyx_t_2 = NULL;
15748  PyObject *__pyx_t_3 = NULL;
15749  __Pyx_TypeInfo *__pyx_t_4;
15750  Py_buffer __pyx_t_5;
15751  Py_ssize_t *__pyx_t_6;
15752  Py_ssize_t *__pyx_t_7;
15753  Py_ssize_t *__pyx_t_8;
15754  Py_ssize_t __pyx_t_9;
15755  int __pyx_lineno = 0;
15756  const char *__pyx_filename = NULL;
15757  int __pyx_clineno = 0;
15758  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
15759 
15760  /* "View.MemoryView":1007
15761  * cdef _memoryviewslice result
15762  *
15763  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
15764  * return None
15765  *
15766  */
15767  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
15768  if (__pyx_t_1) {
15769 
15770  /* "View.MemoryView":1008
15771  *
15772  * if <PyObject *> memviewslice.memview == Py_None:
15773  * return None # <<<<<<<<<<<<<<
15774  *
15775  *
15776  */
15777  __Pyx_XDECREF(__pyx_r);
15778  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15779  goto __pyx_L0;
15780 
15781  /* "View.MemoryView":1007
15782  * cdef _memoryviewslice result
15783  *
15784  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
15785  * return None
15786  *
15787  */
15788  }
15789 
15790  /* "View.MemoryView":1013
15791  *
15792  *
15793  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
15794  *
15795  * result.from_slice = memviewslice
15796  */
15797  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error)
15798  __Pyx_GOTREF(__pyx_t_2);
15799  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1013, __pyx_L1_error)
15800  __Pyx_GOTREF(__pyx_t_3);
15801  __Pyx_INCREF(Py_None);
15802  __Pyx_GIVEREF(Py_None);
15803  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
15804  __Pyx_INCREF(__pyx_int_0);
15805  __Pyx_GIVEREF(__pyx_int_0);
15806  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
15807  __Pyx_GIVEREF(__pyx_t_2);
15808  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
15809  __pyx_t_2 = 0;
15810  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error)
15811  __Pyx_GOTREF(__pyx_t_2);
15812  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15813  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15814  __pyx_t_2 = 0;
15815 
15816  /* "View.MemoryView":1015
15817  * result = _memoryviewslice(None, 0, dtype_is_object)
15818  *
15819  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
15820  * __PYX_INC_MEMVIEW(&memviewslice, 1)
15821  *
15822  */
15823  __pyx_v_result->from_slice = __pyx_v_memviewslice;
15824 
15825  /* "View.MemoryView":1016
15826  *
15827  * result.from_slice = memviewslice
15828  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
15829  *
15830  * result.from_object = (<memoryview> memviewslice.memview).base
15831  */
15832  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
15833 
15834  /* "View.MemoryView":1018
15835  * __PYX_INC_MEMVIEW(&memviewslice, 1)
15836  *
15837  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
15838  * result.typeinfo = memviewslice.memview.typeinfo
15839  *
15840  */
15841  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
15842  __Pyx_GOTREF(__pyx_t_2);
15843  __Pyx_GIVEREF(__pyx_t_2);
15844  __Pyx_GOTREF(__pyx_v_result->from_object);
15845  __Pyx_DECREF(__pyx_v_result->from_object);
15846  __pyx_v_result->from_object = __pyx_t_2;
15847  __pyx_t_2 = 0;
15848 
15849  /* "View.MemoryView":1019
15850  *
15851  * result.from_object = (<memoryview> memviewslice.memview).base
15852  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
15853  *
15854  * result.view = memviewslice.memview.view
15855  */
15856  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15857  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15858 
15859  /* "View.MemoryView":1021
15860  * result.typeinfo = memviewslice.memview.typeinfo
15861  *
15862  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
15863  * result.view.buf = <void *> memviewslice.data
15864  * result.view.ndim = ndim
15865  */
15866  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15867  __pyx_v_result->__pyx_base.view = __pyx_t_5;
15868 
15869  /* "View.MemoryView":1022
15870  *
15871  * result.view = memviewslice.memview.view
15872  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
15873  * result.view.ndim = ndim
15874  * (<__pyx_buffer *> &result.view).obj = Py_None
15875  */
15876  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
15877 
15878  /* "View.MemoryView":1023
15879  * result.view = memviewslice.memview.view
15880  * result.view.buf = <void *> memviewslice.data
15881  * result.view.ndim = ndim # <<<<<<<<<<<<<<
15882  * (<__pyx_buffer *> &result.view).obj = Py_None
15883  * Py_INCREF(Py_None)
15884  */
15885  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15886 
15887  /* "View.MemoryView":1024
15888  * result.view.buf = <void *> memviewslice.data
15889  * result.view.ndim = ndim
15890  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
15891  * Py_INCREF(Py_None)
15892  *
15893  */
15894  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15895 
15896  /* "View.MemoryView":1025
15897  * result.view.ndim = ndim
15898  * (<__pyx_buffer *> &result.view).obj = Py_None
15899  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
15900  *
15901  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15902  */
15903  Py_INCREF(Py_None);
15904 
15905  /* "View.MemoryView":1027
15906  * Py_INCREF(Py_None)
15907  *
15908  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15909  * result.flags = PyBUF_RECORDS
15910  * else:
15911  */
15912  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15913  if (__pyx_t_1) {
15914 
15915  /* "View.MemoryView":1028
15916  *
15917  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15918  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
15919  * else:
15920  * result.flags = PyBUF_RECORDS_RO
15921  */
15922  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15923 
15924  /* "View.MemoryView":1027
15925  * Py_INCREF(Py_None)
15926  *
15927  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15928  * result.flags = PyBUF_RECORDS
15929  * else:
15930  */
15931  goto __pyx_L4;
15932  }
15933 
15934  /* "View.MemoryView":1030
15935  * result.flags = PyBUF_RECORDS
15936  * else:
15937  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
15938  *
15939  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15940  */
15941  /*else*/ {
15942  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15943  }
15944  __pyx_L4:;
15945 
15946  /* "View.MemoryView":1032
15947  * result.flags = PyBUF_RECORDS_RO
15948  *
15949  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
15950  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
15951  *
15952  */
15953  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15954 
15955  /* "View.MemoryView":1033
15956  *
15957  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15958  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
15959  *
15960  *
15961  */
15962  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15963 
15964  /* "View.MemoryView":1036
15965  *
15966  *
15967  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
15968  * for suboffset in result.from_slice.suboffsets[:ndim]:
15969  * if suboffset >= 0:
15970  */
15971  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15972 
15973  /* "View.MemoryView":1037
15974  *
15975  * result.view.suboffsets = NULL
15976  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
15977  * if suboffset >= 0:
15978  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15979  */
15980  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15981  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15982  __pyx_t_6 = __pyx_t_8;
15983  __pyx_v_suboffset = (__pyx_t_6[0]);
15984 
15985  /* "View.MemoryView":1038
15986  * result.view.suboffsets = NULL
15987  * for suboffset in result.from_slice.suboffsets[:ndim]:
15988  * if suboffset >= 0: # <<<<<<<<<<<<<<
15989  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15990  * break
15991  */
15992  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
15993  if (__pyx_t_1) {
15994 
15995  /* "View.MemoryView":1039
15996  * for suboffset in result.from_slice.suboffsets[:ndim]:
15997  * if suboffset >= 0:
15998  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
15999  * break
16000  *
16001  */
16002  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
16003 
16004  /* "View.MemoryView":1040
16005  * if suboffset >= 0:
16006  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16007  * break # <<<<<<<<<<<<<<
16008  *
16009  * result.view.len = result.view.itemsize
16010  */
16011  goto __pyx_L6_break;
16012 
16013  /* "View.MemoryView":1038
16014  * result.view.suboffsets = NULL
16015  * for suboffset in result.from_slice.suboffsets[:ndim]:
16016  * if suboffset >= 0: # <<<<<<<<<<<<<<
16017  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16018  * break
16019  */
16020  }
16021  }
16022  __pyx_L6_break:;
16023 
16024  /* "View.MemoryView":1042
16025  * break
16026  *
16027  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
16028  * for length in result.view.shape[:ndim]:
16029  * result.view.len *= length
16030  */
16031  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
16032  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16033 
16034  /* "View.MemoryView":1043
16035  *
16036  * result.view.len = result.view.itemsize
16037  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
16038  * result.view.len *= length
16039  *
16040  */
16041  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
16042  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16043  __pyx_t_6 = __pyx_t_8;
16044  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error)
16045  __Pyx_GOTREF(__pyx_t_2);
16046  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
16047  __pyx_t_2 = 0;
16048 
16049  /* "View.MemoryView":1044
16050  * result.view.len = result.view.itemsize
16051  * for length in result.view.shape[:ndim]:
16052  * result.view.len *= length # <<<<<<<<<<<<<<
16053  *
16054  * result.to_object_func = to_object_func
16055  */
16056  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error)
16057  __Pyx_GOTREF(__pyx_t_2);
16058  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L1_error)
16059  __Pyx_GOTREF(__pyx_t_3);
16060  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16061  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1044, __pyx_L1_error)
16062  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16063  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16064  }
16065 
16066  /* "View.MemoryView":1046
16067  * result.view.len *= length
16068  *
16069  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
16070  * result.to_dtype_func = to_dtype_func
16071  *
16072  */
16073  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
16074 
16075  /* "View.MemoryView":1047
16076  *
16077  * result.to_object_func = to_object_func
16078  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
16079  *
16080  * return result
16081  */
16082  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
16083 
16084  /* "View.MemoryView":1049
16085  * result.to_dtype_func = to_dtype_func
16086  *
16087  * return result # <<<<<<<<<<<<<<
16088  *
16089  * @cname('__pyx_memoryview_get_slice_from_memoryview')
16090  */
16091  __Pyx_XDECREF(__pyx_r);
16092  __Pyx_INCREF(((PyObject *)__pyx_v_result));
16093  __pyx_r = ((PyObject *)__pyx_v_result);
16094  goto __pyx_L0;
16095 
16096  /* "View.MemoryView":999
16097  *
16098  * @cname('__pyx_memoryview_fromslice')
16099  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
16100  * int ndim,
16101  * object (*to_object_func)(char *),
16102  */
16103 
16104  /* function exit code */
16105  __pyx_L1_error:;
16106  __Pyx_XDECREF(__pyx_t_2);
16107  __Pyx_XDECREF(__pyx_t_3);
16108  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16109  __pyx_r = 0;
16110  __pyx_L0:;
16111  __Pyx_XDECREF((PyObject *)__pyx_v_result);
16112  __Pyx_XDECREF(__pyx_v_length);
16113  __Pyx_XGIVEREF(__pyx_r);
16114  __Pyx_RefNannyFinishContext();
16115  return __pyx_r;
16116 }
16117 
16118 /* "View.MemoryView":1052
16119  *
16120  * @cname('__pyx_memoryview_get_slice_from_memoryview')
16121  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
16122  * __Pyx_memviewslice *mslice) except NULL:
16123  * cdef _memoryviewslice obj
16124  */
16125 
16126 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
16127  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
16128  __Pyx_memviewslice *__pyx_r;
16129  __Pyx_RefNannyDeclarations
16130  int __pyx_t_1;
16131  int __pyx_t_2;
16132  PyObject *__pyx_t_3 = NULL;
16133  int __pyx_lineno = 0;
16134  const char *__pyx_filename = NULL;
16135  int __pyx_clineno = 0;
16136  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
16137 
16138  /* "View.MemoryView":1055
16139  * __Pyx_memviewslice *mslice) except NULL:
16140  * cdef _memoryviewslice obj
16141  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16142  * obj = memview
16143  * return &obj.from_slice
16144  */
16145  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16146  __pyx_t_2 = (__pyx_t_1 != 0);
16147  if (__pyx_t_2) {
16148 
16149  /* "View.MemoryView":1056
16150  * cdef _memoryviewslice obj
16151  * if isinstance(memview, _memoryviewslice):
16152  * obj = memview # <<<<<<<<<<<<<<
16153  * return &obj.from_slice
16154  * else:
16155  */
16156  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(0, 1056, __pyx_L1_error)
16157  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
16158  __Pyx_INCREF(__pyx_t_3);
16159  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
16160  __pyx_t_3 = 0;
16161 
16162  /* "View.MemoryView":1057
16163  * if isinstance(memview, _memoryviewslice):
16164  * obj = memview
16165  * return &obj.from_slice # <<<<<<<<<<<<<<
16166  * else:
16167  * slice_copy(memview, mslice)
16168  */
16169  __pyx_r = (&__pyx_v_obj->from_slice);
16170  goto __pyx_L0;
16171 
16172  /* "View.MemoryView":1055
16173  * __Pyx_memviewslice *mslice) except NULL:
16174  * cdef _memoryviewslice obj
16175  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16176  * obj = memview
16177  * return &obj.from_slice
16178  */
16179  }
16180 
16181  /* "View.MemoryView":1059
16182  * return &obj.from_slice
16183  * else:
16184  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
16185  * return mslice
16186  *
16187  */
16188  /*else*/ {
16189  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
16190 
16191  /* "View.MemoryView":1060
16192  * else:
16193  * slice_copy(memview, mslice)
16194  * return mslice # <<<<<<<<<<<<<<
16195  *
16196  * @cname('__pyx_memoryview_slice_copy')
16197  */
16198  __pyx_r = __pyx_v_mslice;
16199  goto __pyx_L0;
16200  }
16201 
16202  /* "View.MemoryView":1052
16203  *
16204  * @cname('__pyx_memoryview_get_slice_from_memoryview')
16205  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
16206  * __Pyx_memviewslice *mslice) except NULL:
16207  * cdef _memoryviewslice obj
16208  */
16209 
16210  /* function exit code */
16211  __pyx_L1_error:;
16212  __Pyx_XDECREF(__pyx_t_3);
16213  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
16214  __pyx_r = NULL;
16215  __pyx_L0:;
16216  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
16217  __Pyx_RefNannyFinishContext();
16218  return __pyx_r;
16219 }
16220 
16221 /* "View.MemoryView":1063
16222  *
16223  * @cname('__pyx_memoryview_slice_copy')
16224  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
16225  * cdef int dim
16226  * cdef (Py_ssize_t*) shape, strides, suboffsets
16227  */
16228 
16229 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
16230  int __pyx_v_dim;
16231  Py_ssize_t *__pyx_v_shape;
16232  Py_ssize_t *__pyx_v_strides;
16233  Py_ssize_t *__pyx_v_suboffsets;
16234  __Pyx_RefNannyDeclarations
16235  Py_ssize_t *__pyx_t_1;
16236  int __pyx_t_2;
16237  int __pyx_t_3;
16238  int __pyx_t_4;
16239  Py_ssize_t __pyx_t_5;
16240  __Pyx_RefNannySetupContext("slice_copy", 0);
16241 
16242  /* "View.MemoryView":1067
16243  * cdef (Py_ssize_t*) shape, strides, suboffsets
16244  *
16245  * shape = memview.view.shape # <<<<<<<<<<<<<<
16246  * strides = memview.view.strides
16247  * suboffsets = memview.view.suboffsets
16248  */
16249  __pyx_t_1 = __pyx_v_memview->view.shape;
16250  __pyx_v_shape = __pyx_t_1;
16251 
16252  /* "View.MemoryView":1068
16253  *
16254  * shape = memview.view.shape
16255  * strides = memview.view.strides # <<<<<<<<<<<<<<
16256  * suboffsets = memview.view.suboffsets
16257  *
16258  */
16259  __pyx_t_1 = __pyx_v_memview->view.strides;
16260  __pyx_v_strides = __pyx_t_1;
16261 
16262  /* "View.MemoryView":1069
16263  * shape = memview.view.shape
16264  * strides = memview.view.strides
16265  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
16266  *
16267  * dst.memview = <__pyx_memoryview *> memview
16268  */
16269  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
16270  __pyx_v_suboffsets = __pyx_t_1;
16271 
16272  /* "View.MemoryView":1071
16273  * suboffsets = memview.view.suboffsets
16274  *
16275  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
16276  * dst.data = <char *> memview.view.buf
16277  *
16278  */
16279  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
16280 
16281  /* "View.MemoryView":1072
16282  *
16283  * dst.memview = <__pyx_memoryview *> memview
16284  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
16285  *
16286  * for dim in range(memview.view.ndim):
16287  */
16288  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
16289 
16290  /* "View.MemoryView":1074
16291  * dst.data = <char *> memview.view.buf
16292  *
16293  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
16294  * dst.shape[dim] = shape[dim]
16295  * dst.strides[dim] = strides[dim]
16296  */
16297  __pyx_t_2 = __pyx_v_memview->view.ndim;
16298  __pyx_t_3 = __pyx_t_2;
16299  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16300  __pyx_v_dim = __pyx_t_4;
16301 
16302  /* "View.MemoryView":1075
16303  *
16304  * for dim in range(memview.view.ndim):
16305  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
16306  * dst.strides[dim] = strides[dim]
16307  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16308  */
16309  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
16310 
16311  /* "View.MemoryView":1076
16312  * for dim in range(memview.view.ndim):
16313  * dst.shape[dim] = shape[dim]
16314  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
16315  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16316  *
16317  */
16318  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
16319 
16320  /* "View.MemoryView":1077
16321  * dst.shape[dim] = shape[dim]
16322  * dst.strides[dim] = strides[dim]
16323  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
16324  *
16325  * @cname('__pyx_memoryview_copy_object')
16326  */
16327  if ((__pyx_v_suboffsets != 0)) {
16328  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
16329  } else {
16330  __pyx_t_5 = -1L;
16331  }
16332  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
16333  }
16334 
16335  /* "View.MemoryView":1063
16336  *
16337  * @cname('__pyx_memoryview_slice_copy')
16338  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
16339  * cdef int dim
16340  * cdef (Py_ssize_t*) shape, strides, suboffsets
16341  */
16342 
16343  /* function exit code */
16344  __Pyx_RefNannyFinishContext();
16345 }
16346 
16347 /* "View.MemoryView":1080
16348  *
16349  * @cname('__pyx_memoryview_copy_object')
16350  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
16351  * "Create a new memoryview object"
16352  * cdef __Pyx_memviewslice memviewslice
16353  */
16354 
16355 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
16356  __Pyx_memviewslice __pyx_v_memviewslice;
16357  PyObject *__pyx_r = NULL;
16358  __Pyx_RefNannyDeclarations
16359  PyObject *__pyx_t_1 = NULL;
16360  int __pyx_lineno = 0;
16361  const char *__pyx_filename = NULL;
16362  int __pyx_clineno = 0;
16363  __Pyx_RefNannySetupContext("memoryview_copy", 0);
16364 
16365  /* "View.MemoryView":1083
16366  * "Create a new memoryview object"
16367  * cdef __Pyx_memviewslice memviewslice
16368  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
16369  * return memoryview_copy_from_slice(memview, &memviewslice)
16370  *
16371  */
16372  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
16373 
16374  /* "View.MemoryView":1084
16375  * cdef __Pyx_memviewslice memviewslice
16376  * slice_copy(memview, &memviewslice)
16377  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
16378  *
16379  * @cname('__pyx_memoryview_copy_object_from_slice')
16380  */
16381  __Pyx_XDECREF(__pyx_r);
16382  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error)
16383  __Pyx_GOTREF(__pyx_t_1);
16384  __pyx_r = __pyx_t_1;
16385  __pyx_t_1 = 0;
16386  goto __pyx_L0;
16387 
16388  /* "View.MemoryView":1080
16389  *
16390  * @cname('__pyx_memoryview_copy_object')
16391  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
16392  * "Create a new memoryview object"
16393  * cdef __Pyx_memviewslice memviewslice
16394  */
16395 
16396  /* function exit code */
16397  __pyx_L1_error:;
16398  __Pyx_XDECREF(__pyx_t_1);
16399  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
16400  __pyx_r = 0;
16401  __pyx_L0:;
16402  __Pyx_XGIVEREF(__pyx_r);
16403  __Pyx_RefNannyFinishContext();
16404  return __pyx_r;
16405 }
16406 
16407 /* "View.MemoryView":1087
16408  *
16409  * @cname('__pyx_memoryview_copy_object_from_slice')
16410  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
16411  * """
16412  * Create a new memoryview object from a given memoryview object and slice.
16413  */
16414 
16415 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
16416  PyObject *(*__pyx_v_to_object_func)(char *);
16417  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
16418  PyObject *__pyx_r = NULL;
16419  __Pyx_RefNannyDeclarations
16420  int __pyx_t_1;
16421  int __pyx_t_2;
16422  PyObject *(*__pyx_t_3)(char *);
16423  int (*__pyx_t_4)(char *, PyObject *);
16424  PyObject *__pyx_t_5 = NULL;
16425  int __pyx_lineno = 0;
16426  const char *__pyx_filename = NULL;
16427  int __pyx_clineno = 0;
16428  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
16429 
16430  /* "View.MemoryView":1094
16431  * cdef int (*to_dtype_func)(char *, object) except 0
16432  *
16433  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16434  * to_object_func = (<_memoryviewslice> memview).to_object_func
16435  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16436  */
16437  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16438  __pyx_t_2 = (__pyx_t_1 != 0);
16439  if (__pyx_t_2) {
16440 
16441  /* "View.MemoryView":1095
16442  *
16443  * if isinstance(memview, _memoryviewslice):
16444  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
16445  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16446  * else:
16447  */
16448  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
16449  __pyx_v_to_object_func = __pyx_t_3;
16450 
16451  /* "View.MemoryView":1096
16452  * if isinstance(memview, _memoryviewslice):
16453  * to_object_func = (<_memoryviewslice> memview).to_object_func
16454  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
16455  * else:
16456  * to_object_func = NULL
16457  */
16458  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
16459  __pyx_v_to_dtype_func = __pyx_t_4;
16460 
16461  /* "View.MemoryView":1094
16462  * cdef int (*to_dtype_func)(char *, object) except 0
16463  *
16464  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16465  * to_object_func = (<_memoryviewslice> memview).to_object_func
16466  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16467  */
16468  goto __pyx_L3;
16469  }
16470 
16471  /* "View.MemoryView":1098
16472  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16473  * else:
16474  * to_object_func = NULL # <<<<<<<<<<<<<<
16475  * to_dtype_func = NULL
16476  *
16477  */
16478  /*else*/ {
16479  __pyx_v_to_object_func = NULL;
16480 
16481  /* "View.MemoryView":1099
16482  * else:
16483  * to_object_func = NULL
16484  * to_dtype_func = NULL # <<<<<<<<<<<<<<
16485  *
16486  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
16487  */
16488  __pyx_v_to_dtype_func = NULL;
16489  }
16490  __pyx_L3:;
16491 
16492  /* "View.MemoryView":1101
16493  * to_dtype_func = NULL
16494  *
16495  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
16496  * to_object_func, to_dtype_func,
16497  * memview.dtype_is_object)
16498  */
16499  __Pyx_XDECREF(__pyx_r);
16500 
16501  /* "View.MemoryView":1103
16502  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
16503  * to_object_func, to_dtype_func,
16504  * memview.dtype_is_object) # <<<<<<<<<<<<<<
16505  *
16506  *
16507  */
16508  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1101, __pyx_L1_error)
16509  __Pyx_GOTREF(__pyx_t_5);
16510  __pyx_r = __pyx_t_5;
16511  __pyx_t_5 = 0;
16512  goto __pyx_L0;
16513 
16514  /* "View.MemoryView":1087
16515  *
16516  * @cname('__pyx_memoryview_copy_object_from_slice')
16517  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
16518  * """
16519  * Create a new memoryview object from a given memoryview object and slice.
16520  */
16521 
16522  /* function exit code */
16523  __pyx_L1_error:;
16524  __Pyx_XDECREF(__pyx_t_5);
16525  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16526  __pyx_r = 0;
16527  __pyx_L0:;
16528  __Pyx_XGIVEREF(__pyx_r);
16529  __Pyx_RefNannyFinishContext();
16530  return __pyx_r;
16531 }
16532 
16533 /* "View.MemoryView":1109
16534  *
16535  *
16536  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
16537  * if arg < 0:
16538  * return -arg
16539  */
16540 
16541 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
16542  Py_ssize_t __pyx_r;
16543  int __pyx_t_1;
16544 
16545  /* "View.MemoryView":1110
16546  *
16547  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
16548  * if arg < 0: # <<<<<<<<<<<<<<
16549  * return -arg
16550  * else:
16551  */
16552  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
16553  if (__pyx_t_1) {
16554 
16555  /* "View.MemoryView":1111
16556  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
16557  * if arg < 0:
16558  * return -arg # <<<<<<<<<<<<<<
16559  * else:
16560  * return arg
16561  */
16562  __pyx_r = (-__pyx_v_arg);
16563  goto __pyx_L0;
16564 
16565  /* "View.MemoryView":1110
16566  *
16567  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
16568  * if arg < 0: # <<<<<<<<<<<<<<
16569  * return -arg
16570  * else:
16571  */
16572  }
16573 
16574  /* "View.MemoryView":1113
16575  * return -arg
16576  * else:
16577  * return arg # <<<<<<<<<<<<<<
16578  *
16579  * @cname('__pyx_get_best_slice_order')
16580  */
16581  /*else*/ {
16582  __pyx_r = __pyx_v_arg;
16583  goto __pyx_L0;
16584  }
16585 
16586  /* "View.MemoryView":1109
16587  *
16588  *
16589  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
16590  * if arg < 0:
16591  * return -arg
16592  */
16593 
16594  /* function exit code */
16595  __pyx_L0:;
16596  return __pyx_r;
16597 }
16598 
16599 /* "View.MemoryView":1116
16600  *
16601  * @cname('__pyx_get_best_slice_order')
16602  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
16603  * """
16604  * Figure out the best memory access order for a given slice.
16605  */
16606 
16607 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
16608  int __pyx_v_i;
16609  Py_ssize_t __pyx_v_c_stride;
16610  Py_ssize_t __pyx_v_f_stride;
16611  char __pyx_r;
16612  int __pyx_t_1;
16613  int __pyx_t_2;
16614  int __pyx_t_3;
16615  int __pyx_t_4;
16616 
16617  /* "View.MemoryView":1121
16618  * """
16619  * cdef int i
16620  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
16621  * cdef Py_ssize_t f_stride = 0
16622  *
16623  */
16624  __pyx_v_c_stride = 0;
16625 
16626  /* "View.MemoryView":1122
16627  * cdef int i
16628  * cdef Py_ssize_t c_stride = 0
16629  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
16630  *
16631  * for i in range(ndim - 1, -1, -1):
16632  */
16633  __pyx_v_f_stride = 0;
16634 
16635  /* "View.MemoryView":1124
16636  * cdef Py_ssize_t f_stride = 0
16637  *
16638  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
16639  * if mslice.shape[i] > 1:
16640  * c_stride = mslice.strides[i]
16641  */
16642  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
16643  __pyx_v_i = __pyx_t_1;
16644 
16645  /* "View.MemoryView":1125
16646  *
16647  * for i in range(ndim - 1, -1, -1):
16648  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16649  * c_stride = mslice.strides[i]
16650  * break
16651  */
16652  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
16653  if (__pyx_t_2) {
16654 
16655  /* "View.MemoryView":1126
16656  * for i in range(ndim - 1, -1, -1):
16657  * if mslice.shape[i] > 1:
16658  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
16659  * break
16660  *
16661  */
16662  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16663 
16664  /* "View.MemoryView":1127
16665  * if mslice.shape[i] > 1:
16666  * c_stride = mslice.strides[i]
16667  * break # <<<<<<<<<<<<<<
16668  *
16669  * for i in range(ndim):
16670  */
16671  goto __pyx_L4_break;
16672 
16673  /* "View.MemoryView":1125
16674  *
16675  * for i in range(ndim - 1, -1, -1):
16676  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16677  * c_stride = mslice.strides[i]
16678  * break
16679  */
16680  }
16681  }
16682  __pyx_L4_break:;
16683 
16684  /* "View.MemoryView":1129
16685  * break
16686  *
16687  * for i in range(ndim): # <<<<<<<<<<<<<<
16688  * if mslice.shape[i] > 1:
16689  * f_stride = mslice.strides[i]
16690  */
16691  __pyx_t_1 = __pyx_v_ndim;
16692  __pyx_t_3 = __pyx_t_1;
16693  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16694  __pyx_v_i = __pyx_t_4;
16695 
16696  /* "View.MemoryView":1130
16697  *
16698  * for i in range(ndim):
16699  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16700  * f_stride = mslice.strides[i]
16701  * break
16702  */
16703  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
16704  if (__pyx_t_2) {
16705 
16706  /* "View.MemoryView":1131
16707  * for i in range(ndim):
16708  * if mslice.shape[i] > 1:
16709  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
16710  * break
16711  *
16712  */
16713  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16714 
16715  /* "View.MemoryView":1132
16716  * if mslice.shape[i] > 1:
16717  * f_stride = mslice.strides[i]
16718  * break # <<<<<<<<<<<<<<
16719  *
16720  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16721  */
16722  goto __pyx_L7_break;
16723 
16724  /* "View.MemoryView":1130
16725  *
16726  * for i in range(ndim):
16727  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16728  * f_stride = mslice.strides[i]
16729  * break
16730  */
16731  }
16732  }
16733  __pyx_L7_break:;
16734 
16735  /* "View.MemoryView":1134
16736  * break
16737  *
16738  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
16739  * return 'C'
16740  * else:
16741  */
16742  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
16743  if (__pyx_t_2) {
16744 
16745  /* "View.MemoryView":1135
16746  *
16747  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16748  * return 'C' # <<<<<<<<<<<<<<
16749  * else:
16750  * return 'F'
16751  */
16752  __pyx_r = 'C';
16753  goto __pyx_L0;
16754 
16755  /* "View.MemoryView":1134
16756  * break
16757  *
16758  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
16759  * return 'C'
16760  * else:
16761  */
16762  }
16763 
16764  /* "View.MemoryView":1137
16765  * return 'C'
16766  * else:
16767  * return 'F' # <<<<<<<<<<<<<<
16768  *
16769  * @cython.cdivision(True)
16770  */
16771  /*else*/ {
16772  __pyx_r = 'F';
16773  goto __pyx_L0;
16774  }
16775 
16776  /* "View.MemoryView":1116
16777  *
16778  * @cname('__pyx_get_best_slice_order')
16779  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
16780  * """
16781  * Figure out the best memory access order for a given slice.
16782  */
16783 
16784  /* function exit code */
16785  __pyx_L0:;
16786  return __pyx_r;
16787 }
16788 
16789 /* "View.MemoryView":1140
16790  *
16791  * @cython.cdivision(True)
16792  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
16793  * char *dst_data, Py_ssize_t *dst_strides,
16794  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
16795  */
16796 
16797 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) {
16798  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
16799  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
16800  Py_ssize_t __pyx_v_dst_extent;
16801  Py_ssize_t __pyx_v_src_stride;
16802  Py_ssize_t __pyx_v_dst_stride;
16803  int __pyx_t_1;
16804  int __pyx_t_2;
16805  int __pyx_t_3;
16806  Py_ssize_t __pyx_t_4;
16807  Py_ssize_t __pyx_t_5;
16808  Py_ssize_t __pyx_t_6;
16809 
16810  /* "View.MemoryView":1147
16811  *
16812  * cdef Py_ssize_t i
16813  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
16814  * cdef Py_ssize_t dst_extent = dst_shape[0]
16815  * cdef Py_ssize_t src_stride = src_strides[0]
16816  */
16817  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16818 
16819  /* "View.MemoryView":1148
16820  * cdef Py_ssize_t i
16821  * cdef Py_ssize_t src_extent = src_shape[0]
16822  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
16823  * cdef Py_ssize_t src_stride = src_strides[0]
16824  * cdef Py_ssize_t dst_stride = dst_strides[0]
16825  */
16826  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16827 
16828  /* "View.MemoryView":1149
16829  * cdef Py_ssize_t src_extent = src_shape[0]
16830  * cdef Py_ssize_t dst_extent = dst_shape[0]
16831  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
16832  * cdef Py_ssize_t dst_stride = dst_strides[0]
16833  *
16834  */
16835  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16836 
16837  /* "View.MemoryView":1150
16838  * cdef Py_ssize_t dst_extent = dst_shape[0]
16839  * cdef Py_ssize_t src_stride = src_strides[0]
16840  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
16841  *
16842  * if ndim == 1:
16843  */
16844  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16845 
16846  /* "View.MemoryView":1152
16847  * cdef Py_ssize_t dst_stride = dst_strides[0]
16848  *
16849  * if ndim == 1: # <<<<<<<<<<<<<<
16850  * if (src_stride > 0 and dst_stride > 0 and
16851  * <size_t> src_stride == itemsize == <size_t> dst_stride):
16852  */
16853  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
16854  if (__pyx_t_1) {
16855 
16856  /* "View.MemoryView":1153
16857  *
16858  * if ndim == 1:
16859  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16860  * <size_t> src_stride == itemsize == <size_t> dst_stride):
16861  * memcpy(dst_data, src_data, itemsize * dst_extent)
16862  */
16863  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
16864  if (__pyx_t_2) {
16865  } else {
16866  __pyx_t_1 = __pyx_t_2;
16867  goto __pyx_L5_bool_binop_done;
16868  }
16869  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
16870  if (__pyx_t_2) {
16871  } else {
16872  __pyx_t_1 = __pyx_t_2;
16873  goto __pyx_L5_bool_binop_done;
16874  }
16875 
16876  /* "View.MemoryView":1154
16877  * if ndim == 1:
16878  * if (src_stride > 0 and dst_stride > 0 and
16879  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
16880  * memcpy(dst_data, src_data, itemsize * dst_extent)
16881  * else:
16882  */
16883  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16884  if (__pyx_t_2) {
16885  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16886  }
16887  __pyx_t_3 = (__pyx_t_2 != 0);
16888  __pyx_t_1 = __pyx_t_3;
16889  __pyx_L5_bool_binop_done:;
16890 
16891  /* "View.MemoryView":1153
16892  *
16893  * if ndim == 1:
16894  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16895  * <size_t> src_stride == itemsize == <size_t> dst_stride):
16896  * memcpy(dst_data, src_data, itemsize * dst_extent)
16897  */
16898  if (__pyx_t_1) {
16899 
16900  /* "View.MemoryView":1155
16901  * if (src_stride > 0 and dst_stride > 0 and
16902  * <size_t> src_stride == itemsize == <size_t> dst_stride):
16903  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
16904  * else:
16905  * for i in range(dst_extent):
16906  */
16907  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
16908 
16909  /* "View.MemoryView":1153
16910  *
16911  * if ndim == 1:
16912  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16913  * <size_t> src_stride == itemsize == <size_t> dst_stride):
16914  * memcpy(dst_data, src_data, itemsize * dst_extent)
16915  */
16916  goto __pyx_L4;
16917  }
16918 
16919  /* "View.MemoryView":1157
16920  * memcpy(dst_data, src_data, itemsize * dst_extent)
16921  * else:
16922  * for i in range(dst_extent): # <<<<<<<<<<<<<<
16923  * memcpy(dst_data, src_data, itemsize)
16924  * src_data += src_stride
16925  */
16926  /*else*/ {
16927  __pyx_t_4 = __pyx_v_dst_extent;
16928  __pyx_t_5 = __pyx_t_4;
16929  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16930  __pyx_v_i = __pyx_t_6;
16931 
16932  /* "View.MemoryView":1158
16933  * else:
16934  * for i in range(dst_extent):
16935  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
16936  * src_data += src_stride
16937  * dst_data += dst_stride
16938  */
16939  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16940 
16941  /* "View.MemoryView":1159
16942  * for i in range(dst_extent):
16943  * memcpy(dst_data, src_data, itemsize)
16944  * src_data += src_stride # <<<<<<<<<<<<<<
16945  * dst_data += dst_stride
16946  * else:
16947  */
16948  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16949 
16950  /* "View.MemoryView":1160
16951  * memcpy(dst_data, src_data, itemsize)
16952  * src_data += src_stride
16953  * dst_data += dst_stride # <<<<<<<<<<<<<<
16954  * else:
16955  * for i in range(dst_extent):
16956  */
16957  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16958  }
16959  }
16960  __pyx_L4:;
16961 
16962  /* "View.MemoryView":1152
16963  * cdef Py_ssize_t dst_stride = dst_strides[0]
16964  *
16965  * if ndim == 1: # <<<<<<<<<<<<<<
16966  * if (src_stride > 0 and dst_stride > 0 and
16967  * <size_t> src_stride == itemsize == <size_t> dst_stride):
16968  */
16969  goto __pyx_L3;
16970  }
16971 
16972  /* "View.MemoryView":1162
16973  * dst_data += dst_stride
16974  * else:
16975  * for i in range(dst_extent): # <<<<<<<<<<<<<<
16976  * _copy_strided_to_strided(src_data, src_strides + 1,
16977  * dst_data, dst_strides + 1,
16978  */
16979  /*else*/ {
16980  __pyx_t_4 = __pyx_v_dst_extent;
16981  __pyx_t_5 = __pyx_t_4;
16982  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16983  __pyx_v_i = __pyx_t_6;
16984 
16985  /* "View.MemoryView":1163
16986  * else:
16987  * for i in range(dst_extent):
16988  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
16989  * dst_data, dst_strides + 1,
16990  * src_shape + 1, dst_shape + 1,
16991  */
16992  _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);
16993 
16994  /* "View.MemoryView":1167
16995  * src_shape + 1, dst_shape + 1,
16996  * ndim - 1, itemsize)
16997  * src_data += src_stride # <<<<<<<<<<<<<<
16998  * dst_data += dst_stride
16999  *
17000  */
17001  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
17002 
17003  /* "View.MemoryView":1168
17004  * ndim - 1, itemsize)
17005  * src_data += src_stride
17006  * dst_data += dst_stride # <<<<<<<<<<<<<<
17007  *
17008  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
17009  */
17010  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17011  }
17012  }
17013  __pyx_L3:;
17014 
17015  /* "View.MemoryView":1140
17016  *
17017  * @cython.cdivision(True)
17018  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
17019  * char *dst_data, Py_ssize_t *dst_strides,
17020  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
17021  */
17022 
17023  /* function exit code */
17024 }
17025 
17026 /* "View.MemoryView":1170
17027  * dst_data += dst_stride
17028  *
17029  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17030  * __Pyx_memviewslice *dst,
17031  * int ndim, size_t itemsize) nogil:
17032  */
17033 
17034 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) {
17035 
17036  /* "View.MemoryView":1173
17037  * __Pyx_memviewslice *dst,
17038  * int ndim, size_t itemsize) nogil:
17039  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
17040  * src.shape, dst.shape, ndim, itemsize)
17041  *
17042  */
17043  _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);
17044 
17045  /* "View.MemoryView":1170
17046  * dst_data += dst_stride
17047  *
17048  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17049  * __Pyx_memviewslice *dst,
17050  * int ndim, size_t itemsize) nogil:
17051  */
17052 
17053  /* function exit code */
17054 }
17055 
17056 /* "View.MemoryView":1177
17057  *
17058  * @cname('__pyx_memoryview_slice_get_size')
17059  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
17060  * "Return the size of the memory occupied by the slice in number of bytes"
17061  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17062  */
17063 
17064 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
17065  Py_ssize_t __pyx_v_shape;
17066  Py_ssize_t __pyx_v_size;
17067  Py_ssize_t __pyx_r;
17068  Py_ssize_t __pyx_t_1;
17069  Py_ssize_t *__pyx_t_2;
17070  Py_ssize_t *__pyx_t_3;
17071  Py_ssize_t *__pyx_t_4;
17072 
17073  /* "View.MemoryView":1179
17074  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
17075  * "Return the size of the memory occupied by the slice in number of bytes"
17076  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
17077  *
17078  * for shape in src.shape[:ndim]:
17079  */
17080  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17081  __pyx_v_size = __pyx_t_1;
17082 
17083  /* "View.MemoryView":1181
17084  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17085  *
17086  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
17087  * size *= shape
17088  *
17089  */
17090  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
17091  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
17092  __pyx_t_2 = __pyx_t_4;
17093  __pyx_v_shape = (__pyx_t_2[0]);
17094 
17095  /* "View.MemoryView":1182
17096  *
17097  * for shape in src.shape[:ndim]:
17098  * size *= shape # <<<<<<<<<<<<<<
17099  *
17100  * return size
17101  */
17102  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
17103  }
17104 
17105  /* "View.MemoryView":1184
17106  * size *= shape
17107  *
17108  * return size # <<<<<<<<<<<<<<
17109  *
17110  * @cname('__pyx_fill_contig_strides_array')
17111  */
17112  __pyx_r = __pyx_v_size;
17113  goto __pyx_L0;
17114 
17115  /* "View.MemoryView":1177
17116  *
17117  * @cname('__pyx_memoryview_slice_get_size')
17118  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
17119  * "Return the size of the memory occupied by the slice in number of bytes"
17120  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17121  */
17122 
17123  /* function exit code */
17124  __pyx_L0:;
17125  return __pyx_r;
17126 }
17127 
17128 /* "View.MemoryView":1187
17129  *
17130  * @cname('__pyx_fill_contig_strides_array')
17131  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
17132  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
17133  * int ndim, char order) nogil:
17134  */
17135 
17136 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) {
17137  int __pyx_v_idx;
17138  Py_ssize_t __pyx_r;
17139  int __pyx_t_1;
17140  int __pyx_t_2;
17141  int __pyx_t_3;
17142  int __pyx_t_4;
17143 
17144  /* "View.MemoryView":1196
17145  * cdef int idx
17146  *
17147  * if order == 'F': # <<<<<<<<<<<<<<
17148  * for idx in range(ndim):
17149  * strides[idx] = stride
17150  */
17151  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
17152  if (__pyx_t_1) {
17153 
17154  /* "View.MemoryView":1197
17155  *
17156  * if order == 'F':
17157  * for idx in range(ndim): # <<<<<<<<<<<<<<
17158  * strides[idx] = stride
17159  * stride *= shape[idx]
17160  */
17161  __pyx_t_2 = __pyx_v_ndim;
17162  __pyx_t_3 = __pyx_t_2;
17163  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17164  __pyx_v_idx = __pyx_t_4;
17165 
17166  /* "View.MemoryView":1198
17167  * if order == 'F':
17168  * for idx in range(ndim):
17169  * strides[idx] = stride # <<<<<<<<<<<<<<
17170  * stride *= shape[idx]
17171  * else:
17172  */
17173  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17174 
17175  /* "View.MemoryView":1199
17176  * for idx in range(ndim):
17177  * strides[idx] = stride
17178  * stride *= shape[idx] # <<<<<<<<<<<<<<
17179  * else:
17180  * for idx in range(ndim - 1, -1, -1):
17181  */
17182  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17183  }
17184 
17185  /* "View.MemoryView":1196
17186  * cdef int idx
17187  *
17188  * if order == 'F': # <<<<<<<<<<<<<<
17189  * for idx in range(ndim):
17190  * strides[idx] = stride
17191  */
17192  goto __pyx_L3;
17193  }
17194 
17195  /* "View.MemoryView":1201
17196  * stride *= shape[idx]
17197  * else:
17198  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17199  * strides[idx] = stride
17200  * stride *= shape[idx]
17201  */
17202  /*else*/ {
17203  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
17204  __pyx_v_idx = __pyx_t_2;
17205 
17206  /* "View.MemoryView":1202
17207  * else:
17208  * for idx in range(ndim - 1, -1, -1):
17209  * strides[idx] = stride # <<<<<<<<<<<<<<
17210  * stride *= shape[idx]
17211  *
17212  */
17213  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17214 
17215  /* "View.MemoryView":1203
17216  * for idx in range(ndim - 1, -1, -1):
17217  * strides[idx] = stride
17218  * stride *= shape[idx] # <<<<<<<<<<<<<<
17219  *
17220  * return stride
17221  */
17222  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17223  }
17224  }
17225  __pyx_L3:;
17226 
17227  /* "View.MemoryView":1205
17228  * stride *= shape[idx]
17229  *
17230  * return stride # <<<<<<<<<<<<<<
17231  *
17232  * @cname('__pyx_memoryview_copy_data_to_temp')
17233  */
17234  __pyx_r = __pyx_v_stride;
17235  goto __pyx_L0;
17236 
17237  /* "View.MemoryView":1187
17238  *
17239  * @cname('__pyx_fill_contig_strides_array')
17240  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
17241  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
17242  * int ndim, char order) nogil:
17243  */
17244 
17245  /* function exit code */
17246  __pyx_L0:;
17247  return __pyx_r;
17248 }
17249 
17250 /* "View.MemoryView":1208
17251  *
17252  * @cname('__pyx_memoryview_copy_data_to_temp')
17253  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17254  * __Pyx_memviewslice *tmpslice,
17255  * char order,
17256  */
17257 
17258 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) {
17259  int __pyx_v_i;
17260  void *__pyx_v_result;
17261  size_t __pyx_v_itemsize;
17262  size_t __pyx_v_size;
17263  void *__pyx_r;
17264  Py_ssize_t __pyx_t_1;
17265  int __pyx_t_2;
17266  int __pyx_t_3;
17267  struct __pyx_memoryview_obj *__pyx_t_4;
17268  int __pyx_t_5;
17269  int __pyx_t_6;
17270  int __pyx_lineno = 0;
17271  const char *__pyx_filename = NULL;
17272  int __pyx_clineno = 0;
17273 
17274  /* "View.MemoryView":1219
17275  * cdef void *result
17276  *
17277  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
17278  * cdef size_t size = slice_get_size(src, ndim)
17279  *
17280  */
17281  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17282  __pyx_v_itemsize = __pyx_t_1;
17283 
17284  /* "View.MemoryView":1220
17285  *
17286  * cdef size_t itemsize = src.memview.view.itemsize
17287  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
17288  *
17289  * result = malloc(size)
17290  */
17291  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
17292 
17293  /* "View.MemoryView":1222
17294  * cdef size_t size = slice_get_size(src, ndim)
17295  *
17296  * result = malloc(size) # <<<<<<<<<<<<<<
17297  * if not result:
17298  * _err(MemoryError, NULL)
17299  */
17300  __pyx_v_result = malloc(__pyx_v_size);
17301 
17302  /* "View.MemoryView":1223
17303  *
17304  * result = malloc(size)
17305  * if not result: # <<<<<<<<<<<<<<
17306  * _err(MemoryError, NULL)
17307  *
17308  */
17309  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
17310  if (__pyx_t_2) {
17311 
17312  /* "View.MemoryView":1224
17313  * result = malloc(size)
17314  * if not result:
17315  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
17316  *
17317  *
17318  */
17319  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1224, __pyx_L1_error)
17320 
17321  /* "View.MemoryView":1223
17322  *
17323  * result = malloc(size)
17324  * if not result: # <<<<<<<<<<<<<<
17325  * _err(MemoryError, NULL)
17326  *
17327  */
17328  }
17329 
17330  /* "View.MemoryView":1227
17331  *
17332  *
17333  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
17334  * tmpslice.memview = src.memview
17335  * for i in range(ndim):
17336  */
17337  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
17338 
17339  /* "View.MemoryView":1228
17340  *
17341  * tmpslice.data = <char *> result
17342  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
17343  * for i in range(ndim):
17344  * tmpslice.shape[i] = src.shape[i]
17345  */
17346  __pyx_t_4 = __pyx_v_src->memview;
17347  __pyx_v_tmpslice->memview = __pyx_t_4;
17348 
17349  /* "View.MemoryView":1229
17350  * tmpslice.data = <char *> result
17351  * tmpslice.memview = src.memview
17352  * for i in range(ndim): # <<<<<<<<<<<<<<
17353  * tmpslice.shape[i] = src.shape[i]
17354  * tmpslice.suboffsets[i] = -1
17355  */
17356  __pyx_t_3 = __pyx_v_ndim;
17357  __pyx_t_5 = __pyx_t_3;
17358  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17359  __pyx_v_i = __pyx_t_6;
17360 
17361  /* "View.MemoryView":1230
17362  * tmpslice.memview = src.memview
17363  * for i in range(ndim):
17364  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
17365  * tmpslice.suboffsets[i] = -1
17366  *
17367  */
17368  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
17369 
17370  /* "View.MemoryView":1231
17371  * for i in range(ndim):
17372  * tmpslice.shape[i] = src.shape[i]
17373  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
17374  *
17375  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
17376  */
17377  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
17378  }
17379 
17380  /* "View.MemoryView":1233
17381  * tmpslice.suboffsets[i] = -1
17382  *
17383  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
17384  * ndim, order)
17385  *
17386  */
17387  (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));
17388 
17389  /* "View.MemoryView":1237
17390  *
17391  *
17392  * for i in range(ndim): # <<<<<<<<<<<<<<
17393  * if tmpslice.shape[i] == 1:
17394  * tmpslice.strides[i] = 0
17395  */
17396  __pyx_t_3 = __pyx_v_ndim;
17397  __pyx_t_5 = __pyx_t_3;
17398  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17399  __pyx_v_i = __pyx_t_6;
17400 
17401  /* "View.MemoryView":1238
17402  *
17403  * for i in range(ndim):
17404  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
17405  * tmpslice.strides[i] = 0
17406  *
17407  */
17408  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
17409  if (__pyx_t_2) {
17410 
17411  /* "View.MemoryView":1239
17412  * for i in range(ndim):
17413  * if tmpslice.shape[i] == 1:
17414  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
17415  *
17416  * if slice_is_contig(src[0], order, ndim):
17417  */
17418  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
17419 
17420  /* "View.MemoryView":1238
17421  *
17422  * for i in range(ndim):
17423  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
17424  * tmpslice.strides[i] = 0
17425  *
17426  */
17427  }
17428  }
17429 
17430  /* "View.MemoryView":1241
17431  * tmpslice.strides[i] = 0
17432  *
17433  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
17434  * memcpy(result, src.data, size)
17435  * else:
17436  */
17437  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
17438  if (__pyx_t_2) {
17439 
17440  /* "View.MemoryView":1242
17441  *
17442  * if slice_is_contig(src[0], order, ndim):
17443  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
17444  * else:
17445  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
17446  */
17447  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
17448 
17449  /* "View.MemoryView":1241
17450  * tmpslice.strides[i] = 0
17451  *
17452  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
17453  * memcpy(result, src.data, size)
17454  * else:
17455  */
17456  goto __pyx_L9;
17457  }
17458 
17459  /* "View.MemoryView":1244
17460  * memcpy(result, src.data, size)
17461  * else:
17462  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
17463  *
17464  * return result
17465  */
17466  /*else*/ {
17467  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
17468  }
17469  __pyx_L9:;
17470 
17471  /* "View.MemoryView":1246
17472  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
17473  *
17474  * return result # <<<<<<<<<<<<<<
17475  *
17476  *
17477  */
17478  __pyx_r = __pyx_v_result;
17479  goto __pyx_L0;
17480 
17481  /* "View.MemoryView":1208
17482  *
17483  * @cname('__pyx_memoryview_copy_data_to_temp')
17484  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17485  * __Pyx_memviewslice *tmpslice,
17486  * char order,
17487  */
17488 
17489  /* function exit code */
17490  __pyx_L1_error:;
17491  {
17492  #ifdef WITH_THREAD
17493  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17494  #endif
17495  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
17496  #ifdef WITH_THREAD
17497  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17498  #endif
17499  }
17500  __pyx_r = NULL;
17501  __pyx_L0:;
17502  return __pyx_r;
17503 }
17504 
17505 /* "View.MemoryView":1251
17506  *
17507  * @cname('__pyx_memoryview_err_extents')
17508  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
17509  * Py_ssize_t extent2) except -1 with gil:
17510  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
17511  */
17512 
17513 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
17514  int __pyx_r;
17515  __Pyx_RefNannyDeclarations
17516  PyObject *__pyx_t_1 = NULL;
17517  PyObject *__pyx_t_2 = NULL;
17518  PyObject *__pyx_t_3 = NULL;
17519  PyObject *__pyx_t_4 = NULL;
17520  int __pyx_lineno = 0;
17521  const char *__pyx_filename = NULL;
17522  int __pyx_clineno = 0;
17523  #ifdef WITH_THREAD
17524  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17525  #endif
17526  __Pyx_RefNannySetupContext("_err_extents", 0);
17527 
17528  /* "View.MemoryView":1254
17529  * Py_ssize_t extent2) except -1 with gil:
17530  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
17531  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
17532  *
17533  * @cname('__pyx_memoryview_err_dim')
17534  */
17535  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
17536  __Pyx_GOTREF(__pyx_t_1);
17537  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1254, __pyx_L1_error)
17538  __Pyx_GOTREF(__pyx_t_2);
17539  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L1_error)
17540  __Pyx_GOTREF(__pyx_t_3);
17541  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1254, __pyx_L1_error)
17542  __Pyx_GOTREF(__pyx_t_4);
17543  __Pyx_GIVEREF(__pyx_t_1);
17544  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
17545  __Pyx_GIVEREF(__pyx_t_2);
17546  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
17547  __Pyx_GIVEREF(__pyx_t_3);
17548  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
17549  __pyx_t_1 = 0;
17550  __pyx_t_2 = 0;
17551  __pyx_t_3 = 0;
17552 
17553  /* "View.MemoryView":1253
17554  * cdef int _err_extents(int i, Py_ssize_t extent1,
17555  * Py_ssize_t extent2) except -1 with gil:
17556  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
17557  * (i, extent1, extent2))
17558  *
17559  */
17560  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1253, __pyx_L1_error)
17561  __Pyx_GOTREF(__pyx_t_3);
17562  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17563  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1253, __pyx_L1_error)
17564  __Pyx_GOTREF(__pyx_t_4);
17565  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17566  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
17567  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17568  __PYX_ERR(0, 1253, __pyx_L1_error)
17569 
17570  /* "View.MemoryView":1251
17571  *
17572  * @cname('__pyx_memoryview_err_extents')
17573  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
17574  * Py_ssize_t extent2) except -1 with gil:
17575  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
17576  */
17577 
17578  /* function exit code */
17579  __pyx_L1_error:;
17580  __Pyx_XDECREF(__pyx_t_1);
17581  __Pyx_XDECREF(__pyx_t_2);
17582  __Pyx_XDECREF(__pyx_t_3);
17583  __Pyx_XDECREF(__pyx_t_4);
17584  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17585  __pyx_r = -1;
17586  __Pyx_RefNannyFinishContext();
17587  #ifdef WITH_THREAD
17588  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17589  #endif
17590  return __pyx_r;
17591 }
17592 
17593 /* "View.MemoryView":1257
17594  *
17595  * @cname('__pyx_memoryview_err_dim')
17596  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
17597  * raise error(msg.decode('ascii') % dim)
17598  *
17599  */
17600 
17601 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
17602  int __pyx_r;
17603  __Pyx_RefNannyDeclarations
17604  PyObject *__pyx_t_1 = NULL;
17605  PyObject *__pyx_t_2 = NULL;
17606  PyObject *__pyx_t_3 = NULL;
17607  PyObject *__pyx_t_4 = NULL;
17608  int __pyx_lineno = 0;
17609  const char *__pyx_filename = NULL;
17610  int __pyx_clineno = 0;
17611  #ifdef WITH_THREAD
17612  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17613  #endif
17614  __Pyx_RefNannySetupContext("_err_dim", 0);
17615  __Pyx_INCREF(__pyx_v_error);
17616 
17617  /* "View.MemoryView":1258
17618  * @cname('__pyx_memoryview_err_dim')
17619  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
17620  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
17621  *
17622  * @cname('__pyx_memoryview_err')
17623  */
17624  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error)
17625  __Pyx_GOTREF(__pyx_t_2);
17626  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1258, __pyx_L1_error)
17627  __Pyx_GOTREF(__pyx_t_3);
17628  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L1_error)
17629  __Pyx_GOTREF(__pyx_t_4);
17630  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17631  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17632  __Pyx_INCREF(__pyx_v_error);
17633  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
17634  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
17635  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
17636  if (likely(__pyx_t_2)) {
17637  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
17638  __Pyx_INCREF(__pyx_t_2);
17639  __Pyx_INCREF(function);
17640  __Pyx_DECREF_SET(__pyx_t_3, function);
17641  }
17642  }
17643  __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);
17644  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
17645  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17646  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error)
17647  __Pyx_GOTREF(__pyx_t_1);
17648  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17649  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17650  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17651  __PYX_ERR(0, 1258, __pyx_L1_error)
17652 
17653  /* "View.MemoryView":1257
17654  *
17655  * @cname('__pyx_memoryview_err_dim')
17656  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
17657  * raise error(msg.decode('ascii') % dim)
17658  *
17659  */
17660 
17661  /* function exit code */
17662  __pyx_L1_error:;
17663  __Pyx_XDECREF(__pyx_t_1);
17664  __Pyx_XDECREF(__pyx_t_2);
17665  __Pyx_XDECREF(__pyx_t_3);
17666  __Pyx_XDECREF(__pyx_t_4);
17667  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
17668  __pyx_r = -1;
17669  __Pyx_XDECREF(__pyx_v_error);
17670  __Pyx_RefNannyFinishContext();
17671  #ifdef WITH_THREAD
17672  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17673  #endif
17674  return __pyx_r;
17675 }
17676 
17677 /* "View.MemoryView":1261
17678  *
17679  * @cname('__pyx_memoryview_err')
17680  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
17681  * if msg != NULL:
17682  * raise error(msg.decode('ascii'))
17683  */
17684 
17685 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
17686  int __pyx_r;
17687  __Pyx_RefNannyDeclarations
17688  int __pyx_t_1;
17689  PyObject *__pyx_t_2 = NULL;
17690  PyObject *__pyx_t_3 = NULL;
17691  PyObject *__pyx_t_4 = NULL;
17692  PyObject *__pyx_t_5 = NULL;
17693  int __pyx_lineno = 0;
17694  const char *__pyx_filename = NULL;
17695  int __pyx_clineno = 0;
17696  #ifdef WITH_THREAD
17697  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17698  #endif
17699  __Pyx_RefNannySetupContext("_err", 0);
17700  __Pyx_INCREF(__pyx_v_error);
17701 
17702  /* "View.MemoryView":1262
17703  * @cname('__pyx_memoryview_err')
17704  * cdef int _err(object error, char *msg) except -1 with gil:
17705  * if msg != NULL: # <<<<<<<<<<<<<<
17706  * raise error(msg.decode('ascii'))
17707  * else:
17708  */
17709  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
17710  if (unlikely(__pyx_t_1)) {
17711 
17712  /* "View.MemoryView":1263
17713  * cdef int _err(object error, char *msg) except -1 with gil:
17714  * if msg != NULL:
17715  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
17716  * else:
17717  * raise error
17718  */
17719  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error)
17720  __Pyx_GOTREF(__pyx_t_3);
17721  __Pyx_INCREF(__pyx_v_error);
17722  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
17723  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
17724  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
17725  if (likely(__pyx_t_5)) {
17726  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
17727  __Pyx_INCREF(__pyx_t_5);
17728  __Pyx_INCREF(function);
17729  __Pyx_DECREF_SET(__pyx_t_4, function);
17730  }
17731  }
17732  __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);
17733  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17734  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17735  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1263, __pyx_L1_error)
17736  __Pyx_GOTREF(__pyx_t_2);
17737  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17738  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
17739  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17740  __PYX_ERR(0, 1263, __pyx_L1_error)
17741 
17742  /* "View.MemoryView":1262
17743  * @cname('__pyx_memoryview_err')
17744  * cdef int _err(object error, char *msg) except -1 with gil:
17745  * if msg != NULL: # <<<<<<<<<<<<<<
17746  * raise error(msg.decode('ascii'))
17747  * else:
17748  */
17749  }
17750 
17751  /* "View.MemoryView":1265
17752  * raise error(msg.decode('ascii'))
17753  * else:
17754  * raise error # <<<<<<<<<<<<<<
17755  *
17756  * @cname('__pyx_memoryview_copy_contents')
17757  */
17758  /*else*/ {
17759  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
17760  __PYX_ERR(0, 1265, __pyx_L1_error)
17761  }
17762 
17763  /* "View.MemoryView":1261
17764  *
17765  * @cname('__pyx_memoryview_err')
17766  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
17767  * if msg != NULL:
17768  * raise error(msg.decode('ascii'))
17769  */
17770 
17771  /* function exit code */
17772  __pyx_L1_error:;
17773  __Pyx_XDECREF(__pyx_t_2);
17774  __Pyx_XDECREF(__pyx_t_3);
17775  __Pyx_XDECREF(__pyx_t_4);
17776  __Pyx_XDECREF(__pyx_t_5);
17777  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
17778  __pyx_r = -1;
17779  __Pyx_XDECREF(__pyx_v_error);
17780  __Pyx_RefNannyFinishContext();
17781  #ifdef WITH_THREAD
17782  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17783  #endif
17784  return __pyx_r;
17785 }
17786 
17787 /* "View.MemoryView":1268
17788  *
17789  * @cname('__pyx_memoryview_copy_contents')
17790  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
17791  * __Pyx_memviewslice dst,
17792  * int src_ndim, int dst_ndim,
17793  */
17794 
17795 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) {
17796  void *__pyx_v_tmpdata;
17797  size_t __pyx_v_itemsize;
17798  int __pyx_v_i;
17799  char __pyx_v_order;
17800  int __pyx_v_broadcasting;
17801  int __pyx_v_direct_copy;
17802  __Pyx_memviewslice __pyx_v_tmp;
17803  int __pyx_v_ndim;
17804  int __pyx_r;
17805  Py_ssize_t __pyx_t_1;
17806  int __pyx_t_2;
17807  int __pyx_t_3;
17808  int __pyx_t_4;
17809  int __pyx_t_5;
17810  int __pyx_t_6;
17811  void *__pyx_t_7;
17812  int __pyx_t_8;
17813  int __pyx_lineno = 0;
17814  const char *__pyx_filename = NULL;
17815  int __pyx_clineno = 0;
17816 
17817  /* "View.MemoryView":1276
17818  * Check for overlapping memory and verify the shapes.
17819  * """
17820  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
17821  * cdef size_t itemsize = src.memview.view.itemsize
17822  * cdef int i
17823  */
17824  __pyx_v_tmpdata = NULL;
17825 
17826  /* "View.MemoryView":1277
17827  * """
17828  * cdef void *tmpdata = NULL
17829  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
17830  * cdef int i
17831  * cdef char order = get_best_order(&src, src_ndim)
17832  */
17833  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
17834  __pyx_v_itemsize = __pyx_t_1;
17835 
17836  /* "View.MemoryView":1279
17837  * cdef size_t itemsize = src.memview.view.itemsize
17838  * cdef int i
17839  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
17840  * cdef bint broadcasting = False
17841  * cdef bint direct_copy = False
17842  */
17843  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17844 
17845  /* "View.MemoryView":1280
17846  * cdef int i
17847  * cdef char order = get_best_order(&src, src_ndim)
17848  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
17849  * cdef bint direct_copy = False
17850  * cdef __Pyx_memviewslice tmp
17851  */
17852  __pyx_v_broadcasting = 0;
17853 
17854  /* "View.MemoryView":1281
17855  * cdef char order = get_best_order(&src, src_ndim)
17856  * cdef bint broadcasting = False
17857  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
17858  * cdef __Pyx_memviewslice tmp
17859  *
17860  */
17861  __pyx_v_direct_copy = 0;
17862 
17863  /* "View.MemoryView":1284
17864  * cdef __Pyx_memviewslice tmp
17865  *
17866  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17867  * broadcast_leading(&src, src_ndim, dst_ndim)
17868  * elif dst_ndim < src_ndim:
17869  */
17870  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
17871  if (__pyx_t_2) {
17872 
17873  /* "View.MemoryView":1285
17874  *
17875  * if src_ndim < dst_ndim:
17876  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17877  * elif dst_ndim < src_ndim:
17878  * broadcast_leading(&dst, dst_ndim, src_ndim)
17879  */
17880  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17881 
17882  /* "View.MemoryView":1284
17883  * cdef __Pyx_memviewslice tmp
17884  *
17885  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17886  * broadcast_leading(&src, src_ndim, dst_ndim)
17887  * elif dst_ndim < src_ndim:
17888  */
17889  goto __pyx_L3;
17890  }
17891 
17892  /* "View.MemoryView":1286
17893  * if src_ndim < dst_ndim:
17894  * broadcast_leading(&src, src_ndim, dst_ndim)
17895  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17896  * broadcast_leading(&dst, dst_ndim, src_ndim)
17897  *
17898  */
17899  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
17900  if (__pyx_t_2) {
17901 
17902  /* "View.MemoryView":1287
17903  * broadcast_leading(&src, src_ndim, dst_ndim)
17904  * elif dst_ndim < src_ndim:
17905  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
17906  *
17907  * cdef int ndim = max(src_ndim, dst_ndim)
17908  */
17909  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17910 
17911  /* "View.MemoryView":1286
17912  * if src_ndim < dst_ndim:
17913  * broadcast_leading(&src, src_ndim, dst_ndim)
17914  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17915  * broadcast_leading(&dst, dst_ndim, src_ndim)
17916  *
17917  */
17918  }
17919  __pyx_L3:;
17920 
17921  /* "View.MemoryView":1289
17922  * broadcast_leading(&dst, dst_ndim, src_ndim)
17923  *
17924  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17925  *
17926  * for i in range(ndim):
17927  */
17928  __pyx_t_3 = __pyx_v_dst_ndim;
17929  __pyx_t_4 = __pyx_v_src_ndim;
17930  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
17931  __pyx_t_5 = __pyx_t_3;
17932  } else {
17933  __pyx_t_5 = __pyx_t_4;
17934  }
17935  __pyx_v_ndim = __pyx_t_5;
17936 
17937  /* "View.MemoryView":1291
17938  * cdef int ndim = max(src_ndim, dst_ndim)
17939  *
17940  * for i in range(ndim): # <<<<<<<<<<<<<<
17941  * if src.shape[i] != dst.shape[i]:
17942  * if src.shape[i] == 1:
17943  */
17944  __pyx_t_5 = __pyx_v_ndim;
17945  __pyx_t_3 = __pyx_t_5;
17946  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17947  __pyx_v_i = __pyx_t_4;
17948 
17949  /* "View.MemoryView":1292
17950  *
17951  * for i in range(ndim):
17952  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17953  * if src.shape[i] == 1:
17954  * broadcasting = True
17955  */
17956  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
17957  if (__pyx_t_2) {
17958 
17959  /* "View.MemoryView":1293
17960  * for i in range(ndim):
17961  * if src.shape[i] != dst.shape[i]:
17962  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
17963  * broadcasting = True
17964  * src.strides[i] = 0
17965  */
17966  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
17967  if (__pyx_t_2) {
17968 
17969  /* "View.MemoryView":1294
17970  * if src.shape[i] != dst.shape[i]:
17971  * if src.shape[i] == 1:
17972  * broadcasting = True # <<<<<<<<<<<<<<
17973  * src.strides[i] = 0
17974  * else:
17975  */
17976  __pyx_v_broadcasting = 1;
17977 
17978  /* "View.MemoryView":1295
17979  * if src.shape[i] == 1:
17980  * broadcasting = True
17981  * src.strides[i] = 0 # <<<<<<<<<<<<<<
17982  * else:
17983  * _err_extents(i, dst.shape[i], src.shape[i])
17984  */
17985  (__pyx_v_src.strides[__pyx_v_i]) = 0;
17986 
17987  /* "View.MemoryView":1293
17988  * for i in range(ndim):
17989  * if src.shape[i] != dst.shape[i]:
17990  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
17991  * broadcasting = True
17992  * src.strides[i] = 0
17993  */
17994  goto __pyx_L7;
17995  }
17996 
17997  /* "View.MemoryView":1297
17998  * src.strides[i] = 0
17999  * else:
18000  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
18001  *
18002  * if src.suboffsets[i] >= 0:
18003  */
18004  /*else*/ {
18005  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1297, __pyx_L1_error)
18006  }
18007  __pyx_L7:;
18008 
18009  /* "View.MemoryView":1292
18010  *
18011  * for i in range(ndim):
18012  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
18013  * if src.shape[i] == 1:
18014  * broadcasting = True
18015  */
18016  }
18017 
18018  /* "View.MemoryView":1299
18019  * _err_extents(i, dst.shape[i], src.shape[i])
18020  *
18021  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
18022  * _err_dim(ValueError, "Dimension %d is not direct", i)
18023  *
18024  */
18025  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
18026  if (__pyx_t_2) {
18027 
18028  /* "View.MemoryView":1300
18029  *
18030  * if src.suboffsets[i] >= 0:
18031  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
18032  *
18033  * if slices_overlap(&src, &dst, ndim, itemsize):
18034  */
18035  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1300, __pyx_L1_error)
18036 
18037  /* "View.MemoryView":1299
18038  * _err_extents(i, dst.shape[i], src.shape[i])
18039  *
18040  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
18041  * _err_dim(ValueError, "Dimension %d is not direct", i)
18042  *
18043  */
18044  }
18045  }
18046 
18047  /* "View.MemoryView":1302
18048  * _err_dim(ValueError, "Dimension %d is not direct", i)
18049  *
18050  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
18051  *
18052  * if not slice_is_contig(src, order, ndim):
18053  */
18054  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
18055  if (__pyx_t_2) {
18056 
18057  /* "View.MemoryView":1304
18058  * if slices_overlap(&src, &dst, ndim, itemsize):
18059  *
18060  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
18061  * order = get_best_order(&dst, ndim)
18062  *
18063  */
18064  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
18065  if (__pyx_t_2) {
18066 
18067  /* "View.MemoryView":1305
18068  *
18069  * if not slice_is_contig(src, order, ndim):
18070  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
18071  *
18072  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
18073  */
18074  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
18075 
18076  /* "View.MemoryView":1304
18077  * if slices_overlap(&src, &dst, ndim, itemsize):
18078  *
18079  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
18080  * order = get_best_order(&dst, ndim)
18081  *
18082  */
18083  }
18084 
18085  /* "View.MemoryView":1307
18086  * order = get_best_order(&dst, ndim)
18087  *
18088  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
18089  * src = tmp
18090  *
18091  */
18092  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(0, 1307, __pyx_L1_error)
18093  __pyx_v_tmpdata = __pyx_t_7;
18094 
18095  /* "View.MemoryView":1308
18096  *
18097  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
18098  * src = tmp # <<<<<<<<<<<<<<
18099  *
18100  * if not broadcasting:
18101  */
18102  __pyx_v_src = __pyx_v_tmp;
18103 
18104  /* "View.MemoryView":1302
18105  * _err_dim(ValueError, "Dimension %d is not direct", i)
18106  *
18107  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
18108  *
18109  * if not slice_is_contig(src, order, ndim):
18110  */
18111  }
18112 
18113  /* "View.MemoryView":1310
18114  * src = tmp
18115  *
18116  * if not broadcasting: # <<<<<<<<<<<<<<
18117  *
18118  *
18119  */
18120  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
18121  if (__pyx_t_2) {
18122 
18123  /* "View.MemoryView":1313
18124  *
18125  *
18126  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
18127  * direct_copy = slice_is_contig(dst, 'C', ndim)
18128  * elif slice_is_contig(src, 'F', ndim):
18129  */
18130  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
18131  if (__pyx_t_2) {
18132 
18133  /* "View.MemoryView":1314
18134  *
18135  * if slice_is_contig(src, 'C', ndim):
18136  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
18137  * elif slice_is_contig(src, 'F', ndim):
18138  * direct_copy = slice_is_contig(dst, 'F', ndim)
18139  */
18140  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
18141 
18142  /* "View.MemoryView":1313
18143  *
18144  *
18145  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
18146  * direct_copy = slice_is_contig(dst, 'C', ndim)
18147  * elif slice_is_contig(src, 'F', ndim):
18148  */
18149  goto __pyx_L12;
18150  }
18151 
18152  /* "View.MemoryView":1315
18153  * if slice_is_contig(src, 'C', ndim):
18154  * direct_copy = slice_is_contig(dst, 'C', ndim)
18155  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
18156  * direct_copy = slice_is_contig(dst, 'F', ndim)
18157  *
18158  */
18159  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
18160  if (__pyx_t_2) {
18161 
18162  /* "View.MemoryView":1316
18163  * direct_copy = slice_is_contig(dst, 'C', ndim)
18164  * elif slice_is_contig(src, 'F', ndim):
18165  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
18166  *
18167  * if direct_copy:
18168  */
18169  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
18170 
18171  /* "View.MemoryView":1315
18172  * if slice_is_contig(src, 'C', ndim):
18173  * direct_copy = slice_is_contig(dst, 'C', ndim)
18174  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
18175  * direct_copy = slice_is_contig(dst, 'F', ndim)
18176  *
18177  */
18178  }
18179  __pyx_L12:;
18180 
18181  /* "View.MemoryView":1318
18182  * direct_copy = slice_is_contig(dst, 'F', ndim)
18183  *
18184  * if direct_copy: # <<<<<<<<<<<<<<
18185  *
18186  * refcount_copying(&dst, dtype_is_object, ndim, False)
18187  */
18188  __pyx_t_2 = (__pyx_v_direct_copy != 0);
18189  if (__pyx_t_2) {
18190 
18191  /* "View.MemoryView":1320
18192  * if direct_copy:
18193  *
18194  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
18195  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18196  * refcount_copying(&dst, dtype_is_object, ndim, True)
18197  */
18198  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18199 
18200  /* "View.MemoryView":1321
18201  *
18202  * refcount_copying(&dst, dtype_is_object, ndim, False)
18203  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
18204  * refcount_copying(&dst, dtype_is_object, ndim, True)
18205  * free(tmpdata)
18206  */
18207  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
18208 
18209  /* "View.MemoryView":1322
18210  * refcount_copying(&dst, dtype_is_object, ndim, False)
18211  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18212  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
18213  * free(tmpdata)
18214  * return 0
18215  */
18216  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18217 
18218  /* "View.MemoryView":1323
18219  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18220  * refcount_copying(&dst, dtype_is_object, ndim, True)
18221  * free(tmpdata) # <<<<<<<<<<<<<<
18222  * return 0
18223  *
18224  */
18225  free(__pyx_v_tmpdata);
18226 
18227  /* "View.MemoryView":1324
18228  * refcount_copying(&dst, dtype_is_object, ndim, True)
18229  * free(tmpdata)
18230  * return 0 # <<<<<<<<<<<<<<
18231  *
18232  * if order == 'F' == get_best_order(&dst, ndim):
18233  */
18234  __pyx_r = 0;
18235  goto __pyx_L0;
18236 
18237  /* "View.MemoryView":1318
18238  * direct_copy = slice_is_contig(dst, 'F', ndim)
18239  *
18240  * if direct_copy: # <<<<<<<<<<<<<<
18241  *
18242  * refcount_copying(&dst, dtype_is_object, ndim, False)
18243  */
18244  }
18245 
18246  /* "View.MemoryView":1310
18247  * src = tmp
18248  *
18249  * if not broadcasting: # <<<<<<<<<<<<<<
18250  *
18251  *
18252  */
18253  }
18254 
18255  /* "View.MemoryView":1326
18256  * return 0
18257  *
18258  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
18259  *
18260  *
18261  */
18262  __pyx_t_2 = (__pyx_v_order == 'F');
18263  if (__pyx_t_2) {
18264  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
18265  }
18266  __pyx_t_8 = (__pyx_t_2 != 0);
18267  if (__pyx_t_8) {
18268 
18269  /* "View.MemoryView":1329
18270  *
18271  *
18272  * transpose_memslice(&src) # <<<<<<<<<<<<<<
18273  * transpose_memslice(&dst)
18274  *
18275  */
18276  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(0, 1329, __pyx_L1_error)
18277 
18278  /* "View.MemoryView":1330
18279  *
18280  * transpose_memslice(&src)
18281  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
18282  *
18283  * refcount_copying(&dst, dtype_is_object, ndim, False)
18284  */
18285  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(0, 1330, __pyx_L1_error)
18286 
18287  /* "View.MemoryView":1326
18288  * return 0
18289  *
18290  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
18291  *
18292  *
18293  */
18294  }
18295 
18296  /* "View.MemoryView":1332
18297  * transpose_memslice(&dst)
18298  *
18299  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
18300  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
18301  * refcount_copying(&dst, dtype_is_object, ndim, True)
18302  */
18303  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18304 
18305  /* "View.MemoryView":1333
18306  *
18307  * refcount_copying(&dst, dtype_is_object, ndim, False)
18308  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
18309  * refcount_copying(&dst, dtype_is_object, ndim, True)
18310  *
18311  */
18312  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
18313 
18314  /* "View.MemoryView":1334
18315  * refcount_copying(&dst, dtype_is_object, ndim, False)
18316  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
18317  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
18318  *
18319  * free(tmpdata)
18320  */
18321  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18322 
18323  /* "View.MemoryView":1336
18324  * refcount_copying(&dst, dtype_is_object, ndim, True)
18325  *
18326  * free(tmpdata) # <<<<<<<<<<<<<<
18327  * return 0
18328  *
18329  */
18330  free(__pyx_v_tmpdata);
18331 
18332  /* "View.MemoryView":1337
18333  *
18334  * free(tmpdata)
18335  * return 0 # <<<<<<<<<<<<<<
18336  *
18337  * @cname('__pyx_memoryview_broadcast_leading')
18338  */
18339  __pyx_r = 0;
18340  goto __pyx_L0;
18341 
18342  /* "View.MemoryView":1268
18343  *
18344  * @cname('__pyx_memoryview_copy_contents')
18345  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
18346  * __Pyx_memviewslice dst,
18347  * int src_ndim, int dst_ndim,
18348  */
18349 
18350  /* function exit code */
18351  __pyx_L1_error:;
18352  {
18353  #ifdef WITH_THREAD
18354  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18355  #endif
18356  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18357  #ifdef WITH_THREAD
18358  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18359  #endif
18360  }
18361  __pyx_r = -1;
18362  __pyx_L0:;
18363  return __pyx_r;
18364 }
18365 
18366 /* "View.MemoryView":1340
18367  *
18368  * @cname('__pyx_memoryview_broadcast_leading')
18369  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
18370  * int ndim,
18371  * int ndim_other) nogil:
18372  */
18373 
18374 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
18375  int __pyx_v_i;
18376  int __pyx_v_offset;
18377  int __pyx_t_1;
18378  int __pyx_t_2;
18379  int __pyx_t_3;
18380 
18381  /* "View.MemoryView":1344
18382  * int ndim_other) nogil:
18383  * cdef int i
18384  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
18385  *
18386  * for i in range(ndim - 1, -1, -1):
18387  */
18388  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
18389 
18390  /* "View.MemoryView":1346
18391  * cdef int offset = ndim_other - ndim
18392  *
18393  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18394  * mslice.shape[i + offset] = mslice.shape[i]
18395  * mslice.strides[i + offset] = mslice.strides[i]
18396  */
18397  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18398  __pyx_v_i = __pyx_t_1;
18399 
18400  /* "View.MemoryView":1347
18401  *
18402  * for i in range(ndim - 1, -1, -1):
18403  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
18404  * mslice.strides[i + offset] = mslice.strides[i]
18405  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18406  */
18407  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
18408 
18409  /* "View.MemoryView":1348
18410  * for i in range(ndim - 1, -1, -1):
18411  * mslice.shape[i + offset] = mslice.shape[i]
18412  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
18413  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18414  *
18415  */
18416  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
18417 
18418  /* "View.MemoryView":1349
18419  * mslice.shape[i + offset] = mslice.shape[i]
18420  * mslice.strides[i + offset] = mslice.strides[i]
18421  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
18422  *
18423  * for i in range(offset):
18424  */
18425  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
18426  }
18427 
18428  /* "View.MemoryView":1351
18429  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18430  *
18431  * for i in range(offset): # <<<<<<<<<<<<<<
18432  * mslice.shape[i] = 1
18433  * mslice.strides[i] = mslice.strides[0]
18434  */
18435  __pyx_t_1 = __pyx_v_offset;
18436  __pyx_t_2 = __pyx_t_1;
18437  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18438  __pyx_v_i = __pyx_t_3;
18439 
18440  /* "View.MemoryView":1352
18441  *
18442  * for i in range(offset):
18443  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
18444  * mslice.strides[i] = mslice.strides[0]
18445  * mslice.suboffsets[i] = -1
18446  */
18447  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
18448 
18449  /* "View.MemoryView":1353
18450  * for i in range(offset):
18451  * mslice.shape[i] = 1
18452  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
18453  * mslice.suboffsets[i] = -1
18454  *
18455  */
18456  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
18457 
18458  /* "View.MemoryView":1354
18459  * mslice.shape[i] = 1
18460  * mslice.strides[i] = mslice.strides[0]
18461  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
18462  *
18463  *
18464  */
18465  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
18466  }
18467 
18468  /* "View.MemoryView":1340
18469  *
18470  * @cname('__pyx_memoryview_broadcast_leading')
18471  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
18472  * int ndim,
18473  * int ndim_other) nogil:
18474  */
18475 
18476  /* function exit code */
18477 }
18478 
18479 /* "View.MemoryView":1362
18480  *
18481  * @cname('__pyx_memoryview_refcount_copying')
18482  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
18483  * int ndim, bint inc) nogil:
18484  *
18485  */
18486 
18487 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) {
18488  int __pyx_t_1;
18489 
18490  /* "View.MemoryView":1366
18491  *
18492  *
18493  * if dtype_is_object: # <<<<<<<<<<<<<<
18494  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
18495  * dst.strides, ndim, inc)
18496  */
18497  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
18498  if (__pyx_t_1) {
18499 
18500  /* "View.MemoryView":1367
18501  *
18502  * if dtype_is_object:
18503  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
18504  * dst.strides, ndim, inc)
18505  *
18506  */
18507  __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);
18508 
18509  /* "View.MemoryView":1366
18510  *
18511  *
18512  * if dtype_is_object: # <<<<<<<<<<<<<<
18513  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
18514  * dst.strides, ndim, inc)
18515  */
18516  }
18517 
18518  /* "View.MemoryView":1362
18519  *
18520  * @cname('__pyx_memoryview_refcount_copying')
18521  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
18522  * int ndim, bint inc) nogil:
18523  *
18524  */
18525 
18526  /* function exit code */
18527 }
18528 
18529 /* "View.MemoryView":1371
18530  *
18531  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
18532  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18533  * Py_ssize_t *strides, int ndim,
18534  * bint inc) with gil:
18535  */
18536 
18537 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) {
18538  __Pyx_RefNannyDeclarations
18539  #ifdef WITH_THREAD
18540  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18541  #endif
18542  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
18543 
18544  /* "View.MemoryView":1374
18545  * Py_ssize_t *strides, int ndim,
18546  * bint inc) with gil:
18547  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
18548  *
18549  * @cname('__pyx_memoryview_refcount_objects_in_slice')
18550  */
18551  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
18552 
18553  /* "View.MemoryView":1371
18554  *
18555  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
18556  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18557  * Py_ssize_t *strides, int ndim,
18558  * bint inc) with gil:
18559  */
18560 
18561  /* function exit code */
18562  __Pyx_RefNannyFinishContext();
18563  #ifdef WITH_THREAD
18564  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18565  #endif
18566 }
18567 
18568 /* "View.MemoryView":1377
18569  *
18570  * @cname('__pyx_memoryview_refcount_objects_in_slice')
18571  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18572  * Py_ssize_t *strides, int ndim, bint inc):
18573  * cdef Py_ssize_t i
18574  */
18575 
18576 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) {
18577  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18578  __Pyx_RefNannyDeclarations
18579  Py_ssize_t __pyx_t_1;
18580  Py_ssize_t __pyx_t_2;
18581  Py_ssize_t __pyx_t_3;
18582  int __pyx_t_4;
18583  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
18584 
18585  /* "View.MemoryView":1381
18586  * cdef Py_ssize_t i
18587  *
18588  * for i in range(shape[0]): # <<<<<<<<<<<<<<
18589  * if ndim == 1:
18590  * if inc:
18591  */
18592  __pyx_t_1 = (__pyx_v_shape[0]);
18593  __pyx_t_2 = __pyx_t_1;
18594  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18595  __pyx_v_i = __pyx_t_3;
18596 
18597  /* "View.MemoryView":1382
18598  *
18599  * for i in range(shape[0]):
18600  * if ndim == 1: # <<<<<<<<<<<<<<
18601  * if inc:
18602  * Py_INCREF((<PyObject **> data)[0])
18603  */
18604  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
18605  if (__pyx_t_4) {
18606 
18607  /* "View.MemoryView":1383
18608  * for i in range(shape[0]):
18609  * if ndim == 1:
18610  * if inc: # <<<<<<<<<<<<<<
18611  * Py_INCREF((<PyObject **> data)[0])
18612  * else:
18613  */
18614  __pyx_t_4 = (__pyx_v_inc != 0);
18615  if (__pyx_t_4) {
18616 
18617  /* "View.MemoryView":1384
18618  * if ndim == 1:
18619  * if inc:
18620  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
18621  * else:
18622  * Py_DECREF((<PyObject **> data)[0])
18623  */
18624  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
18625 
18626  /* "View.MemoryView":1383
18627  * for i in range(shape[0]):
18628  * if ndim == 1:
18629  * if inc: # <<<<<<<<<<<<<<
18630  * Py_INCREF((<PyObject **> data)[0])
18631  * else:
18632  */
18633  goto __pyx_L6;
18634  }
18635 
18636  /* "View.MemoryView":1386
18637  * Py_INCREF((<PyObject **> data)[0])
18638  * else:
18639  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
18640  * else:
18641  * refcount_objects_in_slice(data, shape + 1, strides + 1,
18642  */
18643  /*else*/ {
18644  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
18645  }
18646  __pyx_L6:;
18647 
18648  /* "View.MemoryView":1382
18649  *
18650  * for i in range(shape[0]):
18651  * if ndim == 1: # <<<<<<<<<<<<<<
18652  * if inc:
18653  * Py_INCREF((<PyObject **> data)[0])
18654  */
18655  goto __pyx_L5;
18656  }
18657 
18658  /* "View.MemoryView":1388
18659  * Py_DECREF((<PyObject **> data)[0])
18660  * else:
18661  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
18662  * ndim - 1, inc)
18663  *
18664  */
18665  /*else*/ {
18666 
18667  /* "View.MemoryView":1389
18668  * else:
18669  * refcount_objects_in_slice(data, shape + 1, strides + 1,
18670  * ndim - 1, inc) # <<<<<<<<<<<<<<
18671  *
18672  * data += strides[0]
18673  */
18674  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
18675  }
18676  __pyx_L5:;
18677 
18678  /* "View.MemoryView":1391
18679  * ndim - 1, inc)
18680  *
18681  * data += strides[0] # <<<<<<<<<<<<<<
18682  *
18683  *
18684  */
18685  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
18686  }
18687 
18688  /* "View.MemoryView":1377
18689  *
18690  * @cname('__pyx_memoryview_refcount_objects_in_slice')
18691  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18692  * Py_ssize_t *strides, int ndim, bint inc):
18693  * cdef Py_ssize_t i
18694  */
18695 
18696  /* function exit code */
18697  __Pyx_RefNannyFinishContext();
18698 }
18699 
18700 /* "View.MemoryView":1397
18701  *
18702  * @cname('__pyx_memoryview_slice_assign_scalar')
18703  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
18704  * size_t itemsize, void *item,
18705  * bint dtype_is_object) nogil:
18706  */
18707 
18708 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) {
18709 
18710  /* "View.MemoryView":1400
18711  * size_t itemsize, void *item,
18712  * bint dtype_is_object) nogil:
18713  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
18714  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
18715  * itemsize, item)
18716  */
18717  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18718 
18719  /* "View.MemoryView":1401
18720  * bint dtype_is_object) nogil:
18721  * refcount_copying(dst, dtype_is_object, ndim, False)
18722  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
18723  * itemsize, item)
18724  * refcount_copying(dst, dtype_is_object, ndim, True)
18725  */
18726  __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);
18727 
18728  /* "View.MemoryView":1403
18729  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
18730  * itemsize, item)
18731  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
18732  *
18733  *
18734  */
18735  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18736 
18737  /* "View.MemoryView":1397
18738  *
18739  * @cname('__pyx_memoryview_slice_assign_scalar')
18740  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
18741  * size_t itemsize, void *item,
18742  * bint dtype_is_object) nogil:
18743  */
18744 
18745  /* function exit code */
18746 }
18747 
18748 /* "View.MemoryView":1407
18749  *
18750  * @cname('__pyx_memoryview__slice_assign_scalar')
18751  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18752  * Py_ssize_t *strides, int ndim,
18753  * size_t itemsize, void *item) nogil:
18754  */
18755 
18756 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) {
18757  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18758  Py_ssize_t __pyx_v_stride;
18759  Py_ssize_t __pyx_v_extent;
18760  int __pyx_t_1;
18761  Py_ssize_t __pyx_t_2;
18762  Py_ssize_t __pyx_t_3;
18763  Py_ssize_t __pyx_t_4;
18764 
18765  /* "View.MemoryView":1411
18766  * size_t itemsize, void *item) nogil:
18767  * cdef Py_ssize_t i
18768  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
18769  * cdef Py_ssize_t extent = shape[0]
18770  *
18771  */
18772  __pyx_v_stride = (__pyx_v_strides[0]);
18773 
18774  /* "View.MemoryView":1412
18775  * cdef Py_ssize_t i
18776  * cdef Py_ssize_t stride = strides[0]
18777  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
18778  *
18779  * if ndim == 1:
18780  */
18781  __pyx_v_extent = (__pyx_v_shape[0]);
18782 
18783  /* "View.MemoryView":1414
18784  * cdef Py_ssize_t extent = shape[0]
18785  *
18786  * if ndim == 1: # <<<<<<<<<<<<<<
18787  * for i in range(extent):
18788  * memcpy(data, item, itemsize)
18789  */
18790  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18791  if (__pyx_t_1) {
18792 
18793  /* "View.MemoryView":1415
18794  *
18795  * if ndim == 1:
18796  * for i in range(extent): # <<<<<<<<<<<<<<
18797  * memcpy(data, item, itemsize)
18798  * data += stride
18799  */
18800  __pyx_t_2 = __pyx_v_extent;
18801  __pyx_t_3 = __pyx_t_2;
18802  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18803  __pyx_v_i = __pyx_t_4;
18804 
18805  /* "View.MemoryView":1416
18806  * if ndim == 1:
18807  * for i in range(extent):
18808  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
18809  * data += stride
18810  * else:
18811  */
18812  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18813 
18814  /* "View.MemoryView":1417
18815  * for i in range(extent):
18816  * memcpy(data, item, itemsize)
18817  * data += stride # <<<<<<<<<<<<<<
18818  * else:
18819  * for i in range(extent):
18820  */
18821  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18822  }
18823 
18824  /* "View.MemoryView":1414
18825  * cdef Py_ssize_t extent = shape[0]
18826  *
18827  * if ndim == 1: # <<<<<<<<<<<<<<
18828  * for i in range(extent):
18829  * memcpy(data, item, itemsize)
18830  */
18831  goto __pyx_L3;
18832  }
18833 
18834  /* "View.MemoryView":1419
18835  * data += stride
18836  * else:
18837  * for i in range(extent): # <<<<<<<<<<<<<<
18838  * _slice_assign_scalar(data, shape + 1, strides + 1,
18839  * ndim - 1, itemsize, item)
18840  */
18841  /*else*/ {
18842  __pyx_t_2 = __pyx_v_extent;
18843  __pyx_t_3 = __pyx_t_2;
18844  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18845  __pyx_v_i = __pyx_t_4;
18846 
18847  /* "View.MemoryView":1420
18848  * else:
18849  * for i in range(extent):
18850  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
18851  * ndim - 1, itemsize, item)
18852  * data += stride
18853  */
18854  __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);
18855 
18856  /* "View.MemoryView":1422
18857  * _slice_assign_scalar(data, shape + 1, strides + 1,
18858  * ndim - 1, itemsize, item)
18859  * data += stride # <<<<<<<<<<<<<<
18860  *
18861  *
18862  */
18863  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18864  }
18865  }
18866  __pyx_L3:;
18867 
18868  /* "View.MemoryView":1407
18869  *
18870  * @cname('__pyx_memoryview__slice_assign_scalar')
18871  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18872  * Py_ssize_t *strides, int ndim,
18873  * size_t itemsize, void *item) nogil:
18874  */
18875 
18876  /* function exit code */
18877 }
18878 
18879 /* "(tree fragment)":1
18880  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
18881  * cdef object __pyx_PickleError
18882  * cdef object __pyx_result
18883  */
18884 
18885 /* Python wrapper */
18886 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18887 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};
18888 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18889  PyObject *__pyx_v___pyx_type = 0;
18890  long __pyx_v___pyx_checksum;
18891  PyObject *__pyx_v___pyx_state = 0;
18892  int __pyx_lineno = 0;
18893  const char *__pyx_filename = NULL;
18894  int __pyx_clineno = 0;
18895  PyObject *__pyx_r = 0;
18896  __Pyx_RefNannyDeclarations
18897  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
18898  {
18899  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
18900  PyObject* values[3] = {0,0,0};
18901  if (unlikely(__pyx_kwds)) {
18902  Py_ssize_t kw_args;
18903  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18904  switch (pos_args) {
18905  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18906  CYTHON_FALLTHROUGH;
18907  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18908  CYTHON_FALLTHROUGH;
18909  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18910  CYTHON_FALLTHROUGH;
18911  case 0: break;
18912  default: goto __pyx_L5_argtuple_error;
18913  }
18914  kw_args = PyDict_Size(__pyx_kwds);
18915  switch (pos_args) {
18916  case 0:
18917  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
18918  else goto __pyx_L5_argtuple_error;
18919  CYTHON_FALLTHROUGH;
18920  case 1:
18921  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
18922  else {
18923  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(0, 1, __pyx_L3_error)
18924  }
18925  CYTHON_FALLTHROUGH;
18926  case 2:
18927  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
18928  else {
18929  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(0, 1, __pyx_L3_error)
18930  }
18931  }
18932  if (unlikely(kw_args > 0)) {
18933  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(0, 1, __pyx_L3_error)
18934  }
18935  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
18936  goto __pyx_L5_argtuple_error;
18937  } else {
18938  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18939  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18940  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18941  }
18942  __pyx_v___pyx_type = values[0];
18943  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error)
18944  __pyx_v___pyx_state = values[2];
18945  }
18946  goto __pyx_L4_argument_unpacking_done;
18947  __pyx_L5_argtuple_error:;
18948  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1, __pyx_L3_error)
18949  __pyx_L3_error:;
18950  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18951  __Pyx_RefNannyFinishContext();
18952  return NULL;
18953  __pyx_L4_argument_unpacking_done:;
18954  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18955 
18956  /* function exit code */
18957  __Pyx_RefNannyFinishContext();
18958  return __pyx_r;
18959 }
18960 
18961 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) {
18962  PyObject *__pyx_v___pyx_PickleError = 0;
18963  PyObject *__pyx_v___pyx_result = 0;
18964  PyObject *__pyx_r = NULL;
18965  __Pyx_RefNannyDeclarations
18966  PyObject *__pyx_t_1 = NULL;
18967  int __pyx_t_2;
18968  int __pyx_t_3;
18969  PyObject *__pyx_t_4 = NULL;
18970  PyObject *__pyx_t_5 = NULL;
18971  PyObject *__pyx_t_6 = NULL;
18972  int __pyx_lineno = 0;
18973  const char *__pyx_filename = NULL;
18974  int __pyx_clineno = 0;
18975  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
18976 
18977  /* "(tree fragment)":4
18978  * cdef object __pyx_PickleError
18979  * cdef object __pyx_result
18980  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
18981  * from pickle import PickleError as __pyx_PickleError
18982  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
18983  */
18984  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
18985  __Pyx_GOTREF(__pyx_t_1);
18986  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__34, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 4, __pyx_L1_error)
18987  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18988  __pyx_t_3 = (__pyx_t_2 != 0);
18989  if (__pyx_t_3) {
18990 
18991  /* "(tree fragment)":5
18992  * cdef object __pyx_result
18993  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
18994  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
18995  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
18996  * __pyx_result = Enum.__new__(__pyx_type)
18997  */
18998  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
18999  __Pyx_GOTREF(__pyx_t_1);
19000  __Pyx_INCREF(__pyx_n_s_PickleError);
19001  __Pyx_GIVEREF(__pyx_n_s_PickleError);
19002  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
19003  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5, __pyx_L1_error)
19004  __Pyx_GOTREF(__pyx_t_4);
19005  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19006  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
19007  __Pyx_GOTREF(__pyx_t_1);
19008  __Pyx_INCREF(__pyx_t_1);
19009  __pyx_v___pyx_PickleError = __pyx_t_1;
19010  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19011  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19012 
19013  /* "(tree fragment)":6
19014  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
19015  * from pickle import PickleError as __pyx_PickleError
19016  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
19017  * __pyx_result = Enum.__new__(__pyx_type)
19018  * if __pyx_state is not None:
19019  */
19020  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
19021  __Pyx_GOTREF(__pyx_t_1);
19022  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 6, __pyx_L1_error)
19023  __Pyx_GOTREF(__pyx_t_5);
19024  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19025  __Pyx_INCREF(__pyx_v___pyx_PickleError);
19026  __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
19027  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
19028  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
19029  if (likely(__pyx_t_6)) {
19030  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
19031  __Pyx_INCREF(__pyx_t_6);
19032  __Pyx_INCREF(function);
19033  __Pyx_DECREF_SET(__pyx_t_1, function);
19034  }
19035  }
19036  __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);
19037  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
19038  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19039  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error)
19040  __Pyx_GOTREF(__pyx_t_4);
19041  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19042  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19043  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19044  __PYX_ERR(0, 6, __pyx_L1_error)
19045 
19046  /* "(tree fragment)":4
19047  * cdef object __pyx_PickleError
19048  * cdef object __pyx_result
19049  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
19050  * from pickle import PickleError as __pyx_PickleError
19051  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19052  */
19053  }
19054 
19055  /* "(tree fragment)":7
19056  * from pickle import PickleError as __pyx_PickleError
19057  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19058  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
19059  * if __pyx_state is not None:
19060  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19061  */
19062  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
19063  __Pyx_GOTREF(__pyx_t_1);
19064  __pyx_t_5 = NULL;
19065  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
19066  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
19067  if (likely(__pyx_t_5)) {
19068  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
19069  __Pyx_INCREF(__pyx_t_5);
19070  __Pyx_INCREF(function);
19071  __Pyx_DECREF_SET(__pyx_t_1, function);
19072  }
19073  }
19074  __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);
19075  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19076  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7, __pyx_L1_error)
19077  __Pyx_GOTREF(__pyx_t_4);
19078  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19079  __pyx_v___pyx_result = __pyx_t_4;
19080  __pyx_t_4 = 0;
19081 
19082  /* "(tree fragment)":8
19083  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19084  * __pyx_result = Enum.__new__(__pyx_type)
19085  * if __pyx_state is not None: # <<<<<<<<<<<<<<
19086  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19087  * return __pyx_result
19088  */
19089  __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
19090  __pyx_t_2 = (__pyx_t_3 != 0);
19091  if (__pyx_t_2) {
19092 
19093  /* "(tree fragment)":9
19094  * __pyx_result = Enum.__new__(__pyx_type)
19095  * if __pyx_state is not None:
19096  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
19097  * return __pyx_result
19098  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19099  */
19100  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 9, __pyx_L1_error)
19101  __pyx_t_4 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 9, __pyx_L1_error)
19102  __Pyx_GOTREF(__pyx_t_4);
19103  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19104 
19105  /* "(tree fragment)":8
19106  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
19107  * __pyx_result = Enum.__new__(__pyx_type)
19108  * if __pyx_state is not None: # <<<<<<<<<<<<<<
19109  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19110  * return __pyx_result
19111  */
19112  }
19113 
19114  /* "(tree fragment)":10
19115  * if __pyx_state is not None:
19116  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19117  * return __pyx_result # <<<<<<<<<<<<<<
19118  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19119  * __pyx_result.name = __pyx_state[0]
19120  */
19121  __Pyx_XDECREF(__pyx_r);
19122  __Pyx_INCREF(__pyx_v___pyx_result);
19123  __pyx_r = __pyx_v___pyx_result;
19124  goto __pyx_L0;
19125 
19126  /* "(tree fragment)":1
19127  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
19128  * cdef object __pyx_PickleError
19129  * cdef object __pyx_result
19130  */
19131 
19132  /* function exit code */
19133  __pyx_L1_error:;
19134  __Pyx_XDECREF(__pyx_t_1);
19135  __Pyx_XDECREF(__pyx_t_4);
19136  __Pyx_XDECREF(__pyx_t_5);
19137  __Pyx_XDECREF(__pyx_t_6);
19138  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
19139  __pyx_r = NULL;
19140  __pyx_L0:;
19141  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
19142  __Pyx_XDECREF(__pyx_v___pyx_result);
19143  __Pyx_XGIVEREF(__pyx_r);
19144  __Pyx_RefNannyFinishContext();
19145  return __pyx_r;
19146 }
19147 
19148 /* "(tree fragment)":11
19149  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19150  * return __pyx_result
19151  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
19152  * __pyx_result.name = __pyx_state[0]
19153  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19154  */
19155 
19156 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
19157  PyObject *__pyx_r = NULL;
19158  __Pyx_RefNannyDeclarations
19159  PyObject *__pyx_t_1 = NULL;
19160  int __pyx_t_2;
19161  Py_ssize_t __pyx_t_3;
19162  int __pyx_t_4;
19163  int __pyx_t_5;
19164  PyObject *__pyx_t_6 = NULL;
19165  PyObject *__pyx_t_7 = NULL;
19166  PyObject *__pyx_t_8 = NULL;
19167  int __pyx_lineno = 0;
19168  const char *__pyx_filename = NULL;
19169  int __pyx_clineno = 0;
19170  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
19171 
19172  /* "(tree fragment)":12
19173  * return __pyx_result
19174  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19175  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
19176  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19177  * __pyx_result.__dict__.update(__pyx_state[1])
19178  */
19179  if (unlikely(__pyx_v___pyx_state == Py_None)) {
19180  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19181  __PYX_ERR(0, 12, __pyx_L1_error)
19182  }
19183  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
19184  __Pyx_GOTREF(__pyx_t_1);
19185  __Pyx_GIVEREF(__pyx_t_1);
19186  __Pyx_GOTREF(__pyx_v___pyx_result->name);
19187  __Pyx_DECREF(__pyx_v___pyx_result->name);
19188  __pyx_v___pyx_result->name = __pyx_t_1;
19189  __pyx_t_1 = 0;
19190 
19191  /* "(tree fragment)":13
19192  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19193  * __pyx_result.name = __pyx_state[0]
19194  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
19195  * __pyx_result.__dict__.update(__pyx_state[1])
19196  */
19197  if (unlikely(__pyx_v___pyx_state == Py_None)) {
19198  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
19199  __PYX_ERR(0, 13, __pyx_L1_error)
19200  }
19201  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 13, __pyx_L1_error)
19202  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
19203  if (__pyx_t_4) {
19204  } else {
19205  __pyx_t_2 = __pyx_t_4;
19206  goto __pyx_L4_bool_binop_done;
19207  }
19208  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 13, __pyx_L1_error)
19209  __pyx_t_5 = (__pyx_t_4 != 0);
19210  __pyx_t_2 = __pyx_t_5;
19211  __pyx_L4_bool_binop_done:;
19212  if (__pyx_t_2) {
19213 
19214  /* "(tree fragment)":14
19215  * __pyx_result.name = __pyx_state[0]
19216  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19217  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
19218  */
19219  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 14, __pyx_L1_error)
19220  __Pyx_GOTREF(__pyx_t_6);
19221  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 14, __pyx_L1_error)
19222  __Pyx_GOTREF(__pyx_t_7);
19223  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19224  if (unlikely(__pyx_v___pyx_state == Py_None)) {
19225  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19226  __PYX_ERR(0, 14, __pyx_L1_error)
19227  }
19228  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 14, __pyx_L1_error)
19229  __Pyx_GOTREF(__pyx_t_6);
19230  __pyx_t_8 = NULL;
19231  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
19232  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
19233  if (likely(__pyx_t_8)) {
19234  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
19235  __Pyx_INCREF(__pyx_t_8);
19236  __Pyx_INCREF(function);
19237  __Pyx_DECREF_SET(__pyx_t_7, function);
19238  }
19239  }
19240  __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);
19241  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
19242  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19243  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
19244  __Pyx_GOTREF(__pyx_t_1);
19245  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19246  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19247 
19248  /* "(tree fragment)":13
19249  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19250  * __pyx_result.name = __pyx_state[0]
19251  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
19252  * __pyx_result.__dict__.update(__pyx_state[1])
19253  */
19254  }
19255 
19256  /* "(tree fragment)":11
19257  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19258  * return __pyx_result
19259  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
19260  * __pyx_result.name = __pyx_state[0]
19261  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19262  */
19263 
19264  /* function exit code */
19265  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19266  goto __pyx_L0;
19267  __pyx_L1_error:;
19268  __Pyx_XDECREF(__pyx_t_1);
19269  __Pyx_XDECREF(__pyx_t_6);
19270  __Pyx_XDECREF(__pyx_t_7);
19271  __Pyx_XDECREF(__pyx_t_8);
19272  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
19273  __pyx_r = 0;
19274  __pyx_L0:;
19275  __Pyx_XGIVEREF(__pyx_r);
19276  __Pyx_RefNannyFinishContext();
19277  return __pyx_r;
19278 }
19279 
19280 /* "BufferFormatFromTypeInfo":1463
19281  *
19282  * @cname('__pyx_format_from_typeinfo')
19283  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
19284  * cdef __Pyx_StructField *field
19285  * cdef __pyx_typeinfo_string fmt
19286  */
19287 
19288 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) {
19289  __Pyx_StructField *__pyx_v_field;
19290  struct __pyx_typeinfo_string __pyx_v_fmt;
19291  PyObject *__pyx_v_part = 0;
19292  PyObject *__pyx_v_result = 0;
19293  PyObject *__pyx_v_alignment = NULL;
19294  PyObject *__pyx_v_parts = NULL;
19295  PyObject *__pyx_v_extents = NULL;
19296  int __pyx_v_i;
19297  PyObject *__pyx_r = NULL;
19298  __Pyx_RefNannyDeclarations
19299  int __pyx_t_1;
19300  PyObject *__pyx_t_2 = NULL;
19301  __Pyx_StructField *__pyx_t_3;
19302  PyObject *__pyx_t_4 = NULL;
19303  PyObject *__pyx_t_5 = NULL;
19304  int __pyx_t_6;
19305  int __pyx_t_7;
19306  int __pyx_t_8;
19307  int __pyx_t_9;
19308  int __pyx_lineno = 0;
19309  const char *__pyx_filename = NULL;
19310  int __pyx_clineno = 0;
19311  __Pyx_RefNannySetupContext("format_from_typeinfo", 0);
19312 
19313  /* "BufferFormatFromTypeInfo":1468
19314  * cdef bytes part, result
19315  *
19316  * if type.typegroup == 'S': # <<<<<<<<<<<<<<
19317  * assert type.fields != NULL
19318  * assert type.fields.type != NULL
19319  */
19320  __pyx_t_1 = ((__pyx_v_type->typegroup == 'S') != 0);
19321  if (__pyx_t_1) {
19322 
19323  /* "BufferFormatFromTypeInfo":1469
19324  *
19325  * if type.typegroup == 'S':
19326  * assert type.fields != NULL # <<<<<<<<<<<<<<
19327  * assert type.fields.type != NULL
19328  *
19329  */
19330  #ifndef CYTHON_WITHOUT_ASSERTIONS
19331  if (unlikely(!Py_OptimizeFlag)) {
19332  if (unlikely(!((__pyx_v_type->fields != NULL) != 0))) {
19333  PyErr_SetNone(PyExc_AssertionError);
19334  __PYX_ERR(0, 1469, __pyx_L1_error)
19335  }
19336  }
19337  #endif
19338 
19339  /* "BufferFormatFromTypeInfo":1470
19340  * if type.typegroup == 'S':
19341  * assert type.fields != NULL
19342  * assert type.fields.type != NULL # <<<<<<<<<<<<<<
19343  *
19344  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
19345  */
19346  #ifndef CYTHON_WITHOUT_ASSERTIONS
19347  if (unlikely(!Py_OptimizeFlag)) {
19348  if (unlikely(!((__pyx_v_type->fields->type != NULL) != 0))) {
19349  PyErr_SetNone(PyExc_AssertionError);
19350  __PYX_ERR(0, 1470, __pyx_L1_error)
19351  }
19352  }
19353  #endif
19354 
19355  /* "BufferFormatFromTypeInfo":1472
19356  * assert type.fields.type != NULL
19357  *
19358  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
19359  * alignment = b'^'
19360  * else:
19361  */
19362  __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
19363  if (__pyx_t_1) {
19364 
19365  /* "BufferFormatFromTypeInfo":1473
19366  *
19367  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
19368  * alignment = b'^' # <<<<<<<<<<<<<<
19369  * else:
19370  * alignment = b''
19371  */
19372  __Pyx_INCREF(__pyx_kp_b__35);
19373  __pyx_v_alignment = __pyx_kp_b__35;
19374 
19375  /* "BufferFormatFromTypeInfo":1472
19376  * assert type.fields.type != NULL
19377  *
19378  * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
19379  * alignment = b'^'
19380  * else:
19381  */
19382  goto __pyx_L4;
19383  }
19384 
19385  /* "BufferFormatFromTypeInfo":1475
19386  * alignment = b'^'
19387  * else:
19388  * alignment = b'' # <<<<<<<<<<<<<<
19389  *
19390  * parts = [b"T{"]
19391  */
19392  /*else*/ {
19393  __Pyx_INCREF(__pyx_kp_b__36);
19394  __pyx_v_alignment = __pyx_kp_b__36;
19395  }
19396  __pyx_L4:;
19397 
19398  /* "BufferFormatFromTypeInfo":1477
19399  * alignment = b''
19400  *
19401  * parts = [b"T{"] # <<<<<<<<<<<<<<
19402  * field = type.fields
19403  *
19404  */
19405  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error)
19406  __Pyx_GOTREF(__pyx_t_2);
19407  __Pyx_INCREF(__pyx_kp_b_T);
19408  __Pyx_GIVEREF(__pyx_kp_b_T);
19409  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_b_T);
19410  __pyx_v_parts = ((PyObject*)__pyx_t_2);
19411  __pyx_t_2 = 0;
19412 
19413  /* "BufferFormatFromTypeInfo":1478
19414  *
19415  * parts = [b"T{"]
19416  * field = type.fields # <<<<<<<<<<<<<<
19417  *
19418  * while field.type:
19419  */
19420  __pyx_t_3 = __pyx_v_type->fields;
19421  __pyx_v_field = __pyx_t_3;
19422 
19423  /* "BufferFormatFromTypeInfo":1480
19424  * field = type.fields
19425  *
19426  * while field.type: # <<<<<<<<<<<<<<
19427  * part = format_from_typeinfo(field.type)
19428  * parts.append(part + b':' + field.name + b':')
19429  */
19430  while (1) {
19431  __pyx_t_1 = (__pyx_v_field->type != 0);
19432  if (!__pyx_t_1) break;
19433 
19434  /* "BufferFormatFromTypeInfo":1481
19435  *
19436  * while field.type:
19437  * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<<
19438  * parts.append(part + b':' + field.name + b':')
19439  * field += 1
19440  */
19441  __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error)
19442  __Pyx_GOTREF(__pyx_t_2);
19443  __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
19444  __pyx_t_2 = 0;
19445 
19446  /* "BufferFormatFromTypeInfo":1482
19447  * while field.type:
19448  * part = format_from_typeinfo(field.type)
19449  * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<<
19450  * field += 1
19451  *
19452  */
19453  __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__37); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error)
19454  __Pyx_GOTREF(__pyx_t_2);
19455  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error)
19456  __Pyx_GOTREF(__pyx_t_4);
19457  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1482, __pyx_L1_error)
19458  __Pyx_GOTREF(__pyx_t_5);
19459  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19460  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19461  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__37); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error)
19462  __Pyx_GOTREF(__pyx_t_4);
19463  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19464  __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1482, __pyx_L1_error)
19465  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19466 
19467  /* "BufferFormatFromTypeInfo":1483
19468  * part = format_from_typeinfo(field.type)
19469  * parts.append(part + b':' + field.name + b':')
19470  * field += 1 # <<<<<<<<<<<<<<
19471  *
19472  * result = alignment.join(parts) + b'}'
19473  */
19474  __pyx_v_field = (__pyx_v_field + 1);
19475  }
19476 
19477  /* "BufferFormatFromTypeInfo":1485
19478  * field += 1
19479  *
19480  * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<<
19481  * else:
19482  * fmt = __Pyx_TypeInfoToFormat(type)
19483  */
19484  __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1485, __pyx_L1_error)
19485  __Pyx_GOTREF(__pyx_t_4);
19486  __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_b__38); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1485, __pyx_L1_error)
19487  __Pyx_GOTREF(__pyx_t_5);
19488  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19489  if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 1485, __pyx_L1_error)
19490  __pyx_v_result = ((PyObject*)__pyx_t_5);
19491  __pyx_t_5 = 0;
19492 
19493  /* "BufferFormatFromTypeInfo":1468
19494  * cdef bytes part, result
19495  *
19496  * if type.typegroup == 'S': # <<<<<<<<<<<<<<
19497  * assert type.fields != NULL
19498  * assert type.fields.type != NULL
19499  */
19500  goto __pyx_L3;
19501  }
19502 
19503  /* "BufferFormatFromTypeInfo":1487
19504  * result = alignment.join(parts) + b'}'
19505  * else:
19506  * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<<
19507  * if type.arraysize[0]:
19508  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
19509  */
19510  /*else*/ {
19511  __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
19512 
19513  /* "BufferFormatFromTypeInfo":1488
19514  * else:
19515  * fmt = __Pyx_TypeInfoToFormat(type)
19516  * if type.arraysize[0]: # <<<<<<<<<<<<<<
19517  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
19518  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
19519  */
19520  __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
19521  if (__pyx_t_1) {
19522 
19523  /* "BufferFormatFromTypeInfo":1489
19524  * fmt = __Pyx_TypeInfoToFormat(type)
19525  * if type.arraysize[0]:
19526  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)] # <<<<<<<<<<<<<<
19527  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
19528  * else:
19529  */
19530  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1489, __pyx_L1_error)
19531  __Pyx_GOTREF(__pyx_t_5);
19532  __pyx_t_7 = __pyx_v_type->ndim;
19533  __pyx_t_8 = __pyx_t_7;
19534  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
19535  __pyx_v_i = __pyx_t_9;
19536  __pyx_t_4 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1489, __pyx_L1_error)
19537  __Pyx_GOTREF(__pyx_t_4);
19538  __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1489, __pyx_L1_error)
19539  __Pyx_GOTREF(__pyx_t_2);
19540  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19541  if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1489, __pyx_L1_error)
19542  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19543  }
19544  __pyx_v_extents = ((PyObject*)__pyx_t_5);
19545  __pyx_t_5 = 0;
19546 
19547  /* "BufferFormatFromTypeInfo":1490
19548  * if type.arraysize[0]:
19549  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
19550  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string # <<<<<<<<<<<<<<
19551  * else:
19552  * result = fmt.string
19553  */
19554  __pyx_t_5 = PyUnicode_Join(__pyx_kp_u__39, __pyx_v_extents); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1490, __pyx_L1_error)
19555  __Pyx_GOTREF(__pyx_t_5);
19556  __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error)
19557  __Pyx_GOTREF(__pyx_t_2);
19558  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19559  __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1490, __pyx_L1_error)
19560  __Pyx_GOTREF(__pyx_t_5);
19561  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19562  __pyx_t_2 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error)
19563  __Pyx_GOTREF(__pyx_t_2);
19564  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1490, __pyx_L1_error)
19565  __Pyx_GOTREF(__pyx_t_4);
19566  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19567  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19568  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 1490, __pyx_L1_error)
19569  __pyx_v_result = ((PyObject*)__pyx_t_4);
19570  __pyx_t_4 = 0;
19571 
19572  /* "BufferFormatFromTypeInfo":1488
19573  * else:
19574  * fmt = __Pyx_TypeInfoToFormat(type)
19575  * if type.arraysize[0]: # <<<<<<<<<<<<<<
19576  * extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
19577  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
19578  */
19579  goto __pyx_L7;
19580  }
19581 
19582  /* "BufferFormatFromTypeInfo":1492
19583  * result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
19584  * else:
19585  * result = fmt.string # <<<<<<<<<<<<<<
19586  *
19587  * return result
19588  */
19589  /*else*/ {
19590  __pyx_t_4 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1492, __pyx_L1_error)
19591  __Pyx_GOTREF(__pyx_t_4);
19592  __pyx_v_result = ((PyObject*)__pyx_t_4);
19593  __pyx_t_4 = 0;
19594  }
19595  __pyx_L7:;
19596  }
19597  __pyx_L3:;
19598 
19599  /* "BufferFormatFromTypeInfo":1494
19600  * result = fmt.string
19601  *
19602  * return result # <<<<<<<<<<<<<<
19603  */
19604  __Pyx_XDECREF(__pyx_r);
19605  __Pyx_INCREF(__pyx_v_result);
19606  __pyx_r = __pyx_v_result;
19607  goto __pyx_L0;
19608 
19609  /* "BufferFormatFromTypeInfo":1463
19610  *
19611  * @cname('__pyx_format_from_typeinfo')
19612  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
19613  * cdef __Pyx_StructField *field
19614  * cdef __pyx_typeinfo_string fmt
19615  */
19616 
19617  /* function exit code */
19618  __pyx_L1_error:;
19619  __Pyx_XDECREF(__pyx_t_2);
19620  __Pyx_XDECREF(__pyx_t_4);
19621  __Pyx_XDECREF(__pyx_t_5);
19622  __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
19623  __pyx_r = 0;
19624  __pyx_L0:;
19625  __Pyx_XDECREF(__pyx_v_part);
19626  __Pyx_XDECREF(__pyx_v_result);
19627  __Pyx_XDECREF(__pyx_v_alignment);
19628  __Pyx_XDECREF(__pyx_v_parts);
19629  __Pyx_XDECREF(__pyx_v_extents);
19630  __Pyx_XGIVEREF(__pyx_r);
19631  __Pyx_RefNannyFinishContext();
19632  return __pyx_r;
19633 }
19634 
19635 static PyObject *__pyx_tp_new_22equivalent_polynomials_Simplex(PyTypeObject *t, PyObject *a, PyObject *k) {
19636  struct __pyx_obj_22equivalent_polynomials_Simplex *p;
19637  PyObject *o;
19638  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19639  o = (*t->tp_alloc)(t, 0);
19640  } else {
19641  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19642  }
19643  if (unlikely(!o)) return 0;
19644  p = ((struct __pyx_obj_22equivalent_polynomials_Simplex *)o);
19645  new((void*)&(p->s11)) equivalent_polynomials::Simplex<1,1,50,50> ();
19646  new((void*)&(p->s12)) equivalent_polynomials::Simplex<1,2,50,50> ();
19647  new((void*)&(p->s13)) equivalent_polynomials::Simplex<1,3,50,50> ();
19648  new((void*)&(p->s21)) equivalent_polynomials::Simplex<2,1,50,50> ();
19649  new((void*)&(p->s22)) equivalent_polynomials::Simplex<2,2,50,50> ();
19650  new((void*)&(p->s23)) equivalent_polynomials::Simplex<2,3,50,50> ();
19651  new((void*)&(p->s31)) equivalent_polynomials::Simplex<3,1,50,50> ();
19652  new((void*)&(p->s32)) equivalent_polynomials::Simplex<3,2,50,50> ();
19653  new((void*)&(p->s33)) equivalent_polynomials::Simplex<3,3,50,50> ();
19654  p->xiBuffer = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
19655  p->_H = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
19656  p->_ImH = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
19657  p->_D = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
19658  if (unlikely(__pyx_pw_22equivalent_polynomials_7Simplex_1__cinit__(o, a, k) < 0)) goto bad;
19659  return o;
19660  bad:
19661  Py_DECREF(o); o = 0;
19662  return NULL;
19663 }
19664 
19665 static void __pyx_tp_dealloc_22equivalent_polynomials_Simplex(PyObject *o) {
19666  struct __pyx_obj_22equivalent_polynomials_Simplex *p = (struct __pyx_obj_22equivalent_polynomials_Simplex *)o;
19667  #if CYTHON_USE_TP_FINALIZE
19668  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
19669  if (PyObject_CallFinalizerFromDealloc(o)) return;
19670  }
19671  #endif
19672  PyObject_GC_UnTrack(o);
19673  __Pyx_call_destructor(p->s11);
19674  __Pyx_call_destructor(p->s12);
19675  __Pyx_call_destructor(p->s13);
19676  __Pyx_call_destructor(p->s21);
19677  __Pyx_call_destructor(p->s22);
19678  __Pyx_call_destructor(p->s23);
19679  __Pyx_call_destructor(p->s31);
19680  __Pyx_call_destructor(p->s32);
19681  __Pyx_call_destructor(p->s33);
19682  Py_CLEAR(p->xiBuffer);
19683  Py_CLEAR(p->_H);
19684  Py_CLEAR(p->_ImH);
19685  Py_CLEAR(p->_D);
19686  (*Py_TYPE(o)->tp_free)(o);
19687 }
19688 
19689 static int __pyx_tp_traverse_22equivalent_polynomials_Simplex(PyObject *o, visitproc v, void *a) {
19690  int e;
19691  struct __pyx_obj_22equivalent_polynomials_Simplex *p = (struct __pyx_obj_22equivalent_polynomials_Simplex *)o;
19692  if (p->xiBuffer) {
19693  e = (*v)(((PyObject *)p->xiBuffer), a); if (e) return e;
19694  }
19695  if (p->_H) {
19696  e = (*v)(((PyObject *)p->_H), a); if (e) return e;
19697  }
19698  if (p->_ImH) {
19699  e = (*v)(((PyObject *)p->_ImH), a); if (e) return e;
19700  }
19701  if (p->_D) {
19702  e = (*v)(((PyObject *)p->_D), a); if (e) return e;
19703  }
19704  return 0;
19705 }
19706 
19707 static int __pyx_tp_clear_22equivalent_polynomials_Simplex(PyObject *o) {
19708  PyObject* tmp;
19709  struct __pyx_obj_22equivalent_polynomials_Simplex *p = (struct __pyx_obj_22equivalent_polynomials_Simplex *)o;
19710  tmp = ((PyObject*)p->xiBuffer);
19711  p->xiBuffer = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
19712  Py_XDECREF(tmp);
19713  tmp = ((PyObject*)p->_H);
19714  p->_H = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
19715  Py_XDECREF(tmp);
19716  tmp = ((PyObject*)p->_ImH);
19717  p->_ImH = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
19718  Py_XDECREF(tmp);
19719  tmp = ((PyObject*)p->_D);
19720  p->_D = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
19721  Py_XDECREF(tmp);
19722  return 0;
19723 }
19724 
19725 static PyObject *__pyx_getprop_22equivalent_polynomials_7Simplex_H(PyObject *o, CYTHON_UNUSED void *x) {
19726  return __pyx_pw_22equivalent_polynomials_7Simplex_1H_1__get__(o);
19727 }
19728 
19729 static PyObject *__pyx_getprop_22equivalent_polynomials_7Simplex_ImH(PyObject *o, CYTHON_UNUSED void *x) {
19730  return __pyx_pw_22equivalent_polynomials_7Simplex_3ImH_1__get__(o);
19731 }
19732 
19733 static PyObject *__pyx_getprop_22equivalent_polynomials_7Simplex_D(PyObject *o, CYTHON_UNUSED void *x) {
19734  return __pyx_pw_22equivalent_polynomials_7Simplex_1D_1__get__(o);
19735 }
19736 
19737 static PyMethodDef __pyx_methods_22equivalent_polynomials_Simplex[] = {
19738  {"calculate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_22equivalent_polynomials_7Simplex_3calculate, METH_VARARGS|METH_KEYWORDS, 0},
19739  {"set_quad", (PyCFunction)__pyx_pw_22equivalent_polynomials_7Simplex_5set_quad, METH_O, 0},
19740  {"__reduce_cython__", (PyCFunction)__pyx_pw_22equivalent_polynomials_7Simplex_7__reduce_cython__, METH_NOARGS, 0},
19741  {"__setstate_cython__", (PyCFunction)__pyx_pw_22equivalent_polynomials_7Simplex_9__setstate_cython__, METH_O, 0},
19742  {0, 0, 0, 0}
19743 };
19744 
19745 static struct PyGetSetDef __pyx_getsets_22equivalent_polynomials_Simplex[] = {
19746  {(char *)"H", __pyx_getprop_22equivalent_polynomials_7Simplex_H, 0, (char *)0, 0},
19747  {(char *)"ImH", __pyx_getprop_22equivalent_polynomials_7Simplex_ImH, 0, (char *)0, 0},
19748  {(char *)"D", __pyx_getprop_22equivalent_polynomials_7Simplex_D, 0, (char *)0, 0},
19749  {0, 0, 0, 0, 0}
19750 };
19751 
19752 static PyTypeObject __pyx_type_22equivalent_polynomials_Simplex = {
19753  PyVarObject_HEAD_INIT(0, 0)
19754  "equivalent_polynomials.Simplex", /*tp_name*/
19755  sizeof(struct __pyx_obj_22equivalent_polynomials_Simplex), /*tp_basicsize*/
19756  0, /*tp_itemsize*/
19757  __pyx_tp_dealloc_22equivalent_polynomials_Simplex, /*tp_dealloc*/
19758  #if PY_VERSION_HEX < 0x030800b4
19759  0, /*tp_print*/
19760  #endif
19761  #if PY_VERSION_HEX >= 0x030800b4
19762  0, /*tp_vectorcall_offset*/
19763  #endif
19764  0, /*tp_getattr*/
19765  0, /*tp_setattr*/
19766  #if PY_MAJOR_VERSION < 3
19767  0, /*tp_compare*/
19768  #endif
19769  #if PY_MAJOR_VERSION >= 3
19770  0, /*tp_as_async*/
19771  #endif
19772  0, /*tp_repr*/
19773  0, /*tp_as_number*/
19774  0, /*tp_as_sequence*/
19775  0, /*tp_as_mapping*/
19776  0, /*tp_hash*/
19777  0, /*tp_call*/
19778  0, /*tp_str*/
19779  0, /*tp_getattro*/
19780  0, /*tp_setattro*/
19781  0, /*tp_as_buffer*/
19782  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
19783  0, /*tp_doc*/
19784  __pyx_tp_traverse_22equivalent_polynomials_Simplex, /*tp_traverse*/
19785  __pyx_tp_clear_22equivalent_polynomials_Simplex, /*tp_clear*/
19786  0, /*tp_richcompare*/
19787  0, /*tp_weaklistoffset*/
19788  0, /*tp_iter*/
19789  0, /*tp_iternext*/
19790  __pyx_methods_22equivalent_polynomials_Simplex, /*tp_methods*/
19791  0, /*tp_members*/
19792  __pyx_getsets_22equivalent_polynomials_Simplex, /*tp_getset*/
19793  0, /*tp_base*/
19794  0, /*tp_dict*/
19795  0, /*tp_descr_get*/
19796  0, /*tp_descr_set*/
19797  0, /*tp_dictoffset*/
19798  0, /*tp_init*/
19799  0, /*tp_alloc*/
19800  __pyx_tp_new_22equivalent_polynomials_Simplex, /*tp_new*/
19801  0, /*tp_free*/
19802  0, /*tp_is_gc*/
19803  0, /*tp_bases*/
19804  0, /*tp_mro*/
19805  0, /*tp_cache*/
19806  0, /*tp_subclasses*/
19807  0, /*tp_weaklist*/
19808  0, /*tp_del*/
19809  0, /*tp_version_tag*/
19810  #if PY_VERSION_HEX >= 0x030400a1
19811  0, /*tp_finalize*/
19812  #endif
19813  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
19814  0, /*tp_vectorcall*/
19815  #endif
19816  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
19817  0, /*tp_print*/
19818  #endif
19819  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
19820  0, /*tp_pypy_flags*/
19821  #endif
19822 };
19823 static struct __pyx_vtabstruct_array __pyx_vtable_array;
19824 
19825 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
19826  struct __pyx_array_obj *p;
19827  PyObject *o;
19828  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
19829  o = (*t->tp_alloc)(t, 0);
19830  } else {
19831  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
19832  }
19833  if (unlikely(!o)) return 0;
19834  p = ((struct __pyx_array_obj *)o);
19835  p->__pyx_vtab = __pyx_vtabptr_array;
19836  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
19837  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
19838  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
19839  return o;
19840  bad:
19841  Py_DECREF(o); o = 0;
19842  return NULL;
19843 }
19844 
19845 static void __pyx_tp_dealloc_array(PyObject *o) {
19846  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
19847  #if CYTHON_USE_TP_FINALIZE
19848  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))) {
19849  if (PyObject_CallFinalizerFromDealloc(o)) return;
19850  }
19851  #endif
19852  {
19853  PyObject *etype, *eval, *etb;
19854  PyErr_Fetch(&etype, &eval, &etb);
19855  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
19856  __pyx_array___dealloc__(o);
19857  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
19858  PyErr_Restore(etype, eval, etb);
19859  }
19860  Py_CLEAR(p->mode);
19861  Py_CLEAR(p->_format);
19862  (*Py_TYPE(o)->tp_free)(o);
19863 }
19864 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
19865  PyObject *r;
19866  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
19867  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
19868  Py_DECREF(x);
19869  return r;
19870 }
19871 
19872 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
19873  if (v) {
19874  return __pyx_array___setitem__(o, i, v);
19875  }
19876  else {
19877  PyErr_Format(PyExc_NotImplementedError,
19878  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
19879  return -1;
19880  }
19881 }
19882 
19883 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
19884  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
19885  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
19886  PyErr_Clear();
19887  v = __pyx_array___getattr__(o, n);
19888  }
19889  return v;
19890 }
19891 
19892 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
19893  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
19894 }
19895 
19896 static PyMethodDef __pyx_methods_array[] = {
19897  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
19898  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
19899  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
19900  {0, 0, 0, 0}
19901 };
19902 
19903 static struct PyGetSetDef __pyx_getsets_array[] = {
19904  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
19905  {0, 0, 0, 0, 0}
19906 };
19907 
19908 static PySequenceMethods __pyx_tp_as_sequence_array = {
19909  __pyx_array___len__, /*sq_length*/
19910  0, /*sq_concat*/
19911  0, /*sq_repeat*/
19912  __pyx_sq_item_array, /*sq_item*/
19913  0, /*sq_slice*/
19914  0, /*sq_ass_item*/
19915  0, /*sq_ass_slice*/
19916  0, /*sq_contains*/
19917  0, /*sq_inplace_concat*/
19918  0, /*sq_inplace_repeat*/
19919 };
19920 
19921 static PyMappingMethods __pyx_tp_as_mapping_array = {
19922  __pyx_array___len__, /*mp_length*/
19923  __pyx_array___getitem__, /*mp_subscript*/
19924  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
19925 };
19926 
19927 static PyBufferProcs __pyx_tp_as_buffer_array = {
19928  #if PY_MAJOR_VERSION < 3
19929  0, /*bf_getreadbuffer*/
19930  #endif
19931  #if PY_MAJOR_VERSION < 3
19932  0, /*bf_getwritebuffer*/
19933  #endif
19934  #if PY_MAJOR_VERSION < 3
19935  0, /*bf_getsegcount*/
19936  #endif
19937  #if PY_MAJOR_VERSION < 3
19938  0, /*bf_getcharbuffer*/
19939  #endif
19940  __pyx_array_getbuffer, /*bf_getbuffer*/
19941  0, /*bf_releasebuffer*/
19942 };
19943 
19944 static PyTypeObject __pyx_type___pyx_array = {
19945  PyVarObject_HEAD_INIT(0, 0)
19946  "equivalent_polynomials.array", /*tp_name*/
19947  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
19948  0, /*tp_itemsize*/
19949  __pyx_tp_dealloc_array, /*tp_dealloc*/
19950  #if PY_VERSION_HEX < 0x030800b4
19951  0, /*tp_print*/
19952  #endif
19953  #if PY_VERSION_HEX >= 0x030800b4
19954  0, /*tp_vectorcall_offset*/
19955  #endif
19956  0, /*tp_getattr*/
19957  0, /*tp_setattr*/
19958  #if PY_MAJOR_VERSION < 3
19959  0, /*tp_compare*/
19960  #endif
19961  #if PY_MAJOR_VERSION >= 3
19962  0, /*tp_as_async*/
19963  #endif
19964  0, /*tp_repr*/
19965  0, /*tp_as_number*/
19966  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
19967  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
19968  0, /*tp_hash*/
19969  0, /*tp_call*/
19970  0, /*tp_str*/
19971  __pyx_tp_getattro_array, /*tp_getattro*/
19972  0, /*tp_setattro*/
19973  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
19974  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
19975  0, /*tp_doc*/
19976  0, /*tp_traverse*/
19977  0, /*tp_clear*/
19978  0, /*tp_richcompare*/
19979  0, /*tp_weaklistoffset*/
19980  0, /*tp_iter*/
19981  0, /*tp_iternext*/
19982  __pyx_methods_array, /*tp_methods*/
19983  0, /*tp_members*/
19984  __pyx_getsets_array, /*tp_getset*/
19985  0, /*tp_base*/
19986  0, /*tp_dict*/
19987  0, /*tp_descr_get*/
19988  0, /*tp_descr_set*/
19989  0, /*tp_dictoffset*/
19990  0, /*tp_init*/
19991  0, /*tp_alloc*/
19992  __pyx_tp_new_array, /*tp_new*/
19993  0, /*tp_free*/
19994  0, /*tp_is_gc*/
19995  0, /*tp_bases*/
19996  0, /*tp_mro*/
19997  0, /*tp_cache*/
19998  0, /*tp_subclasses*/
19999  0, /*tp_weaklist*/
20000  0, /*tp_del*/
20001  0, /*tp_version_tag*/
20002  #if PY_VERSION_HEX >= 0x030400a1
20003  0, /*tp_finalize*/
20004  #endif
20005  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20006  0, /*tp_vectorcall*/
20007  #endif
20008  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20009  0, /*tp_print*/
20010  #endif
20011  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20012  0, /*tp_pypy_flags*/
20013  #endif
20014 };
20015 
20016 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20017  struct __pyx_MemviewEnum_obj *p;
20018  PyObject *o;
20019  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20020  o = (*t->tp_alloc)(t, 0);
20021  } else {
20022  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20023  }
20024  if (unlikely(!o)) return 0;
20025  p = ((struct __pyx_MemviewEnum_obj *)o);
20026  p->name = Py_None; Py_INCREF(Py_None);
20027  return o;
20028 }
20029 
20030 static void __pyx_tp_dealloc_Enum(PyObject *o) {
20031  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
20032  #if CYTHON_USE_TP_FINALIZE
20033  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20034  if (PyObject_CallFinalizerFromDealloc(o)) return;
20035  }
20036  #endif
20037  PyObject_GC_UnTrack(o);
20038  Py_CLEAR(p->name);
20039  (*Py_TYPE(o)->tp_free)(o);
20040 }
20041 
20042 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
20043  int e;
20044  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
20045  if (p->name) {
20046  e = (*v)(p->name, a); if (e) return e;
20047  }
20048  return 0;
20049 }
20050 
20051 static int __pyx_tp_clear_Enum(PyObject *o) {
20052  PyObject* tmp;
20053  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
20054  tmp = ((PyObject*)p->name);
20055  p->name = Py_None; Py_INCREF(Py_None);
20056  Py_XDECREF(tmp);
20057  return 0;
20058 }
20059 
20060 static PyMethodDef __pyx_methods_Enum[] = {
20061  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
20062  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
20063  {0, 0, 0, 0}
20064 };
20065 
20066 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
20067  PyVarObject_HEAD_INIT(0, 0)
20068  "equivalent_polynomials.Enum", /*tp_name*/
20069  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
20070  0, /*tp_itemsize*/
20071  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
20072  #if PY_VERSION_HEX < 0x030800b4
20073  0, /*tp_print*/
20074  #endif
20075  #if PY_VERSION_HEX >= 0x030800b4
20076  0, /*tp_vectorcall_offset*/
20077  #endif
20078  0, /*tp_getattr*/
20079  0, /*tp_setattr*/
20080  #if PY_MAJOR_VERSION < 3
20081  0, /*tp_compare*/
20082  #endif
20083  #if PY_MAJOR_VERSION >= 3
20084  0, /*tp_as_async*/
20085  #endif
20086  __pyx_MemviewEnum___repr__, /*tp_repr*/
20087  0, /*tp_as_number*/
20088  0, /*tp_as_sequence*/
20089  0, /*tp_as_mapping*/
20090  0, /*tp_hash*/
20091  0, /*tp_call*/
20092  0, /*tp_str*/
20093  0, /*tp_getattro*/
20094  0, /*tp_setattro*/
20095  0, /*tp_as_buffer*/
20096  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20097  0, /*tp_doc*/
20098  __pyx_tp_traverse_Enum, /*tp_traverse*/
20099  __pyx_tp_clear_Enum, /*tp_clear*/
20100  0, /*tp_richcompare*/
20101  0, /*tp_weaklistoffset*/
20102  0, /*tp_iter*/
20103  0, /*tp_iternext*/
20104  __pyx_methods_Enum, /*tp_methods*/
20105  0, /*tp_members*/
20106  0, /*tp_getset*/
20107  0, /*tp_base*/
20108  0, /*tp_dict*/
20109  0, /*tp_descr_get*/
20110  0, /*tp_descr_set*/
20111  0, /*tp_dictoffset*/
20112  __pyx_MemviewEnum___init__, /*tp_init*/
20113  0, /*tp_alloc*/
20114  __pyx_tp_new_Enum, /*tp_new*/
20115  0, /*tp_free*/
20116  0, /*tp_is_gc*/
20117  0, /*tp_bases*/
20118  0, /*tp_mro*/
20119  0, /*tp_cache*/
20120  0, /*tp_subclasses*/
20121  0, /*tp_weaklist*/
20122  0, /*tp_del*/
20123  0, /*tp_version_tag*/
20124  #if PY_VERSION_HEX >= 0x030400a1
20125  0, /*tp_finalize*/
20126  #endif
20127  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20128  0, /*tp_vectorcall*/
20129  #endif
20130  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20131  0, /*tp_print*/
20132  #endif
20133  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20134  0, /*tp_pypy_flags*/
20135  #endif
20136 };
20137 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
20138 
20139 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
20140  struct __pyx_memoryview_obj *p;
20141  PyObject *o;
20142  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20143  o = (*t->tp_alloc)(t, 0);
20144  } else {
20145  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20146  }
20147  if (unlikely(!o)) return 0;
20148  p = ((struct __pyx_memoryview_obj *)o);
20149  p->__pyx_vtab = __pyx_vtabptr_memoryview;
20150  p->obj = Py_None; Py_INCREF(Py_None);
20151  p->_size = Py_None; Py_INCREF(Py_None);
20152  p->_array_interface = Py_None; Py_INCREF(Py_None);
20153  p->view.obj = NULL;
20154  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
20155  return o;
20156  bad:
20157  Py_DECREF(o); o = 0;
20158  return NULL;
20159 }
20160 
20161 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
20162  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
20163  #if CYTHON_USE_TP_FINALIZE
20164  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20165  if (PyObject_CallFinalizerFromDealloc(o)) return;
20166  }
20167  #endif
20168  PyObject_GC_UnTrack(o);
20169  {
20170  PyObject *etype, *eval, *etb;
20171  PyErr_Fetch(&etype, &eval, &etb);
20172  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20173  __pyx_memoryview___dealloc__(o);
20174  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20175  PyErr_Restore(etype, eval, etb);
20176  }
20177  Py_CLEAR(p->obj);
20178  Py_CLEAR(p->_size);
20179  Py_CLEAR(p->_array_interface);
20180  (*Py_TYPE(o)->tp_free)(o);
20181 }
20182 
20183 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
20184  int e;
20185  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
20186  if (p->obj) {
20187  e = (*v)(p->obj, a); if (e) return e;
20188  }
20189  if (p->_size) {
20190  e = (*v)(p->_size, a); if (e) return e;
20191  }
20192  if (p->_array_interface) {
20193  e = (*v)(p->_array_interface, a); if (e) return e;
20194  }
20195  if (p->view.obj) {
20196  e = (*v)(p->view.obj, a); if (e) return e;
20197  }
20198  return 0;
20199 }
20200 
20201 static int __pyx_tp_clear_memoryview(PyObject *o) {
20202  PyObject* tmp;
20203  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
20204  tmp = ((PyObject*)p->obj);
20205  p->obj = Py_None; Py_INCREF(Py_None);
20206  Py_XDECREF(tmp);
20207  tmp = ((PyObject*)p->_size);
20208  p->_size = Py_None; Py_INCREF(Py_None);
20209  Py_XDECREF(tmp);
20210  tmp = ((PyObject*)p->_array_interface);
20211  p->_array_interface = Py_None; Py_INCREF(Py_None);
20212  Py_XDECREF(tmp);
20213  Py_CLEAR(p->view.obj);
20214  return 0;
20215 }
20216 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
20217  PyObject *r;
20218  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
20219  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
20220  Py_DECREF(x);
20221  return r;
20222 }
20223 
20224 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
20225  if (v) {
20226  return __pyx_memoryview___setitem__(o, i, v);
20227  }
20228  else {
20229  PyErr_Format(PyExc_NotImplementedError,
20230  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
20231  return -1;
20232  }
20233 }
20234 
20235 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
20236  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
20237 }
20238 
20239 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
20240  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
20241 }
20242 
20243 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
20244  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
20245 }
20246 
20247 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
20248  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
20249 }
20250 
20251 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
20252  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
20253 }
20254 
20255 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
20256  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
20257 }
20258 
20259 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
20260  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
20261 }
20262 
20263 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
20264  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
20265 }
20266 
20267 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
20268  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
20269 }
20270 
20271 static PyMethodDef __pyx_methods_memoryview[] = {
20272  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
20273  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
20274  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
20275  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
20276  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
20277  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
20278  {0, 0, 0, 0}
20279 };
20280 
20281 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
20282  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
20283  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
20284  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
20285  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
20286  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
20287  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
20288  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
20289  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
20290  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
20291  {0, 0, 0, 0, 0}
20292 };
20293 
20294 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
20295  __pyx_memoryview___len__, /*sq_length*/
20296  0, /*sq_concat*/
20297  0, /*sq_repeat*/
20298  __pyx_sq_item_memoryview, /*sq_item*/
20299  0, /*sq_slice*/
20300  0, /*sq_ass_item*/
20301  0, /*sq_ass_slice*/
20302  0, /*sq_contains*/
20303  0, /*sq_inplace_concat*/
20304  0, /*sq_inplace_repeat*/
20305 };
20306 
20307 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
20308  __pyx_memoryview___len__, /*mp_length*/
20309  __pyx_memoryview___getitem__, /*mp_subscript*/
20310  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
20311 };
20312 
20313 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
20314  #if PY_MAJOR_VERSION < 3
20315  0, /*bf_getreadbuffer*/
20316  #endif
20317  #if PY_MAJOR_VERSION < 3
20318  0, /*bf_getwritebuffer*/
20319  #endif
20320  #if PY_MAJOR_VERSION < 3
20321  0, /*bf_getsegcount*/
20322  #endif
20323  #if PY_MAJOR_VERSION < 3
20324  0, /*bf_getcharbuffer*/
20325  #endif
20326  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
20327  0, /*bf_releasebuffer*/
20328 };
20329 
20330 static PyTypeObject __pyx_type___pyx_memoryview = {
20331  PyVarObject_HEAD_INIT(0, 0)
20332  "equivalent_polynomials.memoryview", /*tp_name*/
20333  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
20334  0, /*tp_itemsize*/
20335  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
20336  #if PY_VERSION_HEX < 0x030800b4
20337  0, /*tp_print*/
20338  #endif
20339  #if PY_VERSION_HEX >= 0x030800b4
20340  0, /*tp_vectorcall_offset*/
20341  #endif
20342  0, /*tp_getattr*/
20343  0, /*tp_setattr*/
20344  #if PY_MAJOR_VERSION < 3
20345  0, /*tp_compare*/
20346  #endif
20347  #if PY_MAJOR_VERSION >= 3
20348  0, /*tp_as_async*/
20349  #endif
20350  __pyx_memoryview___repr__, /*tp_repr*/
20351  0, /*tp_as_number*/
20352  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
20353  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
20354  0, /*tp_hash*/
20355  0, /*tp_call*/
20356  __pyx_memoryview___str__, /*tp_str*/
20357  0, /*tp_getattro*/
20358  0, /*tp_setattro*/
20359  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
20360  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20361  0, /*tp_doc*/
20362  __pyx_tp_traverse_memoryview, /*tp_traverse*/
20363  __pyx_tp_clear_memoryview, /*tp_clear*/
20364  0, /*tp_richcompare*/
20365  0, /*tp_weaklistoffset*/
20366  0, /*tp_iter*/
20367  0, /*tp_iternext*/
20368  __pyx_methods_memoryview, /*tp_methods*/
20369  0, /*tp_members*/
20370  __pyx_getsets_memoryview, /*tp_getset*/
20371  0, /*tp_base*/
20372  0, /*tp_dict*/
20373  0, /*tp_descr_get*/
20374  0, /*tp_descr_set*/
20375  0, /*tp_dictoffset*/
20376  0, /*tp_init*/
20377  0, /*tp_alloc*/
20378  __pyx_tp_new_memoryview, /*tp_new*/
20379  0, /*tp_free*/
20380  0, /*tp_is_gc*/
20381  0, /*tp_bases*/
20382  0, /*tp_mro*/
20383  0, /*tp_cache*/
20384  0, /*tp_subclasses*/
20385  0, /*tp_weaklist*/
20386  0, /*tp_del*/
20387  0, /*tp_version_tag*/
20388  #if PY_VERSION_HEX >= 0x030400a1
20389  0, /*tp_finalize*/
20390  #endif
20391  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20392  0, /*tp_vectorcall*/
20393  #endif
20394  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20395  0, /*tp_print*/
20396  #endif
20397  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20398  0, /*tp_pypy_flags*/
20399  #endif
20400 };
20401 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
20402 
20403 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
20404  struct __pyx_memoryviewslice_obj *p;
20405  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
20406  if (unlikely(!o)) return 0;
20407  p = ((struct __pyx_memoryviewslice_obj *)o);
20408  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
20409  p->from_object = Py_None; Py_INCREF(Py_None);
20410  p->from_slice.memview = NULL;
20411  return o;
20412 }
20413 
20414 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
20415  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
20416  #if CYTHON_USE_TP_FINALIZE
20417  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20418  if (PyObject_CallFinalizerFromDealloc(o)) return;
20419  }
20420  #endif
20421  PyObject_GC_UnTrack(o);
20422  {
20423  PyObject *etype, *eval, *etb;
20424  PyErr_Fetch(&etype, &eval, &etb);
20425  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
20426  __pyx_memoryviewslice___dealloc__(o);
20427  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
20428  PyErr_Restore(etype, eval, etb);
20429  }
20430  Py_CLEAR(p->from_object);
20431  PyObject_GC_Track(o);
20432  __pyx_tp_dealloc_memoryview(o);
20433 }
20434 
20435 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
20436  int e;
20437  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
20438  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
20439  if (p->from_object) {
20440  e = (*v)(p->from_object, a); if (e) return e;
20441  }
20442  return 0;
20443 }
20444 
20445 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
20446  PyObject* tmp;
20447  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
20448  __pyx_tp_clear_memoryview(o);
20449  tmp = ((PyObject*)p->from_object);
20450  p->from_object = Py_None; Py_INCREF(Py_None);
20451  Py_XDECREF(tmp);
20452  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
20453  return 0;
20454 }
20455 
20456 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
20457  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
20458 }
20459 
20460 static PyMethodDef __pyx_methods__memoryviewslice[] = {
20461  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
20462  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
20463  {0, 0, 0, 0}
20464 };
20465 
20466 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
20467  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
20468  {0, 0, 0, 0, 0}
20469 };
20470 
20471 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
20472  PyVarObject_HEAD_INIT(0, 0)
20473  "equivalent_polynomials._memoryviewslice", /*tp_name*/
20474  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
20475  0, /*tp_itemsize*/
20476  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
20477  #if PY_VERSION_HEX < 0x030800b4
20478  0, /*tp_print*/
20479  #endif
20480  #if PY_VERSION_HEX >= 0x030800b4
20481  0, /*tp_vectorcall_offset*/
20482  #endif
20483  0, /*tp_getattr*/
20484  0, /*tp_setattr*/
20485  #if PY_MAJOR_VERSION < 3
20486  0, /*tp_compare*/
20487  #endif
20488  #if PY_MAJOR_VERSION >= 3
20489  0, /*tp_as_async*/
20490  #endif
20491  #if CYTHON_COMPILING_IN_PYPY
20492  __pyx_memoryview___repr__, /*tp_repr*/
20493  #else
20494  0, /*tp_repr*/
20495  #endif
20496  0, /*tp_as_number*/
20497  0, /*tp_as_sequence*/
20498  0, /*tp_as_mapping*/
20499  0, /*tp_hash*/
20500  0, /*tp_call*/
20501  #if CYTHON_COMPILING_IN_PYPY
20502  __pyx_memoryview___str__, /*tp_str*/
20503  #else
20504  0, /*tp_str*/
20505  #endif
20506  0, /*tp_getattro*/
20507  0, /*tp_setattro*/
20508  0, /*tp_as_buffer*/
20509  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20510  "Internal class for passing memoryview slices to Python", /*tp_doc*/
20511  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
20512  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
20513  0, /*tp_richcompare*/
20514  0, /*tp_weaklistoffset*/
20515  0, /*tp_iter*/
20516  0, /*tp_iternext*/
20517  __pyx_methods__memoryviewslice, /*tp_methods*/
20518  0, /*tp_members*/
20519  __pyx_getsets__memoryviewslice, /*tp_getset*/
20520  0, /*tp_base*/
20521  0, /*tp_dict*/
20522  0, /*tp_descr_get*/
20523  0, /*tp_descr_set*/
20524  0, /*tp_dictoffset*/
20525  0, /*tp_init*/
20526  0, /*tp_alloc*/
20527  __pyx_tp_new__memoryviewslice, /*tp_new*/
20528  0, /*tp_free*/
20529  0, /*tp_is_gc*/
20530  0, /*tp_bases*/
20531  0, /*tp_mro*/
20532  0, /*tp_cache*/
20533  0, /*tp_subclasses*/
20534  0, /*tp_weaklist*/
20535  0, /*tp_del*/
20536  0, /*tp_version_tag*/
20537  #if PY_VERSION_HEX >= 0x030400a1
20538  0, /*tp_finalize*/
20539  #endif
20540  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20541  0, /*tp_vectorcall*/
20542  #endif
20543  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20544  0, /*tp_print*/
20545  #endif
20546  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20547  0, /*tp_pypy_flags*/
20548  #endif
20549 };
20550 
20551 static PyMethodDef __pyx_methods[] = {
20552  {0, 0, 0, 0}
20553 };
20554 
20555 #if PY_MAJOR_VERSION >= 3
20556 #if CYTHON_PEP489_MULTI_PHASE_INIT
20557 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
20558 static int __pyx_pymod_exec_equivalent_polynomials(PyObject* module); /*proto*/
20559 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
20560  {Py_mod_create, (void*)__pyx_pymod_create},
20561  {Py_mod_exec, (void*)__pyx_pymod_exec_equivalent_polynomials},
20562  {0, NULL}
20563 };
20564 #endif
20565 
20566 static struct PyModuleDef __pyx_moduledef = {
20567  PyModuleDef_HEAD_INIT,
20568  "equivalent_polynomials",
20569  0, /* m_doc */
20570  #if CYTHON_PEP489_MULTI_PHASE_INIT
20571  0, /* m_size */
20572  #else
20573  -1, /* m_size */
20574  #endif
20575  __pyx_methods /* m_methods */,
20576  #if CYTHON_PEP489_MULTI_PHASE_INIT
20577  __pyx_moduledef_slots, /* m_slots */
20578  #else
20579  NULL, /* m_reload */
20580  #endif
20581  NULL, /* m_traverse */
20582  NULL, /* m_clear */
20583  NULL /* m_free */
20584 };
20585 #endif
20586 #ifndef CYTHON_SMALL_CODE
20587 #if defined(__clang__)
20588  #define CYTHON_SMALL_CODE
20589 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
20590  #define CYTHON_SMALL_CODE __attribute__((cold))
20591 #else
20592  #define CYTHON_SMALL_CODE
20593 #endif
20594 #endif
20595 
20596 static __Pyx_StringTabEntry __pyx_string_tab[] = {
20597  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
20598  {&__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},
20599  {&__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},
20600  {&__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},
20601  {&__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},
20602  {&__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},
20603  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
20604  {&__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},
20605  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
20606  {&__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},
20607  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
20608  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
20609  {&__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},
20610  {&__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},
20611  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
20612  {&__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},
20613  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
20614  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
20615  {&__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},
20616  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
20617  {&__pyx_n_s_Simplex, __pyx_k_Simplex, sizeof(__pyx_k_Simplex), 0, 0, 1, 1},
20618  {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 0},
20619  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
20620  {&__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},
20621  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
20622  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
20623  {&__pyx_kp_b__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 0, 0, 0},
20624  {&__pyx_kp_b__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 0, 0, 0},
20625  {&__pyx_kp_b__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 0, 0, 0},
20626  {&__pyx_kp_b__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 0, 0, 0},
20627  {&__pyx_kp_u__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 1, 0, 0},
20628  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
20629  {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
20630  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
20631  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
20632  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
20633  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
20634  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
20635  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
20636  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
20637  {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
20638  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
20639  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
20640  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
20641  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
20642  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
20643  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
20644  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
20645  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
20646  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
20647  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
20648  {&__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},
20649  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
20650  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
20651  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
20652  {&__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},
20653  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
20654  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
20655  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
20656  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
20657  {&__pyx_n_s_nP, __pyx_k_nP, sizeof(__pyx_k_nP), 0, 0, 1, 1},
20658  {&__pyx_n_s_nQ, __pyx_k_nQ, sizeof(__pyx_k_nQ), 0, 0, 1, 1},
20659  {&__pyx_n_s_nSpace, __pyx_k_nSpace, sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
20660  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
20661  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
20662  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
20663  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
20664  {&__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},
20665  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
20666  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
20667  {&__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},
20668  {&__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},
20669  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
20670  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
20671  {&__pyx_n_s_phi_dof, __pyx_k_phi_dof, sizeof(__pyx_k_phi_dof), 0, 0, 1, 1},
20672  {&__pyx_n_s_phi_nodes, __pyx_k_phi_nodes, sizeof(__pyx_k_phi_nodes), 0, 0, 1, 1},
20673  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
20674  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
20675  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
20676  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
20677  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
20678  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
20679  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
20680  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
20681  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
20682  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
20683  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
20684  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
20685  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
20686  {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
20687  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
20688  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
20689  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
20690  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
20691  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
20692  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
20693  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
20694  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
20695  {&__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},
20696  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
20697  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
20698  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
20699  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
20700  {&__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},
20701  {&__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},
20702  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
20703  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
20704  {&__pyx_n_s_xi, __pyx_k_xi, sizeof(__pyx_k_xi), 0, 0, 1, 1},
20705  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
20706  {0, 0, 0, 0, 0, 0, 0}
20707 };
20708 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
20709  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
20710  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
20711  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 133, __pyx_L1_error)
20712  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 148, __pyx_L1_error)
20713  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 151, __pyx_L1_error)
20714  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 180, __pyx_L1_error)
20715  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(0, 404, __pyx_L1_error)
20716  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 613, __pyx_L1_error)
20717  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 832, __pyx_L1_error)
20718  return 0;
20719  __pyx_L1_error:;
20720  return -1;
20721 }
20722 
20723 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
20724  __Pyx_RefNannyDeclarations
20725  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
20726 
20727  /* "equivalent_polynomials.pyx":44
20728  * cdef eqp.cSimplex[nSpace3T,nP3T,nQT,nEBQT] s33
20729  * def __cinit__(self, nSpace, nP, nQ):
20730  * self.xiBuffer=np.zeros((50,3),'d') # <<<<<<<<<<<<<<
20731  * self.nSpace = nSpace
20732  * self.nP = nP
20733  */
20734  __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_50, __pyx_int_3); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 44, __pyx_L1_error)
20735  __Pyx_GOTREF(__pyx_tuple_);
20736  __Pyx_GIVEREF(__pyx_tuple_);
20737  __pyx_tuple__2 = PyTuple_Pack(2, __pyx_tuple_, __pyx_n_s_d); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 44, __pyx_L1_error)
20738  __Pyx_GOTREF(__pyx_tuple__2);
20739  __Pyx_GIVEREF(__pyx_tuple__2);
20740 
20741  /* "equivalent_polynomials.pyx":52
20742  * def calculate(self, np.ndarray phi_dof, np.ndarray phi_nodes, np.ndarray xi):
20743  * self.xiBuffer[:xi.shape[0]]=xi
20744  * if (self.nSpace,self.nP) == (1,1): # <<<<<<<<<<<<<<
20745  * icase = self.s11.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
20746  * self._H = np.asarray(<double[:self.nQ]>self.s11.get_H())
20747  */
20748  __pyx_tuple__3 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 52, __pyx_L1_error)
20749  __Pyx_GOTREF(__pyx_tuple__3);
20750  __Pyx_GIVEREF(__pyx_tuple__3);
20751 
20752  /* "equivalent_polynomials.pyx":58
20753  * self._D = np.asarray(<double[:self.nQ]>self.s11.get_D())
20754  * self.inside_out = self.s11.inside_out
20755  * elif (self.nSpace,self.nP) == (1,2): # <<<<<<<<<<<<<<
20756  * icase = self.s12.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
20757  * self._H = np.asarray(<double[:self.nQ]>self.s12.get_H())
20758  */
20759  __pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_2); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 58, __pyx_L1_error)
20760  __Pyx_GOTREF(__pyx_tuple__4);
20761  __Pyx_GIVEREF(__pyx_tuple__4);
20762 
20763  /* "equivalent_polynomials.pyx":64
20764  * self._D = np.asarray(<double[:self.nQ]>self.s12.get_D())
20765  * self.inside_out = self.s12.inside_out
20766  * elif (self.nSpace,self.nP) == (1,3): # <<<<<<<<<<<<<<
20767  * icase = self.s13.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
20768  * self._H = np.asarray(<double[:self.nQ]>self.s13.get_H())
20769  */
20770  __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_3); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 64, __pyx_L1_error)
20771  __Pyx_GOTREF(__pyx_tuple__5);
20772  __Pyx_GIVEREF(__pyx_tuple__5);
20773 
20774  /* "equivalent_polynomials.pyx":70
20775  * self._D = np.asarray(<double[:self.nQ]>self.s13.get_D())
20776  * self.inside_out = self.s13.inside_out
20777  * elif (self.nSpace,self.nP) == (2,1): # <<<<<<<<<<<<<<
20778  * icase = self.s21.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
20779  * self._H = np.asarray(<double[:self.nQ]>self.s21.get_H())
20780  */
20781  __pyx_tuple__6 = PyTuple_Pack(2, __pyx_int_2, __pyx_int_1); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 70, __pyx_L1_error)
20782  __Pyx_GOTREF(__pyx_tuple__6);
20783  __Pyx_GIVEREF(__pyx_tuple__6);
20784 
20785  /* "equivalent_polynomials.pyx":76
20786  * self._D = np.asarray(<double[:self.nQ]>self.s21.get_D())
20787  * self.inside_out = self.s21.inside_out
20788  * elif (self.nSpace,self.nP) == (2,2): # <<<<<<<<<<<<<<
20789  * icase = self.s22.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
20790  * self._H = np.asarray(<double[:self.nQ]>self.s22.get_H())
20791  */
20792  __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_2, __pyx_int_2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 76, __pyx_L1_error)
20793  __Pyx_GOTREF(__pyx_tuple__7);
20794  __Pyx_GIVEREF(__pyx_tuple__7);
20795 
20796  /* "equivalent_polynomials.pyx":82
20797  * self._D = np.asarray(<double[:self.nQ]>self.s22.get_D())
20798  * self.inside_out = self.s22.inside_out
20799  * elif (self.nSpace,self.nP) == (2,3): # <<<<<<<<<<<<<<
20800  * icase = self.s23.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
20801  * self._H = np.asarray(<double[:self.nQ]>self.s23.get_H())
20802  */
20803  __pyx_tuple__8 = PyTuple_Pack(2, __pyx_int_2, __pyx_int_3); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 82, __pyx_L1_error)
20804  __Pyx_GOTREF(__pyx_tuple__8);
20805  __Pyx_GIVEREF(__pyx_tuple__8);
20806 
20807  /* "equivalent_polynomials.pyx":88
20808  * self._D = np.asarray(<double[:self.nQ]>self.s23.get_D())
20809  * self.inside_out = self.s23.inside_out
20810  * if (self.nSpace,self.nP) == (3,1): # <<<<<<<<<<<<<<
20811  * icase = self.s31.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
20812  * self._H = np.asarray(<double[:self.nQ]>self.s31.get_H())
20813  */
20814  __pyx_tuple__9 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_1); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 88, __pyx_L1_error)
20815  __Pyx_GOTREF(__pyx_tuple__9);
20816  __Pyx_GIVEREF(__pyx_tuple__9);
20817 
20818  /* "equivalent_polynomials.pyx":94
20819  * self._D = np.asarray(<double[:self.nQ]>self.s31.get_D())
20820  * self.inside_out = self.s31.inside_out
20821  * elif (self.nSpace,self.nP) == (3,2): # <<<<<<<<<<<<<<
20822  * icase = self.s32.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
20823  * self._H = np.asarray(<double[:self.nQ]>self.s32.get_H())
20824  */
20825  __pyx_tuple__10 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 94, __pyx_L1_error)
20826  __Pyx_GOTREF(__pyx_tuple__10);
20827  __Pyx_GIVEREF(__pyx_tuple__10);
20828 
20829  /* "equivalent_polynomials.pyx":100
20830  * self._D = np.asarray(<double[:self.nQ]>self.s32.get_D())
20831  * self.inside_out = self.s32.inside_out
20832  * elif (self.nSpace,self.nP) == (3,3): # <<<<<<<<<<<<<<
20833  * icase = self.s33.calculate(<double*>(phi_dof.data), <double*>(phi_nodes.data), <double*>(self.xiBuffer.data),False)
20834  * self._H = np.asarray(<double[:self.nQ]>self.s33.get_H())
20835  */
20836  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 100, __pyx_L1_error)
20837  __Pyx_GOTREF(__pyx_tuple__11);
20838  __Pyx_GIVEREF(__pyx_tuple__11);
20839 
20840  /* "(tree fragment)":2
20841  * def __reduce_cython__(self):
20842  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
20843  * def __setstate_cython__(self, __pyx_state):
20844  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20845  */
20846  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 2, __pyx_L1_error)
20847  __Pyx_GOTREF(__pyx_tuple__12);
20848  __Pyx_GIVEREF(__pyx_tuple__12);
20849 
20850  /* "(tree fragment)":4
20851  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20852  * def __setstate_cython__(self, __pyx_state):
20853  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
20854  */
20855  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 4, __pyx_L1_error)
20856  __Pyx_GOTREF(__pyx_tuple__13);
20857  __Pyx_GIVEREF(__pyx_tuple__13);
20858 
20859  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
20860  * __pyx_import_array()
20861  * except Exception:
20862  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
20863  *
20864  * cdef inline int import_umath() except -1:
20865  */
20866  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 945, __pyx_L1_error)
20867  __Pyx_GOTREF(__pyx_tuple__14);
20868  __Pyx_GIVEREF(__pyx_tuple__14);
20869 
20870  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
20871  * _import_umath()
20872  * except Exception:
20873  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
20874  *
20875  * cdef inline int import_ufunc() except -1:
20876  */
20877  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 951, __pyx_L1_error)
20878  __Pyx_GOTREF(__pyx_tuple__15);
20879  __Pyx_GIVEREF(__pyx_tuple__15);
20880 
20881  /* "View.MemoryView":133
20882  *
20883  * if not self.ndim:
20884  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
20885  *
20886  * if itemsize <= 0:
20887  */
20888  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 133, __pyx_L1_error)
20889  __Pyx_GOTREF(__pyx_tuple__16);
20890  __Pyx_GIVEREF(__pyx_tuple__16);
20891 
20892  /* "View.MemoryView":136
20893  *
20894  * if itemsize <= 0:
20895  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
20896  *
20897  * if not isinstance(format, bytes):
20898  */
20899  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 136, __pyx_L1_error)
20900  __Pyx_GOTREF(__pyx_tuple__17);
20901  __Pyx_GIVEREF(__pyx_tuple__17);
20902 
20903  /* "View.MemoryView":148
20904  *
20905  * if not self._shape:
20906  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
20907  *
20908  *
20909  */
20910  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 148, __pyx_L1_error)
20911  __Pyx_GOTREF(__pyx_tuple__18);
20912  __Pyx_GIVEREF(__pyx_tuple__18);
20913 
20914  /* "View.MemoryView":176
20915  * self.data = <char *>malloc(self.len)
20916  * if not self.data:
20917  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
20918  *
20919  * if self.dtype_is_object:
20920  */
20921  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 176, __pyx_L1_error)
20922  __Pyx_GOTREF(__pyx_tuple__19);
20923  __Pyx_GIVEREF(__pyx_tuple__19);
20924 
20925  /* "View.MemoryView":192
20926  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
20927  * if not (flags & bufmode):
20928  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
20929  * info.buf = self.data
20930  * info.len = self.len
20931  */
20932  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 192, __pyx_L1_error)
20933  __Pyx_GOTREF(__pyx_tuple__20);
20934  __Pyx_GIVEREF(__pyx_tuple__20);
20935 
20936  /* "(tree fragment)":2
20937  * def __reduce_cython__(self):
20938  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
20939  * def __setstate_cython__(self, __pyx_state):
20940  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20941  */
20942  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 2, __pyx_L1_error)
20943  __Pyx_GOTREF(__pyx_tuple__21);
20944  __Pyx_GIVEREF(__pyx_tuple__21);
20945 
20946  /* "(tree fragment)":4
20947  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20948  * def __setstate_cython__(self, __pyx_state):
20949  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
20950  */
20951  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 4, __pyx_L1_error)
20952  __Pyx_GOTREF(__pyx_tuple__22);
20953  __Pyx_GIVEREF(__pyx_tuple__22);
20954 
20955  /* "View.MemoryView":418
20956  * def __setitem__(memoryview self, object index, object value):
20957  * if self.view.readonly:
20958  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
20959  *
20960  * have_slices, index = _unellipsify(index, self.view.ndim)
20961  */
20962  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 418, __pyx_L1_error)
20963  __Pyx_GOTREF(__pyx_tuple__23);
20964  __Pyx_GIVEREF(__pyx_tuple__23);
20965 
20966  /* "View.MemoryView":495
20967  * result = struct.unpack(self.view.format, bytesitem)
20968  * except struct.error:
20969  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
20970  * else:
20971  * if len(self.view.format) == 1:
20972  */
20973  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 495, __pyx_L1_error)
20974  __Pyx_GOTREF(__pyx_tuple__24);
20975  __Pyx_GIVEREF(__pyx_tuple__24);
20976 
20977  /* "View.MemoryView":520
20978  * def __getbuffer__(self, Py_buffer *info, int flags):
20979  * if flags & PyBUF_WRITABLE and self.view.readonly:
20980  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
20981  *
20982  * if flags & PyBUF_ND:
20983  */
20984  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 520, __pyx_L1_error)
20985  __Pyx_GOTREF(__pyx_tuple__25);
20986  __Pyx_GIVEREF(__pyx_tuple__25);
20987 
20988  /* "View.MemoryView":570
20989  * if self.view.strides == NULL:
20990  *
20991  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
20992  *
20993  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
20994  */
20995  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 570, __pyx_L1_error)
20996  __Pyx_GOTREF(__pyx_tuple__26);
20997  __Pyx_GIVEREF(__pyx_tuple__26);
20998 
20999  /* "View.MemoryView":577
21000  * def suboffsets(self):
21001  * if self.view.suboffsets == NULL:
21002  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
21003  *
21004  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
21005  */
21006  __pyx_tuple__27 = PyTuple_New(1); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 577, __pyx_L1_error)
21007  __Pyx_GOTREF(__pyx_tuple__27);
21008  __Pyx_INCREF(__pyx_int_neg_1);
21009  __Pyx_GIVEREF(__pyx_int_neg_1);
21010  PyTuple_SET_ITEM(__pyx_tuple__27, 0, __pyx_int_neg_1);
21011  __Pyx_GIVEREF(__pyx_tuple__27);
21012 
21013  /* "(tree fragment)":2
21014  * def __reduce_cython__(self):
21015  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21016  * def __setstate_cython__(self, __pyx_state):
21017  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21018  */
21019  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 2, __pyx_L1_error)
21020  __Pyx_GOTREF(__pyx_tuple__28);
21021  __Pyx_GIVEREF(__pyx_tuple__28);
21022 
21023  /* "(tree fragment)":4
21024  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21025  * def __setstate_cython__(self, __pyx_state):
21026  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21027  */
21028  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 4, __pyx_L1_error)
21029  __Pyx_GOTREF(__pyx_tuple__29);
21030  __Pyx_GIVEREF(__pyx_tuple__29);
21031 
21032  /* "View.MemoryView":682
21033  * if item is Ellipsis:
21034  * if not seen_ellipsis:
21035  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
21036  * seen_ellipsis = True
21037  * else:
21038  */
21039  __pyx_slice__30 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__30)) __PYX_ERR(0, 682, __pyx_L1_error)
21040  __Pyx_GOTREF(__pyx_slice__30);
21041  __Pyx_GIVEREF(__pyx_slice__30);
21042 
21043  /* "View.MemoryView":703
21044  * for suboffset in suboffsets[:ndim]:
21045  * if suboffset >= 0:
21046  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
21047  *
21048  *
21049  */
21050  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 703, __pyx_L1_error)
21051  __Pyx_GOTREF(__pyx_tuple__31);
21052  __Pyx_GIVEREF(__pyx_tuple__31);
21053 
21054  /* "(tree fragment)":2
21055  * def __reduce_cython__(self):
21056  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21057  * def __setstate_cython__(self, __pyx_state):
21058  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21059  */
21060  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2, __pyx_L1_error)
21061  __Pyx_GOTREF(__pyx_tuple__32);
21062  __Pyx_GIVEREF(__pyx_tuple__32);
21063 
21064  /* "(tree fragment)":4
21065  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21066  * def __setstate_cython__(self, __pyx_state):
21067  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21068  */
21069  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 4, __pyx_L1_error)
21070  __Pyx_GOTREF(__pyx_tuple__33);
21071  __Pyx_GIVEREF(__pyx_tuple__33);
21072  __pyx_tuple__34 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 4, __pyx_L1_error)
21073  __Pyx_GOTREF(__pyx_tuple__34);
21074  __Pyx_GIVEREF(__pyx_tuple__34);
21075 
21076  /* "View.MemoryView":286
21077  * return self.name
21078  *
21079  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
21080  * cdef strided = Enum("<strided and direct>") # default
21081  * cdef indirect = Enum("<strided and indirect>")
21082  */
21083  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 286, __pyx_L1_error)
21084  __Pyx_GOTREF(__pyx_tuple__40);
21085  __Pyx_GIVEREF(__pyx_tuple__40);
21086 
21087  /* "View.MemoryView":287
21088  *
21089  * cdef generic = Enum("<strided and direct or indirect>")
21090  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
21091  * cdef indirect = Enum("<strided and indirect>")
21092  *
21093  */
21094  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 287, __pyx_L1_error)
21095  __Pyx_GOTREF(__pyx_tuple__41);
21096  __Pyx_GIVEREF(__pyx_tuple__41);
21097 
21098  /* "View.MemoryView":288
21099  * cdef generic = Enum("<strided and direct or indirect>")
21100  * cdef strided = Enum("<strided and direct>") # default
21101  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
21102  *
21103  *
21104  */
21105  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 288, __pyx_L1_error)
21106  __Pyx_GOTREF(__pyx_tuple__42);
21107  __Pyx_GIVEREF(__pyx_tuple__42);
21108 
21109  /* "View.MemoryView":291
21110  *
21111  *
21112  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
21113  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
21114  *
21115  */
21116  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 291, __pyx_L1_error)
21117  __Pyx_GOTREF(__pyx_tuple__43);
21118  __Pyx_GIVEREF(__pyx_tuple__43);
21119 
21120  /* "View.MemoryView":292
21121  *
21122  * cdef contiguous = Enum("<contiguous and direct>")
21123  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
21124  *
21125  *
21126  */
21127  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 292, __pyx_L1_error)
21128  __Pyx_GOTREF(__pyx_tuple__44);
21129  __Pyx_GIVEREF(__pyx_tuple__44);
21130 
21131  /* "(tree fragment)":1
21132  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21133  * cdef object __pyx_PickleError
21134  * cdef object __pyx_result
21135  */
21136  __pyx_tuple__45 = 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__45)) __PYX_ERR(0, 1, __pyx_L1_error)
21137  __Pyx_GOTREF(__pyx_tuple__45);
21138  __Pyx_GIVEREF(__pyx_tuple__45);
21139  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 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_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 1, __pyx_L1_error)
21140  __Pyx_RefNannyFinishContext();
21141  return 0;
21142  __pyx_L1_error:;
21143  __Pyx_RefNannyFinishContext();
21144  return -1;
21145 }
21146 
21147 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
21148  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
21149  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error)
21150  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error)
21151  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(1, 1, __pyx_L1_error)
21152  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(1, 1, __pyx_L1_error)
21153  __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(1, 1, __pyx_L1_error)
21154  __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(1, 1, __pyx_L1_error)
21155  __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(1, 1, __pyx_L1_error)
21156  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(1, 1, __pyx_L1_error)
21157  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(1, 1, __pyx_L1_error)
21158  return 0;
21159  __pyx_L1_error:;
21160  return -1;
21161 }
21162 
21163 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
21164 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
21165 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
21166 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
21167 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
21168 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
21169 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
21170 
21171 static int __Pyx_modinit_global_init_code(void) {
21172  __Pyx_RefNannyDeclarations
21173  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
21174  /*--- Global init code ---*/
21175  generic = Py_None; Py_INCREF(Py_None);
21176  strided = Py_None; Py_INCREF(Py_None);
21177  indirect = Py_None; Py_INCREF(Py_None);
21178  contiguous = Py_None; Py_INCREF(Py_None);
21179  indirect_contiguous = Py_None; Py_INCREF(Py_None);
21180  __Pyx_RefNannyFinishContext();
21181  return 0;
21182 }
21183 
21184 static int __Pyx_modinit_variable_export_code(void) {
21185  __Pyx_RefNannyDeclarations
21186  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
21187  /*--- Variable export code ---*/
21188  __Pyx_RefNannyFinishContext();
21189  return 0;
21190 }
21191 
21192 static int __Pyx_modinit_function_export_code(void) {
21193  __Pyx_RefNannyDeclarations
21194  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
21195  /*--- Function export code ---*/
21196  __Pyx_RefNannyFinishContext();
21197  return 0;
21198 }
21199 
21200 static int __Pyx_modinit_type_init_code(void) {
21201  __Pyx_RefNannyDeclarations
21202  int __pyx_lineno = 0;
21203  const char *__pyx_filename = NULL;
21204  int __pyx_clineno = 0;
21205  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
21206  /*--- Type init code ---*/
21207  if (PyType_Ready(&__pyx_type_22equivalent_polynomials_Simplex) < 0) __PYX_ERR(1, 22, __pyx_L1_error)
21208  #if PY_VERSION_HEX < 0x030800B1
21209  __pyx_type_22equivalent_polynomials_Simplex.tp_print = 0;
21210  #endif
21211  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_22equivalent_polynomials_Simplex.tp_dictoffset && __pyx_type_22equivalent_polynomials_Simplex.tp_getattro == PyObject_GenericGetAttr)) {
21212  __pyx_type_22equivalent_polynomials_Simplex.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21213  }
21214  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Simplex, (PyObject *)&__pyx_type_22equivalent_polynomials_Simplex) < 0) __PYX_ERR(1, 22, __pyx_L1_error)
21215  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_22equivalent_polynomials_Simplex) < 0) __PYX_ERR(1, 22, __pyx_L1_error)
21216  __pyx_ptype_22equivalent_polynomials_Simplex = &__pyx_type_22equivalent_polynomials_Simplex;
21217  __pyx_vtabptr_array = &__pyx_vtable_array;
21218  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
21219  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
21220  #if PY_VERSION_HEX < 0x030800B1
21221  __pyx_type___pyx_array.tp_print = 0;
21222  #endif
21223  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
21224  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
21225  __pyx_array_type = &__pyx_type___pyx_array;
21226  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
21227  #if PY_VERSION_HEX < 0x030800B1
21228  __pyx_type___pyx_MemviewEnum.tp_print = 0;
21229  #endif
21230  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
21231  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21232  }
21233  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
21234  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
21235  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
21236  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
21237  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
21238  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
21239  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
21240  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
21241  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
21242  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
21243  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
21244  #if PY_VERSION_HEX < 0x030800B1
21245  __pyx_type___pyx_memoryview.tp_print = 0;
21246  #endif
21247  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
21248  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21249  }
21250  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
21251  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
21252  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
21253  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
21254  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
21255  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
21256  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
21257  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
21258  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(0, 965, __pyx_L1_error)
21259  #if PY_VERSION_HEX < 0x030800B1
21260  __pyx_type___pyx_memoryviewslice.tp_print = 0;
21261  #endif
21262  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
21263  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21264  }
21265  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(0, 965, __pyx_L1_error)
21266  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(0, 965, __pyx_L1_error)
21267  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
21268  __Pyx_RefNannyFinishContext();
21269  return 0;
21270  __pyx_L1_error:;
21271  __Pyx_RefNannyFinishContext();
21272  return -1;
21273 }
21274 
21275 static int __Pyx_modinit_type_import_code(void) {
21276  __Pyx_RefNannyDeclarations
21277  PyObject *__pyx_t_1 = NULL;
21278  int __pyx_lineno = 0;
21279  const char *__pyx_filename = NULL;
21280  int __pyx_clineno = 0;
21281  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
21282  /*--- Type import code ---*/
21283  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
21284  __Pyx_GOTREF(__pyx_t_1);
21285  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
21286  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
21287  sizeof(PyTypeObject),
21288  #else
21289  sizeof(PyHeapTypeObject),
21290  #endif
21291  __Pyx_ImportType_CheckSize_Warn);
21292  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
21293  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21294  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
21295  __Pyx_GOTREF(__pyx_t_1);
21296  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
21297  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
21298  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
21299  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
21300  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
21301  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
21302  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
21303  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
21304  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21305  if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
21306  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21307  if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
21308  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21309  if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
21310  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21311  if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
21312  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21313  if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
21314  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21315  if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
21316  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21317  if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
21318  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21319  if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
21320  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21321  if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
21322  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
21323  if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
21324  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
21325  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
21326  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21327  __Pyx_RefNannyFinishContext();
21328  return 0;
21329  __pyx_L1_error:;
21330  __Pyx_XDECREF(__pyx_t_1);
21331  __Pyx_RefNannyFinishContext();
21332  return -1;
21333 }
21334 
21335 static int __Pyx_modinit_variable_import_code(void) {
21336  __Pyx_RefNannyDeclarations
21337  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
21338  /*--- Variable import code ---*/
21339  __Pyx_RefNannyFinishContext();
21340  return 0;
21341 }
21342 
21343 static int __Pyx_modinit_function_import_code(void) {
21344  __Pyx_RefNannyDeclarations
21345  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
21346  /*--- Function import code ---*/
21347  __Pyx_RefNannyFinishContext();
21348  return 0;
21349 }
21350 
21351 
21352 #ifndef CYTHON_NO_PYINIT_EXPORT
21353 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
21354 #elif PY_MAJOR_VERSION < 3
21355 #ifdef __cplusplus
21356 #define __Pyx_PyMODINIT_FUNC extern "C" void
21357 #else
21358 #define __Pyx_PyMODINIT_FUNC void
21359 #endif
21360 #else
21361 #ifdef __cplusplus
21362 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
21363 #else
21364 #define __Pyx_PyMODINIT_FUNC PyObject *
21365 #endif
21366 #endif
21367 
21368 
21369 #if PY_MAJOR_VERSION < 3
21370 __Pyx_PyMODINIT_FUNC initequivalent_polynomials(void) CYTHON_SMALL_CODE; /*proto*/
21371 __Pyx_PyMODINIT_FUNC initequivalent_polynomials(void)
21372 #else
21373 __Pyx_PyMODINIT_FUNC PyInit_equivalent_polynomials(void) CYTHON_SMALL_CODE; /*proto*/
21374 __Pyx_PyMODINIT_FUNC PyInit_equivalent_polynomials(void)
21375 #if CYTHON_PEP489_MULTI_PHASE_INIT
21376 {
21377  return PyModuleDef_Init(&__pyx_moduledef);
21378 }
21379 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
21380  #if PY_VERSION_HEX >= 0x030700A1
21381  static PY_INT64_T main_interpreter_id = -1;
21382  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
21383  if (main_interpreter_id == -1) {
21384  main_interpreter_id = current_id;
21385  return (unlikely(current_id == -1)) ? -1 : 0;
21386  } else if (unlikely(main_interpreter_id != current_id))
21387  #else
21388  static PyInterpreterState *main_interpreter = NULL;
21389  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
21390  if (!main_interpreter) {
21391  main_interpreter = current_interpreter;
21392  } else if (unlikely(main_interpreter != current_interpreter))
21393  #endif
21394  {
21395  PyErr_SetString(
21396  PyExc_ImportError,
21397  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
21398  return -1;
21399  }
21400  return 0;
21401 }
21402 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) {
21403  PyObject *value = PyObject_GetAttrString(spec, from_name);
21404  int result = 0;
21405  if (likely(value)) {
21406  if (allow_none || value != Py_None) {
21407  result = PyDict_SetItemString(moddict, to_name, value);
21408  }
21409  Py_DECREF(value);
21410  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
21411  PyErr_Clear();
21412  } else {
21413  result = -1;
21414  }
21415  return result;
21416 }
21417 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
21418  PyObject *module = NULL, *moddict, *modname;
21419  if (__Pyx_check_single_interpreter())
21420  return NULL;
21421  if (__pyx_m)
21422  return __Pyx_NewRef(__pyx_m);
21423  modname = PyObject_GetAttrString(spec, "name");
21424  if (unlikely(!modname)) goto bad;
21425  module = PyModule_NewObject(modname);
21426  Py_DECREF(modname);
21427  if (unlikely(!module)) goto bad;
21428  moddict = PyModule_GetDict(module);
21429  if (unlikely(!moddict)) goto bad;
21430  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
21431  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
21432  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
21433  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
21434  return module;
21435 bad:
21436  Py_XDECREF(module);
21437  return NULL;
21438 }
21439 
21440 
21441 static CYTHON_SMALL_CODE int __pyx_pymod_exec_equivalent_polynomials(PyObject *__pyx_pyinit_module)
21442 #endif
21443 #endif
21444 {
21445  PyObject *__pyx_t_1 = NULL;
21446  static PyThread_type_lock __pyx_t_2[8];
21447  int __pyx_lineno = 0;
21448  const char *__pyx_filename = NULL;
21449  int __pyx_clineno = 0;
21450  __Pyx_RefNannyDeclarations
21451  #if CYTHON_PEP489_MULTI_PHASE_INIT
21452  if (__pyx_m) {
21453  if (__pyx_m == __pyx_pyinit_module) return 0;
21454  PyErr_SetString(PyExc_RuntimeError, "Module 'equivalent_polynomials' has already been imported. Re-initialisation is not supported.");
21455  return -1;
21456  }
21457  #elif PY_MAJOR_VERSION >= 3
21458  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
21459  #endif
21460  #if CYTHON_REFNANNY
21461 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
21462 if (!__Pyx_RefNanny) {
21463  PyErr_Clear();
21464  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
21465  if (!__Pyx_RefNanny)
21466  Py_FatalError("failed to import 'refnanny' module");
21467 }
21468 #endif
21469  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_equivalent_polynomials(void)", 0);
21470  if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21471  #ifdef __Pxy_PyFrame_Initialize_Offsets
21472  __Pxy_PyFrame_Initialize_Offsets();
21473  #endif
21474  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
21475  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
21476  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
21477  #ifdef __Pyx_CyFunction_USED
21478  if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21479  #endif
21480  #ifdef __Pyx_FusedFunction_USED
21481  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21482  #endif
21483  #ifdef __Pyx_Coroutine_USED
21484  if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21485  #endif
21486  #ifdef __Pyx_Generator_USED
21487  if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21488  #endif
21489  #ifdef __Pyx_AsyncGen_USED
21490  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21491  #endif
21492  #ifdef __Pyx_StopAsyncIteration_USED
21493  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21494  #endif
21495  /*--- Library function declarations ---*/
21496  /*--- Threads initialization code ---*/
21497  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
21498  PyEval_InitThreads();
21499  #endif
21500  /*--- Module creation code ---*/
21501  #if CYTHON_PEP489_MULTI_PHASE_INIT
21502  __pyx_m = __pyx_pyinit_module;
21503  Py_INCREF(__pyx_m);
21504  #else
21505  #if PY_MAJOR_VERSION < 3
21506  __pyx_m = Py_InitModule4("equivalent_polynomials", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
21507  #else
21508  __pyx_m = PyModule_Create(&__pyx_moduledef);
21509  #endif
21510  if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
21511  #endif
21512  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
21513  Py_INCREF(__pyx_d);
21514  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
21515  Py_INCREF(__pyx_b);
21516  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
21517  Py_INCREF(__pyx_cython_runtime);
21518  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
21519  /*--- Initialize various global constants etc. ---*/
21520  if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21521  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
21522  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21523  #endif
21524  if (__pyx_module_is_main_equivalent_polynomials) {
21525  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21526  }
21527  #if PY_MAJOR_VERSION >= 3
21528  {
21529  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
21530  if (!PyDict_GetItemString(modules, "equivalent_polynomials")) {
21531  if (unlikely(PyDict_SetItemString(modules, "equivalent_polynomials", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
21532  }
21533  }
21534  #endif
21535  /*--- Builtin init code ---*/
21536  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21537  /*--- Constants init code ---*/
21538  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21539  /*--- Global type/function init code ---*/
21540  (void)__Pyx_modinit_global_init_code();
21541  (void)__Pyx_modinit_variable_export_code();
21542  (void)__Pyx_modinit_function_export_code();
21543  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
21544  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
21545  (void)__Pyx_modinit_variable_import_code();
21546  (void)__Pyx_modinit_function_import_code();
21547  /*--- Execution code ---*/
21548  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
21549  if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21550  #endif
21551 
21552  /* "equivalent_polynomials.pyx":2
21553  * # A type of -*- python -*- file
21554  * import numpy as np # <<<<<<<<<<<<<<
21555  * cimport numpy as np
21556  * cimport equivalent_polynomials as eqp
21557  */
21558  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
21559  __Pyx_GOTREF(__pyx_t_1);
21560  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
21561  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21562 
21563  /* "equivalent_polynomials.pyx":1
21564  * # A type of -*- python -*- file # <<<<<<<<<<<<<<
21565  * import numpy as np
21566  * cimport numpy as np
21567  */
21568  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
21569  __Pyx_GOTREF(__pyx_t_1);
21570  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
21571  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21572 
21573  /* "View.MemoryView":209
21574  * info.obj = self
21575  *
21576  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
21577  *
21578  * def __dealloc__(array self):
21579  */
21580  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
21581  __Pyx_GOTREF(__pyx_t_1);
21582  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
21583  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21584  PyType_Modified(__pyx_array_type);
21585 
21586  /* "View.MemoryView":286
21587  * return self.name
21588  *
21589  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
21590  * cdef strided = Enum("<strided and direct>") # default
21591  * cdef indirect = Enum("<strided and indirect>")
21592  */
21593  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
21594  __Pyx_GOTREF(__pyx_t_1);
21595  __Pyx_XGOTREF(generic);
21596  __Pyx_DECREF_SET(generic, __pyx_t_1);
21597  __Pyx_GIVEREF(__pyx_t_1);
21598  __pyx_t_1 = 0;
21599 
21600  /* "View.MemoryView":287
21601  *
21602  * cdef generic = Enum("<strided and direct or indirect>")
21603  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
21604  * cdef indirect = Enum("<strided and indirect>")
21605  *
21606  */
21607  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
21608  __Pyx_GOTREF(__pyx_t_1);
21609  __Pyx_XGOTREF(strided);
21610  __Pyx_DECREF_SET(strided, __pyx_t_1);
21611  __Pyx_GIVEREF(__pyx_t_1);
21612  __pyx_t_1 = 0;
21613 
21614  /* "View.MemoryView":288
21615  * cdef generic = Enum("<strided and direct or indirect>")
21616  * cdef strided = Enum("<strided and direct>") # default
21617  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
21618  *
21619  *
21620  */
21621  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
21622  __Pyx_GOTREF(__pyx_t_1);
21623  __Pyx_XGOTREF(indirect);
21624  __Pyx_DECREF_SET(indirect, __pyx_t_1);
21625  __Pyx_GIVEREF(__pyx_t_1);
21626  __pyx_t_1 = 0;
21627 
21628  /* "View.MemoryView":291
21629  *
21630  *
21631  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
21632  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
21633  *
21634  */
21635  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
21636  __Pyx_GOTREF(__pyx_t_1);
21637  __Pyx_XGOTREF(contiguous);
21638  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
21639  __Pyx_GIVEREF(__pyx_t_1);
21640  __pyx_t_1 = 0;
21641 
21642  /* "View.MemoryView":292
21643  *
21644  * cdef contiguous = Enum("<contiguous and direct>")
21645  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
21646  *
21647  *
21648  */
21649  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 292, __pyx_L1_error)
21650  __Pyx_GOTREF(__pyx_t_1);
21651  __Pyx_XGOTREF(indirect_contiguous);
21652  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
21653  __Pyx_GIVEREF(__pyx_t_1);
21654  __pyx_t_1 = 0;
21655 
21656  /* "View.MemoryView":316
21657  *
21658  * DEF THREAD_LOCKS_PREALLOCATED = 8
21659  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
21660  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
21661  * PyThread_allocate_lock(),
21662  */
21663  __pyx_memoryview_thread_locks_used = 0;
21664 
21665  /* "View.MemoryView":317
21666  * DEF THREAD_LOCKS_PREALLOCATED = 8
21667  * cdef int __pyx_memoryview_thread_locks_used = 0
21668  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
21669  * PyThread_allocate_lock(),
21670  * PyThread_allocate_lock(),
21671  */
21672  __pyx_t_2[0] = PyThread_allocate_lock();
21673  __pyx_t_2[1] = PyThread_allocate_lock();
21674  __pyx_t_2[2] = PyThread_allocate_lock();
21675  __pyx_t_2[3] = PyThread_allocate_lock();
21676  __pyx_t_2[4] = PyThread_allocate_lock();
21677  __pyx_t_2[5] = PyThread_allocate_lock();
21678  __pyx_t_2[6] = PyThread_allocate_lock();
21679  __pyx_t_2[7] = PyThread_allocate_lock();
21680  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
21681 
21682  /* "View.MemoryView":549
21683  * info.obj = self
21684  *
21685  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
21686  *
21687  *
21688  */
21689  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
21690  __Pyx_GOTREF(__pyx_t_1);
21691  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
21692  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21693  PyType_Modified(__pyx_memoryview_type);
21694 
21695  /* "View.MemoryView":995
21696  * return self.from_object
21697  *
21698  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
21699  *
21700  *
21701  */
21702  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error)
21703  __Pyx_GOTREF(__pyx_t_1);
21704  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 995, __pyx_L1_error)
21705  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21706  PyType_Modified(__pyx_memoryviewslice_type);
21707 
21708  /* "(tree fragment)":1
21709  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
21710  * cdef object __pyx_PickleError
21711  * cdef object __pyx_result
21712  */
21713  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
21714  __Pyx_GOTREF(__pyx_t_1);
21715  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21716  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21717 
21718  /* "BufferFormatFromTypeInfo":1463
21719  *
21720  * @cname('__pyx_format_from_typeinfo')
21721  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type): # <<<<<<<<<<<<<<
21722  * cdef __Pyx_StructField *field
21723  * cdef __pyx_typeinfo_string fmt
21724  */
21725 
21726  /*--- Wrapped vars code ---*/
21727 
21728  goto __pyx_L0;
21729  __pyx_L1_error:;
21730  __Pyx_XDECREF(__pyx_t_1);
21731  if (__pyx_m) {
21732  if (__pyx_d) {
21733  __Pyx_AddTraceback("init equivalent_polynomials", __pyx_clineno, __pyx_lineno, __pyx_filename);
21734  }
21735  Py_CLEAR(__pyx_m);
21736  } else if (!PyErr_Occurred()) {
21737  PyErr_SetString(PyExc_ImportError, "init equivalent_polynomials");
21738  }
21739  __pyx_L0:;
21740  __Pyx_RefNannyFinishContext();
21741  #if CYTHON_PEP489_MULTI_PHASE_INIT
21742  return (__pyx_m != NULL) ? 0 : -1;
21743  #elif PY_MAJOR_VERSION >= 3
21744  return __pyx_m;
21745  #else
21746  return;
21747  #endif
21748 }
21749 
21750 /* --- Runtime support code --- */
21751 /* Refnanny */
21752 #if CYTHON_REFNANNY
21753 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
21754  PyObject *m = NULL, *p = NULL;
21755  void *r = NULL;
21756  m = PyImport_ImportModule(modname);
21757  if (!m) goto end;
21758  p = PyObject_GetAttrString(m, "RefNannyAPI");
21759  if (!p) goto end;
21760  r = PyLong_AsVoidPtr(p);
21761 end:
21762  Py_XDECREF(p);
21763  Py_XDECREF(m);
21764  return (__Pyx_RefNannyAPIStruct *)r;
21765 }
21766 #endif
21767 
21768 /* PyObjectGetAttrStr */
21769 #if CYTHON_USE_TYPE_SLOTS
21770 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
21771  PyTypeObject* tp = Py_TYPE(obj);
21772  if (likely(tp->tp_getattro))
21773  return tp->tp_getattro(obj, attr_name);
21774 #if PY_MAJOR_VERSION < 3
21775  if (likely(tp->tp_getattr))
21776  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
21777 #endif
21778  return PyObject_GetAttr(obj, attr_name);
21779 }
21780 #endif
21781 
21782 /* GetBuiltinName */
21783 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
21784  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
21785  if (unlikely(!result)) {
21786  PyErr_Format(PyExc_NameError,
21787 #if PY_MAJOR_VERSION >= 3
21788  "name '%U' is not defined", name);
21789 #else
21790  "name '%.200s' is not defined", PyString_AS_STRING(name));
21791 #endif
21792  }
21793  return result;
21794 }
21795 
21796 /* RaiseArgTupleInvalid */
21797 static void __Pyx_RaiseArgtupleInvalid(
21798  const char* func_name,
21799  int exact,
21800  Py_ssize_t num_min,
21801  Py_ssize_t num_max,
21802  Py_ssize_t num_found)
21803 {
21804  Py_ssize_t num_expected;
21805  const char *more_or_less;
21806  if (num_found < num_min) {
21807  num_expected = num_min;
21808  more_or_less = "at least";
21809  } else {
21810  num_expected = num_max;
21811  more_or_less = "at most";
21812  }
21813  if (exact) {
21814  more_or_less = "exactly";
21815  }
21816  PyErr_Format(PyExc_TypeError,
21817  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
21818  func_name, more_or_less, num_expected,
21819  (num_expected == 1) ? "" : "s", num_found);
21820 }
21821 
21822 /* RaiseDoubleKeywords */
21823 static void __Pyx_RaiseDoubleKeywordsError(
21824  const char* func_name,
21825  PyObject* kw_name)
21826 {
21827  PyErr_Format(PyExc_TypeError,
21828  #if PY_MAJOR_VERSION >= 3
21829  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
21830  #else
21831  "%s() got multiple values for keyword argument '%s'", func_name,
21832  PyString_AsString(kw_name));
21833  #endif
21834 }
21835 
21836 /* ParseKeywords */
21837 static int __Pyx_ParseOptionalKeywords(
21838  PyObject *kwds,
21839  PyObject **argnames[],
21840  PyObject *kwds2,
21841  PyObject *values[],
21842  Py_ssize_t num_pos_args,
21843  const char* function_name)
21844 {
21845  PyObject *key = 0, *value = 0;
21846  Py_ssize_t pos = 0;
21847  PyObject*** name;
21848  PyObject*** first_kw_arg = argnames + num_pos_args;
21849  while (PyDict_Next(kwds, &pos, &key, &value)) {
21850  name = first_kw_arg;
21851  while (*name && (**name != key)) name++;
21852  if (*name) {
21853  values[name-argnames] = value;
21854  continue;
21855  }
21856  name = first_kw_arg;
21857  #if PY_MAJOR_VERSION < 3
21858  if (likely(PyString_Check(key))) {
21859  while (*name) {
21860  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
21861  && _PyString_Eq(**name, key)) {
21862  values[name-argnames] = value;
21863  break;
21864  }
21865  name++;
21866  }
21867  if (*name) continue;
21868  else {
21869  PyObject*** argname = argnames;
21870  while (argname != first_kw_arg) {
21871  if ((**argname == key) || (
21872  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
21873  && _PyString_Eq(**argname, key))) {
21874  goto arg_passed_twice;
21875  }
21876  argname++;
21877  }
21878  }
21879  } else
21880  #endif
21881  if (likely(PyUnicode_Check(key))) {
21882  while (*name) {
21883  int cmp = (**name == key) ? 0 :
21884  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21885  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
21886  #endif
21887  PyUnicode_Compare(**name, key);
21888  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
21889  if (cmp == 0) {
21890  values[name-argnames] = value;
21891  break;
21892  }
21893  name++;
21894  }
21895  if (*name) continue;
21896  else {
21897  PyObject*** argname = argnames;
21898  while (argname != first_kw_arg) {
21899  int cmp = (**argname == key) ? 0 :
21900  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
21901  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
21902  #endif
21903  PyUnicode_Compare(**argname, key);
21904  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
21905  if (cmp == 0) goto arg_passed_twice;
21906  argname++;
21907  }
21908  }
21909  } else
21910  goto invalid_keyword_type;
21911  if (kwds2) {
21912  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
21913  } else {
21914  goto invalid_keyword;
21915  }
21916  }
21917  return 0;
21918 arg_passed_twice:
21919  __Pyx_RaiseDoubleKeywordsError(function_name, key);
21920  goto bad;
21921 invalid_keyword_type:
21922  PyErr_Format(PyExc_TypeError,
21923  "%.200s() keywords must be strings", function_name);
21924  goto bad;
21925 invalid_keyword:
21926  PyErr_Format(PyExc_TypeError,
21927  #if PY_MAJOR_VERSION < 3
21928  "%.200s() got an unexpected keyword argument '%.200s'",
21929  function_name, PyString_AsString(key));
21930  #else
21931  "%s() got an unexpected keyword argument '%U'",
21932  function_name, key);
21933  #endif
21934 bad:
21935  return -1;
21936 }
21937 
21938 /* PyDictVersioning */
21939 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
21940 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
21941  PyObject *dict = Py_TYPE(obj)->tp_dict;
21942  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
21943 }
21944 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
21945  PyObject **dictptr = NULL;
21946  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
21947  if (offset) {
21948 #if CYTHON_COMPILING_IN_CPYTHON
21949  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
21950 #else
21951  dictptr = _PyObject_GetDictPtr(obj);
21952 #endif
21953  }
21954  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
21955 }
21956 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
21957  PyObject *dict = Py_TYPE(obj)->tp_dict;
21958  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
21959  return 0;
21960  return obj_dict_version == __Pyx_get_object_dict_version(obj);
21961 }
21962 #endif
21963 
21964 /* GetModuleGlobalName */
21965 #if CYTHON_USE_DICT_VERSIONS
21966 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
21967 #else
21968 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
21969 #endif
21970 {
21971  PyObject *result;
21972 #if !CYTHON_AVOID_BORROWED_REFS
21973 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
21974  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
21975  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21976  if (likely(result)) {
21977  return __Pyx_NewRef(result);
21978  } else if (unlikely(PyErr_Occurred())) {
21979  return NULL;
21980  }
21981 #else
21982  result = PyDict_GetItem(__pyx_d, name);
21983  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21984  if (likely(result)) {
21985  return __Pyx_NewRef(result);
21986  }
21987 #endif
21988 #else
21989  result = PyObject_GetItem(__pyx_d, name);
21990  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
21991  if (likely(result)) {
21992  return __Pyx_NewRef(result);
21993  }
21994  PyErr_Clear();
21995 #endif
21996  return __Pyx_GetBuiltinName(name);
21997 }
21998 
21999 /* PyObjectCall */
22000 #if CYTHON_COMPILING_IN_CPYTHON
22001 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
22002  PyObject *result;
22003  ternaryfunc call = Py_TYPE(func)->tp_call;
22004  if (unlikely(!call))
22005  return PyObject_Call(func, arg, kw);
22006  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
22007  return NULL;
22008  result = (*call)(func, arg, kw);
22009  Py_LeaveRecursiveCall();
22010  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
22011  PyErr_SetString(
22012  PyExc_SystemError,
22013  "NULL result without error in PyObject_Call");
22014  }
22015  return result;
22016 }
22017 #endif
22018 
22019 /* ExtTypeTest */
22020 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
22021  if (unlikely(!type)) {
22022  PyErr_SetString(PyExc_SystemError, "Missing type object");
22023  return 0;
22024  }
22025  if (likely(__Pyx_TypeCheck(obj, type)))
22026  return 1;
22027  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
22028  Py_TYPE(obj)->tp_name, type->tp_name);
22029  return 0;
22030 }
22031 
22032 /* ArgTypeTest */
22033 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
22034 {
22035  if (unlikely(!type)) {
22036  PyErr_SetString(PyExc_SystemError, "Missing type object");
22037  return 0;
22038  }
22039  else if (exact) {
22040  #if PY_MAJOR_VERSION == 2
22041  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
22042  #endif
22043  }
22044  else {
22045  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
22046  }
22047  PyErr_Format(PyExc_TypeError,
22048  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
22049  name, type->tp_name, Py_TYPE(obj)->tp_name);
22050  return 0;
22051 }
22052 
22053 /* SliceObject */
22054 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
22055  Py_ssize_t cstart, Py_ssize_t cstop,
22056  PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
22057  int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
22058 #if CYTHON_USE_TYPE_SLOTS
22059  PyMappingMethods* mp;
22060 #if PY_MAJOR_VERSION < 3
22061  PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
22062  if (likely(ms && ms->sq_ass_slice)) {
22063  if (!has_cstart) {
22064  if (_py_start && (*_py_start != Py_None)) {
22065  cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
22066  if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
22067  } else
22068  cstart = 0;
22069  }
22070  if (!has_cstop) {
22071  if (_py_stop && (*_py_stop != Py_None)) {
22072  cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
22073  if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
22074  } else
22075  cstop = PY_SSIZE_T_MAX;
22076  }
22077  if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
22078  Py_ssize_t l = ms->sq_length(obj);
22079  if (likely(l >= 0)) {
22080  if (cstop < 0) {
22081  cstop += l;
22082  if (cstop < 0) cstop = 0;
22083  }
22084  if (cstart < 0) {
22085  cstart += l;
22086  if (cstart < 0) cstart = 0;
22087  }
22088  } else {
22089  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
22090  goto bad;
22091  PyErr_Clear();
22092  }
22093  }
22094  return ms->sq_ass_slice(obj, cstart, cstop, value);
22095  }
22096 #endif
22097  mp = Py_TYPE(obj)->tp_as_mapping;
22098  if (likely(mp && mp->mp_ass_subscript))
22099 #endif
22100  {
22101  int result;
22102  PyObject *py_slice, *py_start, *py_stop;
22103  if (_py_slice) {
22104  py_slice = *_py_slice;
22105  } else {
22106  PyObject* owned_start = NULL;
22107  PyObject* owned_stop = NULL;
22108  if (_py_start) {
22109  py_start = *_py_start;
22110  } else {
22111  if (has_cstart) {
22112  owned_start = py_start = PyInt_FromSsize_t(cstart);
22113  if (unlikely(!py_start)) goto bad;
22114  } else
22115  py_start = Py_None;
22116  }
22117  if (_py_stop) {
22118  py_stop = *_py_stop;
22119  } else {
22120  if (has_cstop) {
22121  owned_stop = py_stop = PyInt_FromSsize_t(cstop);
22122  if (unlikely(!py_stop)) {
22123  Py_XDECREF(owned_start);
22124  goto bad;
22125  }
22126  } else
22127  py_stop = Py_None;
22128  }
22129  py_slice = PySlice_New(py_start, py_stop, Py_None);
22130  Py_XDECREF(owned_start);
22131  Py_XDECREF(owned_stop);
22132  if (unlikely(!py_slice)) goto bad;
22133  }
22134 #if CYTHON_USE_TYPE_SLOTS
22135  result = mp->mp_ass_subscript(obj, py_slice, value);
22136 #else
22137  result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
22138 #endif
22139  if (!_py_slice) {
22140  Py_DECREF(py_slice);
22141  }
22142  return result;
22143  }
22144  PyErr_Format(PyExc_TypeError,
22145  "'%.200s' object does not support slice %.10s",
22146  Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
22147 bad:
22148  return -1;
22149 }
22150 
22151 /* PyCFunctionFastCall */
22152 #if CYTHON_FAST_PYCCALL
22153 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
22154  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
22155  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
22156  PyObject *self = PyCFunction_GET_SELF(func);
22157  int flags = PyCFunction_GET_FLAGS(func);
22158  assert(PyCFunction_Check(func));
22159  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
22160  assert(nargs >= 0);
22161  assert(nargs == 0 || args != NULL);
22162  /* _PyCFunction_FastCallDict() must not be called with an exception set,
22163  because it may clear it (directly or indirectly) and so the
22164  caller loses its exception */
22165  assert(!PyErr_Occurred());
22166  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
22167  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
22168  } else {
22169  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
22170  }
22171 }
22172 #endif
22173 
22174 /* PyFunctionFastCall */
22175 #if CYTHON_FAST_PYCALL
22176 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
22177  PyObject *globals) {
22178  PyFrameObject *f;
22179  PyThreadState *tstate = __Pyx_PyThreadState_Current;
22180  PyObject **fastlocals;
22181  Py_ssize_t i;
22182  PyObject *result;
22183  assert(globals != NULL);
22184  /* XXX Perhaps we should create a specialized
22185  PyFrame_New() that doesn't take locals, but does
22186  take builtins without sanity checking them.
22187  */
22188  assert(tstate != NULL);
22189  f = PyFrame_New(tstate, co, globals, NULL);
22190  if (f == NULL) {
22191  return NULL;
22192  }
22193  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
22194  for (i = 0; i < na; i++) {
22195  Py_INCREF(*args);
22196  fastlocals[i] = *args++;
22197  }
22198  result = PyEval_EvalFrameEx(f,0);
22199  ++tstate->recursion_depth;
22200  Py_DECREF(f);
22201  --tstate->recursion_depth;
22202  return result;
22203 }
22204 #if 1 || PY_VERSION_HEX < 0x030600B1
22205 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
22206  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
22207  PyObject *globals = PyFunction_GET_GLOBALS(func);
22208  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
22209  PyObject *closure;
22210 #if PY_MAJOR_VERSION >= 3
22211  PyObject *kwdefs;
22212 #endif
22213  PyObject *kwtuple, **k;
22214  PyObject **d;
22215  Py_ssize_t nd;
22216  Py_ssize_t nk;
22217  PyObject *result;
22218  assert(kwargs == NULL || PyDict_Check(kwargs));
22219  nk = kwargs ? PyDict_Size(kwargs) : 0;
22220  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
22221  return NULL;
22222  }
22223  if (
22224 #if PY_MAJOR_VERSION >= 3
22225  co->co_kwonlyargcount == 0 &&
22226 #endif
22227  likely(kwargs == NULL || nk == 0) &&
22228  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
22229  if (argdefs == NULL && co->co_argcount == nargs) {
22230  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
22231  goto done;
22232  }
22233  else if (nargs == 0 && argdefs != NULL
22234  && co->co_argcount == Py_SIZE(argdefs)) {
22235  /* function called with no arguments, but all parameters have
22236  a default value: use default values as arguments .*/
22237  args = &PyTuple_GET_ITEM(argdefs, 0);
22238  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
22239  goto done;
22240  }
22241  }
22242  if (kwargs != NULL) {
22243  Py_ssize_t pos, i;
22244  kwtuple = PyTuple_New(2 * nk);
22245  if (kwtuple == NULL) {
22246  result = NULL;
22247  goto done;
22248  }
22249  k = &PyTuple_GET_ITEM(kwtuple, 0);
22250  pos = i = 0;
22251  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
22252  Py_INCREF(k[i]);
22253  Py_INCREF(k[i+1]);
22254  i += 2;
22255  }
22256  nk = i / 2;
22257  }
22258  else {
22259  kwtuple = NULL;
22260  k = NULL;
22261  }
22262  closure = PyFunction_GET_CLOSURE(func);
22263 #if PY_MAJOR_VERSION >= 3
22264  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
22265 #endif
22266  if (argdefs != NULL) {
22267  d = &PyTuple_GET_ITEM(argdefs, 0);
22268  nd = Py_SIZE(argdefs);
22269  }
22270  else {
22271  d = NULL;
22272  nd = 0;
22273  }
22274 #if PY_MAJOR_VERSION >= 3
22275  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
22276  args, (int)nargs,
22277  k, (int)nk,
22278  d, (int)nd, kwdefs, closure);
22279 #else
22280  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
22281  args, (int)nargs,
22282  k, (int)nk,
22283  d, (int)nd, closure);
22284 #endif
22285  Py_XDECREF(kwtuple);
22286 done:
22287  Py_LeaveRecursiveCall();
22288  return result;
22289 }
22290 #endif
22291 #endif
22292 
22293 /* PyObjectCall2Args */
22294 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
22295  PyObject *args, *result = NULL;
22296  #if CYTHON_FAST_PYCALL
22297  if (PyFunction_Check(function)) {
22298  PyObject *args[2] = {arg1, arg2};
22299  return __Pyx_PyFunction_FastCall(function, args, 2);
22300  }
22301  #endif
22302  #if CYTHON_FAST_PYCCALL
22303  if (__Pyx_PyFastCFunction_Check(function)) {
22304  PyObject *args[2] = {arg1, arg2};
22305  return __Pyx_PyCFunction_FastCall(function, args, 2);
22306  }
22307  #endif
22308  args = PyTuple_New(2);
22309  if (unlikely(!args)) goto done;
22310  Py_INCREF(arg1);
22311  PyTuple_SET_ITEM(args, 0, arg1);
22312  Py_INCREF(arg2);
22313  PyTuple_SET_ITEM(args, 1, arg2);
22314  Py_INCREF(function);
22315  result = __Pyx_PyObject_Call(function, args, NULL);
22316  Py_DECREF(args);
22317  Py_DECREF(function);
22318 done:
22319  return result;
22320 }
22321 
22322 /* PyObjectCallMethO */
22323 #if CYTHON_COMPILING_IN_CPYTHON
22324 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
22325  PyObject *self, *result;
22326  PyCFunction cfunc;
22327  cfunc = PyCFunction_GET_FUNCTION(func);
22328  self = PyCFunction_GET_SELF(func);
22329  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
22330  return NULL;
22331  result = cfunc(self, arg);
22332  Py_LeaveRecursiveCall();
22333  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
22334  PyErr_SetString(
22335  PyExc_SystemError,
22336  "NULL result without error in PyObject_Call");
22337  }
22338  return result;
22339 }
22340 #endif
22341 
22342 /* PyObjectCallOneArg */
22343 #if CYTHON_COMPILING_IN_CPYTHON
22344 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22345  PyObject *result;
22346  PyObject *args = PyTuple_New(1);
22347  if (unlikely(!args)) return NULL;
22348  Py_INCREF(arg);
22349  PyTuple_SET_ITEM(args, 0, arg);
22350  result = __Pyx_PyObject_Call(func, args, NULL);
22351  Py_DECREF(args);
22352  return result;
22353 }
22354 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22355 #if CYTHON_FAST_PYCALL
22356  if (PyFunction_Check(func)) {
22357  return __Pyx_PyFunction_FastCall(func, &arg, 1);
22358  }
22359 #endif
22360  if (likely(PyCFunction_Check(func))) {
22361  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
22362  return __Pyx_PyObject_CallMethO(func, arg);
22363 #if CYTHON_FAST_PYCCALL
22364  } else if (__Pyx_PyFastCFunction_Check(func)) {
22365  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
22366 #endif
22367  }
22368  }
22369  return __Pyx__PyObject_CallOneArg(func, arg);
22370 }
22371 #else
22372 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22373  PyObject *result;
22374  PyObject *args = PyTuple_Pack(1, arg);
22375  if (unlikely(!args)) return NULL;
22376  result = __Pyx_PyObject_Call(func, args, NULL);
22377  Py_DECREF(args);
22378  return result;
22379 }
22380 #endif
22381 
22382 /* GetItemInt */
22383 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
22384  PyObject *r;
22385  if (!j) return NULL;
22386  r = PyObject_GetItem(o, j);
22387  Py_DECREF(j);
22388  return r;
22389 }
22390 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
22391  CYTHON_NCP_UNUSED int wraparound,
22392  CYTHON_NCP_UNUSED int boundscheck) {
22393 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22394  Py_ssize_t wrapped_i = i;
22395  if (wraparound & unlikely(i < 0)) {
22396  wrapped_i += PyList_GET_SIZE(o);
22397  }
22398  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
22399  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
22400  Py_INCREF(r);
22401  return r;
22402  }
22403  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
22404 #else
22405  return PySequence_GetItem(o, i);
22406 #endif
22407 }
22408 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
22409  CYTHON_NCP_UNUSED int wraparound,
22410  CYTHON_NCP_UNUSED int boundscheck) {
22411 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22412  Py_ssize_t wrapped_i = i;
22413  if (wraparound & unlikely(i < 0)) {
22414  wrapped_i += PyTuple_GET_SIZE(o);
22415  }
22416  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
22417  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
22418  Py_INCREF(r);
22419  return r;
22420  }
22421  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
22422 #else
22423  return PySequence_GetItem(o, i);
22424 #endif
22425 }
22426 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
22427  CYTHON_NCP_UNUSED int wraparound,
22428  CYTHON_NCP_UNUSED int boundscheck) {
22429 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
22430  if (is_list || PyList_CheckExact(o)) {
22431  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
22432  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
22433  PyObject *r = PyList_GET_ITEM(o, n);
22434  Py_INCREF(r);
22435  return r;
22436  }
22437  }
22438  else if (PyTuple_CheckExact(o)) {
22439  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
22440  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
22441  PyObject *r = PyTuple_GET_ITEM(o, n);
22442  Py_INCREF(r);
22443  return r;
22444  }
22445  } else {
22446  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
22447  if (likely(m && m->sq_item)) {
22448  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
22449  Py_ssize_t l = m->sq_length(o);
22450  if (likely(l >= 0)) {
22451  i += l;
22452  } else {
22453  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
22454  return NULL;
22455  PyErr_Clear();
22456  }
22457  }
22458  return m->sq_item(o, i);
22459  }
22460  }
22461 #else
22462  if (is_list || PySequence_Check(o)) {
22463  return PySequence_GetItem(o, i);
22464  }
22465 #endif
22466  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
22467 }
22468 
22469 /* PyErrFetchRestore */
22470 #if CYTHON_FAST_THREAD_STATE
22471 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
22472  PyObject *tmp_type, *tmp_value, *tmp_tb;
22473  tmp_type = tstate->curexc_type;
22474  tmp_value = tstate->curexc_value;
22475  tmp_tb = tstate->curexc_traceback;
22476  tstate->curexc_type = type;
22477  tstate->curexc_value = value;
22478  tstate->curexc_traceback = tb;
22479  Py_XDECREF(tmp_type);
22480  Py_XDECREF(tmp_value);
22481  Py_XDECREF(tmp_tb);
22482 }
22483 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22484  *type = tstate->curexc_type;
22485  *value = tstate->curexc_value;
22486  *tb = tstate->curexc_traceback;
22487  tstate->curexc_type = 0;
22488  tstate->curexc_value = 0;
22489  tstate->curexc_traceback = 0;
22490 }
22491 #endif
22492 
22493 /* RaiseException */
22494 #if PY_MAJOR_VERSION < 3
22495 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
22496  CYTHON_UNUSED PyObject *cause) {
22497  __Pyx_PyThreadState_declare
22498  Py_XINCREF(type);
22499  if (!value || value == Py_None)
22500  value = NULL;
22501  else
22502  Py_INCREF(value);
22503  if (!tb || tb == Py_None)
22504  tb = NULL;
22505  else {
22506  Py_INCREF(tb);
22507  if (!PyTraceBack_Check(tb)) {
22508  PyErr_SetString(PyExc_TypeError,
22509  "raise: arg 3 must be a traceback or None");
22510  goto raise_error;
22511  }
22512  }
22513  if (PyType_Check(type)) {
22514 #if CYTHON_COMPILING_IN_PYPY
22515  if (!value) {
22516  Py_INCREF(Py_None);
22517  value = Py_None;
22518  }
22519 #endif
22520  PyErr_NormalizeException(&type, &value, &tb);
22521  } else {
22522  if (value) {
22523  PyErr_SetString(PyExc_TypeError,
22524  "instance exception may not have a separate value");
22525  goto raise_error;
22526  }
22527  value = type;
22528  type = (PyObject*) Py_TYPE(type);
22529  Py_INCREF(type);
22530  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
22531  PyErr_SetString(PyExc_TypeError,
22532  "raise: exception class must be a subclass of BaseException");
22533  goto raise_error;
22534  }
22535  }
22536  __Pyx_PyThreadState_assign
22537  __Pyx_ErrRestore(type, value, tb);
22538  return;
22539 raise_error:
22540  Py_XDECREF(value);
22541  Py_XDECREF(type);
22542  Py_XDECREF(tb);
22543  return;
22544 }
22545 #else
22546 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
22547  PyObject* owned_instance = NULL;
22548  if (tb == Py_None) {
22549  tb = 0;
22550  } else if (tb && !PyTraceBack_Check(tb)) {
22551  PyErr_SetString(PyExc_TypeError,
22552  "raise: arg 3 must be a traceback or None");
22553  goto bad;
22554  }
22555  if (value == Py_None)
22556  value = 0;
22557  if (PyExceptionInstance_Check(type)) {
22558  if (value) {
22559  PyErr_SetString(PyExc_TypeError,
22560  "instance exception may not have a separate value");
22561  goto bad;
22562  }
22563  value = type;
22564  type = (PyObject*) Py_TYPE(value);
22565  } else if (PyExceptionClass_Check(type)) {
22566  PyObject *instance_class = NULL;
22567  if (value && PyExceptionInstance_Check(value)) {
22568  instance_class = (PyObject*) Py_TYPE(value);
22569  if (instance_class != type) {
22570  int is_subclass = PyObject_IsSubclass(instance_class, type);
22571  if (!is_subclass) {
22572  instance_class = NULL;
22573  } else if (unlikely(is_subclass == -1)) {
22574  goto bad;
22575  } else {
22576  type = instance_class;
22577  }
22578  }
22579  }
22580  if (!instance_class) {
22581  PyObject *args;
22582  if (!value)
22583  args = PyTuple_New(0);
22584  else if (PyTuple_Check(value)) {
22585  Py_INCREF(value);
22586  args = value;
22587  } else
22588  args = PyTuple_Pack(1, value);
22589  if (!args)
22590  goto bad;
22591  owned_instance = PyObject_Call(type, args, NULL);
22592  Py_DECREF(args);
22593  if (!owned_instance)
22594  goto bad;
22595  value = owned_instance;
22596  if (!PyExceptionInstance_Check(value)) {
22597  PyErr_Format(PyExc_TypeError,
22598  "calling %R should have returned an instance of "
22599  "BaseException, not %R",
22600  type, Py_TYPE(value));
22601  goto bad;
22602  }
22603  }
22604  } else {
22605  PyErr_SetString(PyExc_TypeError,
22606  "raise: exception class must be a subclass of BaseException");
22607  goto bad;
22608  }
22609  if (cause) {
22610  PyObject *fixed_cause;
22611  if (cause == Py_None) {
22612  fixed_cause = NULL;
22613  } else if (PyExceptionClass_Check(cause)) {
22614  fixed_cause = PyObject_CallObject(cause, NULL);
22615  if (fixed_cause == NULL)
22616  goto bad;
22617  } else if (PyExceptionInstance_Check(cause)) {
22618  fixed_cause = cause;
22619  Py_INCREF(fixed_cause);
22620  } else {
22621  PyErr_SetString(PyExc_TypeError,
22622  "exception causes must derive from "
22623  "BaseException");
22624  goto bad;
22625  }
22626  PyException_SetCause(value, fixed_cause);
22627  }
22628  PyErr_SetObject(type, value);
22629  if (tb) {
22630 #if CYTHON_COMPILING_IN_PYPY
22631  PyObject *tmp_type, *tmp_value, *tmp_tb;
22632  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
22633  Py_INCREF(tb);
22634  PyErr_Restore(tmp_type, tmp_value, tb);
22635  Py_XDECREF(tmp_tb);
22636 #else
22637  PyThreadState *tstate = __Pyx_PyThreadState_Current;
22638  PyObject* tmp_tb = tstate->curexc_traceback;
22639  if (tb != tmp_tb) {
22640  Py_INCREF(tb);
22641  tstate->curexc_traceback = tb;
22642  Py_XDECREF(tmp_tb);
22643  }
22644 #endif
22645  }
22646 bad:
22647  Py_XDECREF(owned_instance);
22648  return;
22649 }
22650 #endif
22651 
22652 /* GetTopmostException */
22653 #if CYTHON_USE_EXC_INFO_STACK
22654 static _PyErr_StackItem *
22655 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
22656 {
22657  _PyErr_StackItem *exc_info = tstate->exc_info;
22658  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
22659  exc_info->previous_item != NULL)
22660  {
22661  exc_info = exc_info->previous_item;
22662  }
22663  return exc_info;
22664 }
22665 #endif
22666 
22667 /* SaveResetException */
22668 #if CYTHON_FAST_THREAD_STATE
22669 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22670  #if CYTHON_USE_EXC_INFO_STACK
22671  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
22672  *type = exc_info->exc_type;
22673  *value = exc_info->exc_value;
22674  *tb = exc_info->exc_traceback;
22675  #else
22676  *type = tstate->exc_type;
22677  *value = tstate->exc_value;
22678  *tb = tstate->exc_traceback;
22679  #endif
22680  Py_XINCREF(*type);
22681  Py_XINCREF(*value);
22682  Py_XINCREF(*tb);
22683 }
22684 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
22685  PyObject *tmp_type, *tmp_value, *tmp_tb;
22686  #if CYTHON_USE_EXC_INFO_STACK
22687  _PyErr_StackItem *exc_info = tstate->exc_info;
22688  tmp_type = exc_info->exc_type;
22689  tmp_value = exc_info->exc_value;
22690  tmp_tb = exc_info->exc_traceback;
22691  exc_info->exc_type = type;
22692  exc_info->exc_value = value;
22693  exc_info->exc_traceback = tb;
22694  #else
22695  tmp_type = tstate->exc_type;
22696  tmp_value = tstate->exc_value;
22697  tmp_tb = tstate->exc_traceback;
22698  tstate->exc_type = type;
22699  tstate->exc_value = value;
22700  tstate->exc_traceback = tb;
22701  #endif
22702  Py_XDECREF(tmp_type);
22703  Py_XDECREF(tmp_value);
22704  Py_XDECREF(tmp_tb);
22705 }
22706 #endif
22707 
22708 /* PyErrExceptionMatches */
22709 #if CYTHON_FAST_THREAD_STATE
22710 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
22711  Py_ssize_t i, n;
22712  n = PyTuple_GET_SIZE(tuple);
22713 #if PY_MAJOR_VERSION >= 3
22714  for (i=0; i<n; i++) {
22715  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
22716  }
22717 #endif
22718  for (i=0; i<n; i++) {
22719  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
22720  }
22721  return 0;
22722 }
22723 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
22724  PyObject *exc_type = tstate->curexc_type;
22725  if (exc_type == err) return 1;
22726  if (unlikely(!exc_type)) return 0;
22727  if (unlikely(PyTuple_Check(err)))
22728  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
22729  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
22730 }
22731 #endif
22732 
22733 /* GetException */
22734 #if CYTHON_FAST_THREAD_STATE
22735 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
22736 #else
22737 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
22738 #endif
22739 {
22740  PyObject *local_type, *local_value, *local_tb;
22741 #if CYTHON_FAST_THREAD_STATE
22742  PyObject *tmp_type, *tmp_value, *tmp_tb;
22743  local_type = tstate->curexc_type;
22744  local_value = tstate->curexc_value;
22745  local_tb = tstate->curexc_traceback;
22746  tstate->curexc_type = 0;
22747  tstate->curexc_value = 0;
22748  tstate->curexc_traceback = 0;
22749 #else
22750  PyErr_Fetch(&local_type, &local_value, &local_tb);
22751 #endif
22752  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
22753 #if CYTHON_FAST_THREAD_STATE
22754  if (unlikely(tstate->curexc_type))
22755 #else
22756  if (unlikely(PyErr_Occurred()))
22757 #endif
22758  goto bad;
22759  #if PY_MAJOR_VERSION >= 3
22760  if (local_tb) {
22761  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
22762  goto bad;
22763  }
22764  #endif
22765  Py_XINCREF(local_tb);
22766  Py_XINCREF(local_type);
22767  Py_XINCREF(local_value);
22768  *type = local_type;
22769  *value = local_value;
22770  *tb = local_tb;
22771 #if CYTHON_FAST_THREAD_STATE
22772  #if CYTHON_USE_EXC_INFO_STACK
22773  {
22774  _PyErr_StackItem *exc_info = tstate->exc_info;
22775  tmp_type = exc_info->exc_type;
22776  tmp_value = exc_info->exc_value;
22777  tmp_tb = exc_info->exc_traceback;
22778  exc_info->exc_type = local_type;
22779  exc_info->exc_value = local_value;
22780  exc_info->exc_traceback = local_tb;
22781  }
22782  #else
22783  tmp_type = tstate->exc_type;
22784  tmp_value = tstate->exc_value;
22785  tmp_tb = tstate->exc_traceback;
22786  tstate->exc_type = local_type;
22787  tstate->exc_value = local_value;
22788  tstate->exc_traceback = local_tb;
22789  #endif
22790  Py_XDECREF(tmp_type);
22791  Py_XDECREF(tmp_value);
22792  Py_XDECREF(tmp_tb);
22793 #else
22794  PyErr_SetExcInfo(local_type, local_value, local_tb);
22795 #endif
22796  return 0;
22797 bad:
22798  *type = 0;
22799  *value = 0;
22800  *tb = 0;
22801  Py_XDECREF(local_type);
22802  Py_XDECREF(local_value);
22803  Py_XDECREF(local_tb);
22804  return -1;
22805 }
22806 
22807 /* BytesEquals */
22808 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
22809 #if CYTHON_COMPILING_IN_PYPY
22810  return PyObject_RichCompareBool(s1, s2, equals);
22811 #else
22812  if (s1 == s2) {
22813  return (equals == Py_EQ);
22814  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
22815  const char *ps1, *ps2;
22816  Py_ssize_t length = PyBytes_GET_SIZE(s1);
22817  if (length != PyBytes_GET_SIZE(s2))
22818  return (equals == Py_NE);
22819  ps1 = PyBytes_AS_STRING(s1);
22820  ps2 = PyBytes_AS_STRING(s2);
22821  if (ps1[0] != ps2[0]) {
22822  return (equals == Py_NE);
22823  } else if (length == 1) {
22824  return (equals == Py_EQ);
22825  } else {
22826  int result;
22827 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
22828  Py_hash_t hash1, hash2;
22829  hash1 = ((PyBytesObject*)s1)->ob_shash;
22830  hash2 = ((PyBytesObject*)s2)->ob_shash;
22831  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22832  return (equals == Py_NE);
22833  }
22834 #endif
22835  result = memcmp(ps1, ps2, (size_t)length);
22836  return (equals == Py_EQ) ? (result == 0) : (result != 0);
22837  }
22838  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
22839  return (equals == Py_NE);
22840  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
22841  return (equals == Py_NE);
22842  } else {
22843  int result;
22844  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22845  if (!py_result)
22846  return -1;
22847  result = __Pyx_PyObject_IsTrue(py_result);
22848  Py_DECREF(py_result);
22849  return result;
22850  }
22851 #endif
22852 }
22853 
22854 /* UnicodeEquals */
22855 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
22856 #if CYTHON_COMPILING_IN_PYPY
22857  return PyObject_RichCompareBool(s1, s2, equals);
22858 #else
22859 #if PY_MAJOR_VERSION < 3
22860  PyObject* owned_ref = NULL;
22861 #endif
22862  int s1_is_unicode, s2_is_unicode;
22863  if (s1 == s2) {
22864  goto return_eq;
22865  }
22866  s1_is_unicode = PyUnicode_CheckExact(s1);
22867  s2_is_unicode = PyUnicode_CheckExact(s2);
22868 #if PY_MAJOR_VERSION < 3
22869  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
22870  owned_ref = PyUnicode_FromObject(s2);
22871  if (unlikely(!owned_ref))
22872  return -1;
22873  s2 = owned_ref;
22874  s2_is_unicode = 1;
22875  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
22876  owned_ref = PyUnicode_FromObject(s1);
22877  if (unlikely(!owned_ref))
22878  return -1;
22879  s1 = owned_ref;
22880  s1_is_unicode = 1;
22881  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
22882  return __Pyx_PyBytes_Equals(s1, s2, equals);
22883  }
22884 #endif
22885  if (s1_is_unicode & s2_is_unicode) {
22886  Py_ssize_t length;
22887  int kind;
22888  void *data1, *data2;
22889  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
22890  return -1;
22891  length = __Pyx_PyUnicode_GET_LENGTH(s1);
22892  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
22893  goto return_ne;
22894  }
22895 #if CYTHON_USE_UNICODE_INTERNALS
22896  {
22897  Py_hash_t hash1, hash2;
22898  #if CYTHON_PEP393_ENABLED
22899  hash1 = ((PyASCIIObject*)s1)->hash;
22900  hash2 = ((PyASCIIObject*)s2)->hash;
22901  #else
22902  hash1 = ((PyUnicodeObject*)s1)->hash;
22903  hash2 = ((PyUnicodeObject*)s2)->hash;
22904  #endif
22905  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
22906  goto return_ne;
22907  }
22908  }
22909 #endif
22910  kind = __Pyx_PyUnicode_KIND(s1);
22911  if (kind != __Pyx_PyUnicode_KIND(s2)) {
22912  goto return_ne;
22913  }
22914  data1 = __Pyx_PyUnicode_DATA(s1);
22915  data2 = __Pyx_PyUnicode_DATA(s2);
22916  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
22917  goto return_ne;
22918  } else if (length == 1) {
22919  goto return_eq;
22920  } else {
22921  int result = memcmp(data1, data2, (size_t)(length * kind));
22922  #if PY_MAJOR_VERSION < 3
22923  Py_XDECREF(owned_ref);
22924  #endif
22925  return (equals == Py_EQ) ? (result == 0) : (result != 0);
22926  }
22927  } else if ((s1 == Py_None) & s2_is_unicode) {
22928  goto return_ne;
22929  } else if ((s2 == Py_None) & s1_is_unicode) {
22930  goto return_ne;
22931  } else {
22932  int result;
22933  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
22934  #if PY_MAJOR_VERSION < 3
22935  Py_XDECREF(owned_ref);
22936  #endif
22937  if (!py_result)
22938  return -1;
22939  result = __Pyx_PyObject_IsTrue(py_result);
22940  Py_DECREF(py_result);
22941  return result;
22942  }
22943 return_eq:
22944  #if PY_MAJOR_VERSION < 3
22945  Py_XDECREF(owned_ref);
22946  #endif
22947  return (equals == Py_EQ);
22948 return_ne:
22949  #if PY_MAJOR_VERSION < 3
22950  Py_XDECREF(owned_ref);
22951  #endif
22952  return (equals == Py_NE);
22953 #endif
22954 }
22955 
22956 /* DivInt[Py_ssize_t] */
22957 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
22958  Py_ssize_t q = a / b;
22959  Py_ssize_t r = a - q*b;
22960  q -= ((r != 0) & ((r ^ b) < 0));
22961  return q;
22962 }
22963 
22964 /* GetAttr */
22965 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
22966 #if CYTHON_USE_TYPE_SLOTS
22967 #if PY_MAJOR_VERSION >= 3
22968  if (likely(PyUnicode_Check(n)))
22969 #else
22970  if (likely(PyString_Check(n)))
22971 #endif
22972  return __Pyx_PyObject_GetAttrStr(o, n);
22973 #endif
22974  return PyObject_GetAttr(o, n);
22975 }
22976 
22977 /* ObjectGetItem */
22978 #if CYTHON_USE_TYPE_SLOTS
22979 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
22980  PyObject *runerr;
22981  Py_ssize_t key_value;
22982  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
22983  if (unlikely(!(m && m->sq_item))) {
22984  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
22985  return NULL;
22986  }
22987  key_value = __Pyx_PyIndex_AsSsize_t(index);
22988  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
22989  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
22990  }
22991  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
22992  PyErr_Clear();
22993  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
22994  }
22995  return NULL;
22996 }
22997 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
22998  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
22999  if (likely(m && m->mp_subscript)) {
23000  return m->mp_subscript(obj, key);
23001  }
23002  return __Pyx_PyObject_GetIndex(obj, key);
23003 }
23004 #endif
23005 
23006 /* decode_c_string */
23007 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
23008  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
23009  const char* encoding, const char* errors,
23010  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
23011  Py_ssize_t length;
23012  if (unlikely((start < 0) | (stop < 0))) {
23013  size_t slen = strlen(cstring);
23014  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
23015  PyErr_SetString(PyExc_OverflowError,
23016  "c-string too long to convert to Python");
23017  return NULL;
23018  }
23019  length = (Py_ssize_t) slen;
23020  if (start < 0) {
23021  start += length;
23022  if (start < 0)
23023  start = 0;
23024  }
23025  if (stop < 0)
23026  stop += length;
23027  }
23028  if (unlikely(stop <= start))
23029  return __Pyx_NewRef(__pyx_empty_unicode);
23030  length = stop - start;
23031  cstring += start;
23032  if (decode_func) {
23033  return decode_func(cstring, length, errors);
23034  } else {
23035  return PyUnicode_Decode(cstring, length, encoding, errors);
23036  }
23037 }
23038 
23039 /* GetAttr3 */
23040 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
23041  __Pyx_PyThreadState_declare
23042  __Pyx_PyThreadState_assign
23043  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
23044  return NULL;
23045  __Pyx_PyErr_Clear();
23046  Py_INCREF(d);
23047  return d;
23048 }
23049 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
23050  PyObject *r = __Pyx_GetAttr(o, n);
23051  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
23052 }
23053 
23054 /* RaiseTooManyValuesToUnpack */
23055 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
23056  PyErr_Format(PyExc_ValueError,
23057  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
23058 }
23059 
23060 /* RaiseNeedMoreValuesToUnpack */
23061 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
23062  PyErr_Format(PyExc_ValueError,
23063  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
23064  index, (index == 1) ? "" : "s");
23065 }
23066 
23067 /* RaiseNoneIterError */
23068 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
23069  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
23070 }
23071 
23072 /* SwapException */
23073 #if CYTHON_FAST_THREAD_STATE
23074 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23075  PyObject *tmp_type, *tmp_value, *tmp_tb;
23076  #if CYTHON_USE_EXC_INFO_STACK
23077  _PyErr_StackItem *exc_info = tstate->exc_info;
23078  tmp_type = exc_info->exc_type;
23079  tmp_value = exc_info->exc_value;
23080  tmp_tb = exc_info->exc_traceback;
23081  exc_info->exc_type = *type;
23082  exc_info->exc_value = *value;
23083  exc_info->exc_traceback = *tb;
23084  #else
23085  tmp_type = tstate->exc_type;
23086  tmp_value = tstate->exc_value;
23087  tmp_tb = tstate->exc_traceback;
23088  tstate->exc_type = *type;
23089  tstate->exc_value = *value;
23090  tstate->exc_traceback = *tb;
23091  #endif
23092  *type = tmp_type;
23093  *value = tmp_value;
23094  *tb = tmp_tb;
23095 }
23096 #else
23097 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
23098  PyObject *tmp_type, *tmp_value, *tmp_tb;
23099  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
23100  PyErr_SetExcInfo(*type, *value, *tb);
23101  *type = tmp_type;
23102  *value = tmp_value;
23103  *tb = tmp_tb;
23104 }
23105 #endif
23106 
23107 /* Import */
23108 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
23109  PyObject *empty_list = 0;
23110  PyObject *module = 0;
23111  PyObject *global_dict = 0;
23112  PyObject *empty_dict = 0;
23113  PyObject *list;
23114  #if PY_MAJOR_VERSION < 3
23115  PyObject *py_import;
23116  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
23117  if (!py_import)
23118  goto bad;
23119  #endif
23120  if (from_list)
23121  list = from_list;
23122  else {
23123  empty_list = PyList_New(0);
23124  if (!empty_list)
23125  goto bad;
23126  list = empty_list;
23127  }
23128  global_dict = PyModule_GetDict(__pyx_m);
23129  if (!global_dict)
23130  goto bad;
23131  empty_dict = PyDict_New();
23132  if (!empty_dict)
23133  goto bad;
23134  {
23135  #if PY_MAJOR_VERSION >= 3
23136  if (level == -1) {
23137  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
23138  module = PyImport_ImportModuleLevelObject(
23139  name, global_dict, empty_dict, list, 1);
23140  if (!module) {
23141  if (!PyErr_ExceptionMatches(PyExc_ImportError))
23142  goto bad;
23143  PyErr_Clear();
23144  }
23145  }
23146  level = 0;
23147  }
23148  #endif
23149  if (!module) {
23150  #if PY_MAJOR_VERSION < 3
23151  PyObject *py_level = PyInt_FromLong(level);
23152  if (!py_level)
23153  goto bad;
23154  module = PyObject_CallFunctionObjArgs(py_import,
23155  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
23156  Py_DECREF(py_level);
23157  #else
23158  module = PyImport_ImportModuleLevelObject(
23159  name, global_dict, empty_dict, list, level);
23160  #endif
23161  }
23162  }
23163 bad:
23164  #if PY_MAJOR_VERSION < 3
23165  Py_XDECREF(py_import);
23166  #endif
23167  Py_XDECREF(empty_list);
23168  Py_XDECREF(empty_dict);
23169  return module;
23170 }
23171 
23172 /* FastTypeChecks */
23173 #if CYTHON_COMPILING_IN_CPYTHON
23174 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
23175  while (a) {
23176  a = a->tp_base;
23177  if (a == b)
23178  return 1;
23179  }
23180  return b == &PyBaseObject_Type;
23181 }
23182 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
23183  PyObject *mro;
23184  if (a == b) return 1;
23185  mro = a->tp_mro;
23186  if (likely(mro)) {
23187  Py_ssize_t i, n;
23188  n = PyTuple_GET_SIZE(mro);
23189  for (i = 0; i < n; i++) {
23190  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
23191  return 1;
23192  }
23193  return 0;
23194  }
23195  return __Pyx_InBases(a, b);
23196 }
23197 #if PY_MAJOR_VERSION == 2
23198 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
23199  PyObject *exception, *value, *tb;
23200  int res;
23201  __Pyx_PyThreadState_declare
23202  __Pyx_PyThreadState_assign
23203  __Pyx_ErrFetch(&exception, &value, &tb);
23204  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
23205  if (unlikely(res == -1)) {
23206  PyErr_WriteUnraisable(err);
23207  res = 0;
23208  }
23209  if (!res) {
23210  res = PyObject_IsSubclass(err, exc_type2);
23211  if (unlikely(res == -1)) {
23212  PyErr_WriteUnraisable(err);
23213  res = 0;
23214  }
23215  }
23216  __Pyx_ErrRestore(exception, value, tb);
23217  return res;
23218 }
23219 #else
23220 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
23221  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
23222  if (!res) {
23223  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
23224  }
23225  return res;
23226 }
23227 #endif
23228 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
23229  Py_ssize_t i, n;
23230  assert(PyExceptionClass_Check(exc_type));
23231  n = PyTuple_GET_SIZE(tuple);
23232 #if PY_MAJOR_VERSION >= 3
23233  for (i=0; i<n; i++) {
23234  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
23235  }
23236 #endif
23237  for (i=0; i<n; i++) {
23238  PyObject *t = PyTuple_GET_ITEM(tuple, i);
23239  #if PY_MAJOR_VERSION < 3
23240  if (likely(exc_type == t)) return 1;
23241  #endif
23242  if (likely(PyExceptionClass_Check(t))) {
23243  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
23244  } else {
23245  }
23246  }
23247  return 0;
23248 }
23249 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
23250  if (likely(err == exc_type)) return 1;
23251  if (likely(PyExceptionClass_Check(err))) {
23252  if (likely(PyExceptionClass_Check(exc_type))) {
23253  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
23254  } else if (likely(PyTuple_Check(exc_type))) {
23255  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
23256  } else {
23257  }
23258  }
23259  return PyErr_GivenExceptionMatches(err, exc_type);
23260 }
23261 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
23262  assert(PyExceptionClass_Check(exc_type1));
23263  assert(PyExceptionClass_Check(exc_type2));
23264  if (likely(err == exc_type1 || err == exc_type2)) return 1;
23265  if (likely(PyExceptionClass_Check(err))) {
23266  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
23267  }
23268  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
23269 }
23270 #endif
23271 
23272 /* PyIntBinop */
23273 #if !CYTHON_COMPILING_IN_PYPY
23274 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
23275  (void)inplace;
23276  (void)zerodivision_check;
23277  #if PY_MAJOR_VERSION < 3
23278  if (likely(PyInt_CheckExact(op1))) {
23279  const long b = intval;
23280  long x;
23281  long a = PyInt_AS_LONG(op1);
23282  x = (long)((unsigned long)a + b);
23283  if (likely((x^a) >= 0 || (x^b) >= 0))
23284  return PyInt_FromLong(x);
23285  return PyLong_Type.tp_as_number->nb_add(op1, op2);
23286  }
23287  #endif
23288  #if CYTHON_USE_PYLONG_INTERNALS
23289  if (likely(PyLong_CheckExact(op1))) {
23290  const long b = intval;
23291  long a, x;
23292 #ifdef HAVE_LONG_LONG
23293  const PY_LONG_LONG llb = intval;
23294  PY_LONG_LONG lla, llx;
23295 #endif
23296  const digit* digits = ((PyLongObject*)op1)->ob_digit;
23297  const Py_ssize_t size = Py_SIZE(op1);
23298  if (likely(__Pyx_sst_abs(size) <= 1)) {
23299  a = likely(size) ? digits[0] : 0;
23300  if (size == -1) a = -a;
23301  } else {
23302  switch (size) {
23303  case -2:
23304  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
23305  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23306  break;
23307 #ifdef HAVE_LONG_LONG
23308  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23309  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23310  goto long_long;
23311 #endif
23312  }
23313  CYTHON_FALLTHROUGH;
23314  case 2:
23315  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
23316  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23317  break;
23318 #ifdef HAVE_LONG_LONG
23319  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23320  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23321  goto long_long;
23322 #endif
23323  }
23324  CYTHON_FALLTHROUGH;
23325  case -3:
23326  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
23327  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23328  break;
23329 #ifdef HAVE_LONG_LONG
23330  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23331  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]));
23332  goto long_long;
23333 #endif
23334  }
23335  CYTHON_FALLTHROUGH;
23336  case 3:
23337  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
23338  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23339  break;
23340 #ifdef HAVE_LONG_LONG
23341  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23342  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]));
23343  goto long_long;
23344 #endif
23345  }
23346  CYTHON_FALLTHROUGH;
23347  case -4:
23348  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
23349  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23350  break;
23351 #ifdef HAVE_LONG_LONG
23352  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23353  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]));
23354  goto long_long;
23355 #endif
23356  }
23357  CYTHON_FALLTHROUGH;
23358  case 4:
23359  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
23360  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23361  break;
23362 #ifdef HAVE_LONG_LONG
23363  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23364  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]));
23365  goto long_long;
23366 #endif
23367  }
23368  CYTHON_FALLTHROUGH;
23369  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
23370  }
23371  }
23372  x = a + b;
23373  return PyLong_FromLong(x);
23374 #ifdef HAVE_LONG_LONG
23375  long_long:
23376  llx = lla + llb;
23377  return PyLong_FromLongLong(llx);
23378 #endif
23379 
23380 
23381  }
23382  #endif
23383  if (PyFloat_CheckExact(op1)) {
23384  const long b = intval;
23385  double a = PyFloat_AS_DOUBLE(op1);
23386  double result;
23387  PyFPE_START_PROTECT("add", return NULL)
23388  result = ((double)a) + (double)b;
23389  PyFPE_END_PROTECT(result)
23390  return PyFloat_FromDouble(result);
23391  }
23392  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
23393 }
23394 #endif
23395 
23396 /* None */
23397 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
23398  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
23399 }
23400 
23401 /* DivInt[long] */
23402 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
23403  long q = a / b;
23404  long r = a - q*b;
23405  q -= ((r != 0) & ((r ^ b) < 0));
23406  return q;
23407 }
23408 
23409 /* ImportFrom */
23410 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
23411  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
23412  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
23413  PyErr_Format(PyExc_ImportError,
23414  #if PY_MAJOR_VERSION < 3
23415  "cannot import name %.230s", PyString_AS_STRING(name));
23416  #else
23417  "cannot import name %S", name);
23418  #endif
23419  }
23420  return value;
23421 }
23422 
23423 /* HasAttr */
23424 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
23425  PyObject *r;
23426  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
23427  PyErr_SetString(PyExc_TypeError,
23428  "hasattr(): attribute name must be string");
23429  return -1;
23430  }
23431  r = __Pyx_GetAttr(o, n);
23432  if (unlikely(!r)) {
23433  PyErr_Clear();
23434  return 0;
23435  } else {
23436  Py_DECREF(r);
23437  return 1;
23438  }
23439 }
23440 
23441 /* StringJoin */
23442 #if !CYTHON_COMPILING_IN_CPYTHON
23443 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
23444  return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
23445 }
23446 #endif
23447 
23448 /* PyObject_GenericGetAttrNoDict */
23449 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
23450 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
23451  PyErr_Format(PyExc_AttributeError,
23452 #if PY_MAJOR_VERSION >= 3
23453  "'%.50s' object has no attribute '%U'",
23454  tp->tp_name, attr_name);
23455 #else
23456  "'%.50s' object has no attribute '%.400s'",
23457  tp->tp_name, PyString_AS_STRING(attr_name));
23458 #endif
23459  return NULL;
23460 }
23461 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
23462  PyObject *descr;
23463  PyTypeObject *tp = Py_TYPE(obj);
23464  if (unlikely(!PyString_Check(attr_name))) {
23465  return PyObject_GenericGetAttr(obj, attr_name);
23466  }
23467  assert(!tp->tp_dictoffset);
23468  descr = _PyType_Lookup(tp, attr_name);
23469  if (unlikely(!descr)) {
23470  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
23471  }
23472  Py_INCREF(descr);
23473  #if PY_MAJOR_VERSION < 3
23474  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
23475  #endif
23476  {
23477  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
23478  if (unlikely(f)) {
23479  PyObject *res = f(descr, obj, (PyObject *)tp);
23480  Py_DECREF(descr);
23481  return res;
23482  }
23483  }
23484  return descr;
23485 }
23486 #endif
23487 
23488 /* PyObject_GenericGetAttr */
23489 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
23490 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
23491  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
23492  return PyObject_GenericGetAttr(obj, attr_name);
23493  }
23494  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
23495 }
23496 #endif
23497 
23498 /* PyObjectGetAttrStrNoError */
23499 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
23500  __Pyx_PyThreadState_declare
23501  __Pyx_PyThreadState_assign
23502  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
23503  __Pyx_PyErr_Clear();
23504 }
23505 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
23506  PyObject *result;
23507 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
23508  PyTypeObject* tp = Py_TYPE(obj);
23509  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
23510  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
23511  }
23512 #endif
23513  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
23514  if (unlikely(!result)) {
23515  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
23516  }
23517  return result;
23518 }
23519 
23520 /* SetupReduce */
23521 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
23522  int ret;
23523  PyObject *name_attr;
23524  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
23525  if (likely(name_attr)) {
23526  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
23527  } else {
23528  ret = -1;
23529  }
23530  if (unlikely(ret < 0)) {
23531  PyErr_Clear();
23532  ret = 0;
23533  }
23534  Py_XDECREF(name_attr);
23535  return ret;
23536 }
23537 static int __Pyx_setup_reduce(PyObject* type_obj) {
23538  int ret = 0;
23539  PyObject *object_reduce = NULL;
23540  PyObject *object_getstate = NULL;
23541  PyObject *object_reduce_ex = NULL;
23542  PyObject *reduce = NULL;
23543  PyObject *reduce_ex = NULL;
23544  PyObject *reduce_cython = NULL;
23545  PyObject *setstate = NULL;
23546  PyObject *setstate_cython = NULL;
23547  PyObject *getstate = NULL;
23548 #if CYTHON_USE_PYTYPE_LOOKUP
23549  getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
23550 #else
23551  getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
23552  if (!getstate && PyErr_Occurred()) {
23553  goto __PYX_BAD;
23554  }
23555 #endif
23556  if (getstate) {
23557 #if CYTHON_USE_PYTYPE_LOOKUP
23558  object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
23559 #else
23560  object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
23561  if (!object_getstate && PyErr_Occurred()) {
23562  goto __PYX_BAD;
23563  }
23564 #endif
23565  if (object_getstate != getstate) {
23566  goto __PYX_GOOD;
23567  }
23568  }
23569 #if CYTHON_USE_PYTYPE_LOOKUP
23570  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
23571 #else
23572  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
23573 #endif
23574  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
23575  if (reduce_ex == object_reduce_ex) {
23576 #if CYTHON_USE_PYTYPE_LOOKUP
23577  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
23578 #else
23579  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
23580 #endif
23581  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
23582  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
23583  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
23584  if (likely(reduce_cython)) {
23585  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
23586  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
23587  } else if (reduce == object_reduce || PyErr_Occurred()) {
23588  goto __PYX_BAD;
23589  }
23590  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
23591  if (!setstate) PyErr_Clear();
23592  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
23593  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
23594  if (likely(setstate_cython)) {
23595  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
23596  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
23597  } else if (!setstate || PyErr_Occurred()) {
23598  goto __PYX_BAD;
23599  }
23600  }
23601  PyType_Modified((PyTypeObject*)type_obj);
23602  }
23603  }
23604  goto __PYX_GOOD;
23605 __PYX_BAD:
23606  if (!PyErr_Occurred())
23607  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
23608  ret = -1;
23609 __PYX_GOOD:
23610 #if !CYTHON_USE_PYTYPE_LOOKUP
23611  Py_XDECREF(object_reduce);
23612  Py_XDECREF(object_reduce_ex);
23613  Py_XDECREF(object_getstate);
23614  Py_XDECREF(getstate);
23615 #endif
23616  Py_XDECREF(reduce);
23617  Py_XDECREF(reduce_ex);
23618  Py_XDECREF(reduce_cython);
23619  Py_XDECREF(setstate);
23620  Py_XDECREF(setstate_cython);
23621  return ret;
23622 }
23623 
23624 /* SetVTable */
23625 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
23626 #if PY_VERSION_HEX >= 0x02070000
23627  PyObject *ob = PyCapsule_New(vtable, 0, 0);
23628 #else
23629  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
23630 #endif
23631  if (!ob)
23632  goto bad;
23633  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
23634  goto bad;
23635  Py_DECREF(ob);
23636  return 0;
23637 bad:
23638  Py_XDECREF(ob);
23639  return -1;
23640 }
23641 
23642 /* TypeImport */
23643 #ifndef __PYX_HAVE_RT_ImportType
23644 #define __PYX_HAVE_RT_ImportType
23645 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
23646  size_t size, enum __Pyx_ImportType_CheckSize check_size)
23647 {
23648  PyObject *result = 0;
23649  char warning[200];
23650  Py_ssize_t basicsize;
23651 #ifdef Py_LIMITED_API
23652  PyObject *py_basicsize;
23653 #endif
23654  result = PyObject_GetAttrString(module, class_name);
23655  if (!result)
23656  goto bad;
23657  if (!PyType_Check(result)) {
23658  PyErr_Format(PyExc_TypeError,
23659  "%.200s.%.200s is not a type object",
23660  module_name, class_name);
23661  goto bad;
23662  }
23663 #ifndef Py_LIMITED_API
23664  basicsize = ((PyTypeObject *)result)->tp_basicsize;
23665 #else
23666  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
23667  if (!py_basicsize)
23668  goto bad;
23669  basicsize = PyLong_AsSsize_t(py_basicsize);
23670  Py_DECREF(py_basicsize);
23671  py_basicsize = 0;
23672  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
23673  goto bad;
23674 #endif
23675  if ((size_t)basicsize < size) {
23676  PyErr_Format(PyExc_ValueError,
23677  "%.200s.%.200s size changed, may indicate binary incompatibility. "
23678  "Expected %zd from C header, got %zd from PyObject",
23679  module_name, class_name, size, basicsize);
23680  goto bad;
23681  }
23682  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
23683  PyErr_Format(PyExc_ValueError,
23684  "%.200s.%.200s size changed, may indicate binary incompatibility. "
23685  "Expected %zd from C header, got %zd from PyObject",
23686  module_name, class_name, size, basicsize);
23687  goto bad;
23688  }
23689  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
23690  PyOS_snprintf(warning, sizeof(warning),
23691  "%s.%s size changed, may indicate binary incompatibility. "
23692  "Expected %zd from C header, got %zd from PyObject",
23693  module_name, class_name, size, basicsize);
23694  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
23695  }
23696  return (PyTypeObject *)result;
23697 bad:
23698  Py_XDECREF(result);
23699  return NULL;
23700 }
23701 #endif
23702 
23703 /* CLineInTraceback */
23704 #ifndef CYTHON_CLINE_IN_TRACEBACK
23705 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
23706  PyObject *use_cline;
23707  PyObject *ptype, *pvalue, *ptraceback;
23708 #if CYTHON_COMPILING_IN_CPYTHON
23709  PyObject **cython_runtime_dict;
23710 #endif
23711  if (unlikely(!__pyx_cython_runtime)) {
23712  return c_line;
23713  }
23714  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
23715 #if CYTHON_COMPILING_IN_CPYTHON
23716  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
23717  if (likely(cython_runtime_dict)) {
23718  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
23719  use_cline, *cython_runtime_dict,
23720  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
23721  } else
23722 #endif
23723  {
23724  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
23725  if (use_cline_obj) {
23726  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
23727  Py_DECREF(use_cline_obj);
23728  } else {
23729  PyErr_Clear();
23730  use_cline = NULL;
23731  }
23732  }
23733  if (!use_cline) {
23734  c_line = 0;
23735  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
23736  }
23737  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
23738  c_line = 0;
23739  }
23740  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
23741  return c_line;
23742 }
23743 #endif
23744 
23745 /* CodeObjectCache */
23746 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
23747  int start = 0, mid = 0, end = count - 1;
23748  if (end >= 0 && code_line > entries[end].code_line) {
23749  return count;
23750  }
23751  while (start < end) {
23752  mid = start + (end - start) / 2;
23753  if (code_line < entries[mid].code_line) {
23754  end = mid;
23755  } else if (code_line > entries[mid].code_line) {
23756  start = mid + 1;
23757  } else {
23758  return mid;
23759  }
23760  }
23761  if (code_line <= entries[mid].code_line) {
23762  return mid;
23763  } else {
23764  return mid + 1;
23765  }
23766 }
23767 static PyCodeObject *__pyx_find_code_object(int code_line) {
23768  PyCodeObject* code_object;
23769  int pos;
23770  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
23771  return NULL;
23772  }
23773  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
23774  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
23775  return NULL;
23776  }
23777  code_object = __pyx_code_cache.entries[pos].code_object;
23778  Py_INCREF(code_object);
23779  return code_object;
23780 }
23781 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
23782  int pos, i;
23783  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
23784  if (unlikely(!code_line)) {
23785  return;
23786  }
23787  if (unlikely(!entries)) {
23788  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
23789  if (likely(entries)) {
23790  __pyx_code_cache.entries = entries;
23791  __pyx_code_cache.max_count = 64;
23792  __pyx_code_cache.count = 1;
23793  entries[0].code_line = code_line;
23794  entries[0].code_object = code_object;
23795  Py_INCREF(code_object);
23796  }
23797  return;
23798  }
23799  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
23800  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
23801  PyCodeObject* tmp = entries[pos].code_object;
23802  entries[pos].code_object = code_object;
23803  Py_DECREF(tmp);
23804  return;
23805  }
23806  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
23807  int new_max = __pyx_code_cache.max_count + 64;
23808  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
23809  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
23810  if (unlikely(!entries)) {
23811  return;
23812  }
23813  __pyx_code_cache.entries = entries;
23814  __pyx_code_cache.max_count = new_max;
23815  }
23816  for (i=__pyx_code_cache.count; i>pos; i--) {
23817  entries[i] = entries[i-1];
23818  }
23819  entries[pos].code_line = code_line;
23820  entries[pos].code_object = code_object;
23821  __pyx_code_cache.count++;
23822  Py_INCREF(code_object);
23823 }
23824 
23825 /* AddTraceback */
23826 #include "compile.h"
23827 #include "frameobject.h"
23828 #include "traceback.h"
23829 #if PY_VERSION_HEX >= 0x030b00a6
23830  #ifndef Py_BUILD_CORE
23831  #define Py_BUILD_CORE 1
23832  #endif
23833  #include "internal/pycore_frame.h"
23834 #endif
23835 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
23836  const char *funcname, int c_line,
23837  int py_line, const char *filename) {
23838  PyCodeObject *py_code = NULL;
23839  PyObject *py_funcname = NULL;
23840  #if PY_MAJOR_VERSION < 3
23841  PyObject *py_srcfile = NULL;
23842  py_srcfile = PyString_FromString(filename);
23843  if (!py_srcfile) goto bad;
23844  #endif
23845  if (c_line) {
23846  #if PY_MAJOR_VERSION < 3
23847  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
23848  if (!py_funcname) goto bad;
23849  #else
23850  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
23851  if (!py_funcname) goto bad;
23852  funcname = PyUnicode_AsUTF8(py_funcname);
23853  if (!funcname) goto bad;
23854  #endif
23855  }
23856  else {
23857  #if PY_MAJOR_VERSION < 3
23858  py_funcname = PyString_FromString(funcname);
23859  if (!py_funcname) goto bad;
23860  #endif
23861  }
23862  #if PY_MAJOR_VERSION < 3
23863  py_code = __Pyx_PyCode_New(
23864  0,
23865  0,
23866  0,
23867  0,
23868  0,
23869  __pyx_empty_bytes, /*PyObject *code,*/
23870  __pyx_empty_tuple, /*PyObject *consts,*/
23871  __pyx_empty_tuple, /*PyObject *names,*/
23872  __pyx_empty_tuple, /*PyObject *varnames,*/
23873  __pyx_empty_tuple, /*PyObject *freevars,*/
23874  __pyx_empty_tuple, /*PyObject *cellvars,*/
23875  py_srcfile, /*PyObject *filename,*/
23876  py_funcname, /*PyObject *name,*/
23877  py_line,
23878  __pyx_empty_bytes /*PyObject *lnotab*/
23879  );
23880  Py_DECREF(py_srcfile);
23881  #else
23882  py_code = PyCode_NewEmpty(filename, funcname, py_line);
23883  #endif
23884  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
23885  return py_code;
23886 bad:
23887  Py_XDECREF(py_funcname);
23888  #if PY_MAJOR_VERSION < 3
23889  Py_XDECREF(py_srcfile);
23890  #endif
23891  return NULL;
23892 }
23893 static void __Pyx_AddTraceback(const char *funcname, int c_line,
23894  int py_line, const char *filename) {
23895  PyCodeObject *py_code = 0;
23896  PyFrameObject *py_frame = 0;
23897  PyThreadState *tstate = __Pyx_PyThreadState_Current;
23898  PyObject *ptype, *pvalue, *ptraceback;
23899  if (c_line) {
23900  c_line = __Pyx_CLineForTraceback(tstate, c_line);
23901  }
23902  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
23903  if (!py_code) {
23904  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
23905  py_code = __Pyx_CreateCodeObjectForTraceback(
23906  funcname, c_line, py_line, filename);
23907  if (!py_code) {
23908  /* If the code object creation fails, then we should clear the
23909  fetched exception references and propagate the new exception */
23910  Py_XDECREF(ptype);
23911  Py_XDECREF(pvalue);
23912  Py_XDECREF(ptraceback);
23913  goto bad;
23914  }
23915  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
23916  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
23917  }
23918  py_frame = PyFrame_New(
23919  tstate, /*PyThreadState *tstate,*/
23920  py_code, /*PyCodeObject *code,*/
23921  __pyx_d, /*PyObject *globals,*/
23922  0 /*PyObject *locals*/
23923  );
23924  if (!py_frame) goto bad;
23925  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
23926  PyTraceBack_Here(py_frame);
23927 bad:
23928  Py_XDECREF(py_code);
23929  Py_XDECREF(py_frame);
23930 }
23931 
23932 /* CIntFromPyVerify */
23933 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
23934  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
23935 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
23936  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
23937 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
23938  {\
23939  func_type value = func_value;\
23940  if (sizeof(target_type) < sizeof(func_type)) {\
23941  if (unlikely(value != (func_type) (target_type) value)) {\
23942  func_type zero = 0;\
23943  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
23944  return (target_type) -1;\
23945  if (is_unsigned && unlikely(value < zero))\
23946  goto raise_neg_overflow;\
23947  else\
23948  goto raise_overflow;\
23949  }\
23950  }\
23951  return (target_type) value;\
23952  }
23953 
23954 /* MemviewDtypeToObject */
23955 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
23956  return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
23957 }
23958 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
23959  double value = __pyx_PyFloat_AsDouble(obj);
23960  if ((value == (double)-1) && PyErr_Occurred())
23961  return 0;
23962  *(double *) itemp = value;
23963  return 1;
23964 }
23965 
23966 /* Declarations */
23967 #if CYTHON_CCOMPLEX
23968  #ifdef __cplusplus
23969  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
23970  return ::std::complex< float >(x, y);
23971  }
23972  #else
23973  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
23974  return x + y*(__pyx_t_float_complex)_Complex_I;
23975  }
23976  #endif
23977 #else
23978  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
23979  __pyx_t_float_complex z;
23980  z.real = x;
23981  z.imag = y;
23982  return z;
23983  }
23984 #endif
23985 
23986 /* Arithmetic */
23987 #if CYTHON_CCOMPLEX
23988 #else
23989  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23990  return (a.real == b.real) && (a.imag == b.imag);
23991  }
23992  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23993  __pyx_t_float_complex z;
23994  z.real = a.real + b.real;
23995  z.imag = a.imag + b.imag;
23996  return z;
23997  }
23998  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
23999  __pyx_t_float_complex z;
24000  z.real = a.real - b.real;
24001  z.imag = a.imag - b.imag;
24002  return z;
24003  }
24004  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24005  __pyx_t_float_complex z;
24006  z.real = a.real * b.real - a.imag * b.imag;
24007  z.imag = a.real * b.imag + a.imag * b.real;
24008  return z;
24009  }
24010  #if 1
24011  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24012  if (b.imag == 0) {
24013  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
24014  } else if (fabsf(b.real) >= fabsf(b.imag)) {
24015  if (b.real == 0 && b.imag == 0) {
24016  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
24017  } else {
24018  float r = b.imag / b.real;
24019  float s = (float)(1.0) / (b.real + b.imag * r);
24020  return __pyx_t_float_complex_from_parts(
24021  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
24022  }
24023  } else {
24024  float r = b.real / b.imag;
24025  float s = (float)(1.0) / (b.imag + b.real * r);
24026  return __pyx_t_float_complex_from_parts(
24027  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
24028  }
24029  }
24030  #else
24031  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24032  if (b.imag == 0) {
24033  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
24034  } else {
24035  float denom = b.real * b.real + b.imag * b.imag;
24036  return __pyx_t_float_complex_from_parts(
24037  (a.real * b.real + a.imag * b.imag) / denom,
24038  (a.imag * b.real - a.real * b.imag) / denom);
24039  }
24040  }
24041  #endif
24042  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
24043  __pyx_t_float_complex z;
24044  z.real = -a.real;
24045  z.imag = -a.imag;
24046  return z;
24047  }
24048  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
24049  return (a.real == 0) && (a.imag == 0);
24050  }
24051  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
24052  __pyx_t_float_complex z;
24053  z.real = a.real;
24054  z.imag = -a.imag;
24055  return z;
24056  }
24057  #if 1
24058  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
24059  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
24060  return sqrtf(z.real*z.real + z.imag*z.imag);
24061  #else
24062  return hypotf(z.real, z.imag);
24063  #endif
24064  }
24065  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
24066  __pyx_t_float_complex z;
24067  float r, lnr, theta, z_r, z_theta;
24068  if (b.imag == 0 && b.real == (int)b.real) {
24069  if (b.real < 0) {
24070  float denom = a.real * a.real + a.imag * a.imag;
24071  a.real = a.real / denom;
24072  a.imag = -a.imag / denom;
24073  b.real = -b.real;
24074  }
24075  switch ((int)b.real) {
24076  case 0:
24077  z.real = 1;
24078  z.imag = 0;
24079  return z;
24080  case 1:
24081  return a;
24082  case 2:
24083  return __Pyx_c_prod_float(a, a);
24084  case 3:
24085  z = __Pyx_c_prod_float(a, a);
24086  return __Pyx_c_prod_float(z, a);
24087  case 4:
24088  z = __Pyx_c_prod_float(a, a);
24089  return __Pyx_c_prod_float(z, z);
24090  }
24091  }
24092  if (a.imag == 0) {
24093  if (a.real == 0) {
24094  return a;
24095  } else if (b.imag == 0) {
24096  z.real = powf(a.real, b.real);
24097  z.imag = 0;
24098  return z;
24099  } else if (a.real > 0) {
24100  r = a.real;
24101  theta = 0;
24102  } else {
24103  r = -a.real;
24104  theta = atan2f(0.0, -1.0);
24105  }
24106  } else {
24107  r = __Pyx_c_abs_float(a);
24108  theta = atan2f(a.imag, a.real);
24109  }
24110  lnr = logf(r);
24111  z_r = expf(lnr * b.real - theta * b.imag);
24112  z_theta = theta * b.real + lnr * b.imag;
24113  z.real = z_r * cosf(z_theta);
24114  z.imag = z_r * sinf(z_theta);
24115  return z;
24116  }
24117  #endif
24118 #endif
24119 
24120 /* Declarations */
24121 #if CYTHON_CCOMPLEX
24122  #ifdef __cplusplus
24123  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
24124  return ::std::complex< double >(x, y);
24125  }
24126  #else
24127  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
24128  return x + y*(__pyx_t_double_complex)_Complex_I;
24129  }
24130  #endif
24131 #else
24132  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
24133  __pyx_t_double_complex z;
24134  z.real = x;
24135  z.imag = y;
24136  return z;
24137  }
24138 #endif
24139 
24140 /* Arithmetic */
24141 #if CYTHON_CCOMPLEX
24142 #else
24143  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24144  return (a.real == b.real) && (a.imag == b.imag);
24145  }
24146  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24147  __pyx_t_double_complex z;
24148  z.real = a.real + b.real;
24149  z.imag = a.imag + b.imag;
24150  return z;
24151  }
24152  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24153  __pyx_t_double_complex z;
24154  z.real = a.real - b.real;
24155  z.imag = a.imag - b.imag;
24156  return z;
24157  }
24158  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24159  __pyx_t_double_complex z;
24160  z.real = a.real * b.real - a.imag * b.imag;
24161  z.imag = a.real * b.imag + a.imag * b.real;
24162  return z;
24163  }
24164  #if 1
24165  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24166  if (b.imag == 0) {
24167  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
24168  } else if (fabs(b.real) >= fabs(b.imag)) {
24169  if (b.real == 0 && b.imag == 0) {
24170  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
24171  } else {
24172  double r = b.imag / b.real;
24173  double s = (double)(1.0) / (b.real + b.imag * r);
24174  return __pyx_t_double_complex_from_parts(
24175  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
24176  }
24177  } else {
24178  double r = b.real / b.imag;
24179  double s = (double)(1.0) / (b.imag + b.real * r);
24180  return __pyx_t_double_complex_from_parts(
24181  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
24182  }
24183  }
24184  #else
24185  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24186  if (b.imag == 0) {
24187  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
24188  } else {
24189  double denom = b.real * b.real + b.imag * b.imag;
24190  return __pyx_t_double_complex_from_parts(
24191  (a.real * b.real + a.imag * b.imag) / denom,
24192  (a.imag * b.real - a.real * b.imag) / denom);
24193  }
24194  }
24195  #endif
24196  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
24197  __pyx_t_double_complex z;
24198  z.real = -a.real;
24199  z.imag = -a.imag;
24200  return z;
24201  }
24202  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
24203  return (a.real == 0) && (a.imag == 0);
24204  }
24205  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
24206  __pyx_t_double_complex z;
24207  z.real = a.real;
24208  z.imag = -a.imag;
24209  return z;
24210  }
24211  #if 1
24212  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
24213  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
24214  return sqrt(z.real*z.real + z.imag*z.imag);
24215  #else
24216  return hypot(z.real, z.imag);
24217  #endif
24218  }
24219  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
24220  __pyx_t_double_complex z;
24221  double r, lnr, theta, z_r, z_theta;
24222  if (b.imag == 0 && b.real == (int)b.real) {
24223  if (b.real < 0) {
24224  double denom = a.real * a.real + a.imag * a.imag;
24225  a.real = a.real / denom;
24226  a.imag = -a.imag / denom;
24227  b.real = -b.real;
24228  }
24229  switch ((int)b.real) {
24230  case 0:
24231  z.real = 1;
24232  z.imag = 0;
24233  return z;
24234  case 1:
24235  return a;
24236  case 2:
24237  return __Pyx_c_prod_double(a, a);
24238  case 3:
24239  z = __Pyx_c_prod_double(a, a);
24240  return __Pyx_c_prod_double(z, a);
24241  case 4:
24242  z = __Pyx_c_prod_double(a, a);
24243  return __Pyx_c_prod_double(z, z);
24244  }
24245  }
24246  if (a.imag == 0) {
24247  if (a.real == 0) {
24248  return a;
24249  } else if (b.imag == 0) {
24250  z.real = pow(a.real, b.real);
24251  z.imag = 0;
24252  return z;
24253  } else if (a.real > 0) {
24254  r = a.real;
24255  theta = 0;
24256  } else {
24257  r = -a.real;
24258  theta = atan2(0.0, -1.0);
24259  }
24260  } else {
24261  r = __Pyx_c_abs_double(a);
24262  theta = atan2(a.imag, a.real);
24263  }
24264  lnr = log(r);
24265  z_r = exp(lnr * b.real - theta * b.imag);
24266  z_theta = theta * b.real + lnr * b.imag;
24267  z.real = z_r * cos(z_theta);
24268  z.imag = z_r * sin(z_theta);
24269  return z;
24270  }
24271  #endif
24272 #endif
24273 
24274 #if PY_MAJOR_VERSION < 3
24275 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
24276  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
24277  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
24278  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
24279  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
24280  return -1;
24281 }
24282 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
24283  PyObject *obj = view->obj;
24284  if (!obj) return;
24285  if (PyObject_CheckBuffer(obj)) {
24286  PyBuffer_Release(view);
24287  return;
24288  }
24289  if ((0)) {}
24290  view->obj = NULL;
24291  Py_DECREF(obj);
24292 }
24293 #endif
24294 
24295 
24296 /* MemviewSliceIsContig */
24297 static int
24298 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
24299 {
24300  int i, index, step, start;
24301  Py_ssize_t itemsize = mvs.memview->view.itemsize;
24302  if (order == 'F') {
24303  step = 1;
24304  start = 0;
24305  } else {
24306  step = -1;
24307  start = ndim - 1;
24308  }
24309  for (i = 0; i < ndim; i++) {
24310  index = start + step * i;
24311  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
24312  return 0;
24313  itemsize *= mvs.shape[index];
24314  }
24315  return 1;
24316 }
24317 
24318 /* OverlappingSlices */
24319 static void
24320 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
24321  void **out_start, void **out_end,
24322  int ndim, size_t itemsize)
24323 {
24324  char *start, *end;
24325  int i;
24326  start = end = slice->data;
24327  for (i = 0; i < ndim; i++) {
24328  Py_ssize_t stride = slice->strides[i];
24329  Py_ssize_t extent = slice->shape[i];
24330  if (extent == 0) {
24331  *out_start = *out_end = start;
24332  return;
24333  } else {
24334  if (stride > 0)
24335  end += stride * (extent - 1);
24336  else
24337  start += stride * (extent - 1);
24338  }
24339  }
24340  *out_start = start;
24341  *out_end = end + itemsize;
24342 }
24343 static int
24344 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
24345  __Pyx_memviewslice *slice2,
24346  int ndim, size_t itemsize)
24347 {
24348  void *start1, *end1, *start2, *end2;
24349  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
24350  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
24351  return (start1 < end2) && (start2 < end1);
24352 }
24353 
24354 /* Capsule */
24355 static CYTHON_INLINE PyObject *
24356 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
24357 {
24358  PyObject *cobj;
24359 #if PY_VERSION_HEX >= 0x02070000
24360  cobj = PyCapsule_New(p, sig, NULL);
24361 #else
24362  cobj = PyCObject_FromVoidPtr(p, NULL);
24363 #endif
24364  return cobj;
24365 }
24366 
24367 /* CIntFromPy */
24368 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
24369 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24370 #pragma GCC diagnostic push
24371 #pragma GCC diagnostic ignored "-Wconversion"
24372 #endif
24373  const int neg_one = (int) -1, const_zero = (int) 0;
24374 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24375 #pragma GCC diagnostic pop
24376 #endif
24377  const int is_unsigned = neg_one > const_zero;
24378 #if PY_MAJOR_VERSION < 3
24379  if (likely(PyInt_Check(x))) {
24380  if (sizeof(int) < sizeof(long)) {
24381  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
24382  } else {
24383  long val = PyInt_AS_LONG(x);
24384  if (is_unsigned && unlikely(val < 0)) {
24385  goto raise_neg_overflow;
24386  }
24387  return (int) val;
24388  }
24389  } else
24390 #endif
24391  if (likely(PyLong_Check(x))) {
24392  if (is_unsigned) {
24393 #if CYTHON_USE_PYLONG_INTERNALS
24394  const digit* digits = ((PyLongObject*)x)->ob_digit;
24395  switch (Py_SIZE(x)) {
24396  case 0: return (int) 0;
24397  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
24398  case 2:
24399  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
24400  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24401  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24402  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
24403  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24404  }
24405  }
24406  break;
24407  case 3:
24408  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
24409  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24410  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24411  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
24412  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24413  }
24414  }
24415  break;
24416  case 4:
24417  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
24418  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24419  __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])))
24420  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
24421  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24422  }
24423  }
24424  break;
24425  }
24426 #endif
24427 #if CYTHON_COMPILING_IN_CPYTHON
24428  if (unlikely(Py_SIZE(x) < 0)) {
24429  goto raise_neg_overflow;
24430  }
24431 #else
24432  {
24433  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
24434  if (unlikely(result < 0))
24435  return (int) -1;
24436  if (unlikely(result == 1))
24437  goto raise_neg_overflow;
24438  }
24439 #endif
24440  if (sizeof(int) <= sizeof(unsigned long)) {
24441  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
24442 #ifdef HAVE_LONG_LONG
24443  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
24444  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
24445 #endif
24446  }
24447  } else {
24448 #if CYTHON_USE_PYLONG_INTERNALS
24449  const digit* digits = ((PyLongObject*)x)->ob_digit;
24450  switch (Py_SIZE(x)) {
24451  case 0: return (int) 0;
24452  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
24453  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
24454  case -2:
24455  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
24456  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24457  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24458  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
24459  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24460  }
24461  }
24462  break;
24463  case 2:
24464  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
24465  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24466  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24467  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
24468  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24469  }
24470  }
24471  break;
24472  case -3:
24473  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
24474  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24475  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24476  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
24477  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24478  }
24479  }
24480  break;
24481  case 3:
24482  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
24483  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24484  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24485  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
24486  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24487  }
24488  }
24489  break;
24490  case -4:
24491  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
24492  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24493  __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])))
24494  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
24495  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24496  }
24497  }
24498  break;
24499  case 4:
24500  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
24501  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24502  __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])))
24503  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
24504  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24505  }
24506  }
24507  break;
24508  }
24509 #endif
24510  if (sizeof(int) <= sizeof(long)) {
24511  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
24512 #ifdef HAVE_LONG_LONG
24513  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
24514  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
24515 #endif
24516  }
24517  }
24518  {
24519 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
24520  PyErr_SetString(PyExc_RuntimeError,
24521  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
24522 #else
24523  int val;
24524  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
24525  #if PY_MAJOR_VERSION < 3
24526  if (likely(v) && !PyLong_Check(v)) {
24527  PyObject *tmp = v;
24528  v = PyNumber_Long(tmp);
24529  Py_DECREF(tmp);
24530  }
24531  #endif
24532  if (likely(v)) {
24533  int one = 1; int is_little = (int)*(unsigned char *)&one;
24534  unsigned char *bytes = (unsigned char *)&val;
24535  int ret = _PyLong_AsByteArray((PyLongObject *)v,
24536  bytes, sizeof(val),
24537  is_little, !is_unsigned);
24538  Py_DECREF(v);
24539  if (likely(!ret))
24540  return val;
24541  }
24542 #endif
24543  return (int) -1;
24544  }
24545  } else {
24546  int val;
24547  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
24548  if (!tmp) return (int) -1;
24549  val = __Pyx_PyInt_As_int(tmp);
24550  Py_DECREF(tmp);
24551  return val;
24552  }
24553 raise_overflow:
24554  PyErr_SetString(PyExc_OverflowError,
24555  "value too large to convert to int");
24556  return (int) -1;
24557 raise_neg_overflow:
24558  PyErr_SetString(PyExc_OverflowError,
24559  "can't convert negative value to int");
24560  return (int) -1;
24561 }
24562 
24563 /* CIntToPy */
24564 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
24565 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24566 #pragma GCC diagnostic push
24567 #pragma GCC diagnostic ignored "-Wconversion"
24568 #endif
24569  const int neg_one = (int) -1, const_zero = (int) 0;
24570 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24571 #pragma GCC diagnostic pop
24572 #endif
24573  const int is_unsigned = neg_one > const_zero;
24574  if (is_unsigned) {
24575  if (sizeof(int) < sizeof(long)) {
24576  return PyInt_FromLong((long) value);
24577  } else if (sizeof(int) <= sizeof(unsigned long)) {
24578  return PyLong_FromUnsignedLong((unsigned long) value);
24579 #ifdef HAVE_LONG_LONG
24580  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
24581  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
24582 #endif
24583  }
24584  } else {
24585  if (sizeof(int) <= sizeof(long)) {
24586  return PyInt_FromLong((long) value);
24587 #ifdef HAVE_LONG_LONG
24588  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
24589  return PyLong_FromLongLong((PY_LONG_LONG) value);
24590 #endif
24591  }
24592  }
24593  {
24594  int one = 1; int little = (int)*(unsigned char *)&one;
24595  unsigned char *bytes = (unsigned char *)&value;
24596  return _PyLong_FromByteArray(bytes, sizeof(int),
24597  little, !is_unsigned);
24598  }
24599 }
24600 
24601 /* TypeInfoToFormat */
24602 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) {
24603  struct __pyx_typeinfo_string result = { {0} };
24604  char *buf = (char *) result.string;
24605  size_t size = type->size;
24606  switch (type->typegroup) {
24607  case 'H':
24608  *buf = 'c';
24609  break;
24610  case 'I':
24611  case 'U':
24612  if (size == 1)
24613  *buf = (type->is_unsigned) ? 'B' : 'b';
24614  else if (size == 2)
24615  *buf = (type->is_unsigned) ? 'H' : 'h';
24616  else if (size == 4)
24617  *buf = (type->is_unsigned) ? 'I' : 'i';
24618  else if (size == 8)
24619  *buf = (type->is_unsigned) ? 'Q' : 'q';
24620  break;
24621  case 'P':
24622  *buf = 'P';
24623  break;
24624  case 'C':
24625  {
24626  __Pyx_TypeInfo complex_type = *type;
24627  complex_type.typegroup = 'R';
24628  complex_type.size /= 2;
24629  *buf++ = 'Z';
24630  *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
24631  break;
24632  }
24633  case 'R':
24634  if (size == 4)
24635  *buf = 'f';
24636  else if (size == 8)
24637  *buf = 'd';
24638  else
24639  *buf = 'g';
24640  break;
24641  }
24642  return result;
24643 }
24644 
24645 /* MemviewSliceCopyTemplate */
24646 static __Pyx_memviewslice
24647 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
24648  const char *mode, int ndim,
24649  size_t sizeof_dtype, int contig_flag,
24650  int dtype_is_object)
24651 {
24652  __Pyx_RefNannyDeclarations
24653  int i;
24654  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
24655  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
24656  Py_buffer *buf = &from_memview->view;
24657  PyObject *shape_tuple = NULL;
24658  PyObject *temp_int = NULL;
24659  struct __pyx_array_obj *array_obj = NULL;
24660  struct __pyx_memoryview_obj *memview_obj = NULL;
24661  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
24662  for (i = 0; i < ndim; i++) {
24663  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
24664  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
24665  "indirect dimensions (axis %d)", i);
24666  goto fail;
24667  }
24668  }
24669  shape_tuple = PyTuple_New(ndim);
24670  if (unlikely(!shape_tuple)) {
24671  goto fail;
24672  }
24673  __Pyx_GOTREF(shape_tuple);
24674  for(i = 0; i < ndim; i++) {
24675  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
24676  if(unlikely(!temp_int)) {
24677  goto fail;
24678  } else {
24679  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
24680  temp_int = NULL;
24681  }
24682  }
24683  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
24684  if (unlikely(!array_obj)) {
24685  goto fail;
24686  }
24687  __Pyx_GOTREF(array_obj);
24688  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
24689  (PyObject *) array_obj, contig_flag,
24690  dtype_is_object,
24691  from_mvs->memview->typeinfo);
24692  if (unlikely(!memview_obj))
24693  goto fail;
24694  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
24695  goto fail;
24696  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
24697  dtype_is_object) < 0))
24698  goto fail;
24699  goto no_fail;
24700 fail:
24701  __Pyx_XDECREF(new_mvs.memview);
24702  new_mvs.memview = NULL;
24703  new_mvs.data = NULL;
24704 no_fail:
24705  __Pyx_XDECREF(shape_tuple);
24706  __Pyx_XDECREF(temp_int);
24707  __Pyx_XDECREF(array_obj);
24708  __Pyx_RefNannyFinishContext();
24709  return new_mvs;
24710 }
24711 
24712 /* MemviewSliceInit */
24713 static int
24714 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
24715  int ndim,
24716  __Pyx_memviewslice *memviewslice,
24717  int memview_is_new_reference)
24718 {
24719  __Pyx_RefNannyDeclarations
24720  int i, retval=-1;
24721  Py_buffer *buf = &memview->view;
24722  __Pyx_RefNannySetupContext("init_memviewslice", 0);
24723  if (unlikely(memviewslice->memview || memviewslice->data)) {
24724  PyErr_SetString(PyExc_ValueError,
24725  "memviewslice is already initialized!");
24726  goto fail;
24727  }
24728  if (buf->strides) {
24729  for (i = 0; i < ndim; i++) {
24730  memviewslice->strides[i] = buf->strides[i];
24731  }
24732  } else {
24733  Py_ssize_t stride = buf->itemsize;
24734  for (i = ndim - 1; i >= 0; i--) {
24735  memviewslice->strides[i] = stride;
24736  stride *= buf->shape[i];
24737  }
24738  }
24739  for (i = 0; i < ndim; i++) {
24740  memviewslice->shape[i] = buf->shape[i];
24741  if (buf->suboffsets) {
24742  memviewslice->suboffsets[i] = buf->suboffsets[i];
24743  } else {
24744  memviewslice->suboffsets[i] = -1;
24745  }
24746  }
24747  memviewslice->memview = memview;
24748  memviewslice->data = (char *)buf->buf;
24749  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24750  Py_INCREF(memview);
24751  }
24752  retval = 0;
24753  goto no_fail;
24754 fail:
24755  memviewslice->memview = 0;
24756  memviewslice->data = 0;
24757  retval = -1;
24758 no_fail:
24759  __Pyx_RefNannyFinishContext();
24760  return retval;
24761 }
24762 #ifndef Py_NO_RETURN
24763 #define Py_NO_RETURN
24764 #endif
24765 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
24766  va_list vargs;
24767  char msg[200];
24768 #ifdef HAVE_STDARG_PROTOTYPES
24769  va_start(vargs, fmt);
24770 #else
24771  va_start(vargs);
24772 #endif
24773  vsnprintf(msg, 200, fmt, vargs);
24774  va_end(vargs);
24775  Py_FatalError(msg);
24776 }
24777 static CYTHON_INLINE int
24778 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24779  PyThread_type_lock lock)
24780 {
24781  int result;
24782  PyThread_acquire_lock(lock, 1);
24783  result = (*acquisition_count)++;
24784  PyThread_release_lock(lock);
24785  return result;
24786 }
24787 static CYTHON_INLINE int
24788 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24789  PyThread_type_lock lock)
24790 {
24791  int result;
24792  PyThread_acquire_lock(lock, 1);
24793  result = (*acquisition_count)--;
24794  PyThread_release_lock(lock);
24795  return result;
24796 }
24797 static CYTHON_INLINE void
24798 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
24799 {
24800  int first_time;
24801  struct __pyx_memoryview_obj *memview = memslice->memview;
24802  if (unlikely(!memview || (PyObject *) memview == Py_None))
24803  return;
24804  if (unlikely(__pyx_get_slice_count(memview) < 0))
24805  __pyx_fatalerror("Acquisition count is %d (line %d)",
24806  __pyx_get_slice_count(memview), lineno);
24807  first_time = __pyx_add_acquisition_count(memview) == 0;
24808  if (unlikely(first_time)) {
24809  if (have_gil) {
24810  Py_INCREF((PyObject *) memview);
24811  } else {
24812  PyGILState_STATE _gilstate = PyGILState_Ensure();
24813  Py_INCREF((PyObject *) memview);
24814  PyGILState_Release(_gilstate);
24815  }
24816  }
24817 }
24818 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24819  int have_gil, int lineno) {
24820  int last_time;
24821  struct __pyx_memoryview_obj *memview = memslice->memview;
24822  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24823  memslice->memview = NULL;
24824  return;
24825  }
24826  if (unlikely(__pyx_get_slice_count(memview) <= 0))
24827  __pyx_fatalerror("Acquisition count is %d (line %d)",
24828  __pyx_get_slice_count(memview), lineno);
24829  last_time = __pyx_sub_acquisition_count(memview) == 1;
24830  memslice->data = NULL;
24831  if (unlikely(last_time)) {
24832  if (have_gil) {
24833  Py_CLEAR(memslice->memview);
24834  } else {
24835  PyGILState_STATE _gilstate = PyGILState_Ensure();
24836  Py_CLEAR(memslice->memview);
24837  PyGILState_Release(_gilstate);
24838  }
24839  } else {
24840  memslice->memview = NULL;
24841  }
24842 }
24843 
24844 /* CIntFromPy */
24845 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
24846 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24847 #pragma GCC diagnostic push
24848 #pragma GCC diagnostic ignored "-Wconversion"
24849 #endif
24850  const long neg_one = (long) -1, const_zero = (long) 0;
24851 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
24852 #pragma GCC diagnostic pop
24853 #endif
24854  const int is_unsigned = neg_one > const_zero;
24855 #if PY_MAJOR_VERSION < 3
24856  if (likely(PyInt_Check(x))) {
24857  if (sizeof(long) < sizeof(long)) {
24858  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
24859  } else {
24860  long val = PyInt_AS_LONG(x);
24861  if (is_unsigned && unlikely(val < 0)) {
24862  goto raise_neg_overflow;
24863  }
24864  return (long) val;
24865  }
24866  } else
24867 #endif
24868  if (likely(PyLong_Check(x))) {
24869  if (is_unsigned) {
24870 #if CYTHON_USE_PYLONG_INTERNALS
24871  const digit* digits = ((PyLongObject*)x)->ob_digit;
24872  switch (Py_SIZE(x)) {
24873  case 0: return (long) 0;
24874  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
24875  case 2:
24876  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
24877  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24878  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24879  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
24880  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
24881  }
24882  }
24883  break;
24884  case 3:
24885  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
24886  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24887  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24888  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
24889  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
24890  }
24891  }
24892  break;
24893  case 4:
24894  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
24895  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24896  __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])))
24897  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
24898  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
24899  }
24900  }
24901  break;
24902  }
24903 #endif
24904 #if CYTHON_COMPILING_IN_CPYTHON
24905  if (unlikely(Py_SIZE(x) < 0)) {
24906  goto raise_neg_overflow;
24907  }
24908 #else
24909  {
24910  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
24911  if (unlikely(result < 0))
24912  return (long) -1;
24913  if (unlikely(result == 1))
24914  goto raise_neg_overflow;
24915  }
24916 #endif
24917  if (sizeof(long) <= sizeof(unsigned long)) {
24918  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
24919 #ifdef HAVE_LONG_LONG
24920  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
24921  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
24922 #endif
24923  }
24924  } else {
24925 #if CYTHON_USE_PYLONG_INTERNALS
24926  const digit* digits = ((PyLongObject*)x)->ob_digit;
24927  switch (Py_SIZE(x)) {
24928  case 0: return (long) 0;
24929  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
24930  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
24931  case -2:
24932  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
24933  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24934  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24935  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24936  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24937  }
24938  }
24939  break;
24940  case 2:
24941  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
24942  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
24943  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24944  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24945  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24946  }
24947  }
24948  break;
24949  case -3:
24950  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
24951  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24952  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24953  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24954  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24955  }
24956  }
24957  break;
24958  case 3:
24959  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
24960  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
24961  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
24962  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24963  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24964  }
24965  }
24966  break;
24967  case -4:
24968  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
24969  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24970  __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])))
24971  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24972  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24973  }
24974  }
24975  break;
24976  case 4:
24977  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
24978  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
24979  __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])))
24980  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
24981  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
24982  }
24983  }
24984  break;
24985  }
24986 #endif
24987  if (sizeof(long) <= sizeof(long)) {
24988  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
24989 #ifdef HAVE_LONG_LONG
24990  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
24991  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
24992 #endif
24993  }
24994  }
24995  {
24996 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
24997  PyErr_SetString(PyExc_RuntimeError,
24998  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
24999 #else
25000  long val;
25001  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
25002  #if PY_MAJOR_VERSION < 3
25003  if (likely(v) && !PyLong_Check(v)) {
25004  PyObject *tmp = v;
25005  v = PyNumber_Long(tmp);
25006  Py_DECREF(tmp);
25007  }
25008  #endif
25009  if (likely(v)) {
25010  int one = 1; int is_little = (int)*(unsigned char *)&one;
25011  unsigned char *bytes = (unsigned char *)&val;
25012  int ret = _PyLong_AsByteArray((PyLongObject *)v,
25013  bytes, sizeof(val),
25014  is_little, !is_unsigned);
25015  Py_DECREF(v);
25016  if (likely(!ret))
25017  return val;
25018  }
25019 #endif
25020  return (long) -1;
25021  }
25022  } else {
25023  long val;
25024  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
25025  if (!tmp) return (long) -1;
25026  val = __Pyx_PyInt_As_long(tmp);
25027  Py_DECREF(tmp);
25028  return val;
25029  }
25030 raise_overflow:
25031  PyErr_SetString(PyExc_OverflowError,
25032  "value too large to convert to long");
25033  return (long) -1;
25034 raise_neg_overflow:
25035  PyErr_SetString(PyExc_OverflowError,
25036  "can't convert negative value to long");
25037  return (long) -1;
25038 }
25039 
25040 /* CIntToPy */
25041 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
25042 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
25043 #pragma GCC diagnostic push
25044 #pragma GCC diagnostic ignored "-Wconversion"
25045 #endif
25046  const long neg_one = (long) -1, const_zero = (long) 0;
25047 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
25048 #pragma GCC diagnostic pop
25049 #endif
25050  const int is_unsigned = neg_one > const_zero;
25051  if (is_unsigned) {
25052  if (sizeof(long) < sizeof(long)) {
25053  return PyInt_FromLong((long) value);
25054  } else if (sizeof(long) <= sizeof(unsigned long)) {
25055  return PyLong_FromUnsignedLong((unsigned long) value);
25056 #ifdef HAVE_LONG_LONG
25057  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
25058  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
25059 #endif
25060  }
25061  } else {
25062  if (sizeof(long) <= sizeof(long)) {
25063  return PyInt_FromLong((long) value);
25064 #ifdef HAVE_LONG_LONG
25065  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
25066  return PyLong_FromLongLong((PY_LONG_LONG) value);
25067 #endif
25068  }
25069  }
25070  {
25071  int one = 1; int little = (int)*(unsigned char *)&one;
25072  unsigned char *bytes = (unsigned char *)&value;
25073  return _PyLong_FromByteArray(bytes, sizeof(long),
25074  little, !is_unsigned);
25075  }
25076 }
25077 
25078 /* CIntFromPy */
25079 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
25080 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
25081 #pragma GCC diagnostic push
25082 #pragma GCC diagnostic ignored "-Wconversion"
25083 #endif
25084  const char neg_one = (char) -1, const_zero = (char) 0;
25085 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
25086 #pragma GCC diagnostic pop
25087 #endif
25088  const int is_unsigned = neg_one > const_zero;
25089 #if PY_MAJOR_VERSION < 3
25090  if (likely(PyInt_Check(x))) {
25091  if (sizeof(char) < sizeof(long)) {
25092  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
25093  } else {
25094  long val = PyInt_AS_LONG(x);
25095  if (is_unsigned && unlikely(val < 0)) {
25096  goto raise_neg_overflow;
25097  }
25098  return (char) val;
25099  }
25100  } else
25101 #endif
25102  if (likely(PyLong_Check(x))) {
25103  if (is_unsigned) {
25104 #if CYTHON_USE_PYLONG_INTERNALS
25105  const digit* digits = ((PyLongObject*)x)->ob_digit;
25106  switch (Py_SIZE(x)) {
25107  case 0: return (char) 0;
25108  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
25109  case 2:
25110  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
25111  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
25112  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25113  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
25114  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
25115  }
25116  }
25117  break;
25118  case 3:
25119  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
25120  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
25121  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25122  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
25123  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
25124  }
25125  }
25126  break;
25127  case 4:
25128  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
25129  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
25130  __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])))
25131  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
25132  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
25133  }
25134  }
25135  break;
25136  }
25137 #endif
25138 #if CYTHON_COMPILING_IN_CPYTHON
25139  if (unlikely(Py_SIZE(x) < 0)) {
25140  goto raise_neg_overflow;
25141  }
25142 #else
25143  {
25144  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
25145  if (unlikely(result < 0))
25146  return (char) -1;
25147  if (unlikely(result == 1))
25148  goto raise_neg_overflow;
25149  }
25150 #endif
25151  if (sizeof(char) <= sizeof(unsigned long)) {
25152  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
25153 #ifdef HAVE_LONG_LONG
25154  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
25155  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
25156 #endif
25157  }
25158  } else {
25159 #if CYTHON_USE_PYLONG_INTERNALS
25160  const digit* digits = ((PyLongObject*)x)->ob_digit;
25161  switch (Py_SIZE(x)) {
25162  case 0: return (char) 0;
25163  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
25164  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
25165  case -2:
25166  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
25167  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
25168  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25169  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
25170  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25171  }
25172  }
25173  break;
25174  case 2:
25175  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
25176  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
25177  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25178  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
25179  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25180  }
25181  }
25182  break;
25183  case -3:
25184  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
25185  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
25186  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25187  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
25188  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25189  }
25190  }
25191  break;
25192  case 3:
25193  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
25194  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
25195  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
25196  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
25197  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25198  }
25199  }
25200  break;
25201  case -4:
25202  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
25203  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
25204  __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])))
25205  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
25206  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25207  }
25208  }
25209  break;
25210  case 4:
25211  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
25212  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
25213  __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])))
25214  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
25215  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
25216  }
25217  }
25218  break;
25219  }
25220 #endif
25221  if (sizeof(char) <= sizeof(long)) {
25222  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
25223 #ifdef HAVE_LONG_LONG
25224  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
25225  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
25226 #endif
25227  }
25228  }
25229  {
25230 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
25231  PyErr_SetString(PyExc_RuntimeError,
25232  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
25233 #else
25234  char val;
25235  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
25236  #if PY_MAJOR_VERSION < 3
25237  if (likely(v) && !PyLong_Check(v)) {
25238  PyObject *tmp = v;
25239  v = PyNumber_Long(tmp);
25240  Py_DECREF(tmp);
25241  }
25242  #endif
25243  if (likely(v)) {
25244  int one = 1; int is_little = (int)*(unsigned char *)&one;
25245  unsigned char *bytes = (unsigned char *)&val;
25246  int ret = _PyLong_AsByteArray((PyLongObject *)v,
25247  bytes, sizeof(val),
25248  is_little, !is_unsigned);
25249  Py_DECREF(v);
25250  if (likely(!ret))
25251  return val;
25252  }
25253 #endif
25254  return (char) -1;
25255  }
25256  } else {
25257  char val;
25258  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
25259  if (!tmp) return (char) -1;
25260  val = __Pyx_PyInt_As_char(tmp);
25261  Py_DECREF(tmp);
25262  return val;
25263  }
25264 raise_overflow:
25265  PyErr_SetString(PyExc_OverflowError,
25266  "value too large to convert to char");
25267  return (char) -1;
25268 raise_neg_overflow:
25269  PyErr_SetString(PyExc_OverflowError,
25270  "can't convert negative value to char");
25271  return (char) -1;
25272 }
25273 
25274 /* CheckBinaryVersion */
25275 static int __Pyx_check_binary_version(void) {
25276  char ctversion[5];
25277  int same=1, i, found_dot;
25278  const char* rt_from_call = Py_GetVersion();
25279  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
25280  found_dot = 0;
25281  for (i = 0; i < 4; i++) {
25282  if (!ctversion[i]) {
25283  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
25284  break;
25285  }
25286  if (rt_from_call[i] != ctversion[i]) {
25287  same = 0;
25288  break;
25289  }
25290  }
25291  if (!same) {
25292  char rtversion[5] = {'\0'};
25293  char message[200];
25294  for (i=0; i<4; ++i) {
25295  if (rt_from_call[i] == '.') {
25296  if (found_dot) break;
25297  found_dot = 1;
25298  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
25299  break;
25300  }
25301  rtversion[i] = rt_from_call[i];
25302  }
25303  PyOS_snprintf(message, sizeof(message),
25304  "compiletime version %s of module '%.100s' "
25305  "does not match runtime version %s",
25306  ctversion, __Pyx_MODULE_NAME, rtversion);
25307  return PyErr_WarnEx(NULL, message, 1);
25308  }
25309  return 0;
25310 }
25311 
25312 /* InitStrings */
25313 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
25314  while (t->p) {
25315  #if PY_MAJOR_VERSION < 3
25316  if (t->is_unicode) {
25317  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
25318  } else if (t->intern) {
25319  *t->p = PyString_InternFromString(t->s);
25320  } else {
25321  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
25322  }
25323  #else
25324  if (t->is_unicode | t->is_str) {
25325  if (t->intern) {
25326  *t->p = PyUnicode_InternFromString(t->s);
25327  } else if (t->encoding) {
25328  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
25329  } else {
25330  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
25331  }
25332  } else {
25333  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
25334  }
25335  #endif
25336  if (!*t->p)
25337  return -1;
25338  if (PyObject_Hash(*t->p) == -1)
25339  return -1;
25340  ++t;
25341  }
25342  return 0;
25343 }
25344 
25345 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
25346  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
25347 }
25348 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
25349  Py_ssize_t ignore;
25350  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
25351 }
25352 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
25353 #if !CYTHON_PEP393_ENABLED
25354 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25355  char* defenc_c;
25356  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
25357  if (!defenc) return NULL;
25358  defenc_c = PyBytes_AS_STRING(defenc);
25359 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25360  {
25361  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
25362  char* c;
25363  for (c = defenc_c; c < end; c++) {
25364  if ((unsigned char) (*c) >= 128) {
25365  PyUnicode_AsASCIIString(o);
25366  return NULL;
25367  }
25368  }
25369  }
25370 #endif
25371  *length = PyBytes_GET_SIZE(defenc);
25372  return defenc_c;
25373 }
25374 #else
25375 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25376  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
25377 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25378  if (likely(PyUnicode_IS_ASCII(o))) {
25379  *length = PyUnicode_GET_LENGTH(o);
25380  return PyUnicode_AsUTF8(o);
25381  } else {
25382  PyUnicode_AsASCIIString(o);
25383  return NULL;
25384  }
25385 #else
25386  return PyUnicode_AsUTF8AndSize(o, length);
25387 #endif
25388 }
25389 #endif
25390 #endif
25391 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25392 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
25393  if (
25394 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25395  __Pyx_sys_getdefaultencoding_not_ascii &&
25396 #endif
25397  PyUnicode_Check(o)) {
25398  return __Pyx_PyUnicode_AsStringAndSize(o, length);
25399  } else
25400 #endif
25401 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
25402  if (PyByteArray_Check(o)) {
25403  *length = PyByteArray_GET_SIZE(o);
25404  return PyByteArray_AS_STRING(o);
25405  } else
25406 #endif
25407  {
25408  char* result;
25409  int r = PyBytes_AsStringAndSize(o, &result, length);
25410  if (unlikely(r < 0)) {
25411  return NULL;
25412  } else {
25413  return result;
25414  }
25415  }
25416 }
25417 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
25418  int is_true = x == Py_True;
25419  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
25420  else return PyObject_IsTrue(x);
25421 }
25422 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
25423  int retval;
25424  if (unlikely(!x)) return -1;
25425  retval = __Pyx_PyObject_IsTrue(x);
25426  Py_DECREF(x);
25427  return retval;
25428 }
25429 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
25430 #if PY_MAJOR_VERSION >= 3
25431  if (PyLong_Check(result)) {
25432  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
25433  "__int__ returned non-int (type %.200s). "
25434  "The ability to return an instance of a strict subclass of int "
25435  "is deprecated, and may be removed in a future version of Python.",
25436  Py_TYPE(result)->tp_name)) {
25437  Py_DECREF(result);
25438  return NULL;
25439  }
25440  return result;
25441  }
25442 #endif
25443  PyErr_Format(PyExc_TypeError,
25444  "__%.4s__ returned non-%.4s (type %.200s)",
25445  type_name, type_name, Py_TYPE(result)->tp_name);
25446  Py_DECREF(result);
25447  return NULL;
25448 }
25449 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
25450 #if CYTHON_USE_TYPE_SLOTS
25451  PyNumberMethods *m;
25452 #endif
25453  const char *name = NULL;
25454  PyObject *res = NULL;
25455 #if PY_MAJOR_VERSION < 3
25456  if (likely(PyInt_Check(x) || PyLong_Check(x)))
25457 #else
25458  if (likely(PyLong_Check(x)))
25459 #endif
25460  return __Pyx_NewRef(x);
25461 #if CYTHON_USE_TYPE_SLOTS
25462  m = Py_TYPE(x)->tp_as_number;
25463  #if PY_MAJOR_VERSION < 3
25464  if (m && m->nb_int) {
25465  name = "int";
25466  res = m->nb_int(x);
25467  }
25468  else if (m && m->nb_long) {
25469  name = "long";
25470  res = m->nb_long(x);
25471  }
25472  #else
25473  if (likely(m && m->nb_int)) {
25474  name = "int";
25475  res = m->nb_int(x);
25476  }
25477  #endif
25478 #else
25479  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
25480  res = PyNumber_Int(x);
25481  }
25482 #endif
25483  if (likely(res)) {
25484 #if PY_MAJOR_VERSION < 3
25485  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
25486 #else
25487  if (unlikely(!PyLong_CheckExact(res))) {
25488 #endif
25489  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
25490  }
25491  }
25492  else if (!PyErr_Occurred()) {
25493  PyErr_SetString(PyExc_TypeError,
25494  "an integer is required");
25495  }
25496  return res;
25497 }
25498 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
25499  Py_ssize_t ival;
25500  PyObject *x;
25501 #if PY_MAJOR_VERSION < 3
25502  if (likely(PyInt_CheckExact(b))) {
25503  if (sizeof(Py_ssize_t) >= sizeof(long))
25504  return PyInt_AS_LONG(b);
25505  else
25506  return PyInt_AsSsize_t(b);
25507  }
25508 #endif
25509  if (likely(PyLong_CheckExact(b))) {
25510  #if CYTHON_USE_PYLONG_INTERNALS
25511  const digit* digits = ((PyLongObject*)b)->ob_digit;
25512  const Py_ssize_t size = Py_SIZE(b);
25513  if (likely(__Pyx_sst_abs(size) <= 1)) {
25514  ival = likely(size) ? digits[0] : 0;
25515  if (size == -1) ival = -ival;
25516  return ival;
25517  } else {
25518  switch (size) {
25519  case 2:
25520  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
25521  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25522  }
25523  break;
25524  case -2:
25525  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
25526  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25527  }
25528  break;
25529  case 3:
25530  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
25531  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25532  }
25533  break;
25534  case -3:
25535  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
25536  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25537  }
25538  break;
25539  case 4:
25540  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
25541  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]));
25542  }
25543  break;
25544  case -4:
25545  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
25546  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]));
25547  }
25548  break;
25549  }
25550  }
25551  #endif
25552  return PyLong_AsSsize_t(b);
25553  }
25554  x = PyNumber_Index(b);
25555  if (!x) return -1;
25556  ival = PyInt_AsSsize_t(x);
25557  Py_DECREF(x);
25558  return ival;
25559 }
25560 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
25561  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
25562  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
25563 #if PY_MAJOR_VERSION < 3
25564  } else if (likely(PyInt_CheckExact(o))) {
25565  return PyInt_AS_LONG(o);
25566 #endif
25567  } else {
25568  Py_ssize_t ival;
25569  PyObject *x;
25570  x = PyNumber_Index(o);
25571  if (!x) return -1;
25572  ival = PyInt_AsLong(x);
25573  Py_DECREF(x);
25574  return ival;
25575  }
25576 }
25577 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
25578  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
25579 }
25580 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
25581  return PyInt_FromSize_t(ival);
25582 }
25583 
25584 
25585 #endif /* Py_PYTHON_H */
f
Double f
Definition: Headers.h:64
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
equivalent_polynomials::Simplex
Definition: equivalent_polynomials.h:73
equivalent_polynomials.h
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